1
0

FactionExceptionComponent.cs 1009 B

123456789101112131415161718192021222324
  1. using Content.Shared.NPC.Systems;
  2. using Robust.Shared.GameStates;
  3. namespace Content.Shared.NPC.Components;
  4. /// <summary>
  5. /// Prevents an NPC from attacking ignored entities from enemy factions.
  6. /// Can be added to if pettable, see PettableFriendComponent.
  7. /// </summary>
  8. [RegisterComponent, NetworkedComponent, Access(typeof(NpcFactionSystem), typeof(SharedNPCImprintingOnSpawnBehaviourSystem))] // TO DO (Metalgearsloth): If we start adding a billion access overrides they should be going through a system as then there's no reason to have access, but I'll fix this when I rework npcs.
  9. public sealed partial class FactionExceptionComponent : Component
  10. {
  11. /// <summary>
  12. /// Collection of entities that this NPC will refuse to attack
  13. /// </summary>
  14. [DataField]
  15. public HashSet<EntityUid> Ignored = new();
  16. /// <summary>
  17. /// Collection of entities that this NPC will attack, regardless of faction.
  18. /// </summary>
  19. [DataField]
  20. public HashSet<EntityUid> Hostiles = new();
  21. }