Files
Delta-v/Content.Shared/Stealth/Components/StealthComponent.cs
T
CorynandJanet Blackquill cb62b27fcf Nubody (2/3) - ShitMed removal (#5844)
* Reapply "Nubody Merge" (#5807)

This reverts commit d62f7cef10.

* Revert "Nubody Merge (#5670)"

This reverts commit b465cfb3fd.

* Revert "IPC fibers (#4968)"

This reverts commit c2b42211f0.

* Revert "IPC Polymorph fix (#4545)"

This reverts commit fa03d8c655.

* Revert "fix IPC not having humanoid emotes (#4445)"

This reverts commit 216fdf999f.

* Revert "ipc heat/cold (#4306)"

This reverts commit fafd5cf816.

* Revert "ipc cables (#4283)"

This reverts commit 54958039a1.

* Revert "feat: ipcs now have dynamic power draw based off movement speed (#3917)"

This reverts commit 71e8b7e64b.

* Revert "fix ipcs not being able to disarm (#3374)"

This reverts commit 764c4dcf54.

* Revert "make steel heal caustic for ipcs (#3206)"

This reverts commit 450ac82550.

* Revert "add missing ipc survival boxes (#3065)"

This reverts commit 888c9cdb00.

* Revert "make borgs use ipc repairing (#3064)"

This reverts commit f77a49dd0b.

* Revert "Update hud.yml to add ipcs to diagnostic hud (#3019)"

This reverts commit 7220643531.

* Revert "Tweak IPCs (#2979)"

This reverts commit 98b47476de.

* Revert "fix nukies ipc test fail (#2957)"

This reverts commit 4a1acbf863.

* Revert "fix ipc nukies not getting comms (#2884)"

This reverts commit 8a2254770e.

* Revert "fix ipc encryption key mispredict (#2879)"

This reverts commit f08726efc1.

* Revert "Merge pull request #2800 from Spielern/port-ipc"

This reverts commit 822fa4312c, reversing
changes made to fe4c23c702.

* Remove and Fix rest of IPC Hangons causing crashes

* Integration test Errors

* Expand migration file with removed IPC stuff

* IPC Leg was found and migrated to naught

* Revert "Merge pull request #2542 from deltanedas/shitmed-ops"

This reverts commit 83a8002922, reversing
changes made to baa89b0052.

* Revert "Set up surgical augments infrastructure & add tool panel augments (#3059)"

This reverts commit a40f0be6fd.

* Revert "Psionic Prosthetics (#4689)"

This reverts commit 2679bb238a.

* Revert "Add surgical cleanliness and sanitation (#2847)"

This reverts commit 64565ba4f7.

* Remove unremoved mentions

* Revert "Add autoclave to easily sanitize large amounts of items and faster (#2933)"

This reverts commit d0da90fa2e.

* Shit Med Removed

* Remove _ShitMed Folders and fix Errors in Console

* Add OrganAnimalBrain into the mirgraiton file

* Heads no Input Mover

* Monke

* Full migration file I guess

* oops

* shiv state fix

* Restore accidental deleted recipe

* Forgot one flt mention

* Fix more issues

* Comment out Damage Visual for motorkind for now

* Motorkind...

* Commenting stuff out for now

* thought there'd be more of this to gut

---------

Co-authored-by: Janet Blackquill <uhhadd@gmail.com>
2026-05-21 20:27:04 -04:00

91 lines
3.4 KiB
C#

using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Stealth.Components;
/// <summary>
/// Add this component to an entity that you want to be cloaked.
/// It overlays a shader on the entity to give them an invisibility cloaked effect.
/// It also turns the entity invisible.
/// Use other components (like StealthOnMove) to modify this component's visibility based on certain conditions.
/// </summary>
[RegisterComponent, NetworkedComponent]
[Access(typeof(SharedStealthSystem))]
public sealed partial class StealthComponent : Component
{
/// <summary>
/// Whether or not the stealth effect should currently be applied.
/// </summary>
[DataField("enabled")]
public bool Enabled = true;
/// <summary>
/// The creature will continue invisible at death.
/// </summary>
[DataField("enabledOnDeath")]
public bool EnabledOnDeath = true;
/// <summary>
/// Whether or not the entity previously had an interaction outline prior to cloaking.
/// </summary>
[DataField("hadOutline")]
public bool HadOutline;
/// <summary>
/// Minimum visibility before the entity becomes unexaminable (and thus no longer appears on context menus).
/// </summary>
[DataField("examineThreshold")]
public float ExamineThreshold = 0.5f;
/// <summary>
/// Last set level of visibility. The visual effect ranges from 1 (fully visible) and -1 (fully hidden). Values
/// outside of this range simply act as a buffer for the visual effect (i.e., a delay before turning invisible). To
/// get the actual current visibility, use <see cref="SharedStealthSystem.GetVisibility(EntityUid, StealthComponent?)"/>
/// If you don't have anything else updating the stealth, this will just stay at a constant value, which can be useful.
/// </summary>
[DataField("lastVisibility")]
[Access(typeof(SharedStealthSystem), Other = AccessPermissions.None)]
public float LastVisibility = 1;
/// <summary>
/// Time at which <see cref="LastVisibility"/> was set. Null implies the entity is currently paused and not
/// accumulating any visibility change.
/// </summary>
[DataField("lastUpdate", customTypeSerializer:typeof(TimeOffsetSerializer))]
public TimeSpan? LastUpdated;
/// <summary>
/// Minimum visibility. Note that the visual effect caps out at -1, but this value is allowed to be larger or smaller.
/// </summary>
[DataField("minVisibility")]
public float MinVisibility = -1f;
/// <summary>
/// Maximum visibility. Note that the visual effect caps out at +1, but this value is allowed to be larger or smaller.
/// </summary>
[DataField("maxVisibility")]
public float MaxVisibility = 1.5f;
/// <summary>
/// Localization string for how you'd like to describe this effect.
/// </summary>
[DataField("examinedDesc")]
public string ExaminedDesc = "stealth-visual-effect";
}
[Serializable, NetSerializable]
public sealed class StealthComponentState : ComponentState
{
public readonly float Visibility;
public readonly TimeSpan? LastUpdated;
public readonly bool Enabled;
public StealthComponentState(float stealthLevel, TimeSpan? lastUpdated, bool enabled)
{
Visibility = stealthLevel;
LastUpdated = lastUpdated;
Enabled = enabled;
}
}