2024-06-30 23:55:58 +00:00
|
|
|
|
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)
|
|
|
|
|
{
|
2024-07-02 15:16:04 +00:00
|
|
|
|
var patrolStateProcessor = new PatrolStateProcessor
|
|
|
|
|
{
|
|
|
|
|
Points =
|
|
|
|
|
[
|
2024-10-09 13:21:38 +00:00
|
|
|
|
new Godot.Vector2(Config.CellSize * 3, 0),
|
|
|
|
|
new Godot.Vector2(-Config.CellSize * 3, 0),
|
2024-07-02 15:16:04 +00:00
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
RegisterProcessor(patrolStateProcessor);
|
2024-07-06 14:55:07 +00:00
|
|
|
|
var chaseStateProcessor = new ChaseStateProcessor();
|
|
|
|
|
RegisterProcessor(chaseStateProcessor);
|
2024-07-17 14:54:42 +00:00
|
|
|
|
var lookForWeaponProcessor = new LookForWeaponProcessor();
|
|
|
|
|
RegisterProcessor(lookForWeaponProcessor);
|
2024-07-18 14:45:39 +00:00
|
|
|
|
var fleeProcessor = new FleeProcessor();
|
|
|
|
|
RegisterProcessor(fleeProcessor);
|
2024-10-09 13:21:38 +00:00
|
|
|
|
var attackStateProcessor = new AttackStateProcessor();
|
|
|
|
|
RegisterProcessor(attackStateProcessor);
|
2024-06-30 23:55:58 +00:00
|
|
|
|
}
|
|
|
|
|
}
|