MindRoleComponent.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using Content.Shared.Mind;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Prototypes;
  4. namespace Content.Shared.Roles;
  5. /// <summary>
  6. /// This holds data for, and indicates, a Mind Role entity
  7. /// </summary>
  8. [RegisterComponent, NetworkedComponent]
  9. public sealed partial class MindRoleComponent : BaseMindRoleComponent
  10. {
  11. /// <summary>
  12. /// Marks this Mind Role as Antagonist
  13. /// A single antag Mind Role is enough to make the owner mind count as Antagonist.
  14. /// </summary>
  15. [DataField]
  16. public bool Antag { get; set; } = false;
  17. /// <summary>
  18. /// The mind's current antagonist/special role, or lack thereof;
  19. /// </summary>
  20. [DataField]
  21. public ProtoId<RoleTypePrototype>? RoleType;
  22. /// <summary>
  23. /// True if this mindrole is an exclusive antagonist. Antag setting is not checked if this is True.
  24. /// </summary>
  25. [DataField]
  26. public bool ExclusiveAntag { get; set; } = false;
  27. /// <summary>
  28. /// The Mind that this role belongs to
  29. /// </summary>
  30. public Entity<MindComponent> Mind { get; set; }
  31. /// <summary>
  32. /// The Antagonist prototype of this role
  33. /// </summary>
  34. [DataField]
  35. public ProtoId<AntagPrototype>? AntagPrototype { get; set; }
  36. /// <summary>
  37. /// The Job prototype of this role
  38. /// </summary>
  39. [DataField]
  40. public ProtoId<JobPrototype>? JobPrototype { get; set; }
  41. }
  42. // Why does this base component actually exist? It does make auto-categorization easy, but before that it was useless?
  43. // I used it for easy organisation/bookkeeping of what components are for mindroles
  44. [EntityCategory("Roles")]
  45. public abstract partial class BaseMindRoleComponent : Component
  46. {
  47. }