Files
tbd-station-14/Content.Shared/Traits/Assorted/ImpairedMobilityComponent.cs
Mora cd0cc72157 Impaired Mobility Disability (#39398)
* Implements mobility impairment

* Implements mobility impairment

* Implements mobility impairment

* Removed white cane related stuff (impaired cane replacement and removed mobility aid component)

* fix development.toml

* Implements slower standing

* Prevent speed stacking by checking if the entity is already holding a mobility aid

* Move all speed handling into ImpairedMobilitySystem, added comments, made it so wielding a mobility aid doesn't grant the recovery benefit

* Move all speed handling into ImpairedMobilitySystem, added comments, made it so wielding a mobility aid doesn't grant the recovery benefit

* remove unused file

* Shorten description

* Apply suggestions

Co-authored-by: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com>

* Suggestion cleanup

* formatting fix and removed extra datafield stuff

* added comment, fixed slashes, yadda yadda

* summary comments

* removed a word

* Add trait to clone whitelist

* Fix clone.yml

* my own review

---------

Co-authored-by: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com>
Co-authored-by: ScarKy0 <scarky0@onet.eu>
2025-08-20 17:43:06 -07:00

26 lines
978 B
C#

using Robust.Shared.GameStates;
namespace Content.Shared.Traits.Assorted;
/// <summary>
/// Used for the Impaired Mobility disability trait.
/// Applies a base movement speed reduction as determined by the SpeedModifier field.
/// Also increases the time it takes to stand up after falling, as determined by the StandUpTimeModifier field.
/// When an entity holds an item with the MobilityAidComponent, the speed penalty is nullified.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class ImpairedMobilityComponent : Component
{
/// <summary>
/// The movement speed modifier applied to the player (0.4 is 40% slower)
/// </summary>
[DataField, AutoNetworkedField]
public float SpeedModifier = 0.4f;
/// <summary>
/// The doAfter modifier when getting up after falling (1.4 is 40% slower)
/// </summary>
[DataField, AutoNetworkedField]
public float StandUpTimeModifier = 1.4f;
}