Cyborg health alert and damage examining (#20084)

* Option for alt health alert and no overlay

* Fancy borg health indicator

* Borg damage examine localization

* EENENGHHHH ENNNGHHH

* Requested code changes

* Legal sound

* Revert "Legal sound"

This reverts commit 35715c88898aeb78dfe800319852c230395fdd7e.

I misunderstood what Sloth meant

* Annoying buzzer is back
This commit is contained in:
Doru991
2023-09-15 06:14:47 +03:00
committed by GitHub
parent c25b769132
commit eaecdb4336
15 changed files with 153 additions and 14 deletions

View File

@@ -1,4 +1,5 @@
using Content.Shared.FixedPoint;
using Content.Shared.Alert;
using Content.Shared.FixedPoint;
using Content.Shared.Mobs.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
@@ -9,7 +10,7 @@ namespace Content.Shared.Mobs.Components;
[Access(typeof(MobThresholdSystem))]
public sealed partial class MobThresholdsComponent : Component
{
[DataField("thresholds", required:true)]
[DataField("thresholds", required: true)]
public SortedDictionary<FixedPoint2, MobState> Thresholds = new();
[DataField("triggersAlerts")]
@@ -18,6 +19,24 @@ public sealed partial class MobThresholdsComponent : Component
[DataField("currentThresholdState")]
public MobState CurrentThresholdState;
/// <summary>
/// The health alert that should be displayed for player controlled entities.
/// Used for alternate health alerts (silicons, for example)
/// </summary>
[DataField("stateAlertDict")]
public Dictionary<MobState, AlertType> StateAlertDict = new()
{
{MobState.Alive, AlertType.HumanHealth},
{MobState.Critical, AlertType.HumanCrit},
{MobState.Dead, AlertType.HumanDead},
};
/// <summary>
/// Whether or not this entity should display damage overlays (robots don't feel pain, black out etc.)
/// </summary>
[DataField("showOverlays")]
public bool ShowOverlays = true;
/// <summary>
/// Whether or not this entity can be revived out of a dead state.
/// </summary>
@@ -34,13 +53,25 @@ public sealed class MobThresholdsComponentState : ComponentState
public MobState CurrentThresholdState;
public Dictionary<MobState, AlertType> StateAlertDict = new()
{
{MobState.Alive, AlertType.HumanHealth},
{MobState.Critical, AlertType.HumanCrit},
{MobState.Dead, AlertType.HumanDead},
};
public bool ShowOverlays;
public bool AllowRevives;
public MobThresholdsComponentState(Dictionary<FixedPoint2, MobState> unsortedThresholds, bool triggersAlerts, MobState currentThresholdState, bool allowRevives)
public MobThresholdsComponentState(Dictionary<FixedPoint2, MobState> unsortedThresholds, bool triggersAlerts, MobState currentThresholdState,
Dictionary<MobState, AlertType> stateAlertDict, bool showOverlays, bool allowRevives)
{
UnsortedThresholds = unsortedThresholds;
TriggersAlerts = triggersAlerts;
CurrentThresholdState = currentThresholdState;
StateAlertDict = stateAlertDict;
ShowOverlays = showOverlays;
AllowRevives = allowRevives;
}
}