Defines an NPC stimulus value type and some common stimulus kind constants. Stimulus is a readonly record struct holding kind, position, source, radius and expiry. StimulusKind is a static class with string constants for common events like gunshot and explosion.
namespace Sandbox.Npcs;
/// <summary>
/// Something that happened in the world that NPCs can sense -- a gunshot, an explosion, a
/// scream. Broadcast via <see cref="NpcStimulusSystem"/>; sensed by <see cref="Layers.SensesLayer"/>.
/// </summary>
public readonly record struct Stimulus( string Kind, Vector3 Position, GameObject Source, float Radius, float Expiry );
/// <summary>
/// Common stimulus kinds. Plain strings so UGC can add its own; this is just the shared set.
/// </summary>
public static class StimulusKind
{
public const string Gunshot = "gunshot";
public const string Explosion = "explosion";
public const string Death = "death";
public const string Scream = "scream";
public const string Crime = "crime";
}