Skip to content

Commit

Permalink
Parkour Training Rework (DeltaV-Station#1432)
Browse files Browse the repository at this point in the history
# Description

Parkour Training, Sluggish and Snail-Paced have been reworked to be more
impactful in everyday space life. A new trait has been added, Bad Knees.

**Parkour Training** (-5 points)
- No longer modifies laying down
- Climbing speed bonus reduced from 65% to 50%
- 30% shorter slip stuns
- 50% resistance against slows in difficult terrain
- Example: Spider webs inflict a 50% slow, reduced by 50% results in a
25% slow.

Notably, the reworked Parkour Training is much closer to the CDDA trait
[Parkour
Expert](https://cddawiki.danmakudan.com/wiki/index.php/Parkour_Expert).

Difficult terrain examples: Spider webs, slime/blood puddles, kudzu,
space glue

**(NEW)** **Bad Knees** (3 points)
- Designed to be the opposite of Parkour Training
- 50% climbing speed penalty
- 40% longer slip stuns
- 35% increased slows in difficult terrain
- Example: Spider webs inflict a 50% slow, increased by 35% results in a
67.5% slow.

Inspired by the CDDA trait of the same name [Bad
Knees](https://cddawiki.danmakudan.com/wiki/index.php/Bad_Knees).

The stun time for banana peels and puddles is 3 seconds. With Bad Knees,
the stun is increased to 4.2 seconds. The time it takes to handcuff
someone is 3.5 seconds. Go figure :trollface:

**Sluggish** (3 points)
- No longer increases the time for laying down and climbing tables
(given to Bad Knees instead)
- Speed penalty increased from 15% to 16%

**Snail-Paced** (5 points)
- No longer increases the time for laying down and climbing tables
- Speed penalty increased from 30% to 32%
- No longer prevents you from slipping when running due to how slow your
sprint speed is. Snail-Paced trait users must suffer.

## Media

**Parkour Training**


![image](https://github.com/user-attachments/assets/b320d18a-7ac8-419d-b783-28a4d3ac0bb5)

**Bad Knees**


![image](https://github.com/user-attachments/assets/caa64d6a-a58b-4378-a947-0a5f3f6e70a6)

**Sluggish**


![image](https://github.com/user-attachments/assets/7f9ac71f-475f-4aa9-8e36-b93aaad12670)


**Snail-Paced**


![image](https://github.com/user-attachments/assets/faf70f4b-2911-4d03-a72a-99972838b7f9)


## Changelog

:cl: Skubman
- tweak: The Parkour Training trait has been reworked. It no longer
makes you lie down or get up faster, but grants you 30% shorter slip
stuns and 50% resistance against slows in difficult terrain.
- tweak: The Sluggish and Snail-Paced traits now only reduce your
movement speed with no other effects. The speed reductions have been
slightly increased from 15% to 16% for Sluggish, and 30% to 32% for
Snail-Paced.
- add: Added a new 3-point negative trait called Bad Knees. It is the
opposite of Parkour Training and it makes you climb tables slower,
stunned for longer against slip stuns, and move more slowly in difficult
terrain.
- tweak: Snail-Paced no longer prevents you from slipping when running.
  • Loading branch information
angelofallars authored Jan 5, 2025
1 parent 06be5d3 commit 8935492
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Content.Shared.Movement.Systems;
using Robust.Shared.GameStates;

namespace Content.Shared.Movement.Components;

// <summary>
// This is used to modify how much an entity is affected by speed modifier contacts.
// </summary>
[NetworkedComponent, RegisterComponent]
[AutoGenerateComponentState]
[Access(typeof(SpeedModifierContactsSystem))]
public sealed partial class SpeedModifiedByContactModifierComponent : Component
{
// <summary>
// Numbers greater than 1 amplify the walk speed modifier, and lower numbers lessen the effect.
// </summary>
[DataField, AutoNetworkedField]
public float WalkModifierEffectiveness = 1.0f;

// <summary>
// Numbers greater than 1 amplify the sprint speed modifier, and lower numbers lessen the effect.
// </summary>
[DataField, AutoNetworkedField]
public float SprintModifierEffectiveness = 1.0f;

// <summary>
// The minimum walk speed multiplier.
// </summary>
[DataField, AutoNetworkedField]
public float MinWalkMultiplier = 0.1f;

// <summary>
// The minimum sprint speed multiplier.
// </summary>
[DataField, AutoNetworkedField]
public float MinSprintMultiplier = 0.1f;
}
10 changes: 10 additions & 0 deletions Content.Shared/Movement/Systems/SpeedModifierContactsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ private void MovementSpeedCheck(EntityUid uid, SpeedModifiedByContactComponent c
walkSpeed /= entries;
sprintSpeed /= entries;

if (TryComp<SpeedModifiedByContactModifierComponent>(uid, out var modifier))
{
walkSpeed = Math.Max(Math.Min(modifier.MinWalkMultiplier, walkSpeed),
// Similar to the formula for movement slow resist in Deadlock
1 - (1 - walkSpeed) * modifier.WalkModifierEffectiveness);

sprintSpeed = Math.Max(Math.Min(modifier.MinSprintMultiplier, sprintSpeed),
1 - (1 - sprintSpeed) * modifier.SprintModifierEffectiveness);
}

args.ModifySpeed(walkSpeed, sprintSpeed);
}

Expand Down
15 changes: 15 additions & 0 deletions Content.Shared/Slippery/SlippableModifierComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Slippery;

/// <summary>
/// Modifies the duration of slip paralysis on an entity.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class SlippableModifierComponent : Component
{
/// <summary>
/// What to multiply the paralyze time by.
/// </summary>
[DataField, AutoNetworkedField]
public float ParalyzeTimeMultiplier = 1f;
}
27 changes: 26 additions & 1 deletion Content.Shared/Slippery/SlipperySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public override void Initialize()
SubscribeLocalEvent<ThrownItemComponent, SlipCausingAttemptEvent>(OnThrownSlipAttempt);
// as long as slip-resistant mice are never added, this should be fine (otherwise a mouse-hat will transfer it's power to the wearer).
SubscribeLocalEvent<NoSlipComponent, InventoryRelayedEvent<SlipAttemptEvent>>((e, c, ev) => OnNoSlipAttempt(e, c, ev.Args));
SubscribeLocalEvent<SlippableModifierComponent, SlippedEvent>(OnSlippableModifierSlipped);
}

private void HandleStepTrigger(EntityUid uid, SlipperyComponent component, ref StepTriggeredOffEvent args)
Expand All @@ -62,6 +63,11 @@ private void OnThrownSlipAttempt(EntityUid uid, ThrownItemComponent comp, ref Sl
args.Cancelled = true;
}

private void OnSlippableModifierSlipped(EntityUid uid, SlippableModifierComponent comp, ref SlippedEvent args)
{
args.ParalyzeTime *= comp.ParalyzeTimeMultiplier;
}

private bool CanSlip(EntityUid uid, EntityUid toSlip)
{
return !_container.IsEntityInContainer(uid)
Expand All @@ -86,6 +92,9 @@ private void TrySlip(EntityUid uid, SlipperyComponent component, EntityUid other
var ev = new SlipEvent(other);
RaiseLocalEvent(uid, ref ev);

var slippedEv = new SlippedEvent(uid, component.ParalyzeTime);
RaiseLocalEvent(other, ref slippedEv);

if (TryComp(other, out PhysicsComponent? physics) && !HasComp<SlidingComponent>(other))
{
_physics.SetLinearVelocity(other, physics.LinearVelocity * component.LaunchForwardsMultiplier, body: physics);
Expand All @@ -100,7 +109,7 @@ private void TrySlip(EntityUid uid, SlipperyComponent component, EntityUid other

var playSound = !_statusEffects.HasStatusEffect(other, "KnockedDown");

_stun.TryParalyze(other, TimeSpan.FromSeconds(component.ParalyzeTime), true);
_stun.TryParalyze(other, TimeSpan.FromSeconds(slippedEv.ParalyzeTime), true);

RaiseLocalEvent(other, new MoodEffectEvent("MobSlipped"));

Expand Down Expand Up @@ -134,3 +143,19 @@ public record struct SlipCausingAttemptEvent (bool Cancelled);
/// <param name="Slipped">The entity being slipped</param>
[ByRefEvent]
public readonly record struct SlipEvent(EntityUid Slipped);

/// Raised on an entity that slipped.
/// <param name="Slipper">The entity that caused the slip</param>
/// <param name="ParalyzeTime">How many seconds the entity will be paralyzed for, modifiable with this event.</param>
[ByRefEvent]
public record struct SlippedEvent
{
public readonly EntityUid Slipper;
public float ParalyzeTime;

public SlippedEvent(EntityUid slipper, float paralyzeTime)
{
Slipper = slipper;
ParalyzeTime = paralyzeTime;
}
}
7 changes: 6 additions & 1 deletion Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Content.Shared.Gravity;
using Content.Shared.StepTrigger.Components;
using Content.Shared.Traits.Assorted.Components;
using Content.Shared.Whitelist;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics;
Expand Down Expand Up @@ -97,7 +98,11 @@ private void UpdateColliding(EntityUid uid, StepTriggerComponent component, Tran
// this is hard to explain
var intersect = Box2.Area(otherAabb.Intersect(ourAabb));
var ratio = Math.Max(intersect / Box2.Area(otherAabb), intersect / Box2.Area(ourAabb));
if (otherPhysics.LinearVelocity.Length() < component.RequiredTriggeredSpeed
var requiredTriggeredSpeed = component.RequiredTriggeredSpeed;
if (TryComp<TraitSpeedModifierComponent>(otherUid, out var speedModifier))
requiredTriggeredSpeed *= speedModifier.RequiredTriggeredSpeedModifier;

if (otherPhysics.LinearVelocity.Length() < requiredTriggeredSpeed
|| component.CurrentlySteppedOn.Contains(otherUid)
|| ratio < component.IntersectRatio
|| !CanTrigger(uid, otherUid, component))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ public sealed partial class TraitSpeedModifierComponent : Component

[DataField, AutoNetworkedField]
public float SprintModifier = 1.0f;

// <summary>
// Multiplied with the required trigger speed for step triggers that this entity collides with.
// </summary>
[DataField, AutoNetworkedField]
public float RequiredTriggeredSpeedModifier = 1.0f;
}
18 changes: 15 additions & 3 deletions Resources/Locale/en-US/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -224,20 +224,32 @@ trait-description-Voracious =
Nothing gets between you and your food.
Your endless consumption of food and drinks is twice as fast.
-terrain-example = [color=gray](e.g. spider web, slime puddle, kudzu, space glue)[/color]
-slippery-example = [color=gray](e.g. banana peel, water puddle, soap, space lube)[/color]
trait-name-ParkourTraining = Parkour Training
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.
You climb structures like tables [color=yellow]50%[/color] faster.
Slipping leaves you stunned for [color=yellow]30%[/color] shorter. { -slippery-example }
You gain a [color=yellow]50%[/color] resistance to slows from difficult terrain. { -terrain-example }
trait-name-BadKnees = Bad Knees
trait-description-BadKnees =
Whether due to injury, age, or wear and tear, your knees aren't particularly strong or flexible.
You climb structures like tables [color=yellow]50%[/color] slower.
Slipping leaves you stunned for [color=yellow]40%[/color] longer. { -slippery-example }
Difficult terrain slows you down [color=yellow]35%[/color] more. { -terrain-example }
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.
Your movement speed is decreased by [color=yellow]16%[/color].
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.
Your movement speed is decreased by [color=yellow]32%[/color].
trait-name-LightStep = Light Step
trait-description-LightStep =
Expand Down
42 changes: 30 additions & 12 deletions Resources/Prototypes/Traits/disabilities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,30 @@
components:
- type: Snoring

- type: trait
id: BadKnees
category: Physical
points: 3
requirements:
- !type:CharacterTraitRequirement
inverted: true
traits:
- ParkourTraining
- !type:CharacterSpeciesRequirement
inverted: true
species:
- Diona
functions:
- !type:TraitAddComponent
components:
- type: ClimbDelayModifier
climbDelayMultiplier: 1.5
- type: SlippableModifier
paralyzeTimeMultiplier: 1.4
- type: SpeedModifiedByContactModifier
walkModifierEffectiveness: 1.35
sprintModifierEffectiveness: 1.35

- type: trait
id: Sluggish
category: Physical
Expand All @@ -159,12 +183,9 @@
- !type:TraitAddComponent
components:
- type: TraitSpeedModifier
sprintModifier: 0.85
walkModifier: 0.85
- type: ClimbDelayModifier
climbDelayMultiplier: 1.35
- type: LayingDownModifier
layingDownCooldownMultiplier: 1.2
sprintModifier: 0.84
walkModifier: 0.84
requiredTriggeredSpeedModifier: 0.84

- type: trait
id: SnailPaced
Expand All @@ -184,12 +205,9 @@
- !type:TraitAddComponent
components:
- type: TraitSpeedModifier
sprintModifier: 0.7
walkModifier: 0.7
- type: ClimbDelayModifier
climbDelayMultiplier: 1.66
- type: LayingDownModifier
layingDownCooldownMultiplier: 1.6
sprintModifier: 0.68
walkModifier: 0.68
requiredTriggeredSpeedModifier: 0.68 # Still slip against normal slips with the new sprint speed

- type: trait
id: BloodDeficiency
Expand Down
11 changes: 7 additions & 4 deletions Resources/Prototypes/Traits/skills.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
traits:
- Sluggish
- SnailPaced
- BadKnees
- !type:CharacterSpeciesRequirement
inverted: true
species:
Expand All @@ -143,10 +144,12 @@
- !type:TraitReplaceComponent
components:
- type: ClimbDelayModifier
climbDelayMultiplier: 0.35
- type: LayingDownModifier
layingDownCooldownMultiplier: 0.5
downedSpeedMultiplierMultiplier: 1.65
climbDelayMultiplier: 0.5
- type: SlippableModifier
paralyzeTimeMultiplier: 0.7
- type: SpeedModifiedByContactModifier
walkModifierEffectiveness: 0.5
sprintModifierEffectiveness: 0.5

- type: trait
id: LightStep
Expand Down

0 comments on commit 8935492

Please sign in to comment.