Files
tbd-station-14/Content.Server/NPC/HTN/PrimitiveTasks/Operators/Combat/UnbuckleOperator.cs
IProduceWidgets f24949a0b0 ai stays seated and pulled while cuffed. (#30397)
* ai stays seated while cuffed.

* Do the thing I thought was dumb.... whatever.

* less than
2024-08-08 19:53:07 +10:00

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