2023-08-25 18:50:46 +10:00
using Content.Shared.Actions ;
using Robust.Shared.GameStates ;
2023-09-08 18:16:05 -07:00
using Robust.Shared.Prototypes ;
2023-08-25 18:50:46 +10:00
namespace Content.Shared.Ghost ;
[RegisterComponent, NetworkedComponent, Access(typeof(SharedGhostSystem))]
2023-09-10 21:36:26 -07:00
[AutoGenerateComponentState(true)]
2023-08-25 18:50:46 +10:00
public sealed partial class GhostComponent : Component
{
2023-09-24 13:34:08 -07:00
// Actions
[DataField]
public EntProtoId ToggleLightingAction = "ActionToggleLighting" ;
2023-09-08 18:16:05 -07:00
2023-09-23 04:49:39 -04:00
[DataField, AutoNetworkedField]
2023-09-08 18:16:05 -07:00
public EntityUid ? ToggleLightingActionEntity ;
2023-09-24 13:34:08 -07:00
[DataField]
public EntProtoId ToggleFoVAction = "ActionToggleFov" ;
2023-09-08 18:16:05 -07:00
2023-09-23 04:49:39 -04:00
[DataField, AutoNetworkedField]
2023-09-08 18:16:05 -07:00
public EntityUid ? ToggleFoVActionEntity ;
2023-09-24 13:34:08 -07:00
[DataField]
public EntProtoId ToggleGhostsAction = "ActionToggleGhosts" ;
2023-09-08 18:16:05 -07:00
2023-09-23 04:49:39 -04:00
[DataField, AutoNetworkedField]
2023-09-08 18:16:05 -07:00
public EntityUid ? ToggleGhostsActionEntity ;
2023-08-25 18:50:46 +10:00
2023-09-24 13:34:08 -07:00
[DataField]
public EntProtoId ToggleGhostHearingAction = "ActionToggleGhostHearing" ;
2023-08-25 18:50:46 +10:00
2023-09-24 13:34:08 -07:00
[DataField]
public EntityUid ? ToggleGhostHearingActionEntity ;
2023-08-25 18:50:46 +10:00
2023-09-23 04:49:39 -04:00
[DataField]
public EntProtoId BooAction = "ActionGhostBoo" ;
2023-09-08 18:16:05 -07:00
2023-09-23 04:49:39 -04:00
[DataField, AutoNetworkedField]
public EntityUid ? BooActionEntity ;
2023-08-25 18:50:46 +10:00
2023-09-24 13:34:08 -07:00
// End actions
[ViewVariables(VVAccess.ReadWrite), DataField]
public TimeSpan TimeOfDeath = TimeSpan . Zero ;
2023-11-19 15:17:53 -05:00
[DataField("booRadius"), ViewVariables(VVAccess.ReadWrite)]
2023-09-24 13:34:08 -07:00
public float BooRadius = 3 ;
2023-11-19 15:17:53 -05:00
[DataField("booMaxTargets"), ViewVariables(VVAccess.ReadWrite)]
2023-09-24 13:34:08 -07:00
public int BooMaxTargets = 3 ;
2023-08-25 18:50:46 +10:00
// TODO: instead of this funny stuff just give it access and update in system dirtying when needed
[ViewVariables(VVAccess.ReadWrite)]
public bool CanGhostInteract
{
get = > _canGhostInteract ;
set
{
if ( _canGhostInteract = = value ) return ;
_canGhostInteract = value ;
Dirty ( ) ;
}
}
[DataField("canInteract"), AutoNetworkedField]
private bool _canGhostInteract ;
/// <summary>
/// Changed by <see cref="SharedGhostSystem.SetCanReturnToBody"/>
/// </summary>
// TODO MIRROR change this to use friend classes when thats merged
[ViewVariables(VVAccess.ReadWrite)]
public bool CanReturnToBody
{
get = > _canReturnToBody ;
set
{
if ( _canReturnToBody = = value ) return ;
_canReturnToBody = value ;
Dirty ( ) ;
}
}
2025-03-21 02:20:37 +05:00
[DataField, AutoNetworkedField]
public bool Visible ;
2023-08-25 18:50:46 +10:00
/// <summary>
/// Ghost color
/// </summary>
/// <remarks>Used to allow admins to change ghost colors. Should be removed if the capability to edit existing sprite colors is ever added back.</remarks>
2025-03-21 02:20:37 +05:00
[DataField("color"), AutoNetworkedField]
public Color Color = Color . White ;
2023-08-25 18:50:46 +10:00
[DataField("canReturnToBody"), AutoNetworkedField]
private bool _canReturnToBody ;
}
2023-09-24 13:34:08 -07:00
public sealed partial class ToggleFoVActionEvent : InstantActionEvent { }
2023-08-25 18:50:46 +10:00
2023-09-24 13:34:08 -07:00
public sealed partial class ToggleGhostsActionEvent : InstantActionEvent { }
2023-08-25 18:50:46 +10:00
2023-09-24 13:34:08 -07:00
public sealed partial class ToggleLightingActionEvent : InstantActionEvent { }
2023-08-25 18:50:46 +10:00
2023-09-24 13:34:08 -07:00
public sealed partial class ToggleGhostHearingActionEvent : InstantActionEvent { }
public sealed partial class BooActionEvent : InstantActionEvent { }