1
0

ChameleonProjectorComponent.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using Content.Shared.Polymorph.Systems;
  2. using Content.Shared.Whitelist;
  3. using Robust.Shared.Prototypes;
  4. namespace Content.Shared.Polymorph.Components;
  5. /// <summary>
  6. /// A chameleon projector polymorphs you into a clicked entity, then polymorphs back when clicked on or destroyed.
  7. /// This creates a new dummy polymorph entity and copies the appearance over.
  8. /// </summary>
  9. [RegisterComponent, Access(typeof(SharedChameleonProjectorSystem))]
  10. public sealed partial class ChameleonProjectorComponent : Component
  11. {
  12. /// <summary>
  13. /// If non-null, whitelist for valid entities to disguise as.
  14. /// </summary>
  15. [DataField(required: true)]
  16. public EntityWhitelist? Whitelist;
  17. /// <summary>
  18. /// If non-null, blacklist that prevents entities from being used even if they are in the whitelist.
  19. /// </summary>
  20. [DataField(required: true)]
  21. public EntityWhitelist? Blacklist;
  22. /// <summary>
  23. /// Disguise entity to spawn and use.
  24. /// </summary>
  25. [DataField(required: true)]
  26. public EntProtoId DisguiseProto = string.Empty;
  27. /// <summary>
  28. /// Action for disabling your disguise's rotation.
  29. /// </summary>
  30. [DataField]
  31. public EntProtoId NoRotAction = "ActionDisguiseNoRot";
  32. [DataField]
  33. public EntityUid? NoRotActionEntity;
  34. /// <summary>
  35. /// Action for anchoring your disguise in place.
  36. /// </summary>
  37. [DataField]
  38. public EntProtoId AnchorAction = "ActionDisguiseAnchor";
  39. [DataField]
  40. public EntityUid? AnchorActionEntity;
  41. /// <summary>
  42. /// Minimum health to give the disguise.
  43. /// </summary>
  44. [DataField]
  45. public float MinHealth = 1f;
  46. /// <summary>
  47. /// Maximum health to give the disguise, health scales with mass.
  48. /// </summary>
  49. [DataField]
  50. public float MaxHealth = 100f;
  51. /// <summary>
  52. /// User currently disguised by this projector, if any
  53. /// </summary>
  54. [DataField]
  55. public EntityUid? Disguised;
  56. }