Traveller/scripts/stateMachine/PatrolStateMachine.cs
Cold-Mint 9416993849
Give the enemy pause after the attack.
使敌人攻击后有所停顿。
2024-10-09 21:21:38 +08:00

31 lines
1.1 KiB
C#

using ColdMint.scripts.stateMachine.StateProcessor;
namespace ColdMint.scripts.stateMachine;
/// <summary>
/// <para>State machine for patrollers</para>
/// <para>适用于巡逻者的状态机</para>
/// </summary>
public class PatrolStateMachine : StateMachineTemplate
{
protected override void OnStart(StateContext context)
{
var patrolStateProcessor = new PatrolStateProcessor
{
Points =
[
new Godot.Vector2(Config.CellSize * 3, 0),
new Godot.Vector2(-Config.CellSize * 3, 0),
]
};
RegisterProcessor(patrolStateProcessor);
var chaseStateProcessor = new ChaseStateProcessor();
RegisterProcessor(chaseStateProcessor);
var lookForWeaponProcessor = new LookForWeaponProcessor();
RegisterProcessor(lookForWeaponProcessor);
var fleeProcessor = new FleeProcessor();
RegisterProcessor(fleeProcessor);
var attackStateProcessor = new AttackStateProcessor();
RegisterProcessor(attackStateProcessor);
}
}