Files
tbd-station-14/Content.Shared/PAI/PAIComponent.cs
mr-bo-jangles 412f3f470c Set pAI up with a static map the pAI can use (#23499)
* Set pAI up with a trackless map

* Added a untracked map user interface class to support gps-less mapping
* Added to pAI by default, expect it to be  given to borgs as well in time.

As the personal AI is literally immobile as a ghost, it is useful to ensure that people carry one. With that idea in mind, it is worth giving the pAI a reason to be carried that doesn't depend on the player having a cracking selection of midi files on hand.

* Tried to use new ProtoId and have EntityUid on the client as commented by metalgearsloth

* Review

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2024-01-06 18:31:20 +11:00

57 lines
2.0 KiB
C#

using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.PAI;
/// <summary>
/// pAIs, or Personal AIs, are essentially portable ghost role generators.
/// In their current implementation in SS14, they create a ghost role anyone can access,
/// and that a player can also "wipe" (reset/kick out player).
/// Theoretically speaking pAIs are supposed to use a dedicated "offer and select" system,
/// with the player holding the pAI being able to choose one of the ghosts in the round.
/// This seems too complicated for an initial implementation, though,
/// and there's not always enough players and ghost roles to justify it.
/// All logic in PAISystem.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class PAIComponent : Component
{
/// <summary>
/// The last person who activated this PAI.
/// Used for assigning the name.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public EntityUid? LastUser;
[DataField(serverOnly: true)]
public EntProtoId? MidiActionId = "ActionPAIPlayMidi";
[DataField(serverOnly: true)] // server only, as it uses a server-BUI event !type
public EntityUid? MidiAction;
[DataField]
public ProtoId<EntityPrototype> MapActionId = "ActionPAIOpenMap";
[DataField, AutoNetworkedField]
public EntityUid? MapAction;
/// <summary>
/// When microwaved there is this chance to brick the pai, kicking out its player and preventing it from being used again.
/// </summary>
[DataField]
public float BrickChance = 0.5f;
/// <summary>
/// Locale id for the popup shown when the pai gets bricked.
/// </summary>
[DataField]
public string BrickPopup = "pai-system-brick-popup";
/// <summary>
/// Locale id for the popup shown when the pai is microwaved but does not get bricked.
/// </summary>
[DataField]
public string ScramblePopup = "pai-system-scramble-popup";
}