diff --git a/Content.Server/Traits/Assorted/LayingDownModifierComponent.cs b/Content.Server/Traits/Assorted/LayingDownModifierComponent.cs new file mode 100644 index 00000000000..22660ff4487 --- /dev/null +++ b/Content.Server/Traits/Assorted/LayingDownModifierComponent.cs @@ -0,0 +1,22 @@ +using Robust.Shared.GameStates; + +namespace Content.Server.Traits.Assorted; + +/// +/// This is used for traits that modify values related to the Laying Down system. +/// +[RegisterComponent] +public sealed partial class LayingDownModifierComponent : Component +{ + /// + /// What to multiply the cooldown of laying down and standing up by. + /// + [DataField] + public float LayingDownCooldownMultiplier = 1f; + + /// + /// What to multiply the speed multiplier when lying down by. + /// + [DataField] + public float DownedSpeedMultiplierMultiplier = 1f; +} diff --git a/Content.Server/Traits/Assorted/LayingDownModifierSystem.cs b/Content.Server/Traits/Assorted/LayingDownModifierSystem.cs new file mode 100644 index 00000000000..4bb261c5a1d --- /dev/null +++ b/Content.Server/Traits/Assorted/LayingDownModifierSystem.cs @@ -0,0 +1,24 @@ +using Content.Server.Traits.Assorted; +using Content.Server.Standing; + +namespace Content.Shared.Traits.Assorted.Systems; + +public sealed class LayingDownModifierSystem : EntitySystem +{ + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(OnStartup); + } + + private void OnStartup(EntityUid uid, LayingDownModifierComponent component, ComponentStartup args) + { + if (!TryComp(uid, out var layingDown)) + return; + + Log.Debug("Got to on startup"); + + layingDown.Cooldown *= component.LayingDownCooldownMultiplier; + layingDown.DownedSpeedMultiplier *= component.DownedSpeedMultiplierMultiplier; + } +} diff --git a/Content.Shared/Climbing/Systems/ClimbSystem.cs b/Content.Shared/Climbing/Systems/ClimbSystem.cs index 8f6e8046aa4..521f5ace99d 100644 --- a/Content.Shared/Climbing/Systems/ClimbSystem.cs +++ b/Content.Shared/Climbing/Systems/ClimbSystem.cs @@ -13,6 +13,7 @@ using Content.Shared.Physics; using Content.Shared.Popups; using Content.Shared.Stunnable; +using Content.Shared.Traits.Assorted.Components; using Content.Shared.Verbs; using Robust.Shared.Audio.Systems; using Robust.Shared.Physics; @@ -216,7 +217,11 @@ public bool TryClimb( if (ev.Cancelled) return false; - var args = new DoAfterArgs(EntityManager, user, comp.ClimbDelay, new ClimbDoAfterEvent(), + var climbDelay = comp.ClimbDelay; + if (user == entityToMove && TryComp(user, out var delayModifier)) + climbDelay *= delayModifier.ClimbDelayMultiplier; + + var args = new DoAfterArgs(EntityManager, user, climbDelay, new ClimbDoAfterEvent(), entityToMove, target: climbable, used: entityToMove) diff --git a/Content.Shared/Traits/Assorted/Components/ClimbDelayModifierComponent.cs b/Content.Shared/Traits/Assorted/Components/ClimbDelayModifierComponent.cs new file mode 100644 index 00000000000..c04657a4875 --- /dev/null +++ b/Content.Shared/Traits/Assorted/Components/ClimbDelayModifierComponent.cs @@ -0,0 +1,16 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.Traits.Assorted.Components; + +/// +/// This is used for any trait that modifies climbing speed. +/// +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] +public sealed partial class ClimbDelayModifierComponent : Component +{ + /// + /// What to multiply the climbing delay by. + /// + [DataField, AutoNetworkedField] + public float ClimbDelayMultiplier = 1f; +} diff --git a/Resources/Locale/en-US/traits/traits.ftl b/Resources/Locale/en-US/traits/traits.ftl index cd5d1782ba3..7aec8624503 100644 --- a/Resources/Locale/en-US/traits/traits.ftl +++ b/Resources/Locale/en-US/traits/traits.ftl @@ -55,3 +55,10 @@ trait-name-Foreigner = Foreigner trait-description-Foreigner = For one reason or another you do not speak this station's primary language. Instead, you have a translator issued to you that only you can use. + +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 climb 25% faster over tables, railings, fences and other similar structures. + You crawl 25% faster. + You can lie down and stand up in succession 10% faster. diff --git a/Resources/Prototypes/Traits/skills.yml b/Resources/Prototypes/Traits/skills.yml index 2cfbd244e7e..d2790b9cac0 100644 --- a/Resources/Prototypes/Traits/skills.yml +++ b/Resources/Prototypes/Traits/skills.yml @@ -31,3 +31,14 @@ inverted: true species: - Felinid + +- type: trait + id: ParkourTraining + category: Physical + points: -3 + components: + - type: ClimbDelayModifier + climbDelayMultiplier: 0.75 + - type: LayingDownModifier + layingDownCooldownMultiplier: 0.8 + downedSpeedMultiplierMultiplier: 1.25