-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Trait: Sluggish / Snail-Paced (#692)
# Description This PR adds two new negative traits that decrease your movement speed: **Sluggish** and **Snail-Paced**. - Sluggish (+1 points) - 15% slower movement speed - 35% slower climbing speed (for standard tables, from 1.5s to ~2.02 seconds) - Cooldown on laying down/standing up increased from 2.5 seconds to 3 seconds - Snail-Paced (+2 points) - 30% slower movement speed - 66% slower climbing speed (for standard tables, from 1.5s to ~2.48 seconds) - Cooldown on laying down/standing up increased from 2.5 seconds to 4 seconds ## Media <details><summary>Expand</summary> **Trait entry** ![image](https://github.com/user-attachments/assets/cb483536-ec3e-4c28-a4b4-c431bb1b669e) ![image](https://github.com/user-attachments/assets/a251844e-7058-4d4b-b21d-a5637c39489f) </details> # Changelog :cl: Skubman - add: Add two new negative traits: Sluggish (+1) and Snail-Paced (+2) that make you move slower, and climb tables slower. --------- Signed-off-by: Angelo Fallaria <[email protected]> Co-authored-by: VMSolidus <[email protected]>
- Loading branch information
1 parent
dfe5c2c
commit f79c6db
Showing
5 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
Content.Server/Traits/Assorted/TraitSpeedModifierComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace Content.Server.Traits.Assorted; | ||
|
||
/// <summary> | ||
/// This component is used for traits that modify movement speed. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class TraitSpeedModifierComponent : Component | ||
{ | ||
[DataField(required: true)] | ||
public float WalkModifier = 1.0f; | ||
|
||
[DataField(required: true)] | ||
public float SprintModifier = 1.0f; | ||
} |
19 changes: 19 additions & 0 deletions
19
Content.Server/Traits/Assorted/TraitSpeedModifierSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Content.Shared.Movement.Systems; | ||
using Content.Server.Traits.Assorted; | ||
|
||
namespace Content.Shared.Traits.Assorted; | ||
|
||
public sealed class TraitSpeedModifierSystem : EntitySystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<TraitSpeedModifierComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovementSpeed); | ||
} | ||
|
||
private void OnRefreshMovementSpeed(EntityUid uid, TraitSpeedModifierComponent component, RefreshMovementSpeedModifiersEvent args) | ||
{ | ||
args.ModifySpeed(component.WalkModifier, component.SprintModifier); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters