Overhauled stamina slowdown behavior (#36336)

This commit is contained in:
nikitosych
2025-05-02 00:01:17 +01:00
committed by GitHub
parent 52062dcfad
commit 72d2d8ab0f
3 changed files with 116 additions and 22 deletions

View File

@@ -1,4 +1,5 @@
using Content.Shared.Alert;
using Content.Shared.FixedPoint;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
@@ -56,4 +57,22 @@ public sealed partial class StaminaComponent : Component
[DataField]
public ProtoId<AlertPrototype> StaminaAlert = "Stamina";
/// <summary>
/// This flag indicates whether the value of <see cref="StaminaDamage"/> decreases after the entity exits stamina crit.
/// </summary>
[DataField, AutoNetworkedField]
public bool AfterCritical;
/// <summary>
/// This float determines how fast stamina will regenerate after exiting the stamina crit.
/// </summary>
[DataField, AutoNetworkedField]
public float AfterCritDecayMultiplier = 5f;
/// <summary>
/// Thresholds that determine an entity's slowdown as a function of stamina damage.
/// </summary>
[DataField]
public Dictionary<FixedPoint2, float> StunModifierThresholds = new() { {0, 1f }, { 60, 0.7f }, { 80, 0.5f } };
}