Files
tbd-station-14/Content.Shared/Climbing/SharedClimbSystem.cs
metalgearsloth 2b6c352aff Jetpacks (#9023)
* Movement acceleration

* tweaks

* Weightless refactor coz fuck it

* CCVars

* weightless movement tweaks

* Some cleanup while I'm here

* dorkpacks

* thanks fork

* fixes

* zoomies

* toggles

* hmm

* yamls

* b

* so true

* Effects refactor

* namespace

* review
2022-06-24 17:44:30 +10:00

30 lines
945 B
C#

using Content.Shared.DragDrop;
using Content.Shared.Movement;
using Content.Shared.Movement.Events;
namespace Content.Shared.Climbing;
public abstract class SharedClimbSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SharedClimbingComponent, UpdateCanMoveEvent>(HandleMoveAttempt);
SubscribeLocalEvent<SharedClimbableComponent, CanDragDropOnEvent>(OnCanDragDropOn);
}
private static void HandleMoveAttempt(EntityUid uid, SharedClimbingComponent component, UpdateCanMoveEvent args)
{
if (component.LifeStage > ComponentLifeStage.Running)
return;
if (component.OwnerIsTransitioning)
args.Cancel();
}
protected virtual void OnCanDragDropOn(EntityUid uid, SharedClimbableComponent component, CanDragDropOnEvent args)
{
args.CanDrop = HasComp<SharedClimbingComponent>(args.Dragged);
}
}