Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Trait: Sluggish / Snail-Paced #692

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Content.Server/Traits/Assorted/TraitSpeedModifierComponent.cs
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("walkModifier", required: true)]
angelofallars marked this conversation as resolved.
Show resolved Hide resolved
public float WalkModifier = 1.0f;

[DataField("sprintModifier", required: true)]
angelofallars marked this conversation as resolved.
Show resolved Hide resolved
public float SprintModifier = 1.0f;
}
19 changes: 19 additions & 0 deletions Content.Server/Traits/Assorted/TraitSpeedModifierSystem.cs
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);
}
}
12 changes: 11 additions & 1 deletion Resources/Locale/en-US/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ trait-description-ParkourTraining =
Whether as a hobby, lifestyle, or professional training, you are trained in the discipline of parkour.
You're faster with climbing, crawling, lying down, and getting up.

trait-name-Sluggish = Sluggish
trait-description-Sluggish =
You navigate the world slower than others, perhaps due to a medical condition, inactivity, or age.
You move slower, and it takes longer for you to climb, lie down and get up.

trait-name-SnailPaced = Snail-Paced
trait-description-SnailPaced =
You walk at a snail's pace, perhaps due to a medical condition, mobility impairment, or age.
You move substantially slower, and it takes far longer for you to climb, lie down and get up.

trait-name-LightStep = Light Step
trait-description-LightStep =
You move with a gentle step, making your footsteps quieter.
Expand All @@ -106,4 +116,4 @@ trait-description-Spearmaster =
trait-name-WeaponsGeneralist = Weapons Generalist
trait-description-WeaponsGeneralist =
You are a jack of all trades with melee weapons, enabling you to be versatile with your weapon arsenal.
Your melee damage bonus for all Brute damage types (Blunt, Slash, Piercing) becomes 25%.
Your melee damage bonus for all Brute damage types (Blunt, Slash, Piercing) becomes 25%.
38 changes: 38 additions & 0 deletions Resources/Prototypes/Traits/disabilities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,44 @@
components:
- type: Snoring

- type: trait
id: Sluggish
category: Physical
points: 1
requirements:
- !type:CharacterTraitRequirement
inverted: true
traits:
- ParkourTraining
- SnailPaced
components:
- type: TraitSpeedModifier
sprintModifier: 0.85
walkModifier: 0.85
- type: ClimbDelayModifier
climbDelayMultiplier: 1.35
- type: LayingDownModifier
layingDownCooldownMultiplier: 1.2

- type: trait
id: SnailPaced
category: Physical
points: 2
requirements:
- !type:CharacterTraitRequirement
inverted: true
traits:
- ParkourTraining
- Sluggish
components:
- type: TraitSpeedModifier
sprintModifier: 0.7
walkModifier: 0.7
- type: ClimbDelayModifier
climbDelayMultiplier: 1.66
- type: LayingDownModifier
layingDownCooldownMultiplier: 1.6

- type: trait
id: BloodDeficiency
category: Physical
Expand Down
6 changes: 6 additions & 0 deletions Resources/Prototypes/Traits/skills.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@
id: ParkourTraining
category: Physical
points: -3
requirements:
- !type:CharacterTraitRequirement
inverted: true
traits:
- Sluggish
- SnailPaced
components:
- type: ClimbDelayModifier
climbDelayMultiplier: 0.70
Expand Down
Loading