Files
space-station-14/Content.Shared/Ghost/GhostComponent.cs
Thinbug 9393d624d7 Ghost types (#37949)
* Empty commit

* yeah thingi

* added a GetHighestDamageTypes thingi to the DamageableSystem

* no idea why those files names are different only in github so just in case readding them

* yeah doing that

* first steps of moving the logic somewhere nicer

* still plenty to do

* gosh such a mess but getting progress done

* small fixie push

* big mess of bunch of stuff

* dealing with a conflict and fixing the random numbers

* testing if github will update now

* dealing with the other conflict

* github please update i beg you

* dealing with more conflicts

* hopefully this fixes it

* fixing conflicts again

* cleaning up stuffies

* sprite fixie

* general cleanup

* doing the small fixies first

* getting rid of the new event, gotta handle ashing next

* adding spaces to comments before i forget

* handling ashing

* think that did it?

* small fixies

* more small fixies

* last batch of quickie fixies before i gotta handle the bigger stuff

* last bunch of fixies i do understand

* small bit of progress yknow may as well yeah

* renaming and moving stuff to shared

* comment fixiees

* saving damage in a new component instead of in MindComponent

* protoid's and dict usage instead of the previously ickier methods

* small fixie before biggie fixie

* more fixies im slepy gosh

* thinkie that should fixie it

* smoothed the damage storage systeem so its less repetitive and icki and now itss cooler and i can go eepy

* lots of stuffies x3

* first step of getting git to detect my file name changes

* thinkie that should fixie it

* fixies

* just getting rid of the merge conflict, will check damageable later

* small thingies first

* more small stuffiees

* now all of the sprites have at leeast a 0

* dirtying the lastbody comp

* more fixies

* small thingi first

* another small fixie and a minor sprite fixie

* rng fixie

* moving the damage storage system to shared

* smoothing out code thats likely to be replaced soon but its good to do for now

* just showing progress bcus yis

* general progress stuffies mhm

* pushie

* small cleanup

* general progress :3

* in progress push for helpie

* proper pushie with progress and workies

* removed unnecessary usage of the storedamage component

* minor fixiees

* extra comments

* replaced a couple strings for ProtoId's

* gibbing related fixies :3
2026-01-30 23:16:03 +00:00

120 lines
3.6 KiB
C#

using Content.Shared.Actions;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared.Ghost;
/// <summary>
/// Represents an observer ghost.
/// Handles limiting interactions, using ghost abilities, ghost visibility, and ghost warping.
/// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(SharedGhostSystem))]
[AutoGenerateComponentState(true), AutoGenerateComponentPause]
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;
// End actions
/// <summary>
/// Time at which the player died and created this ghost.
/// Used to determine votekick eligibility.
/// </summary>
/// <remarks>
/// May not reflect actual time of death if this entity has been paused,
/// but will give an accurate length of time <i>since</i> death.
/// </remarks>
[DataField, AutoPausedField]
public TimeSpan TimeOfDeath = TimeSpan.Zero;
/// <summary>
/// Range of the Boo action.
/// </summary>
[DataField]
public float BooRadius = 3;
/// <summary>
/// Maximum number of entities that can affected by the Boo action.
/// </summary>
[DataField]
public int BooMaxTargets = 3;
/// <summary>
/// Is this ghost allowed to interact with entities?
/// </summary>
/// <remarks>
/// Used to allow admins ghosts to interact with the world.
/// Changed by <see cref="SharedGhostSystem.SetCanGhostInteract"/>.
/// </remarks>
[DataField("canInteract"), AutoNetworkedField]
public bool CanGhostInteract;
/// <summary>
/// Is this ghost player allowed to return to their original body?
/// </summary>
/// <remarks>
/// Changed by <see cref="SharedGhostSystem.SetCanReturnToBody"/>.
/// </remarks>
[DataField, AutoNetworkedField]
public bool CanReturnToBody;
/// <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;
}
/// <summary>
/// Ghost sprites dependent on damage by the player body
/// </summary>
/// <remarks>Used to change a ghost sprite to better visually represent their cause of death</remarks>
[Serializable, NetSerializable]
public enum GhostVisuals : byte
{
Damage
}
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 { }