2022-04-14 12:38:34 +01:00

31 lines
769 B
C#

using GhostEnums;
using QSB.EchoesOfTheEye.Ghosts;
public class QSBSleepwalkAction : QSBGhostAction
{
public override GhostAction.Name GetName() => GhostAction.Name.Sleepwalk;
public override float CalculateUtility()
=> !_data.hasWokenUp
? 100f
: -100f;
protected override void OnEnterAction()
{
MoveToRandomPatrolNode();
_controller.SetLanternConcealed(false, true);
_effects.SetMovementStyle(GhostEffects.MovementStyle.Normal);
}
public override bool Update_Action()
=> true;
public override void OnArriveAtPosition()
=> MoveToRandomPatrolNode();
private void MoveToRandomPatrolNode()
{
_controller.PathfindToNode(_controller.AttachedObject.GetNodeMap().GetRandomPatrolNode(), MoveType.PATROL);
_controller.FaceVelocity();
}
}