NPCImprintingOnSpawnBehaviourComponent.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. using Content.Shared.Whitelist;
  2. using Robust.Shared.Collections;
  3. namespace Content.Server.NPC.Components;
  4. /// <summary>
  5. /// A component that makes the entity friendly to nearby creatures it sees on init.
  6. /// </summary>
  7. [RegisterComponent]
  8. public sealed partial class NPCImprintingOnSpawnBehaviourComponent : Component
  9. {
  10. /// <summary>
  11. /// filter who can be a friend to this creature
  12. /// </summary>
  13. [DataField]
  14. public EntityWhitelist? Whitelist;
  15. /// <summary>
  16. /// when a creature appears, it will memorize all creatures in the radius to remember them as friends
  17. /// </summary>
  18. [DataField]
  19. public float SpawnFriendsSearchRadius = 3f;
  20. /// <summary>
  21. /// if there is a FollowCompound in HTN, the target of the following will be selected from random nearby targets when it appears
  22. /// </summary>
  23. [DataField]
  24. public bool Follow = true;
  25. /// <summary>
  26. /// is used to determine who became a friend from this component
  27. /// </summary>
  28. [DataField]
  29. public List<EntityUid> Friends = new();
  30. }