fish-station/Content.Shared/Ghost/GhostComponent.cs
Vigers Ray 10888fd269 Merge remote-tracking branch 'space-wizards/master'
# Conflicts:
#	Content.Client/GameTicking/Managers/ClientGameTicker.cs
#	Content.Server/Administration/Systems/BwoinkSystem.cs
#	Content.Server/Cargo/Systems/CargoSystem.Orders.cs
#	Content.Server/Chat/Systems/ChatSystem.cs
#	Content.Server/Power/EntitySystems/PowerNetSystem.cs
#	Content.Server/Shuttles/Systems/ArrivalsSystem.cs
#	Content.Server/Station/Systems/StationSpawningSystem.cs
#	Content.Server/StationEvents/Components/PowerGridCheckRuleComponent.cs
#	Content.Server/StationEvents/Events/PowerGridCheckRule.cs
#	Content.Server/Zombies/ZombieSystem.Transform.cs
#	Content.Shared/CCVar/CCVars.Game.cs
#	Content.Shared/GameTicking/SharedGameTicker.cs
#	Resources/Locale/en-US/_strings/game-ticking/game-presets/preset-wizard.ftl
#	Resources/Locale/en-US/_strings/guidebook/cooking.ftl
#	Resources/Prototypes/Entities/Clothing/OuterClothing/misc.yml
#	Resources/Prototypes/Entities/Markers/Spawners/ghost_roles.yml
#	Resources/Prototypes/Entities/Mobs/NPCs/pets.yml
#	Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml
#	Resources/Prototypes/Entities/Objects/Weapons/Guns/turrets.yml
#	Resources/Prototypes/Entities/Structures/Machines/lathe.yml
#	Resources/Prototypes/GameRules/events.yml
#	Resources/Prototypes/GameRules/midround.yml
#	Resources/Prototypes/GameRules/roundstart.yml
#	Resources/Prototypes/Guidebook/antagonist.yml
#	Resources/ServerInfo/Guidebook/Jobs.xml
#	Resources/ServerInfo/Guidebook/Service/FoodRecipes.xml
#	Resources/migration.yml
2025-02-26 22:01:48 +03:00

114 lines
3.3 KiB
C#

using Content.Shared.Actions;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.Ghost;
[RegisterComponent, NetworkedComponent, Access(typeof(SharedGhostSystem))]
[AutoGenerateComponentState(true)]
public sealed partial class GhostComponent : Component
{
// Actions
[DataField]
public EntProtoId ToggleLightingAction = "ActionToggleLighting";
[DataField, AutoNetworkedField]
public EntityUid? ToggleLightingActionEntity;
[DataField]
public EntProtoId ToggleFoVAction = "ActionToggleFov";
[DataField, AutoNetworkedField]
public EntityUid? ToggleFoVActionEntity;
[DataField]
public EntProtoId ToggleGhostsAction = "ActionToggleGhosts";
[DataField, AutoNetworkedField]
public EntityUid? ToggleGhostsActionEntity;
[DataField]
public EntProtoId ToggleGhostHearingAction = "ActionToggleGhostHearing";
[DataField]
public EntityUid? ToggleGhostHearingActionEntity;
[DataField]
public EntProtoId BooAction = "ActionGhostBoo";
[DataField, AutoNetworkedField]
public EntityUid? BooActionEntity;
// Sunrise-Start
[DataField]
public EntProtoId GhostsThemeAction = "GhostChangeTheme";
[DataField, AutoNetworkedField]
public EntityUid? GhostsThemeActionEntity;
// Sunrise-End
// End actions
[ViewVariables(VVAccess.ReadWrite), DataField]
public TimeSpan TimeOfDeath = TimeSpan.Zero;
[DataField("booRadius"), ViewVariables(VVAccess.ReadWrite)]
public float BooRadius = 3;
[DataField("booMaxTargets"), ViewVariables(VVAccess.ReadWrite)]
public int BooMaxTargets = 3;
// 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();
}
}
/// <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>
[DataField, AutoNetworkedField]
public Color Color = Color.White;
[DataField("canReturnToBody"), AutoNetworkedField]
private bool _canReturnToBody;
}
public sealed partial class ToggleFoVActionEvent : InstantActionEvent { }
public sealed partial class ToggleGhostsActionEvent : InstantActionEvent { }
public sealed partial class ToggleLightingActionEvent : InstantActionEvent { }
public sealed partial class ToggleGhostHearingActionEvent : InstantActionEvent { }
public sealed partial class ToggleGhostVisibilityToAllEvent : InstantActionEvent { }
public sealed partial class BooActionEvent : InstantActionEvent { }