mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-22 07:58:06 +03:00
# Description Some improvements to loadouts too. --- # TODO - [x] Points logic - [x] Server-side validation - [x] Categorize traits - [x] Assign points to traits - [x] Header costs - [x] Sort entries - [x] Max traits - [x] Communicate max traits - [x] Point bar - [x] Group exclusivity - Black outline on text - [x] Fix existing component whitelists --- <details><summary><h1>Media</h1></summary> <p> ## Accurate except for small details  ### Something to note:    </p> </details> --- # Changelog 🆑 - add: Added trait points - add: Added categories for traits --------- Co-authored-by: VMSolidus <evilexecutive@gmail.com>
59 lines
2.2 KiB
C#
59 lines
2.2 KiB
C#
using Content.Shared.Body.Systems;
|
|
using Content.Shared.Buckle.Components;
|
|
using Content.Shared.Movement.Events;
|
|
using Content.Shared.Movement.Systems;
|
|
using Content.Shared.Standing;
|
|
using Content.Shared.Throwing;
|
|
|
|
namespace Content.Shared.Traits.Assorted.Systems;
|
|
|
|
public sealed class LegsParalyzedSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifierSystem = default!;
|
|
[Dependency] private readonly StandingStateSystem _standingSystem = default!;
|
|
[Dependency] private readonly SharedBodySystem _bodySystem = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
SubscribeLocalEvent<Components.LegsParalyzedComponent, ComponentStartup>(OnStartup);
|
|
SubscribeLocalEvent<Components.LegsParalyzedComponent, ComponentShutdown>(OnShutdown);
|
|
SubscribeLocalEvent<Components.LegsParalyzedComponent, BuckleChangeEvent>(OnBuckleChange);
|
|
SubscribeLocalEvent<Components.LegsParalyzedComponent, ThrowPushbackAttemptEvent>(OnThrowPushbackAttempt);
|
|
SubscribeLocalEvent<Components.LegsParalyzedComponent, UpdateCanMoveEvent>(OnUpdateCanMoveEvent);
|
|
}
|
|
|
|
private void OnStartup(EntityUid uid, Components.LegsParalyzedComponent component, ComponentStartup args)
|
|
{
|
|
// TODO: In future probably must be surgery related wound
|
|
_movementSpeedModifierSystem.ChangeBaseSpeed(uid, 0, 0, 20);
|
|
}
|
|
|
|
private void OnShutdown(EntityUid uid, Components.LegsParalyzedComponent component, ComponentShutdown args)
|
|
{
|
|
_standingSystem.Stand(uid);
|
|
_bodySystem.UpdateMovementSpeed(uid);
|
|
}
|
|
|
|
private void OnBuckleChange(EntityUid uid, Components.LegsParalyzedComponent component, ref BuckleChangeEvent args)
|
|
{
|
|
if (args.Buckling)
|
|
{
|
|
_standingSystem.Stand(args.BuckledEntity);
|
|
}
|
|
else
|
|
{
|
|
_standingSystem.Down(args.BuckledEntity);
|
|
}
|
|
}
|
|
|
|
private void OnUpdateCanMoveEvent(EntityUid uid, Components.LegsParalyzedComponent component, UpdateCanMoveEvent args)
|
|
{
|
|
args.Cancel();
|
|
}
|
|
|
|
private void OnThrowPushbackAttempt(EntityUid uid, Components.LegsParalyzedComponent component, ThrowPushbackAttemptEvent args)
|
|
{
|
|
args.Cancel();
|
|
}
|
|
}
|