Files
wwdpublic/Content.Shared/Traits/Assorted/Systems/LegsParalyzedSystem.cs
DEATHB4DEFEAT d3ed34ff4e Trait Points (#434)
# 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


![image](https://github.com/Simple-Station/Einstein-Engines/assets/77995199/c0ab2fbf-3bce-4e54-81d5-8e546d6b3c0b)

### Something to note:


![image](https://github.com/Simple-Station/Einstein-Engines/assets/77995199/09a3948e-0c9f-4f57-b297-f62063b11845)


![image](https://github.com/Simple-Station/Einstein-Engines/assets/77995199/35d76095-0714-4613-a17b-73df25a9a832)


![image](https://github.com/Simple-Station/Einstein-Engines/assets/77995199/87149e5c-0af2-4ac0-bbde-52f317a008a0)

</p>
</details>

---

# Changelog

🆑
- add: Added trait points
- add: Added categories for traits

---------

Co-authored-by: VMSolidus <evilexecutive@gmail.com>
2024-06-20 19:39:30 -04:00

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();
}
}