Skip to content

Commit 68a11db

Browse files
New Traits: Steadfast And Feeble (#1431)
# Description Adds two new traits, Steadfast and Feeble that modify how affected a character is by injury slows. Steadfast (-4 points) - 25% slow at 60 damage -> 17% slow at 70 damage - 45% slow at 80 damage -> 30% slow at 90 damage Feeble (4 points) - 25% slow at 60 damage -> 30% slow at 45 damage - 45% slow at 80 damage -> 54% slow at 65 damage Also *half-reverts* the reduction of injury slows from a Delta-V PR by ODJ (DeltaV-Station/Delta-v#741) from 30%/50% to 20%/40%, now 25%/45% to incentivize taking Steadfast. The injury slow resists for jackboot and combat boots has been nerfed from 50% to 20% to account for Steadfast. IPCs' injury slow at 60 damage has been decreased from 30% to 25% to be more consistent with other species. ## Technical details No trait with jackboots: - 25% slow -> 20% slow - 45% slow -> 36% slow Steadfast with jackboots: - 17% slow -> 13.6% slow - 30% slow -> 24.5% slow Feeble with jackboots: - 30% slow -> 24% slow - 54% slow -> 43.2% slow Although Feeble with jackboots has lower slow values than the base slows, the slow damage thresholds (-15) are still lower, making the slows occur with less damage. ## Media **Steadfast** ![image](https://github.com/user-attachments/assets/8b804040-7f0f-4a49-b0cf-1a83efd4c790) **Feeble** ![image](https://github.com/user-attachments/assets/a1759f49-f68c-4cc4-991b-b6864e67e016) **Jackboots** ![image](https://github.com/user-attachments/assets/67132fd0-5a97-43f1-a714-a9deae26f825) # Changelog <!-- You can add an author after the `:cl:` to change the name that appears in the changelog (ex: `:cl: Death`) Leaving it blank will default to your GitHub display name This includes all available types for the changelog --> :cl: Skubman - add: Added two new traits: Steadfast and Feeble that decrease or increase the effect of slows from injuries. - tweak: Injury slows for most species has been slightly increased, but this can be mitigated with the Steadfast trait. - tweak: The jackboots' injury slow resistance has been decreased from 50% to 20%. - tweak: Combat boots now add resistance to injury slows like jackboots. --------- Signed-off-by: Skubman <[email protected]> Co-authored-by: VMSolidus <[email protected]>
1 parent 5cb3d42 commit 68a11db

File tree

9 files changed

+111
-13
lines changed

9 files changed

+111
-13
lines changed

Content.Server/Traits/TraitSystem.Functions.cs

+38
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Content.Shared.FixedPoint;
12
using Content.Shared.Traits;
23
using JetBrains.Annotations;
34
using Robust.Shared.Prototypes;
@@ -11,6 +12,7 @@
1112
using Content.Shared.Mood;
1213
using Content.Shared.Traits.Assorted.Components;
1314
using Content.Shared.Damage;
15+
using Content.Shared.Damage.Components;
1416
using Content.Shared.Chemistry.Components;
1517
using Content.Shared.Chemistry.EntitySystems;
1618
using Content.Shared.Mobs.Components;
@@ -547,3 +549,39 @@ public override void OnPlayerSpawn(EntityUid uid,
547549
staminaComponent.Cooldown += CooldownModifier;
548550
}
549551
}
552+
553+
/// <summary>
554+
/// Used for traits that modify SlowOnDamageComponent.
555+
/// </summary>
556+
[UsedImplicitly]
557+
public sealed partial class TraitModifySlowOnDamage : TraitFunction
558+
{
559+
// <summary>
560+
// A flat modifier to add to all damage threshold keys.
561+
// </summary>
562+
[DataField, AlwaysPushInheritance]
563+
public float DamageThresholdsModifier;
564+
565+
// <summary>
566+
// A multiplier applied to all speed modifier values.
567+
// The higher the multiplier, the stronger the slowdown.
568+
// </summary>
569+
[DataField, AlwaysPushInheritance]
570+
public float SpeedModifierMultiplier = 1f;
571+
572+
public override void OnPlayerSpawn(EntityUid uid,
573+
IComponentFactory factory,
574+
IEntityManager entityManager,
575+
ISerializationManager serializationManager)
576+
{
577+
if (!entityManager.TryGetComponent<SlowOnDamageComponent>(uid, out var slowOnDamage))
578+
return;
579+
580+
var newSpeedModifierThresholds = new Dictionary<FixedPoint2, float>();
581+
582+
foreach (var (damageThreshold, speedModifier) in slowOnDamage.SpeedModifierThresholds)
583+
newSpeedModifierThresholds[damageThreshold + DamageThresholdsModifier] = 1 - (1 - speedModifier) * SpeedModifierMultiplier;
584+
585+
slowOnDamage.SpeedModifierThresholds = newSpeedModifierThresholds;
586+
}
587+
}

