-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(traits): add new trait Parkour Training
- Loading branch information
1 parent
62045ff
commit 4370e29
Showing
6 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
Content.Server/Traits/Assorted/LayingDownModifierComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Server.Traits.Assorted; | ||
|
||
/// <summary> | ||
/// This is used for traits that modify values related to the Laying Down system. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class LayingDownModifierComponent : Component | ||
{ | ||
/// <summary> | ||
/// What to multiply the cooldown of laying down and standing up by. | ||
/// </summary> | ||
[DataField] | ||
public float LayingDownCooldownMultiplier = 1f; | ||
|
||
/// <summary> | ||
/// What to multiply the speed multiplier when lying down by. | ||
/// </summary> | ||
[DataField] | ||
public float DownedSpeedMultiplierMultiplier = 1f; | ||
} |
24 changes: 24 additions & 0 deletions
24
Content.Server/Traits/Assorted/LayingDownModifierSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<LayingDownModifierComponent, ComponentStartup>(OnStartup); | ||
} | ||
|
||
private void OnStartup(EntityUid uid, LayingDownModifierComponent component, ComponentStartup args) | ||
{ | ||
if (!TryComp<LayingDownComponent>(uid, out var layingDown)) | ||
return; | ||
|
||
Log.Debug("Got to on startup"); | ||
|
||
layingDown.Cooldown *= component.LayingDownCooldownMultiplier; | ||
layingDown.DownedSpeedMultiplier *= component.DownedSpeedMultiplierMultiplier; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
Content.Shared/Traits/Assorted/Components/ClimbDelayModifierComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared.Traits.Assorted.Components; | ||
|
||
/// <summary> | ||
/// This is used for any trait that modifies climbing speed. | ||
/// </summary> | ||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] | ||
public sealed partial class ClimbDelayModifierComponent : Component | ||
{ | ||
/// <summary> | ||
/// What to multiply the climbing delay by. | ||
/// </summary> | ||
[DataField, AutoNetworkedField] | ||
public float ClimbDelayMultiplier = 1f; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters