mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
# 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.
32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using Content.Shared.Movement.Components;
|
|
using Content.Shared.Movement.Systems;
|
|
using Content.Shared.Traits.Assorted.Components;
|
|
|
|
namespace Content.Shared.Traits.Assorted.Systems;
|
|
|
|
public sealed class TraitSpeedModifierSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly MovementSpeedModifierSystem _movement = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<TraitSpeedModifierComponent, ComponentStartup>(OnStartup);
|
|
SubscribeLocalEvent<TraitSpeedModifierComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovementSpeed);
|
|
}
|
|
|
|
private void OnRefreshMovementSpeed(EntityUid uid, TraitSpeedModifierComponent component, RefreshMovementSpeedModifiersEvent args)
|
|
{
|
|
args.ModifySpeed(component.WalkModifier, component.SprintModifier, bypassImmunity: true);
|
|
}
|
|
|
|
private void OnStartup(EntityUid uid, TraitSpeedModifierComponent component, ComponentStartup args)
|
|
{
|
|
if (!TryComp<MovementSpeedModifierComponent>(uid, out var move))
|
|
return;
|
|
|
|
_movement.RefreshMovementSpeedModifiers(uid, move);
|
|
}
|
|
}
|