2020-09-13 14:23:52 +02:00
|
|
|
|
using Content.Client.Interfaces.GameObjects.Components.Interaction;
|
2020-08-19 18:13:22 -04:00
|
|
|
|
using Content.Shared.GameObjects.Components.Movement;
|
2020-09-13 14:23:52 +02:00
|
|
|
|
using Robust.Shared.GameObjects;
|
2020-08-19 18:13:22 -04:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.GameObjects.Components.Movement
|
|
|
|
|
|
{
|
|
|
|
|
|
[RegisterComponent]
|
|
|
|
|
|
public class ClimbingComponent : SharedClimbingComponent, IClientDraggable
|
|
|
|
|
|
{
|
|
|
|
|
|
public override void HandleComponentState(ComponentState curState, ComponentState nextState)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!(curState is ClimbModeComponentState climbModeState) || Body == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IsClimbing = climbModeState.Climbing;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool IsClimbing { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
bool IClientDraggable.ClientCanDropOn(CanDropEventArgs eventArgs)
|
|
|
|
|
|
{
|
|
|
|
|
|
return eventArgs.Target.HasComponent<IClimbable>();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool IClientDraggable.ClientCanDrag(CanDragEventArgs eventArgs)
|
|
|
|
|
|
{
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|