Predicted stamina (#12413)

* Predicted stamina

Needed to do some semblence of predicted melee.

* Okay now done.

* Pause support

* Comment
This commit is contained in:
metalgearsloth
2022-11-09 07:34:07 +11:00
committed by GitHub
parent 43b529f647
commit fb3f6fa80f
23 changed files with 148 additions and 95 deletions

View File

@@ -1,10 +0,0 @@
namespace Content.Server.Damage.Components;
/// <summary>
/// Tracks whether an entity has ANY stamina damage for update purposes only.
/// </summary>
[RegisterComponent]
public sealed class ActiveStaminaComponent : Component
{
}

View File

@@ -1,47 +0,0 @@
using Content.Server.Damage.Systems;
using Robust.Shared.GameStates;
namespace Content.Server.Damage.Components;
/// <summary>
/// Add to an entity to paralyze it whenever it reaches critical amounts of Stamina DamageType.
/// </summary>
[RegisterComponent]
public sealed class StaminaComponent : Component
{
/// <summary>
/// Have we reached peak stamina damage and been paralyzed?
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("critical")]
public bool Critical;
/// <summary>
/// How much stamina reduces per second.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("decay")]
public float Decay = 3f;
/// <summary>
/// How much time after receiving damage until stamina starts decreasing.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("cooldown")]
public float DecayCooldown = 5f;
/// <summary>
/// How much stamina damage this entity has taken.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("staminaDamage")]
public float StaminaDamage;
/// <summary>
/// How much stamina damage is required to entire stam crit.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("excess")]
public float CritThreshold = 100f;
/// <summary>
/// Next time we're allowed to decrease stamina damage. Refreshes whenever the stam damage is changed.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("decayAccumulator")]
public float StaminaDecayAccumulator;
}

View File

@@ -1,13 +0,0 @@
using Robust.Shared.GameStates;
namespace Content.Server.Damage.Components;
/// <summary>
/// Applies stamina damage when colliding with an entity.
/// </summary>
[RegisterComponent]
public sealed class StaminaDamageOnCollideComponent : Component
{
[ViewVariables(VVAccess.ReadWrite), DataField("damage")]
public float Damage = 55f;
}

View File

@@ -1,10 +0,0 @@
using Robust.Shared.Audio;
namespace Content.Server.Damage.Components;
[RegisterComponent]
public sealed class StaminaDamageOnHitComponent : Component
{
[ViewVariables(VVAccess.ReadWrite), DataField("damage")]
public float Damage = 30f;
}