Content.Shared/Damage/Systems/SlowOnDamageSystem.cs

+2-6
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,13 @@ private void OnDamageChanged(EntityUid uid, SlowOnDamageComponent component, Dam
6161

6262
private void OnModifySpeed(Entity<ClothingSlowOnDamageModifierComponent> ent, ref InventoryRelayedEvent<ModifySlowOnDamageSpeedEvent> args)
6363
{
64-
var dif = 1 - args.Args.Speed;
65-
if (dif <= 0)
66-
return;
67-
6864
// reduces the slowness modifier by the given coefficient
69-
args.Args.Speed += dif * ent.Comp.Modifier;
65+
args.Args.Speed = 1 - (1 - args.Args.Speed) * ent.Comp.Modifier;
7066
}
7167

7268
private void OnExamined(Entity<ClothingSlowOnDamageModifierComponent> ent, ref ExaminedEvent args)
7369
{
74-
var msg = Loc.GetString("slow-on-damage-modifier-examine", ("mod", (1 - ent.Comp.Modifier) * 100));
70+
var msg = Loc.GetString("slow-on-damage-modifier-examine", ("mod", Math.Round((1 - ent.Comp.Modifier) * 100)));
7571
args.PushMarkup(msg);
7672
}
7773

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
melee-stamina = Not enough stamina
22
3-
slow-on-damage-modifier-examine = Slowness from injuries is reduced by [color=yellow]{$mod}%[/color]
3+
slow-on-damage-modifier-examine = Slowness from injuries is reduced by [color=yellow]{$mod}%[/color].
44
55
throw-no-stamina = You don't have enough stamina to throw the {$item}!

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

+14
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,20 @@ trait-description-LowPainTolerance =
163163
Your tolerance for pain is far below average, and its effects are more inhibiting.
164164
Your melee/throwing damage is penalized by up to an additional 15% when taking stamina damage.
165165
166+
trait-name-Steadfast = Steadfast
167+
trait-description-Steadfast =
168+
When others would buckle from the weight of your injuries, you still march forward unrelentingly.
169+
For most species [color=gray](excluding IPC/Shadowkin)[/color], this trait modifies:
170+
- [color=yellow]25%[/color] movement slow at [color=red]60[/color] damage ➔ [color=yellow]17%[/color] movement slow at [color=red]70[/color] damage
171+
- [color=yellow]45%[/color] movement slow at [color=red]80[/color] damage ➔ [color=yellow]30%[/color] movement slow at [color=red]90[/color] damage
172+
173+
trait-name-Feeble = Feeble
174+
trait-description-Feeble =
175+
Your body responds poorly to injuries, making damage affect your movement more severely.
176+
For most species [color=gray](excluding IPC/Shadowkin)[/color], this trait modifies:
177+
- [color=yellow]25%[/color] movement slow at [color=red]60[/color] damage ➔ [color=yellow]30%[/color] movement slow at [color=red]45[/color] damage
178+
- [color=yellow]45%[/color] movement slow at [color=red]80[/color] damage ➔ [color=yellow]54%[/color] movement slow at [color=red]65[/color] damage
179+
166180
trait-name-MartialArtist = Martial Artist
167181
trait-description-MartialArtist =
168182
You have received formal training in unarmed combat, whether with Fists, Feet, or Claws.

Resources/Prototypes/Entities/Clothing/Shoes/boots.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
- type: Clothing
2222
sprite: Clothing/Shoes/Boots/jackboots.rsi
2323
- type: ClothingSlowOnDamageModifier
24-
modifier: 0.5
24+
modifier: 0.8
2525

2626
- type: entity
2727
parent: ClothingShoesMilitaryBase
@@ -67,6 +67,8 @@
6767
sprite: Clothing/Shoes/Boots/combatboots.rsi
6868
- type: Clothing
6969
sprite: Clothing/Shoes/Boots/combatboots.rsi
70+
- type: ClothingSlowOnDamageModifier
71+
modifier: 0.8
7072

7173
- type: entity
7274
parent: ClothingShoesMilitaryBase
@@ -93,6 +95,8 @@
9395
sprite: Clothing/Shoes/Boots/mercboots.rsi
9496
- type: Clothing
9597
sprite: Clothing/Shoes/Boots/mercboots.rsi
98+
- type: ClothingSlowOnDamageModifier
99+
modifier: 0.6
96100

97101
- type: entity
98102
parent: ClothingShoesBaseButcherable

Resources/Prototypes/Entities/Clothing/Shoes/specific.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
- type: Clothing
138138
sprite: Clothing/Shoes/Specific/swat.rsi
139139
- type: ClothingSlowOnDamageModifier
140-
modifier: 0.5
140+
modifier: 0.7
141141

142142
- type: entity
143143
parent: ClothingShoesBaseButcherable

Resources/Prototypes/Entities/Mobs/Player/ipc.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
- !type:GibBehavior { }
5959
- type: SlowOnDamage
6060
speedModifierThresholds:
61-
60: 0.7
61+
60: 0.75
6262
90: 0.5
6363
120: 0.3
6464
- type: SiliconDownOnDead
@@ -142,4 +142,4 @@
142142
- type: HumanoidAppearance
143143
species: IPC
144144
- type: Inventory
145-
templateId: ipc
145+
templateId: ipc

Resources/Prototypes/Entities/Mobs/Species/base.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@
9090
species: Human
9191
- type: SlowOnDamage
9292
speedModifierThresholds:
93-
60: 0.8 # DV - Was 0.7
94-
80: 0.6 # DV - Was 0.5
93+
60: 0.75
94+
80: 0.55
9595
- type: Fixtures
9696
fixtures: # TODO: This needs a second fixture just for mob collisions.
9797
fix1:

Resources/Prototypes/Traits/physical.yml

+46
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,52 @@
235235
- type: PainTolerance
236236
rangeModifier: 0.6
237237

238+
- type: trait
239+
id: Steadfast
240+
category: Physical
241+
points: -4
242+
requirements:
243+
- !type:CharacterJobRequirement
244+
inverted: true
245+
jobs:
246+
- Borg
247+
- MedicalBorg
248+
- !type:CharacterSpeciesRequirement
249+
inverted: true
250+
species:
251+
- Felinid
252+
- !type:CharacterTraitRequirement
253+
inverted: true
254+
traits:
255+
- Feeble
256+
functions:
257+
- !type:TraitModifySlowOnDamage
258+
damageThresholdsModifier: 10
259+
speedModifierMultiplier: 0.68
260+
261+
- type: trait
262+
id: Feeble
263+
category: Physical
264+
points: 3
265+
requirements:
266+
- !type:CharacterJobRequirement
267+
inverted: true
268+
jobs:
269+
- Borg
270+
- MedicalBorg
271+
- !type:CharacterSpeciesRequirement
272+
inverted: true
273+
species:
274+
- Felinid
275+
- !type:CharacterTraitRequirement
276+
inverted: true
277+
traits:
278+
- Steadfast
279+
functions:
280+
- !type:TraitModifySlowOnDamage
281+
damageThresholdsModifier: -15
282+
speedModifierMultiplier: 1.2
283+
238284
- type: trait
239285
id: MartialArtist
240286
category: Physical

0 commit comments

Comments
 (0)