mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 13:37:47 +03:00
Make Dionas Slow And Steady (#704)
# Description Dionas now have 25% slower movement speed in exchange for total slip immunity and slow immunity (except lying down). Note that this also prevents slowdowns from hunger and thirst. This also fixes an existing bug with Sluggish and Snail-Paced related to `TraitSpeedModifierSystem`, as it was not applying the reduced movement speed upon spawning, only when the movement speed has been modified by another source. `TraitSpeedModifierSystem` has been moved from `Content.Server` to `Content.Shared`. This used to be a trait costing 3 points, but is now given for free to all Dionas per request of @VMSolidus. ## Media <details><summary>Expand</summary> **Speed with no items**  **Speed wearing a jugsuit, wearing a duffel bag, holding one duffel bag in each arm, and walking through a puddle of glue covered in spider webs.**  </details> # Changelog 🆑 Skubman - add: Dionas have been given a 25% slower movement speed. In exchange for that, they gain absolute slip immunity and movement speed modifier immunity. This makes them immune to slowdown from things like duffelbags, hardsuits, and spider webs. - fix: Sluggish and Snail-Paced will now properly apply their movement penalties upon joining.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Traits.Assorted.Components;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Shared.Movement.Systems
|
||||
@@ -16,7 +17,11 @@ namespace Content.Shared.Movement.Systems
|
||||
if (_timing.ApplyingState)
|
||||
return;
|
||||
|
||||
var ev = new RefreshMovementSpeedModifiersEvent();
|
||||
var isImmune = false;
|
||||
if (HasComp<SpeedModifierImmunityComponent>(uid))
|
||||
isImmune = true;
|
||||
|
||||
var ev = new RefreshMovementSpeedModifiersEvent(isImmune);
|
||||
RaiseLocalEvent(uid, ev);
|
||||
|
||||
if (MathHelper.CloseTo(ev.WalkSpeedModifier, move.WalkSpeedModifier) &&
|
||||
@@ -64,10 +69,24 @@ namespace Content.Shared.Movement.Systems
|
||||
public float WalkSpeedModifier { get; private set; } = 1.0f;
|
||||
public float SprintSpeedModifier { get; private set; } = 1.0f;
|
||||
|
||||
public void ModifySpeed(float walk, float sprint)
|
||||
/// <summary>
|
||||
/// Whether this entity is immune to most movement speed modifiers.
|
||||
/// Bypassable by setting bypassImmunity to true.
|
||||
/// </summary
|
||||
private bool IsImmune = false;
|
||||
|
||||
public void ModifySpeed(float walk, float sprint, bool bypassImmunity = false)
|
||||
{
|
||||
if (IsImmune && !bypassImmunity)
|
||||
return;
|
||||
|
||||
WalkSpeedModifier *= walk;
|
||||
SprintSpeedModifier *= sprint;
|
||||
}
|
||||
|
||||
public RefreshMovementSpeedModifiersEvent(bool isImmune = false)
|
||||
{
|
||||
IsImmune = isImmune;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user