[Trait] Wheelchair bound (#18785)
* Init commit * move to shared and remove all from component * maybe that * Use SharedBuckleSystem * Rename to WheelchairBound * Move Carriage to prototype * Update sprite to TG, add folded sprite, rename carriage to wheelchair * Fix wheelchair rsi path * Add stand & down for buckling * Add wheelchair inhand sprites * Move wheelchair down in file & fix fold sprite & add suffix Vehicle * Use new wheelchair id * Add standing & speed reset on component remove * Split system to leg paralyzed and wheelchair bound * Rename to LegsParalyzed * Rename in prototype * Move LegsParalyzed to shared --------- Co-authored-by: Ray <vigersray@gmail.com>
This commit is contained in:
21
Content.Server/Traits/Assorted/WheelchairBoundSystem.cs
Normal file
21
Content.Server/Traits/Assorted/WheelchairBoundSystem.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Content.Shared.Buckle;
|
||||
using Content.Shared.Traits.Assorted;
|
||||
|
||||
namespace Content.Server.Traits.Assorted;
|
||||
|
||||
public sealed class WheelchairBoundSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedBuckleSystem _buckleSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<WheelchairBoundComponent, ComponentStartup>(OnStartup);
|
||||
}
|
||||
|
||||
private void OnStartup(EntityUid uid, WheelchairBoundComponent component, ComponentStartup args)
|
||||
{
|
||||
var wheelchair = Spawn(component.WheelchairPrototype, Transform(uid).Coordinates);
|
||||
_buckleSystem.TryBuckle(uid, uid, wheelchair);
|
||||
RemComp<WheelchairBoundComponent>(uid);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user