1
0

NPCRetaliationComponent.cs 1012 B

123456789101112131415161718192021222324
  1. using Content.Server.NPC.Systems;
  2. namespace Content.Server.NPC.Components;
  3. /// <summary>
  4. /// Entities with this component will retaliate against those who physically attack them.
  5. /// It has an optional "memory" specification wherein it will only attack those entities for a specified length of time.
  6. /// </summary>
  7. [RegisterComponent, Access(typeof(NPCRetaliationSystem))]
  8. public sealed partial class NPCRetaliationComponent : Component
  9. {
  10. /// <summary>
  11. /// How long after being attacked will an NPC continue to be aggressive to the attacker for.
  12. /// </summary>
  13. [DataField("attackMemoryLength"), ViewVariables(VVAccess.ReadWrite)]
  14. public TimeSpan? AttackMemoryLength;
  15. /// <summary>
  16. /// A dictionary that stores an entity and the time at which they will no longer be considered hostile.
  17. /// </summary>
  18. /// todo: this needs to support timeoffsetserializer at some point
  19. [DataField("attackMemories")]
  20. public Dictionary<EntityUid, TimeSpan> AttackMemories = new();
  21. }