* ai stays seated while cuffed. * Do the thing I thought was dumb.... whatever. * less than
30 lines
890 B
C#
30 lines
890 B
C#
using Content.Server.Buckle.Systems;
|
|
|
|
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Combat;
|
|
|
|
public sealed partial class UnbuckleOperator : HTNOperator
|
|
{
|
|
private BuckleSystem _buckle = default!;
|
|
|
|
[DataField("shutdownState")]
|
|
public HTNPlanState ShutdownState { get; private set; } = HTNPlanState.TaskFinished;
|
|
|
|
public override void Initialize(IEntitySystemManager sysManager)
|
|
{
|
|
base.Initialize(sysManager);
|
|
_buckle = sysManager.GetEntitySystem<BuckleSystem>();
|
|
}
|
|
|
|
public override void Startup(NPCBlackboard blackboard)
|
|
{
|
|
base.Startup(blackboard);
|
|
var owner = blackboard.GetValue<EntityUid>(NPCBlackboard.Owner);
|
|
_buckle.TryUnbuckle(owner, owner, false);
|
|
}
|
|
|
|
public override HTNOperatorStatus Update(NPCBlackboard blackboard, float frameTime)
|
|
{
|
|
return HTNOperatorStatus.Finished;
|
|
}
|
|
}
|