NPC utility queries (#15843)
This commit is contained in:
34
Content.Server/NPC/Queries/UtilityService.cs
Normal file
34
Content.Server/NPC/Queries/UtilityService.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Server.NPC.Queries;
|
||||
|
||||
/// <summary>
|
||||
/// Utility queries that run regularly to update an NPC without re-doing their thinking logic.
|
||||
/// </summary>
|
||||
[DataDefinition]
|
||||
public sealed class UtilityService
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifier to use for this service. This is used to track its cooldown.
|
||||
/// </summary>
|
||||
[DataField("id", required: true)]
|
||||
public string ID = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Prototype of the utility query.
|
||||
/// </summary>
|
||||
[DataField("proto", required: true, customTypeSerializer:typeof(PrototypeIdSerializer<UtilityQueryPrototype>))]
|
||||
public string Prototype = string.Empty;
|
||||
|
||||
[DataField("minCooldown")]
|
||||
public float MinCooldown = 0.25f;
|
||||
|
||||
[DataField("maxCooldown")]
|
||||
public float MaxCooldown = 0.60f;
|
||||
|
||||
/// <summary>
|
||||
/// Key to update with the utility query.
|
||||
/// </summary>
|
||||
[DataField("key", required: true)]
|
||||
public string Key = string.Empty;
|
||||
}
|
||||
Reference in New Issue
Block a user