Skip to content

Commit 8935492

Browse files
Parkour Training Rework (#1432)
# 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.
1 parent 06be5d3 commit 8935492

File tree

9 files changed

+152
-21
lines changed

9 files changed

+152
-21
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using Content.Shared.Movement.Systems;
2+
using Robust.Shared.GameStates;
3+
4+
namespace Content.Shared.Movement.Components;
5+
6+
// <summary>
7+
// This is used to modify how much an entity is affected by speed modifier contacts.
8+
// </summary>
9+
[NetworkedComponent, RegisterComponent]
10+
[AutoGenerateComponentState]
11+
[Access(typeof(SpeedModifierContactsSystem))]
12+
public sealed partial class SpeedModifiedByContactModifierComponent : Component
13+
{
14+
// <summary>
15+
// Numbers greater than 1 amplify the walk speed modifier, and lower numbers lessen the effect.
16+
// </summary>
17+
[DataField, AutoNetworkedField]
18+
public float WalkModifierEffectiveness = 1.0f;
19+
20+
// <summary>
21+
// Numbers greater than 1 amplify the sprint speed modifier, and lower numbers lessen the effect.
22+
// </summary>
23+
[DataField, AutoNetworkedField]
24+
public float SprintModifierEffectiveness = 1.0f;
25+
26+
// <summary>
27+
// The minimum walk speed multiplier.
28+
// </summary>
29+
[DataField, AutoNetworkedField]
30+
public float MinWalkMultiplier = 0.1f;
31+
32+
// <summary>
33+
// The minimum sprint speed multiplier.
34+
// </summary>
35+
[DataField, AutoNetworkedField]
36+
public float MinSprintMultiplier = 0.1f;
37+
}

Content.Shared/Movement/Systems/SpeedModifierContactsSystem.cs

+10
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ private void MovementSpeedCheck(EntityUid uid, SpeedModifiedByContactComponent c
102102
walkSpeed /= entries;
103103
sprintSpeed /= entries;
104104

105+
if (TryComp<SpeedModifiedByContactModifierComponent>(uid, out var modifier))
106+
{
107+
walkSpeed = Math.Max(Math.Min(modifier.MinWalkMultiplier, walkSpeed),
108+
// Similar to the formula for movement slow resist in Deadlock
109+
1 - (1 - walkSpeed) * modifier.WalkModifierEffectiveness);
110+
111+
sprintSpeed = Math.Max(Math.Min(modifier.MinSprintMultiplier, sprintSpeed),
112+
1 - (1 - sprintSpeed) * modifier.SprintModifierEffectiveness);
113+
}
114+
105115
args.ModifySpeed(walkSpeed, sprintSpeed);
106116
}
107117

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using Robust.Shared.GameStates;
2+
namespace Content.Shared.Slippery;
3+
4+
/// <summary>
5+
/// Modifies the duration of slip paralysis on an entity.
6+
/// </summary>
7+
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
8+
public sealed partial class SlippableModifierComponent : Component
9+
{
10+
/// <summary>
11+
/// What to multiply the paralyze time by.
12+
/// </summary>
13+
[DataField, AutoNetworkedField]
14+
public float ParalyzeTimeMultiplier = 1f;
15+
}

Content.Shared/Slippery/SlipperySystem.cs

+26-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public override void Initialize()
3737
SubscribeLocalEvent<ThrownItemComponent, SlipCausingAttemptEvent>(OnThrownSlipAttempt);
3838
// 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).
3939
SubscribeLocalEvent<NoSlipComponent, InventoryRelayedEvent<SlipAttemptEvent>>((e, c, ev) => OnNoSlipAttempt(e, c, ev.Args));
40+
SubscribeLocalEvent<SlippableModifierComponent, SlippedEvent>(OnSlippableModifierSlipped);
4041
}
4142

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

