From c2fff7aad2d94e52639ce24d3c01656843e9da5b Mon Sep 17 00:00:00 2001 From: MLGTASTICa Date: Mon, 8 Aug 2022 23:43:22 +0300 Subject: [PATCH 1/2] AAAAAAAAAAAA --- Content.Client/Content.Client.csproj | 5 +- Content.Client/Input/ContentContexts.cs | 1 + Content.Client/Stamina/StaminaComponent.cs | 12 + Content.Client/Stamina/StaminaSystem.cs | 58 +++++ Content.Server/CombatMode/CombatModeSystem.cs | 2 +- .../Damage/Components/ActivePainComponent.cs | 10 + .../Components/ActiveStaminaComponent.cs | 10 - .../{StaminaComponent.cs => PainComponent.cs} | 22 +- ...ent.cs => PainDamageOnCollideComponent.cs} | 4 +- ...mponent.cs => PainDamageOnHitComponent.cs} | 2 +- ...vent.cs => PainDamageOnHitAttemptEvent.cs} | 4 +- .../{StaminaSystem.cs => PainSystem.cs} | 108 ++++----- Content.Server/Stamina/StaminaComponent.cs | 35 +++ Content.Server/Stamina/StaminaSystem.cs | 103 +++++++++ .../Stunnable/Systems/StunbatonSystem.cs | 6 +- .../Weapon/Ranged/Systems/GunSystem.cs | 6 +- Content.Shared/Alert/AlertCategory.cs | 3 +- Content.Shared/Alert/AlertType.cs | 3 +- Content.Shared/Input/ContentKeyFunctions.cs | 1 + .../Stamina/SharedStaminaComponent.cs | 55 +++++ Content.Shared/Stamina/SharedStaminaSystem.cs | 216 ++++++++++++++++++ .../Weapons/Ranged/HitscanPrototype.cs | 4 +- Resources/Locale/en-US/damage/pain.ftl | 1 + Resources/Locale/en-US/damage/stamina.ftl | 1 - Resources/Prototypes/Alerts/alerts.yml | 19 +- .../Entities/Mobs/Species/human.yml | 1 + .../Guns/Ammunition/Projectiles/shotgun.yml | 2 +- .../Weapons/Guns/Projectiles/projectiles.yml | 6 +- .../Objects/Weapons/Throwable/bola.yml | 2 +- .../Entities/Objects/Weapons/security.yml | 2 +- .../Interface/Alerts/pain.rsi/meta.json | 124 ++++++++++ .../Interface/Alerts/pain.rsi/pain0.png | Bin 0 -> 1156 bytes .../Interface/Alerts/pain.rsi/pain1.png | Bin 0 -> 701 bytes .../Interface/Alerts/pain.rsi/pain2.png | Bin 0 -> 1003 bytes .../Interface/Alerts/pain.rsi/pain3.png | Bin 0 -> 912 bytes .../Interface/Alerts/pain.rsi/pain4.png | Bin 0 -> 795 bytes .../stamina5.png => pain.rsi/pain5.png} | Bin .../stamina6.png => pain.rsi/pain6.png} | Bin .../Interface/Alerts/stamina.rsi/meta.json | 105 +-------- .../Interface/Alerts/stamina.rsi/stamina0.png | Bin 1156 -> 298 bytes .../Interface/Alerts/stamina.rsi/stamina1.png | Bin 701 -> 297 bytes .../Interface/Alerts/stamina.rsi/stamina2.png | Bin 1003 -> 296 bytes .../Interface/Alerts/stamina.rsi/stamina3.png | Bin 912 -> 300 bytes .../Interface/Alerts/stamina.rsi/stamina4.png | Bin 795 -> 300 bytes Resources/keybinds.yml | 3 + 45 files changed, 740 insertions(+), 196 deletions(-) create mode 100644 Content.Client/Stamina/StaminaComponent.cs create mode 100644 Content.Client/Stamina/StaminaSystem.cs create mode 100644 Content.Server/Damage/Components/ActivePainComponent.cs delete mode 100644 Content.Server/Damage/Components/ActiveStaminaComponent.cs rename Content.Server/Damage/Components/{StaminaComponent.cs => PainComponent.cs} (58%) rename Content.Server/Damage/Components/{StaminaDamageOnCollideComponent.cs => PainDamageOnCollideComponent.cs} (64%) rename Content.Server/Damage/Components/{StaminaDamageOnHitComponent.cs => PainDamageOnHitComponent.cs} (72%) rename Content.Server/Damage/Events/{StaminaDamageOnHitAttemptEvent.cs => PainDamageOnHitAttemptEvent.cs} (62%) rename Content.Server/Damage/Systems/{StaminaSystem.cs => PainSystem.cs} (52%) create mode 100644 Content.Server/Stamina/StaminaComponent.cs create mode 100644 Content.Server/Stamina/StaminaSystem.cs create mode 100644 Content.Shared/Stamina/SharedStaminaComponent.cs create mode 100644 Content.Shared/Stamina/SharedStaminaSystem.cs create mode 100644 Resources/Locale/en-US/damage/pain.ftl delete mode 100644 Resources/Locale/en-US/damage/stamina.ftl create mode 100644 Resources/Textures/Interface/Alerts/pain.rsi/meta.json create mode 100644 Resources/Textures/Interface/Alerts/pain.rsi/pain0.png create mode 100644 Resources/Textures/Interface/Alerts/pain.rsi/pain1.png create mode 100644 Resources/Textures/Interface/Alerts/pain.rsi/pain2.png create mode 100644 Resources/Textures/Interface/Alerts/pain.rsi/pain3.png create mode 100644 Resources/Textures/Interface/Alerts/pain.rsi/pain4.png rename Resources/Textures/Interface/Alerts/{stamina.rsi/stamina5.png => pain.rsi/pain5.png} (100%) rename Resources/Textures/Interface/Alerts/{stamina.rsi/stamina6.png => pain.rsi/pain6.png} (100%) diff --git a/Content.Client/Content.Client.csproj b/Content.Client/Content.Client.csproj index 4065ffe7c8..0bcfa3ac4c 100644 --- a/Content.Client/Content.Client.csproj +++ b/Content.Client/Content.Client.csproj @@ -1,4 +1,4 @@ - + @@ -23,6 +23,9 @@ + + + diff --git a/Content.Client/Input/ContentContexts.cs b/Content.Client/Input/ContentContexts.cs index 2c588a9a29..acaabb3c55 100644 --- a/Content.Client/Input/ContentContexts.cs +++ b/Content.Client/Input/ContentContexts.cs @@ -40,6 +40,7 @@ public static void SetupContexts(IInputContextContainer contexts) human.AddFunction(ContentKeyFunctions.OpenCharacterMenu); human.AddFunction(ContentKeyFunctions.ActivateItemInWorld); human.AddFunction(ContentKeyFunctions.ThrowItemInHand); + human.AddFunction(ContentKeyFunctions.Slide); human.AddFunction(ContentKeyFunctions.AltActivateItemInWorld); human.AddFunction(ContentKeyFunctions.TryPullObject); human.AddFunction(ContentKeyFunctions.MovePulledObject); diff --git a/Content.Client/Stamina/StaminaComponent.cs b/Content.Client/Stamina/StaminaComponent.cs new file mode 100644 index 0000000000..e3b1347bf5 --- /dev/null +++ b/Content.Client/Stamina/StaminaComponent.cs @@ -0,0 +1,12 @@ +using Content.Shared.Stamina; + +namespace Content.Client.Stamina +{ + [RegisterComponent] + [ComponentReference(typeof(SharedStaminaComponent))] + public sealed class StaminaComponent : SharedStaminaComponent + { + + } + +} diff --git a/Content.Client/Stamina/StaminaSystem.cs b/Content.Client/Stamina/StaminaSystem.cs new file mode 100644 index 0000000000..757ff1099a --- /dev/null +++ b/Content.Client/Stamina/StaminaSystem.cs @@ -0,0 +1,58 @@ +using Content.Shared.Stamina; +using Content.Shared.Movement.Components; +using Content.Shared.Input; +using Robust.Shared.Input.Binding; +using Robust.Shared.Map; +using Robust.Shared.Players; +using Robust.Shared.Timing; +using Content.Shared.Standing; +using Robust.Shared.GameStates; + +namespace Content.Client.Stamina +{ + public sealed class StaminaSystem : SharedStaminaSystem + { + [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly StandingStateSystem _standing = default!; + + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(HandleCompState); + //UpdatesOutsidePrediction = false; + + CommandBinds.Builder + .Bind(ContentKeyFunctions.Slide, new PointerInputCmdHandler(HandleSlideAttempt)) + .Register(); + } + + private void HandleCompState(EntityUid uid, SharedStaminaComponent component, ref ComponentHandleState args) + { + if (args.Current is not StaminaComponentState state) return; + component.CurrentStamina = state.CurrentStamina; + component.CanSlide = state.CanSlide; + component.SlideCost = state.SlideCost; + component.ActualRegenRate = state.ActualRegenRate; + component.Stimulated = state.Stimulated; + + } + + public override bool HandleSlideAttempt(ICommonSession? session, EntityCoordinates coords, EntityUid uid) + { + if (base.HandleSlideAttempt(session, coords, uid)) + { + RaiseNetworkEvent(new StaminaSlideEvent(coords)); + return true; + } + return false; + } + + public override void Update(float frameTime) + { + // Can't predict this part since it unsynchronizes. + if (_timing.IsFirstTimePredicted) + base.Update(frameTime); + + } + } +} diff --git a/Content.Server/CombatMode/CombatModeSystem.cs b/Content.Server/CombatMode/CombatModeSystem.cs index 1179f22717..9f20c7f317 100644 --- a/Content.Server/CombatMode/CombatModeSystem.cs +++ b/Content.Server/CombatMode/CombatModeSystem.cs @@ -124,7 +124,7 @@ private float CalculateDisarmChance(EntityUid disarmer, EntityUid disarmed, Enti } float chance = (disarmerComp.BaseDisarmFailChance - healthMod - massMod); - if (HasComp(disarmer)) // might need to revisit this part after stamina damage, right now this is basically "pre-stun" + if (HasComp(disarmer)) // might need to revisit this part after Pain damage, right now this is basically "pre-stun" chance += 0.35f; if (HasComp(disarmed)) chance -= 0.35f; diff --git a/Content.Server/Damage/Components/ActivePainComponent.cs b/Content.Server/Damage/Components/ActivePainComponent.cs new file mode 100644 index 0000000000..aaaced3e77 --- /dev/null +++ b/Content.Server/Damage/Components/ActivePainComponent.cs @@ -0,0 +1,10 @@ +namespace Content.Server.Damage.Components; + +/// +/// Tracks whether an entity has ANY Pain damage for update purposes only. +/// +[RegisterComponent] +public sealed class ActivePainComponent : Component +{ + +} diff --git a/Content.Server/Damage/Components/ActiveStaminaComponent.cs b/Content.Server/Damage/Components/ActiveStaminaComponent.cs deleted file mode 100644 index 073d394728..0000000000 --- a/Content.Server/Damage/Components/ActiveStaminaComponent.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Content.Server.Damage.Components; - -/// -/// Tracks whether an entity has ANY stamina damage for update purposes only. -/// -[RegisterComponent] -public sealed class ActiveStaminaComponent : Component -{ - -} diff --git a/Content.Server/Damage/Components/StaminaComponent.cs b/Content.Server/Damage/Components/PainComponent.cs similarity index 58% rename from Content.Server/Damage/Components/StaminaComponent.cs rename to Content.Server/Damage/Components/PainComponent.cs index 87e881016b..ca34bfddb1 100644 --- a/Content.Server/Damage/Components/StaminaComponent.cs +++ b/Content.Server/Damage/Components/PainComponent.cs @@ -4,44 +4,44 @@ namespace Content.Server.Damage.Components; /// -/// Add to an entity to paralyze it whenever it reaches critical amounts of Stamina DamageType. +/// Add to an entity to paralyze it whenever it reaches critical amounts of Pain DamageType. /// [RegisterComponent] -public sealed class StaminaComponent : Component +public sealed class PainComponent : Component { /// - /// Have we reached peak stamina damage and been paralyzed? + /// Have we reached peak Pain damage and been paralyzed? /// [ViewVariables(VVAccess.ReadWrite), DataField("critical")] public bool Critical; /// - /// How much stamina reduces per second. + /// How much Pain reduces per second. /// [ViewVariables(VVAccess.ReadWrite), DataField("decay")] public float Decay = 3f; /// - /// How much time after receiving damage until stamina starts decreasing. + /// How much time after receiving damage until Pain starts decreasing. /// [ViewVariables(VVAccess.ReadWrite), DataField("cooldown")] public float DecayCooldown = 5f; /// - /// How much stamina damage this entity has taken. + /// How much Pain damage this entity has taken. /// - [ViewVariables(VVAccess.ReadWrite), DataField("staminaDamage")] - public float StaminaDamage; + [ViewVariables(VVAccess.ReadWrite), DataField("PainDamage")] + public float PainDamage; /// - /// How much stamina damage is required to entire stam crit. + /// How much Pain damage is required to entire stam crit. /// [ViewVariables(VVAccess.ReadWrite), DataField("excess")] public float CritThreshold = 100f; /// - /// Next time we're allowed to decrease stamina damage. Refreshes whenever the stam damage is changed. + /// Next time we're allowed to decrease Pain damage. Refreshes whenever the stam damage is changed. /// [ViewVariables(VVAccess.ReadWrite), DataField("decayAccumulator")] - public float StaminaDecayAccumulator; + public float PainDecayAccumulator; } diff --git a/Content.Server/Damage/Components/StaminaDamageOnCollideComponent.cs b/Content.Server/Damage/Components/PainDamageOnCollideComponent.cs similarity index 64% rename from Content.Server/Damage/Components/StaminaDamageOnCollideComponent.cs rename to Content.Server/Damage/Components/PainDamageOnCollideComponent.cs index 450fb56aab..3da0f2f0bc 100644 --- a/Content.Server/Damage/Components/StaminaDamageOnCollideComponent.cs +++ b/Content.Server/Damage/Components/PainDamageOnCollideComponent.cs @@ -3,10 +3,10 @@ namespace Content.Server.Damage.Components; /// -/// Applies stamina damage when colliding with an entity. +/// Applies Pain damage when colliding with an entity. /// [RegisterComponent] -public sealed class StaminaDamageOnCollideComponent : Component +public sealed class PainDamageOnCollideComponent : Component { [ViewVariables(VVAccess.ReadWrite), DataField("damage")] public float Damage = 55f; diff --git a/Content.Server/Damage/Components/StaminaDamageOnHitComponent.cs b/Content.Server/Damage/Components/PainDamageOnHitComponent.cs similarity index 72% rename from Content.Server/Damage/Components/StaminaDamageOnHitComponent.cs rename to Content.Server/Damage/Components/PainDamageOnHitComponent.cs index fafe2a366f..ce34b7a980 100644 --- a/Content.Server/Damage/Components/StaminaDamageOnHitComponent.cs +++ b/Content.Server/Damage/Components/PainDamageOnHitComponent.cs @@ -1,7 +1,7 @@ namespace Content.Server.Damage.Components; [RegisterComponent] -public sealed class StaminaDamageOnHitComponent : Component +public sealed class PainDamageOnHitComponent : Component { [ViewVariables(VVAccess.ReadWrite), DataField("damage")] public float Damage = 30f; diff --git a/Content.Server/Damage/Events/StaminaDamageOnHitAttemptEvent.cs b/Content.Server/Damage/Events/PainDamageOnHitAttemptEvent.cs similarity index 62% rename from Content.Server/Damage/Events/StaminaDamageOnHitAttemptEvent.cs rename to Content.Server/Damage/Events/PainDamageOnHitAttemptEvent.cs index 1564a7843d..0871cedfc1 100644 --- a/Content.Server/Damage/Events/StaminaDamageOnHitAttemptEvent.cs +++ b/Content.Server/Damage/Events/PainDamageOnHitAttemptEvent.cs @@ -3,10 +3,10 @@ namespace Content.Server.Damage.Events; /// -/// Attempting to apply stamina damage on a melee hit to an entity. +/// Attempting to apply Pain damage on a melee hit to an entity. /// [ByRefEvent] -public struct StaminaDamageOnHitAttemptEvent +public struct PainDamageOnHitAttemptEvent { public bool Cancelled; public SoundSpecifier? HitSoundOverride; diff --git a/Content.Server/Damage/Systems/StaminaSystem.cs b/Content.Server/Damage/Systems/PainSystem.cs similarity index 52% rename from Content.Server/Damage/Systems/StaminaSystem.cs rename to Content.Server/Damage/Systems/PainSystem.cs index 5139945675..122f924497 100644 --- a/Content.Server/Damage/Systems/StaminaSystem.cs +++ b/Content.Server/Damage/Systems/PainSystem.cs @@ -12,7 +12,7 @@ namespace Content.Server.Damage.Systems; -public sealed class StaminaSystem : EntitySystem +public sealed class PainSystem : EntitySystem { [Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly AlertsSystem _alerts = default!; @@ -34,36 +34,36 @@ public sealed class StaminaSystem : EntitySystem public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnCollide); - SubscribeLocalEvent(OnHit); - SubscribeLocalEvent(OnStartup); - SubscribeLocalEvent(OnShutdown); + SubscribeLocalEvent(OnCollide); + SubscribeLocalEvent(OnHit); + SubscribeLocalEvent(OnStartup); + SubscribeLocalEvent(OnShutdown); } - private void OnShutdown(EntityUid uid, StaminaComponent component, ComponentShutdown args) + private void OnShutdown(EntityUid uid, PainComponent component, ComponentShutdown args) { - SetStaminaAlert(uid); + SetPainAlert(uid); } - private void OnStartup(EntityUid uid, StaminaComponent component, ComponentStartup args) + private void OnStartup(EntityUid uid, PainComponent component, ComponentStartup args) { - SetStaminaAlert(uid, component); + SetPainAlert(uid, component); } - private void OnHit(EntityUid uid, StaminaDamageOnHitComponent component, MeleeHitEvent args) + private void OnHit(EntityUid uid, PainDamageOnHitComponent component, MeleeHitEvent args) { if (component.Damage <= 0f) return; - var ev = new StaminaDamageOnHitAttemptEvent(); + var ev = new PainDamageOnHitAttemptEvent(); RaiseLocalEvent(uid, ref ev); if (ev.Cancelled) return; args.HitSoundOverride = ev.HitSoundOverride; - var stamQuery = GetEntityQuery(); - var toHit = new ValueList(); + var stamQuery = GetEntityQuery(); + var toHit = new ValueList(); - // Split stamina damage between all eligible targets. + // Split Pain damage between all eligible targets. foreach (var ent in args.HitEntities) { if (!stamQuery.TryGetComponent(ent, out var stam)) continue; @@ -72,73 +72,73 @@ private void OnHit(EntityUid uid, StaminaDamageOnHitComponent component, MeleeHi foreach (var comp in toHit) { - var oldDamage = comp.StaminaDamage; - TakeStaminaDamage(comp.Owner, component.Damage / toHit.Count, comp); - if (comp.StaminaDamage.Equals(oldDamage)) + var oldDamage = comp.PainDamage; + TakePainDamage(comp.Owner, component.Damage / toHit.Count, comp); + if (comp.PainDamage.Equals(oldDamage)) { - _popup.PopupEntity(Loc.GetString("stamina-resist"), comp.Owner, Filter.Entities(args.User)); + _popup.PopupEntity(Loc.GetString("Pain-resist"), comp.Owner, Filter.Entities(args.User)); } } } - private void OnCollide(EntityUid uid, StaminaDamageOnCollideComponent component, StartCollideEvent args) + private void OnCollide(EntityUid uid, PainDamageOnCollideComponent component, StartCollideEvent args) { if (!args.OurFixture.ID.Equals(CollideFixture)) return; - TakeStaminaDamage(args.OtherFixture.Body.Owner, component.Damage); + TakePainDamage(args.OtherFixture.Body.Owner, component.Damage); } - private void SetStaminaAlert(EntityUid uid, StaminaComponent? component = null) + private void SetPainAlert(EntityUid uid, PainComponent? component = null) { if (!Resolve(uid, ref component, false) || component.Deleted) { - _alerts.ClearAlert(uid, AlertType.Stamina); + _alerts.ClearAlert(uid, AlertType.Pain); return; } - var severity = ContentHelpers.RoundToLevels(MathF.Max(0f, component.CritThreshold - component.StaminaDamage), component.CritThreshold, 7); - _alerts.ShowAlert(uid, AlertType.Stamina, (short) severity); + var severity = ContentHelpers.RoundToLevels(MathF.Max(0f, component.CritThreshold - component.PainDamage), component.CritThreshold, 7); + _alerts.ShowAlert(uid, AlertType.Pain, (short) severity); } - public void TakeStaminaDamage(EntityUid uid, float value, StaminaComponent? component = null) + public void TakePainDamage(EntityUid uid, float value, PainComponent? component = null) { if (!Resolve(uid, ref component, false) || component.Critical) return; - var oldDamage = component.StaminaDamage; - component.StaminaDamage = MathF.Max(0f, component.StaminaDamage + value); + var oldDamage = component.PainDamage; + component.PainDamage = MathF.Max(0f, component.PainDamage + value); // Reset the decay cooldown upon taking damage. - if (oldDamage < component.StaminaDamage) + if (oldDamage < component.PainDamage) { - component.StaminaDecayAccumulator = component.DecayCooldown; + component.PainDecayAccumulator = component.DecayCooldown; } var slowdownThreshold = component.CritThreshold / 2f; // If we go above n% then apply slowdown if (oldDamage < slowdownThreshold && - component.StaminaDamage > slowdownThreshold) + component.PainDamage > slowdownThreshold) { _stunSystem.TrySlowdown(uid, TimeSpan.FromSeconds(3), true, 0.8f, 0.8f); } - SetStaminaAlert(uid, component); + SetPainAlert(uid, component); // Can't do it here as resetting prediction gets cooked. _dirtyEntities.Add(uid); if (!component.Critical) { - if (component.StaminaDamage >= component.CritThreshold) + if (component.PainDamage >= component.CritThreshold) { - EnterStamCrit(uid, component); + EnterPainCrit(uid, component); } } else { - if (component.StaminaDamage < component.CritThreshold) + if (component.PainDamage < component.CritThreshold) { - ExitStamCrit(uid, component); + ExitPainCrit(uid, component); } } } @@ -153,45 +153,45 @@ public override void Update(float frameTime) if (_accumulator > 0f) return; - var stamQuery = GetEntityQuery(); + var stamQuery = GetEntityQuery(); foreach (var uid in _dirtyEntities) { // Don't need to RemComp as they will get handled below. - if (!stamQuery.TryGetComponent(uid, out var comp) || comp.StaminaDamage <= 0f) continue; - EnsureComp(uid); + if (!stamQuery.TryGetComponent(uid, out var comp) || comp.PainDamage <= 0f) continue; + EnsureComp(uid); } _dirtyEntities.Clear(); _accumulator += UpdateCooldown; - foreach (var active in EntityQuery()) + foreach (var active in EntityQuery()) { - // Just in case we have active but not stamina we'll check and account for it. + // Just in case we have active but not Pain we'll check and account for it. if (!stamQuery.TryGetComponent(active.Owner, out var comp) || - comp.StaminaDamage <= 0f) + comp.PainDamage <= 0f) { - RemComp(active.Owner); + RemComp(active.Owner); continue; } - comp.StaminaDecayAccumulator -= UpdateCooldown; + comp.PainDecayAccumulator -= UpdateCooldown; - if (comp.StaminaDecayAccumulator > 0f) continue; + if (comp.PainDecayAccumulator > 0f) continue; // We were in crit so come out of it and continue. if (comp.Critical) { - ExitStamCrit(active.Owner, comp); + ExitPainCrit(active.Owner, comp); continue; } - comp.StaminaDecayAccumulator = 0f; - TakeStaminaDamage(comp.Owner, -comp.Decay * UpdateCooldown, comp); + comp.PainDecayAccumulator = 0f; + TakePainDamage(comp.Owner, -comp.Decay * UpdateCooldown, comp); } } - private void EnterStamCrit(EntityUid uid, StaminaComponent? component = null) + private void EnterPainCrit(EntityUid uid, PainComponent? component = null) { if (!Resolve(uid, ref component) || component.Critical) return; @@ -200,23 +200,23 @@ private void EnterStamCrit(EntityUid uid, StaminaComponent? component = null) // TODO: Mask? component.Critical = true; - component.StaminaDamage = component.CritThreshold; - component.StaminaDecayAccumulator = 0f; + component.PainDamage = component.CritThreshold; + component.PainDecayAccumulator = 0f; var stunTime = TimeSpan.FromSeconds(6); _stunSystem.TryParalyze(uid, stunTime, true); // Give them buffer before being able to be re-stunned - component.StaminaDecayAccumulator = (float) stunTime.TotalSeconds + StamCritBufferTime; + component.PainDecayAccumulator = (float) stunTime.TotalSeconds + StamCritBufferTime; } - private void ExitStamCrit(EntityUid uid, StaminaComponent? component = null) + private void ExitPainCrit(EntityUid uid, PainComponent? component = null) { if (!Resolve(uid, ref component) || !component.Critical) return; component.Critical = false; - component.StaminaDamage = 0f; - SetStaminaAlert(uid, component); + component.PainDamage = 0f; + SetPainAlert(uid, component); } } diff --git a/Content.Server/Stamina/StaminaComponent.cs b/Content.Server/Stamina/StaminaComponent.cs new file mode 100644 index 0000000000..ab96145683 --- /dev/null +++ b/Content.Server/Stamina/StaminaComponent.cs @@ -0,0 +1,35 @@ +using Content.Shared.Alert; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; +using Robust.Shared.Prototypes; +using Content.Shared.Actions.ActionTypes; +using Robust.Shared.Utility; +using Content.Shared.Stamina; + + +namespace Content.Server.Stamina +{ + [RegisterComponent] + [ComponentReference(typeof(SharedStaminaComponent))] + public sealed class StaminaComponent : SharedStaminaComponent + { + [ViewVariables(VVAccess.ReadWrite)] + [DataField("baseRegenRate")] + public float BaseRegenRate = 25f; + + // A multiplier to the base regen rate and regen rate added combined. + [ViewVariables(VVAccess.ReadWrite)] + public sbyte RegenRateMultiplier = 1; + + // a hard value added on top of the base regen, its added before multipliers are calculated. + [ViewVariables(VVAccess.ReadWrite)] + public float RegenRateAdded = 0f; + + // A variable used to define for how many StaminaSystem ticks there should be no regeneration (counted in seconds). + // Only fits values between 0 and 255. (anything more than 200 seconds should be handled in a manager anyway) + [ViewVariables(VVAccess.ReadWrite)] + [DataField("noRegenTicks")] + public byte NoRegenTicks = 0; + + + } +} diff --git a/Content.Server/Stamina/StaminaSystem.cs b/Content.Server/Stamina/StaminaSystem.cs new file mode 100644 index 0000000000..8811677fca --- /dev/null +++ b/Content.Server/Stamina/StaminaSystem.cs @@ -0,0 +1,103 @@ +using JetBrains.Annotations; +using Content.Shared.Movement.Components; +using Content.Shared.Movement.Systems; +using Content.Shared.Standing; +using Content.Shared.Stamina; +using Robust.Shared.GameStates; + +namespace Content.Server.Stamina +{ + [UsedImplicitly] + public sealed class StaminaSystem : SharedStaminaSystem + { + [Dependency] private readonly MovementSpeedModifierSystem _movement = default!; + [Dependency] private readonly StandingStateSystem _standing = default!; + + + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(OnComponentStartup); + SubscribeLocalEvent(GetCompState); + SubscribeNetworkEvent(OnStaminaUpdate); + + } + + private void GetCompState(EntityUid uid, SharedStaminaComponent component, ref ComponentGetState args) + { + args.State = new StaminaComponentState( + component.CurrentStamina, + component.CanSlide, + component.SlideCost, + component.ActualRegenRate, + component.Stimulated); + } + + + private void OnStaminaUpdate(StaminaSlideEvent message, EntitySessionEventArgs eventArgs) + { + if (TryComp(eventArgs.SenderSession.AttachedEntity, out StaminaComponent? stam)) + { + HandleSlideAttempt(eventArgs.SenderSession, message.Coords, (EntityUid) eventArgs.SenderSession.AttachedEntity); + } + + } + + + public void OnComponentStartup(EntityUid uid, StaminaComponent component, ComponentStartup args) + { + base.OnComponentStartup(uid, component, args); + RefreshRegenRate(component); + } + + public void UpdateEffects(StaminaComponent component) + { + //base.UpdateEffects(component); + switch (component.CurrentStaminaThreshold) + { + case StaminaThreshold.Overcharged: + component.BaseRegenRate = 0f; + RefreshRegenRate(component); + return; + + case StaminaThreshold.Energetic: + component.BaseRegenRate = 2.5f; + RefreshRegenRate(component); + return; + + case StaminaThreshold.Normal: + component.BaseRegenRate = 5f; + RefreshRegenRate(component); + return; + case StaminaThreshold.Tired: + component.BaseRegenRate = 10f; + RefreshRegenRate(component); + return; + + case StaminaThreshold.Collapsed: + component.BaseRegenRate = 25f; + RefreshRegenRate(component); + return; + + default: + Sawmill.Error($"No thirst threshold found for {component.CurrentStaminaThreshold}"); + throw new ArgumentOutOfRangeException($"No thirst threshold found for {component.CurrentStaminaThreshold}"); + } + } + + public void ResetStamina(StaminaComponent component) + { + component.CurrentStamina = component.StaminaThresholds[StaminaThreshold.Normal]; + component.CurrentStaminaThreshold = StaminaThreshold.Normal; + component.LastStaminaThreshold = StaminaThreshold.Normal; + component.Dirty(); + } + + public void RefreshRegenRate(StaminaComponent component) + { + component.ActualRegenRate = (component.BaseRegenRate + component.RegenRateAdded) * component.RegenRateMultiplier; + component.Dirty(); + } + + } +} diff --git a/Content.Server/Stunnable/Systems/StunbatonSystem.cs b/Content.Server/Stunnable/Systems/StunbatonSystem.cs index a93ac44485..bc6d975943 100644 --- a/Content.Server/Stunnable/Systems/StunbatonSystem.cs +++ b/Content.Server/Stunnable/Systems/StunbatonSystem.cs @@ -29,7 +29,7 @@ public override void Initialize() SubscribeLocalEvent(OnUseInHand); SubscribeLocalEvent(OnExamined); - SubscribeLocalEvent(OnStaminaHitAttempt); + SubscribeLocalEvent(OnPainHitAttempt); SubscribeLocalEvent(OnMeleeHit); } @@ -37,11 +37,11 @@ private void OnMeleeHit(EntityUid uid, StunbatonComponent component, MeleeHitEve { if (!component.Activated) return; - // Don't apply damage if it's activated; just do stamina damage. + // Don't apply damage if it's activated; just do Pain damage. args.BonusDamage -= args.BaseDamage; } - private void OnStaminaHitAttempt(EntityUid uid, StunbatonComponent component, ref StaminaDamageOnHitAttemptEvent args) + private void OnPainHitAttempt(EntityUid uid, StunbatonComponent component, ref PainDamageOnHitAttemptEvent args) { if (!component.Activated || !TryComp(uid, out var battery) || !battery.TryUseCharge(component.EnergyPerUse)) diff --git a/Content.Server/Weapon/Ranged/Systems/GunSystem.cs b/Content.Server/Weapon/Ranged/Systems/GunSystem.cs index b8e4915580..9134c15803 100644 --- a/Content.Server/Weapon/Ranged/Systems/GunSystem.cs +++ b/Content.Server/Weapon/Ranged/Systems/GunSystem.cs @@ -23,7 +23,7 @@ namespace Content.Server.Weapon.Ranged.Systems; public sealed partial class GunSystem : SharedGunSystem { [Dependency] private readonly EffectSystem _effects = default!; - [Dependency] private readonly StaminaSystem _stamina = default!; + [Dependency] private readonly PainSystem _Pain = default!; public const float DamagePitchVariation = MeleeWeaponSystem.DamagePitchVariation; @@ -116,8 +116,8 @@ public override void Shoot(GunComponent gun, List ammo, EntityCoordi var distance = result.Distance; FireEffects(fromCoordinates, distance, entityDirection.ToAngle(), hitscan, result.HitEntity); - if (hitscan.StaminaDamage > 0f) - _stamina.TakeStaminaDamage(result.HitEntity, hitscan.StaminaDamage); + if (hitscan.PainDamage > 0f) + _Pain.TakePainDamage(result.HitEntity, hitscan.PainDamage); var dmg = hitscan.Damage; diff --git a/Content.Shared/Alert/AlertCategory.cs b/Content.Shared/Alert/AlertCategory.cs index df310ca469..dbac394978 100644 --- a/Content.Shared/Alert/AlertCategory.cs +++ b/Content.Shared/Alert/AlertCategory.cs @@ -1,4 +1,4 @@ -namespace Content.Shared.Alert; +namespace Content.Shared.Alert; /// /// Every category of alert. Corresponds to category field in alert prototypes defined in YML @@ -10,6 +10,7 @@ public enum AlertCategory Breathing, Buckled, Health, + Pain, Stamina, Piloting, Hunger, diff --git a/Content.Shared/Alert/AlertType.cs b/Content.Shared/Alert/AlertType.cs index c348edca5a..6ed7084e11 100644 --- a/Content.Shared/Alert/AlertType.cs +++ b/Content.Shared/Alert/AlertType.cs @@ -1,4 +1,4 @@ -namespace Content.Shared.Alert +namespace Content.Shared.Alert { /// /// Every kind of alert. Corresponds to alertType field in alert prototypes defined in YML @@ -28,6 +28,7 @@ public enum AlertType : byte Overhydrated, Thirsty, Parched, + Pain, Stamina, Pulled, Pulling, diff --git a/Content.Shared/Input/ContentKeyFunctions.cs b/Content.Shared/Input/ContentKeyFunctions.cs index be7276e44b..5f3f719a2a 100644 --- a/Content.Shared/Input/ContentKeyFunctions.cs +++ b/Content.Shared/Input/ContentKeyFunctions.cs @@ -25,6 +25,7 @@ public static class ContentKeyFunctions public static readonly BoundKeyFunction OpenContextMenu = "OpenContextMenu"; public static readonly BoundKeyFunction OpenCraftingMenu = "OpenCraftingMenu"; public static readonly BoundKeyFunction OpenInventoryMenu = "OpenInventoryMenu"; + public static readonly BoundKeyFunction Slide = "Slide"; public static readonly BoundKeyFunction SmartEquipBackpack = "SmartEquipBackpack"; public static readonly BoundKeyFunction SmartEquipBelt = "SmartEquipBelt"; public static readonly BoundKeyFunction OpenInfo = "OpenInfo"; diff --git a/Content.Shared/Stamina/SharedStaminaComponent.cs b/Content.Shared/Stamina/SharedStaminaComponent.cs new file mode 100644 index 0000000000..952aed28aa --- /dev/null +++ b/Content.Shared/Stamina/SharedStaminaComponent.cs @@ -0,0 +1,55 @@ +using Robust.Shared.GameStates; + + + +namespace Content.Shared.Stamina +{ + [Flags] + public enum StaminaThreshold : byte + { + Collapsed = 0, + Tired = 1 << 0, + Normal = 1 << 1, + Energetic = 1 << 2, + Overcharged = 1 << 3, + } + + [NetworkedComponent] + public abstract class SharedStaminaComponent : Component + { + [ViewVariables(VVAccess.ReadWrite)] + public StaminaThreshold CurrentStaminaThreshold; + + [ViewVariables(VVAccess.ReadWrite)] + public StaminaThreshold LastStaminaThreshold; + + [ViewVariables(VVAccess.ReadWrite)] + public float CurrentStamina; + + [ViewVariables(VVAccess.ReadWrite)] + public float ActualRegenRate; + + // controls if the stamina can go to levels of energetic or overchargd + [ViewVariables(VVAccess.ReadWrite)] + public bool Stimulated = false; + + [DataField("slideCost")] + public byte SlideCost = 200; + + [DataField("canSlide")] + public bool CanSlide = true; + + [ViewVariables(VVAccess.ReadOnly)] + public float SlideTime = 0f; + + public Dictionary StaminaThresholds { get; } = new() + { + { StaminaThreshold.Collapsed, 1000.0f }, + { StaminaThreshold.Tired, 750.0f }, + { StaminaThreshold.Normal, 500.0f }, + { StaminaThreshold.Energetic, 250.0f }, + { StaminaThreshold.Overcharged, 0.0f }, + }; + + } +} diff --git a/Content.Shared/Stamina/SharedStaminaSystem.cs b/Content.Shared/Stamina/SharedStaminaSystem.cs new file mode 100644 index 0000000000..2073ca0ad0 --- /dev/null +++ b/Content.Shared/Stamina/SharedStaminaSystem.cs @@ -0,0 +1,216 @@ +using JetBrains.Annotations; +using Content.Shared.Movement.Components; +using Content.Shared.Alert; +using Content.Shared.Movement.Systems; +using Robust.Shared.Containers; +using Robust.Shared.Map; +using Robust.Shared.Players; +using Content.Shared.Standing; +using Robust.Shared.Serialization; + +namespace Content.Shared.Stamina +{ + [UsedImplicitly] + public abstract class SharedStaminaSystem : EntitySystem + { + [Dependency] private readonly AlertsSystem _alerts = default!; + [Dependency] private readonly MovementSpeedModifierSystem _movement = default!; + [Dependency] private readonly SharedJetpackSystem _jetpack = default!; + [Dependency] private readonly SharedContainerSystem _container = default!; + [Dependency] private readonly StandingStateSystem _standing = default!; + [Dependency] private readonly SharedPhysicsSystem _phys = default!; + + public ISawmill Sawmill = default!; + private float _accumulatedFrameTime; + private float _sliderFrameTime; + private HashSet _slidingComponents = new HashSet(); + + + public override void Initialize() + { + base.Initialize(); + + Sawmill = Logger.GetSawmill("stamina"); + SubscribeLocalEvent(OnComponentStartup); + SubscribeLocalEvent(OnRefreshMovespeed); + + + } + public virtual void OnComponentStartup(EntityUid uid, SharedStaminaComponent component, ComponentStartup args) + { + component.CurrentStamina = component.StaminaThresholds[StaminaThreshold.Normal]; + component.CurrentStaminaThreshold = StaminaThreshold.Normal; + // Necesarry for proper sliding + EnsureComp(component.Owner); + + } + + #region ComponentState and Event + [Serializable, NetSerializable] + public sealed class StaminaComponentState : ComponentState + { + public float CurrentStamina; + public bool CanSlide; + public byte SlideCost; + public float ActualRegenRate; + public bool Stimulated; + + public StaminaComponentState(float currentStamina, bool canSlide, byte slideCost, float actualRegenRate, bool stimulated) + { + CurrentStamina = currentStamina; + CanSlide = canSlide; + SlideCost = slideCost; + ActualRegenRate = actualRegenRate; + Stimulated = stimulated; + } + + + } + + + [Serializable, NetSerializable] + public sealed class StaminaSlideEvent : EntityEventArgs + { + public EntityCoordinates Coords; + public StaminaSlideEvent(EntityCoordinates coords) + { + Coords = coords; + } + } + #endregion + + private void OnRefreshMovespeed(EntityUid uid, SharedStaminaComponent component, RefreshMovementSpeedModifiersEvent args) + { + if (_jetpack.IsUserFlying(component.Owner)) + return; + + var mod = component.CurrentStaminaThreshold <= StaminaThreshold.Collapsed ? 0.7f : (component.CurrentStaminaThreshold == StaminaThreshold.Tired ? 0.9f : 1f); + args.ModifySpeed(mod, mod); + } + + public virtual bool HandleSlideAttempt(ICommonSession? session, EntityCoordinates coords, EntityUid uid) + { + if (TryComp(session?.AttachedEntity, out SharedStaminaComponent? stam) && stam.CanSlide) + { + if (_jetpack.IsUserFlying(stam.Owner) || _container.IsEntityInContainer(stam.Owner)) + return false; + if (TryComp(stam.Owner, out PhysicsComponent? physics) && TryComp(stam.Owner, out StandingStateComponent? state) + && TryComp(stam.Owner, out MovementIgnoreGravityComponent? grav) && TryComp(stam.Owner, out SharedPlayerInputMoverComponent? input)) + { + // too little to slide. + if ((Math.Abs(physics.LinearVelocity.X) + Math.Abs(physics.LinearVelocity.Y)) < 2f) + return false; + _phys.SetLinearVelocity(physics, physics.LinearVelocity * 4); + physics.LinearDamping += 1.5f; + physics.BodyType = Robust.Shared.Physics.BodyType.Dynamic; // Necesarry for linear dampening to be applied + stam.SlideTime = (Math.Abs(physics.LinearVelocity.X) + Math.Abs(physics.LinearVelocity.Y)) / 16; + // no moving !! + input.CanMove = false; + _standing.Down(stam.Owner, true, false, state); + UpdateStamina(stam, stam.SlideCost); + grav.Weightless = true; + _slidingComponents.Add(stam); + return true; + } + + return false; + } + return false; + } + + + public void UpdateEffects(SharedStaminaComponent component) + { + short alertSeverity = (short) ((int) component.StaminaThresholds[component.CurrentStaminaThreshold] / 250); + _alerts.ShowAlert(component.Owner, AlertType.Stamina, alertSeverity); + } + + public bool IsSliding(SharedStaminaComponent component) + { + if (_slidingComponents.Contains(component)) + return true; + return false; + } + + public StaminaThreshold GetStaminaThreshold(SharedStaminaComponent component, float amount) + { + StaminaThreshold result = StaminaThreshold.Overcharged; + var value = component.StaminaThresholds[StaminaThreshold.Collapsed]; + foreach (var threshold in component.StaminaThresholds) + { + if (threshold.Value <= value && threshold.Value >= amount) + { + result = threshold.Key; + value = threshold.Value; + } + } + + return result; + + } + public void UpdateStamina(SharedStaminaComponent component, float amount) + { + component.CurrentStamina = Math.Clamp(component.CurrentStamina + amount, 0f, component.StaminaThresholds[StaminaThreshold.Collapsed]); + StaminaThreshold last = component.CurrentStaminaThreshold; + component.CurrentStaminaThreshold = GetStaminaThreshold(component, component.CurrentStamina); + if (component.CurrentStaminaThreshold != component.LastStaminaThreshold) + { + UpdateEffects(component); + component.LastStaminaThreshold = component.CurrentStaminaThreshold; + } + + } + + public override void Update(float frameTime) + { + _accumulatedFrameTime += frameTime; + _sliderFrameTime += frameTime; + + if (_sliderFrameTime > 0.5) + { + + foreach (SharedStaminaComponent slidingStamina in _slidingComponents) + { + slidingStamina.SlideTime -= _sliderFrameTime; + if (slidingStamina.SlideTime < 0) + { + if (TryComp(slidingStamina.Owner, out MovementIgnoreGravityComponent? gravity) && TryComp(slidingStamina.Owner, out StandingStateComponent? state) && + TryComp(slidingStamina.Owner, out PhysicsComponent? physics) && TryComp(slidingStamina.Owner, out SharedPlayerInputMoverComponent? input)) + { + gravity.Weightless = false; + _standing.Stand(state.Owner, state); + physics.BodyType = Robust.Shared.Physics.BodyType.KinematicController; + physics.LinearDamping -= 1.5f; + input.CanMove = true; + _movement.RefreshMovementSpeedModifiers(slidingStamina.Owner); + + } + + } + } + + _slidingComponents.RemoveWhere((x) => + { + return x.SlideTime < 0 ? true : false; + }); + + _sliderFrameTime = 0; + } + + if (_accumulatedFrameTime > 1) + { + foreach (var component in EntityManager.EntityQuery()) + { + if (component.CurrentStamina < component.StaminaThresholds[StaminaThreshold.Normal] && !component.Stimulated) + { + UpdateStamina(component, component.ActualRegenRate); + continue; + } + UpdateStamina(component, -component.ActualRegenRate); + + } + _accumulatedFrameTime -= 1; + } + } + } +} diff --git a/Content.Shared/Weapons/Ranged/HitscanPrototype.cs b/Content.Shared/Weapons/Ranged/HitscanPrototype.cs index 2918918162..eaa45811e6 100644 --- a/Content.Shared/Weapons/Ranged/HitscanPrototype.cs +++ b/Content.Shared/Weapons/Ranged/HitscanPrototype.cs @@ -14,8 +14,8 @@ public sealed class HitscanPrototype : IPrototype, IShootable [IdDataFieldAttribute] public string ID { get; } = default!; - [ViewVariables(VVAccess.ReadWrite), DataField("staminaDamage")] - public float StaminaDamage; + [ViewVariables(VVAccess.ReadWrite), DataField("PainDamage")] + public float PainDamage; [ViewVariables(VVAccess.ReadWrite), DataField("damage")] public DamageSpecifier? Damage; diff --git a/Resources/Locale/en-US/damage/pain.ftl b/Resources/Locale/en-US/damage/pain.ftl new file mode 100644 index 0000000000..0195d38d07 --- /dev/null +++ b/Resources/Locale/en-US/damage/pain.ftl @@ -0,0 +1 @@ +pain-resist = Resisted \ No newline at end of file diff --git a/Resources/Locale/en-US/damage/stamina.ftl b/Resources/Locale/en-US/damage/stamina.ftl deleted file mode 100644 index 9afe540b9d..0000000000 --- a/Resources/Locale/en-US/damage/stamina.ftl +++ /dev/null @@ -1 +0,0 @@ -stamina-resist = Resisted \ No newline at end of file diff --git a/Resources/Prototypes/Alerts/alerts.yml b/Resources/Prototypes/Alerts/alerts.yml index f2635768fb..2c7d675214 100644 --- a/Resources/Prototypes/Alerts/alerts.yml +++ b/Resources/Prototypes/Alerts/alerts.yml @@ -7,6 +7,8 @@ - category: Health - alertType: Fire - alertType: Handcuffed + - category: Pain + - category: Stamina - category: Buckled - alertType: Pulling - category: Piloting @@ -164,16 +166,27 @@ name: "[color=yellow]Peckish[/color]" description: Some food would be good right about now. +- type: alert + id: Pain + category: Pain + icon: + sprite: /Textures/Interface/Alerts/pain.rsi + state: pain + name: Pain + description: "Stuns you if it is too low." + minSeverity: 0 + maxSeverity: 6 + - type: alert id: Stamina category: Stamina icon: sprite: /Textures/Interface/Alerts/stamina.rsi - state: stamina + state: Stamina name: Stamina - description: "Stuns you if it is too low." + description: "Slows you if you get too tired" minSeverity: 0 - maxSeverity: 6 + maxSeverity: 4 - type: alert id: Starving diff --git a/Resources/Prototypes/Entities/Mobs/Species/human.yml b/Resources/Prototypes/Entities/Mobs/Species/human.yml index e8359ff04f..d6248b4d1d 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/human.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/human.yml @@ -67,6 +67,7 @@ types: Bloodloss: -0.25 + - type: Pain - type: Stamina - type: StatusEffects allowed: diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml index 86d328099c..e39968adc8 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml @@ -25,7 +25,7 @@ damage: types: Blunt: 10 - - type: StaminaDamageOnCollide + - type: PainDamageOnCollide damage: 55 - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index a1ddefb570..0e73735b85 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -94,7 +94,7 @@ Blunt: 3 soundHit: path: /Audio/Weapons/Guns/Hits/snap.ogg - - type: StaminaDamageOnCollide + - type: PainDamageOnCollide damage: 15 # Energy projectiles @@ -126,7 +126,7 @@ - Impassable - BulletImpassable - type: Ammo - - type: StaminaDamageOnCollide + - type: PainDamageOnCollide damage: 30 - type: Projectile impactEffect: BulletImpactEffectDisabler @@ -231,7 +231,7 @@ Blunt: 1 soundHit: path: /Audio/Effects/gen_hit.ogg - - type: StaminaDamageOnCollide + - type: PainDamageOnCollide damage: 80 - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/bola.yml b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/bola.yml index 1e4bdc1eb9..223a987045 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/bola.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/bola.yml @@ -13,7 +13,7 @@ sound: /Audio/Weapons/bolathrow.ogg - type: EmitSoundOnLand sound: /Audio/Effects/snap.ogg - - type: StaminaDamageOnCollide + - type: PainDamageOnCollide damage: 80 - type: Construction graph: Bola diff --git a/Resources/Prototypes/Entities/Objects/Weapons/security.yml b/Resources/Prototypes/Entities/Objects/Weapons/security.yml index 43e270f4cf..6613ab6761 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/security.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/security.yml @@ -18,7 +18,7 @@ arc: default cooldownTime: 1.5 arcCooldownTime: 1.5 - - type: StaminaDamageOnHit + - type: PainDamageOnHit damage: 55 - type: Battery maxCharge: 1000 diff --git a/Resources/Textures/Interface/Alerts/pain.rsi/meta.json b/Resources/Textures/Interface/Alerts/pain.rsi/meta.json new file mode 100644 index 0000000000..5a40cba281 --- /dev/null +++ b/Resources/Textures/Interface/Alerts/pain.rsi/meta.json @@ -0,0 +1,124 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "taken from tg station at commit https://github.com/tgstation/tgstation/blob/832ae532766d491d91db53746d15b4b55be3f2b0", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "pain6", + "delays": [ + [ + 0.5, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.5 + ] + ] + }, + { + "name": "pain5", + "delays": [ + [ + 0.5, + 0.2, + 0.2, + 0.2, + 0.2, + 0.5 + ] + ] + }, + { + "name": "pain4", + "delays": [ + [ + 0.3, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.3 + ] + ] + }, + { + "name": "pain3", + "delays": [ + [ + 0.3, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.3 + ] + ] + }, + { + "name": "pain2", + "delays": [ + [ + 0.3, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.3 + ] + ] + }, + { + "name": "pain1", + "delays": [ + [ + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1 + ] + ] + }, + { + "name": "pain0", + "delays": [ + [ + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1 + ] + ] + } + ] +} \ No newline at end of file diff --git a/Resources/Textures/Interface/Alerts/pain.rsi/pain0.png b/Resources/Textures/Interface/Alerts/pain.rsi/pain0.png new file mode 100644 index 0000000000000000000000000000000000000000..10e3e8c9560d0c4693dda5ef0cf8d38d282ba34f GIT binary patch literal 1156 zcmV-~1bh35P)>rl^Vx#HQuzbM><=Kt?DNiN1%OrU z4`BA&@L2(1Rrv$b>>nP^Jz#(S?f97=Jo8xrU={lV*!ykystVY;{mk%#cYcvSfZ1=) zr#}G9&-Mq*W&ct|81K*j@8?Sy>4Cr6QxM08vrPrC_pi&(@&{z>kH4nJmf4@l|L52; z``6~v9{}c?j{)rcWqgxw!~#eyj1Q(2!0a#Q(;pCa;t#0YpMQ^In-A1wHa>(_rJd7(eRr$3;D z{rPA<{Q+P;A49=n0KlR@0L*W}A0S|UPk(@8dG`khnBQy9!wLY)vp+z<{NCbRtN^gQ z`U5243xMAz{44A+l+w$iKS03z-twH@{Q&~zUpHF~W%jT0KT7Ej0P{Wh17wCT;f{>? z{S3bkcXV`rfQ#|Li$6fX{C=(Tx8e_w312qm_Y;2h(-HjvV1A4K0P!?8Xu%&KV1BPT zM{E87@isH2KOh9Z?+>u_2UPCQmxM1GetNv+`wO@n4VFm&EPB6kf4+EK72Qn*Jo5bk ze}(b~DE8-z1wTD57_x=FyGI^USgHSKFAh1;a z0A{^jtN^g8{Q=B=8?gews`3Y<+0Sawi4_1=u|I&>ZYz_CSfHv^h}jQ`*qrdKj6qx`2(2!db#!ow4mQy W)KwgApO{ks0000wzAl1vh?Q{u-Qj#HvH;%X+f~6&v0!n*T}X#hvrZ zEE4|5{?}qYx3k_;A^ZB3HTBz9FGxClYk7#nM~8c%{}(YHKfZQ)-Sh9i&+y0Y{uiqI zV!eIY%fqPwo9ljAF1WGD?Pawx+w0|F4i_g}{AJhE%vr1Y^V7$BrT(iQs%)u@C=GtM zFYbTo?$_~rzg|B-e)6mFHK2QzNEm#5XP^4&ZoOB^-!KNB8w}<3IY7plvut11w`w!V@{~mW;g~CV?8i~zu~K_ zcjMQy><4~L$8gOYsAV=#$zH)`u#(Lc65H(yYW7-Om{j*d`()40Kktuz ze{Hwt&HeadflbdoEB}&wJ>Qjei%%D$rtqoXx7R-lQrp7(YvR}Q%bE5?Ib{DzWL~s; z|NHIE^8fOVKK5(6cvt>v|GIiHQHPkHXI$;4@UKX;vtP7-S^kl%8RwUOO~2R_<;I+F zh8^V2jjRVjBol}m0rtik28qv%27OCGvOv!z+kt!q^e{*i=oz583S~B+Xqv%-r$1|E zrM~|B)5NZ??Wf^_i$JbCv(()4%Okhh&G$DBIk4#A&l;)!^&sst{O_!JrN`sHArqJ$ O89ZJ6T-G@yGywpEN>QKy literal 0 HcmV?d00001 diff --git a/Resources/Textures/Interface/Alerts/pain.rsi/pain2.png b/Resources/Textures/Interface/Alerts/pain.rsi/pain2.png new file mode 100644 index 0000000000000000000000000000000000000000..a3d263d7518eae46a91c3f40441e33315930d8a6 GIT binary patch literal 1003 zcmVJNRCt{2oiUEvFc3u`X1uFB7l>HKA@RD6lwkJ*91~1fSBq6^xwbz`SJ7Dmn0&(epLY`an((@ z>At=G?oyKKTa7*=NX+g6JcIQ=yI-nrwb#J`Vs;gP?)T~b8#q8raRHXyf3_Qz-G6<* z3<76`2^6zVA|0JGn3_D{HM#FB`!$Ipts)#_&#pr`xYyZ?sESqov&09Y+|Lj?`&+9za zUlz!-`!n@zp`ZP9lr@4LU2Lm39<;3Qz6SKn{-V7>=#5wl>w~KUdb+=OXUt)on5wTN zNBfOW052bl&{+L+X7^3{BZFAqYV>h{7?%Q^-F+?T;{Y+$1-R1vRr)wU%lft%=zf2F@&RJ~ z?0mpl_isDG_5J++{(ie7pI`s5ry$mci;n}C{m1HOw~KU=>Bqj4&%gB=L1H%+aJ-7g;n}EKn(c+u|5tELq0&P zj|0Sz4-o5<4-o4!g2Ye&G2{cp`Yq%GOswCL4+u>3e1M7dyV~pE05OsC0VdY(Jg$WU z#6-;p*i7F9`rS-_;4m&Q5%U2i*6%#889g6hV*TN?(@?tqnE#`ce1KR#Qa->|^esK) z`G0>w%lUv1>qC@$fQj|HqpsgdKEM|GcCvoA(9eE4A|D{uZ!sTWk@f~HkeI5&IJ&+b93Wj#1m?rW8k--6C!si2`g9F5b%?GqX=zKs6 Z`~_$WJe4kONB95$002ovPDHLkV1nv;@n8S| literal 0 HcmV?d00001 diff --git a/Resources/Textures/Interface/Alerts/pain.rsi/pain3.png b/Resources/Textures/Interface/Alerts/pain.rsi/pain3.png new file mode 100644 index 0000000000000000000000000000000000000000..356916dfe0be5242dbfbc5f052a3cf387d778138 GIT binary patch literal 912 zcmeAS@N?(olHy`uVBq!ia0vp^2|(Py!3HG1+{xJmq&N#aB8wRq_>O=u<5X=vX$A&n zCr=m0kcv5P=U&Xc?I7Ty@3@Qe4)f>Ku!&LYgqhbJ`o}ff!#d3A029Ydp~~&rePti- zEl>WydTVZR$tMMSE{{Zpq%+JF|Gs|y^6&Zk?Mh0!?wd4hj`^x|=HB-E_uDsm{Jr|< zIfu|?+XnZJe|!EW)o-lwD~={e_ns$Um3@wHPZ`&1wYPtvYA6jVcBl^1K)oC@NAf|uI@n5@8j3| zAI{}Z+R@YPRczm|`Tq5MuLBp4pYPi5^4&xvEa({0Zdidw}&-i`& zwoVlMqsu8FwQu`}NW;Gk0(HL_lR(Pm*EQVmw|9869B6;Bqw2E)MLjKKI| z`oH0Wf6OsfwIr~j=f;b_Gq1W~FIy&k>f8P2|MeFDt#p6Ienqri*Sz2xzxF@<`0TGh zfsl>$yV{Z6bs6ZImq2U3FdwPYdyMHgVCaHe1(NPlFywLY`BCRka%TI&&)w$*em&$6 zO5W9z{QB(#2E)658MfVL2ZrZr`3-mKE+sUxbY#9`-|%+djy;0f7kq>58^mwV|M0ir z#hZ8RYxd5F);CyrGYy*yhvU^Qb<9q#$Le+7%(^L9K@WyGaG&2FLhNgO?;WW6PU#qJYD@< J);T3K0RWk*wg&(J literal 0 HcmV?d00001 diff --git a/Resources/Textures/Interface/Alerts/pain.rsi/pain4.png b/Resources/Textures/Interface/Alerts/pain.rsi/pain4.png new file mode 100644 index 0000000000000000000000000000000000000000..d0645f4ebdb3d6fd10cc85985e86e35fd2fdde34 GIT binary patch literal 795 zcmeAS@N?(olHy`uVBq!ia0vp^2|(Py!3HG1+{xJmq&N#aB8wRq_>O=u<5X=vX$A(S zvz{)FAr*7p&c5r(>?q>q{^6q9o0RActvXBk);f3S-f*(=6yE24U4p~uUz(cb&gsQ+ zEQW75cYZ#5DretwB@I4?Wt9xw+o!)h{``7yW5>IEsRMC-wH%wvx7Nsd-JI}m<1{jDP9N9XNEgUbuex<^{?1yN|!>dAC1<;rO!pI@d3j zi%-7Uf3x0k@%MH+&WIh~?_a4eW7w^kw{3ac=l{IlVrp;x70-2Cu2=R-?MnBVfA79G zT-^I#tNyd_#;M=imt~ju9(eI;|E>3lGCr4;Pagi!c>K`9zd&c6W^nudFKa(%L#7;1 z!S{(NDXZ8w*efp#ix;a8W;*dA{o`)dgBA=DzZo~|Kc4wQ>R(-5=bLiwrcB$OXz>o$ zN$G+>Lw3nOc=i4<&^uTEHpsXAJpQ6tg8#8nvOUAM+x!iGzcDB5|I2VAA1@c^upW>i zri3@_2kL|wK$>TRt-W8z0J5-ia+zGGiA?dkX13||r>N`P)zQRm?1 z^qtvAV43`csUQ9}yl8pBo}!j(ufWBBpZ~f3e5LyM0py|l=n{nrgjETS3j3^P6!lvI6;>1s;*bKsp7487n4!^#(Hbd%8G=M7STlevz}qK%nK}jY+x@+jVaQo#|-m zn00q<`(q3?v?L`F@eUmJK1zEI_O^&`rpiB*AXA;SWLMdgpbPXD--V-dH7+ule) zu~e-?B|d9kTYpnwRCsm!-;{Efz78G_!Heyw9B%rK0mrW|64YS`>rl^Vx#HQuzbM><=Kt?DNiN1%OrU z4`BA&@L2(1Rrv$b>>nP^Jz#(S?f97=Jo8xrU={lV*!ykystVY;{mk%#cYcvSfZ1=) zr#}G9&-Mq*W&ct|81K*j@8?Sy>4Cr6QxM08vrPrC_pi&(@&{z>kH4nJmf4@l|L52; z``6~v9{}c?j{)rcWqgxw!~#eyj1Q(2!0a#Q(;pCa;t#0YpMQ^In-A1wHa>(_rJd7(eRr$3;D z{rPA<{Q+P;A49=n0KlR@0L*W}A0S|UPk(@8dG`khnBQy9!wLY)vp+z<{NCbRtN^gQ z`U5243xMAz{44A+l+w$iKS03z-twH@{Q&~zUpHF~W%jT0KT7Ej0P{Wh17wCT;f{>? z{S3bkcXV`rfQ#|Li$6fX{C=(Tx8e_w312qm_Y;2h(-HjvV1A4K0P!?8Xu%&KV1BPT zM{E87@isH2KOh9Z?+>u_2UPCQmxM1GetNv+`wO@n4VFm&EPB6kf4+EK72Qn*Jo5bk ze}(b~DE8-z1wTD57_x=FyGI^USgHSKFAh1;a z0A{^jtN^g8{Q=B=8?gews`3Y<+0Sawi4_1=u|I&>ZYz_CSfHv^h}jQ`*qrdKj6qx`2(2!db#!ow4mQy W)KwgApO{ks0000!lvI6;>1s;*bKsp7487n4!^#(HbdAc};M7STl?#R_*AmDPb!b*JJ_15Lxnt=j= zm+ywIt$(burQ%3q;;H+*zrV)ZUGHB0{X~`2`eNDb{FgU8nABDw{g36Mw6A*vTd?4@ zjV3MW8mtdxCn_s32f2Jnlx(`_EpX-I)(jSI2N5SmheVh6$6o6{&K7hLFX*Y-tfX@) zq~+y|sO#l#JeeG>Z2znIzC%V(a)Qz#{?h_IaZL;Q*1IZ4Ff0<_V&GB^VGwcBU_8+q mz&wF_BBR6ne+N~yQd!;46v;~;`p^#a34^DrpUXO@geCxA^l63w literal 701 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGooCO|{#S9F5M?jcysy3fA0|QgO zr;B4q#hkZuef^jm1zOu%dO6t(9$s@T*5E(Bu;d`CMMI}|irS(!mc$iF`!@dm9VXD* zKks_zXXm{;-mthbCmdp%^8EPU+hyBdDE!-9ccNjjMX5m6h3%{d@8mda{JP{tG^2sJ zWWb%jnZLpq&SWtA-JM@$er;Jk>wzAl1vh?Q{u-Qj#HvH;%X+f~6&v0!n*T}X#hvrZ zEE4|5{?}qYx3k_;A^ZB3HTBz9FGxClYk7#nM~8c%{}(YHKfZQ)-Sh9i&+y0Y{uiqI zV!eIY%fqPwo9ljAF1WGD?Pawx+w0|F4i_g}{AJhE%vr1Y^V7$BrT(iQs%)u@C=GtM zFYbTo?$_~rzg|B-e)6mFHK2QzNEm#5XP^4&ZoOB^-!KNB8w}<3IY7plvut11w`w!V@{~mW;g~CV?8i~zu~K_ zcjMQy><4~L$8gOYsAV=#$zH)`u#(Lc65H(yYW7-Om{j*d`()40Kktuz ze{Hwt&HeadflbdoEB}&wJ>Qjei%%D$rtqoXx7R-lQrp7(YvR}Q%bE5?Ib{DzWL~s; z|NHIE^8fOVKK5(6cvt>v|GIiHQHPkHXI$;4@UKX;vtP7-S^kl%8RwUOO~2R_<;I+F zh8^V2jjRVjBol}m0rtik28qv%27OCGvOv!z+kt!q^e{*i=oz583S~B+Xqv%-r$1|E zrM~|B)5NZ??Wf^_i$JbCv(()4%Okhh&G$DBIk4#A&l;)!^&sst{O_!JrN`sHArqJ$ O89ZJ6T-G@yGywpEN>QKy diff --git a/Resources/Textures/Interface/Alerts/stamina.rsi/stamina2.png b/Resources/Textures/Interface/Alerts/stamina.rsi/stamina2.png index a3d263d7518eae46a91c3f40441e33315930d8a6..5c6e4dc1da51ddf3e89c9e389287cb6dd1616f73 100644 GIT binary patch literal 296 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*bKspJ88GlULcmc@R>*?Yc65)RIx+7PMfq=`!j^m&A$oVIEiMU)T zDGz;p--26Lt}tQ7r}D#fw&CAjU%YF(Y2LBdLC@bFw(!}pMDbpmz2g_R%YxGmhP0IG z@II9Ea;$KF(s80eM6foZE#Zq0OKFX+)IlbJ)&Pb8iHo~G{yP05isd4!%;I}%IJ%8Q z6RnnA`zl*Ki9z6NZv821C3hFLB^@sg8?h{&uCU^9_C*e{28|Y`hC>{p46OoQ3`NRU l7@jz#FkDz(U(o3l$*3J&B)^|Ub0^Rv44$rjF6*2UngGR6YJNRCt{2oiUEvFc3u`X1uFB7l>HKA@RD6lwkJ*91~1fSBq6^xwbz`SJ7Dmn0&(epLY`an((@ z>At=G?oyKKTa7*=NX+g6JcIQ=yI-nrwb#J`Vs;gP?)T~b8#q8raRHXyf3_Qz-G6<* z3<76`2^6zVA|0JGn3_D{HM#FB`!$Ipts)#_&#pr`xYyZ?sESqov&09Y+|Lj?`&+9za zUlz!-`!n@zp`ZP9lr@4LU2Lm39<;3Qz6SKn{-V7>=#5wl>w~KUdb+=OXUt)on5wTN zNBfOW052bl&{+L+X7^3{BZFAqYV>h{7?%Q^-F+?T;{Y+$1-R1vRr)wU%lft%=zf2F@&RJ~ z?0mpl_isDG_5J++{(ie7pI`s5ry$mci;n}C{m1HOw~KU=>Bqj4&%gB=L1H%+aJ-7g;n}EKn(c+u|5tELq0&P zj|0Sz4-o5<4-o4!g2Ye&G2{cp`Yq%GOswCL4+u>3e1M7dyV~pE05OsC0VdY(Jg$WU z#6-;p*i7F9`rS-_;4m&Q5%U2i*6%#889g6hV*TN?(@?tqnE#`ce1KR#Qa->|^esK) z`G0>w%lUv1>qC@$fQj|HqpsgdKEM|GcCvoA(9eE4A|D{uZ!sTWk@f~HkeI5&IJ&+b93Wj#1m?rW8k--6C!si2`g9F5b%?GqX=zKs6 Z`~_$WJe4kONB95$002ovPDHLkV1nv;@n8S| diff --git a/Resources/Textures/Interface/Alerts/stamina.rsi/stamina3.png b/Resources/Textures/Interface/Alerts/stamina.rsi/stamina3.png index 356916dfe0be5242dbfbc5f052a3cf387d778138..2f5e8f4a81b295bd8f066b1932ce11a0109e86de 100644 GIT binary patch literal 300 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*bKsp7487n4!^#(Eydb&7~>fAkgx#;&|M_;7Zo_62^`T zJ7(RT8~Har$FaSCOF-1Vyj$!4U;SHEQrf>}_s6K|@%4shv-f{7=d|VB-z3qyOj)OS zCCBRssYAw7nm+WM5S+-Usq||D&%qa}9It*vnKZE~a4lq5V31Vu_~-PG8#$6VEZp`+ z3W}v_9V+oz`#JrMCzHdK?SJ*&cgP4zPEcCJe_Eg?u4zHvdROHLhD8Eg3|z_~3?fb% qj3;^nm?v;gWOP{n@1UwyDzkY{k^I4mWPPA#7(8A5T-G@yGywok6Kt^n literal 912 zcmeAS@N?(olHy`uVBq!ia0vp^2|(Py!3HG1+{xJmq&N#aB8wRq_>O=u<5X=vX$A&n zCr=m0kcv5P=U&Xc?I7Ty@3@Qe4)f>Ku!&LYgqhbJ`o}ff!#d3A029Ydp~~&rePti- zEl>WydTVZR$tMMSE{{Zpq%+JF|Gs|y^6&Zk?Mh0!?wd4hj`^x|=HB-E_uDsm{Jr|< zIfu|?+XnZJe|!EW)o-lwD~={e_ns$Um3@wHPZ`&1wYPtvYA6jVcBl^1K)oC@NAf|uI@n5@8j3| zAI{}Z+R@YPRczm|`Tq5MuLBp4pYPi5^4&xvEa({0Zdidw}&-i`& zwoVlMqsu8FwQu`}NW;Gk0(HL_lR(Pm*EQVmw|9869B6;Bqw2E)MLjKKI| z`oH0Wf6OsfwIr~j=f;b_Gq1W~FIy&k>f8P2|MeFDt#p6Ienqri*Sz2xzxF@<`0TGh zfsl>$yV{Z6bs6ZImq2U3FdwPYdyMHgVCaHe1(NPlFywLY`BCRka%TI&&)w$*em&$6 zO5W9z{QB(#2E)658MfVL2ZrZr`3-mKE+sUxbY#9`-|%+djy;0f7kq>58^mwV|M0ir z#hZ8RYxd5F);CyrGYy*yhvU^Qb<9q#$Le+7%(^L9K@WyGaG&2FLhNgO?;WW6PU#qJYD@< J);T3K0RWk*wg&(J diff --git a/Resources/Textures/Interface/Alerts/stamina.rsi/stamina4.png b/Resources/Textures/Interface/Alerts/stamina.rsi/stamina4.png index d0645f4ebdb3d6fd10cc85985e86e35fd2fdde34..b3e23d624f1fc2dbc817c0a6d83bbe006f477194 100644 GIT binary patch literal 300 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*bKsp7487n4!^#(Eydb&7~>fAkgyg$F0K^|BEXm;*-@h zL;^SOHeUU|Tld9>iDF)-ulxS~x_?)E|GIY*OU>h6=fBfmR{C=KKedI+ABGDozF5+d zY9N{@>+M|879?;_&{D}r!PP~6nxe#B7Dw6mZnq5#E{Y-yB5pl-Hvf(6#2k4TkFPM- zKD5Zkbw=OH(tka+o(vtow%va!J5gDQImqQpqGZ!WZ-FZxw`Q<#JBTO=u<5X=vX$A(S zvz{)FAr*7p&c5r(>?q>q{^6q9o0RActvXBk);f3S-f*(=6yE24U4p~uUz(cb&gsQ+ zEQW75cYZ#5DretwB@I4?Wt9xw+o!)h{``7yW5>IEsRMC-wH%wvx7Nsd-JI}m<1{jDP9N9XNEgUbuex<^{?1yN|!>dAC1<;rO!pI@d3j zi%-7Uf3x0k@%MH+&WIh~?_a4eW7w^kw{3ac=l{IlVrp;x70-2Cu2=R-?MnBVfA79G zT-^I#tNyd_#;M=imt~ju9(eI;|E>3lGCr4;Pagi!c>K`9zd&c6W^nudFKa(%L#7;1 z!S{(NDXZ8w*efp#ix;a8W;*dA{o`)dgBA=DzZo~|Kc4wQ>R(-5=bLiwrcB$OXz>o$ zN$G+>Lw3nOc=i4<&^uTEHpsXAJpQ6tg8#8nvOUAM+x!iGzcDB5|I2VAA1@c^upW>i zri3@_2kL|wK$>TRt-W8z0J5-ia+zGGiA?dkX13||r>N`P)zQRm?1 z^qtvAV43`csUQ9}yl8pBo}!j(ufWBBpZ~f3e5LyM0py|l=n{nrgjETS3j3^P6 Date: Tue, 9 Aug 2022 00:08:45 +0300 Subject: [PATCH 2/2] binding and localization. --- Content.Client/EscapeMenu/UI/Tabs/KeyRebindTab.xaml.cs | 1 + Content.Shared/Stamina/SharedStaminaSystem.cs | 9 +++++++++ Resources/Locale/en-US/escape-menu/ui/options-menu.ftl | 1 + 3 files changed, 11 insertions(+) diff --git a/Content.Client/EscapeMenu/UI/Tabs/KeyRebindTab.xaml.cs b/Content.Client/EscapeMenu/UI/Tabs/KeyRebindTab.xaml.cs index 56b038a7b0..99279704d7 100644 --- a/Content.Client/EscapeMenu/UI/Tabs/KeyRebindTab.xaml.cs +++ b/Content.Client/EscapeMenu/UI/Tabs/KeyRebindTab.xaml.cs @@ -104,6 +104,7 @@ void AddCheckBox(string checkBoxName, bool currentState, Action stam.StaminaThresholds[StaminaThreshold.Collapsed] - stam.CurrentStamina) + { + return false; + } if (TryComp(stam.Owner, out PhysicsComponent? physics) && TryComp(stam.Owner, out StandingStateComponent? state) && TryComp(stam.Owner, out MovementIgnoreGravityComponent? grav) && TryComp(stam.Owner, out SharedPlayerInputMoverComponent? input)) { // too little to slide. if ((Math.Abs(physics.LinearVelocity.X) + Math.Abs(physics.LinearVelocity.Y)) < 2f) + { return false; + } _phys.SetLinearVelocity(physics, physics.LinearVelocity * 4); physics.LinearDamping += 1.5f; physics.BodyType = Robust.Shared.Physics.BodyType.Dynamic; // Necesarry for linear dampening to be applied diff --git a/Resources/Locale/en-US/escape-menu/ui/options-menu.ftl b/Resources/Locale/en-US/escape-menu/ui/options-menu.ftl index 56fa911e9b..07f68d37ab 100644 --- a/Resources/Locale/en-US/escape-menu/ui/options-menu.ftl +++ b/Resources/Locale/en-US/escape-menu/ui/options-menu.ftl @@ -81,6 +81,7 @@ ui-options-function-move-left = Move Left ui-options-function-move-down = Move Down ui-options-function-move-right = Move Right ui-options-function-walk = Walk +ui-options-function-slide = Slide ui-options-function-use = Use ui-options-function-wide-attack = Wide attack