PAIComponent.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using Robust.Shared.GameStates;
  2. using Robust.Shared.Prototypes;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  4. namespace Content.Shared.PAI;
  5. /// <summary>
  6. /// pAIs, or Personal AIs, are essentially portable ghost role generators.
  7. /// In their current implementation in SS14, they create a ghost role anyone can access,
  8. /// and that a player can also "wipe" (reset/kick out player).
  9. /// Theoretically speaking pAIs are supposed to use a dedicated "offer and select" system,
  10. /// with the player holding the pAI being able to choose one of the ghosts in the round.
  11. /// This seems too complicated for an initial implementation, though,
  12. /// and there's not always enough players and ghost roles to justify it.
  13. /// All logic in PAISystem.
  14. /// </summary>
  15. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  16. public sealed partial class PAIComponent : Component
  17. {
  18. /// <summary>
  19. /// The last person who activated this PAI.
  20. /// Used for assigning the name.
  21. /// </summary>
  22. [DataField, ViewVariables(VVAccess.ReadWrite)]
  23. public EntityUid? LastUser;
  24. [DataField(serverOnly: true)]
  25. public EntProtoId? MidiActionId = "ActionPAIPlayMidi";
  26. [DataField(serverOnly: true)] // server only, as it uses a server-BUI event !type
  27. public EntityUid? MidiAction;
  28. [DataField]
  29. public EntProtoId MapActionId = "ActionPAIOpenMap";
  30. [DataField, AutoNetworkedField]
  31. public EntityUid? MapAction;
  32. /// <summary>
  33. /// When microwaved there is this chance to brick the pai, kicking out its player and preventing it from being used again.
  34. /// </summary>
  35. [DataField]
  36. public float BrickChance = 0.5f;
  37. /// <summary>
  38. /// Locale id for the popup shown when the pai gets bricked.
  39. /// </summary>
  40. [DataField]
  41. public string BrickPopup = "pai-system-brick-popup";
  42. /// <summary>
  43. /// Locale id for the popup shown when the pai is microwaved but does not get bricked.
  44. /// </summary>
  45. [DataField]
  46. public string ScramblePopup = "pai-system-scramble-popup";
  47. }