66+
private void OnSlippableModifierSlipped(EntityUid uid, SlippableModifierComponent comp, ref SlippedEvent args)
67+
{
68+
args.ParalyzeTime *= comp.ParalyzeTimeMultiplier;
69+
}
70+
6571
private bool CanSlip(EntityUid uid, EntityUid toSlip)
6672
{
6773
return !_container.IsEntityInContainer(uid)
@@ -86,6 +92,9 @@ private void TrySlip(EntityUid uid, SlipperyComponent component, EntityUid other
8692
var ev = new SlipEvent(other);
8793
RaiseLocalEvent(uid, ref ev);
8894

95+
var slippedEv = new SlippedEvent(uid, component.ParalyzeTime);
96+
RaiseLocalEvent(other, ref slippedEv);
97+
8998
if (TryComp(other, out PhysicsComponent? physics) && !HasComp<SlidingComponent>(other))
9099
{
91100
_physics.SetLinearVelocity(other, physics.LinearVelocity * component.LaunchForwardsMultiplier, body: physics);
@@ -100,7 +109,7 @@ private void TrySlip(EntityUid uid, SlipperyComponent component, EntityUid other
100109

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

103-
_stun.TryParalyze(other, TimeSpan.FromSeconds(component.ParalyzeTime), true);
112+
_stun.TryParalyze(other, TimeSpan.FromSeconds(slippedEv.ParalyzeTime), true);
104113

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

@@ -134,3 +143,19 @@ public record struct SlipCausingAttemptEvent (bool Cancelled);
134143
/// <param name="Slipped">The entity being slipped</param>
135144
[ByRefEvent]
136145
public readonly record struct SlipEvent(EntityUid Slipped);
146+
147+
/// Raised on an entity that slipped.
148+
/// <param name="Slipper">The entity that caused the slip</param>
149+
/// <param name="ParalyzeTime">How many seconds the entity will be paralyzed for, modifiable with this event.</param>
150+
[ByRefEvent]
151+
public record struct SlippedEvent
152+
{
153+
public readonly EntityUid Slipper;
154+
public float ParalyzeTime;
155+
156+
public SlippedEvent(EntityUid slipper, float paralyzeTime)
157+
{
158+
Slipper = slipper;
159+
ParalyzeTime = paralyzeTime;
160+
}
161+
}

Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Content.Shared.Gravity;
22
using Content.Shared.StepTrigger.Components;
3+
using Content.Shared.Traits.Assorted.Components;
34
using Content.Shared.Whitelist;
45
using Robust.Shared.Map.Components;
56
using Robust.Shared.Physics;
@@ -97,7 +98,11 @@ private void UpdateColliding(EntityUid uid, StepTriggerComponent component, Tran
9798
// this is hard to explain
9899
var intersect = Box2.Area(otherAabb.Intersect(ourAabb));
99100
var ratio = Math.Max(intersect / Box2.Area(otherAabb), intersect / Box2.Area(ourAabb));
100-
if (otherPhysics.LinearVelocity.Length() < component.RequiredTriggeredSpeed
101+
var requiredTriggeredSpeed = component.RequiredTriggeredSpeed;
102+
if (TryComp<TraitSpeedModifierComponent>(otherUid, out var speedModifier))
103+
requiredTriggeredSpeed *= speedModifier.RequiredTriggeredSpeedModifier;
104+
105+
if (otherPhysics.LinearVelocity.Length() < requiredTriggeredSpeed
101106
|| component.CurrentlySteppedOn.Contains(otherUid)
102107
|| ratio < component.IntersectRatio
103108
|| !CanTrigger(uid, otherUid, component))

Content.Shared/Traits/Assorted/Components/TraitSpeedModifierComponent.cs

+6
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@ public sealed partial class TraitSpeedModifierComponent : Component
1313

1414
[DataField, AutoNetworkedField]
1515
public float SprintModifier = 1.0f;
16+
17+
// <summary>
18+
// Multiplied with the required trigger speed for step triggers that this entity collides with.
19+
// </summary>
20+
[DataField, AutoNetworkedField]
21+
public float RequiredTriggeredSpeedModifier = 1.0f;
1622
}

Resources/Locale/en-US/traits/traits.ftl

+15-3
Original file line numberDiff line numberDiff line change
@@ -224,20 +224,32 @@ trait-description-Voracious =
224224
Nothing gets between you and your food.
225225
Your endless consumption of food and drinks is twice as fast.
226226
227+
-terrain-example = [color=gray](e.g. spider web, slime puddle, kudzu, space glue)[/color]
228+
-slippery-example = [color=gray](e.g. banana peel, water puddle, soap, space lube)[/color]
229+
227230
trait-name-ParkourTraining = Parkour Training
228231
trait-description-ParkourTraining =
229232
Whether as a hobby, lifestyle, or professional training, you are trained in the discipline of parkour.
230-
You're faster with climbing, crawling, lying down, and getting up.
233+
You climb structures like tables [color=yellow]50%[/color] faster.
234+
Slipping leaves you stunned for [color=yellow]30%[/color] shorter. { -slippery-example }
235+
You gain a [color=yellow]50%[/color] resistance to slows from difficult terrain. { -terrain-example }
236+
237+
trait-name-BadKnees = Bad Knees
238+
trait-description-BadKnees =
239+
Whether due to injury, age, or wear and tear, your knees aren't particularly strong or flexible.
240+
You climb structures like tables [color=yellow]50%[/color] slower.
241+
Slipping leaves you stunned for [color=yellow]40%[/color] longer. { -slippery-example }
242+
Difficult terrain slows you down [color=yellow]35%[/color] more. { -terrain-example }
231243
232244
trait-name-Sluggish = Sluggish
233245
trait-description-Sluggish =
234246
You navigate the world slower than others, perhaps due to a medical condition, inactivity, or age.
235-
You move slower, and it takes longer for you to climb, lie down and get up.
247+
Your movement speed is decreased by [color=yellow]16%[/color].
236248
237249
trait-name-SnailPaced = Snail-Paced
238250
trait-description-SnailPaced =
239251
You walk at a snail's pace, perhaps due to a medical condition, mobility impairment, or age.
240-
You move substantially slower, and it takes far longer for you to climb, lie down and get up.
252+
Your movement speed is decreased by [color=yellow]32%[/color].
241253
242254
trait-name-LightStep = Light Step
243255
trait-description-LightStep =

Resources/Prototypes/Traits/disabilities.yml

+30-12
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,30 @@
141141
components:
142142
- type: Snoring
143143

144+
- type: trait
145+
id: BadKnees
146+
category: Physical
147+
points: 3
148+
requirements:
149+
- !type:CharacterTraitRequirement
150+
inverted: true
151+
traits:
152+
- ParkourTraining
153+
- !type:CharacterSpeciesRequirement
154+
inverted: true
155+
species:
156+
- Diona
157+
functions:
158+
- !type:TraitAddComponent
159+
components:
160+
- type: ClimbDelayModifier
161+
climbDelayMultiplier: 1.5
162+
- type: SlippableModifier
163+
paralyzeTimeMultiplier: 1.4
164+
- type: SpeedModifiedByContactModifier
165+
walkModifierEffectiveness: 1.35
166+
sprintModifierEffectiveness: 1.35
167+
144168
- type: trait
145169
id: Sluggish
146170
category: Physical
@@ -159,12 +183,9 @@
159183
- !type:TraitAddComponent
160184
components:
161185
- type: TraitSpeedModifier
162-
sprintModifier: 0.85
163-
walkModifier: 0.85
164-
- type: ClimbDelayModifier
165-
climbDelayMultiplier: 1.35
166-
- type: LayingDownModifier
167-
layingDownCooldownMultiplier: 1.2
186+
sprintModifier: 0.84
187+
walkModifier: 0.84
188+
requiredTriggeredSpeedModifier: 0.84
168189

169190
- type: trait
170191
id: SnailPaced
@@ -184,12 +205,9 @@
184205
- !type:TraitAddComponent
185206
components:
186207
- type: TraitSpeedModifier
187-
sprintModifier: 0.7
188-
walkModifier: 0.7
189-
- type: ClimbDelayModifier
190-
climbDelayMultiplier: 1.66
191-
- type: LayingDownModifier
192-
layingDownCooldownMultiplier: 1.6
208+
sprintModifier: 0.68
209+
walkModifier: 0.68
210+
requiredTriggeredSpeedModifier: 0.68 # Still slip against normal slips with the new sprint speed
193211

194212
- type: trait
195213
id: BloodDeficiency

Resources/Prototypes/Traits/skills.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
traits:
136136
- Sluggish
137137
- SnailPaced
138+
- BadKnees
138139
- !type:CharacterSpeciesRequirement
139140
inverted: true
140141
species:
@@ -143,10 +144,12 @@
143144
- !type:TraitReplaceComponent
144145
components:
145146
- type: ClimbDelayModifier
146-
climbDelayMultiplier: 0.35
147-
- type: LayingDownModifier
148-
layingDownCooldownMultiplier: 0.5
149-
downedSpeedMultiplierMultiplier: 1.65
147+
climbDelayMultiplier: 0.5
148+
- type: SlippableModifier
149+
paralyzeTimeMultiplier: 0.7
150+
- type: SpeedModifiedByContactModifier
151+
walkModifierEffectiveness: 0.5
152+
sprintModifierEffectiveness: 0.5
150153

151154
- type: trait
152155
id: LightStep

0 commit comments

Comments
 (0)