34 lines
972 B
C#
34 lines
972 B
C#
using Invector.vCharacterController.AI.FSMBehaviour;
|
|
using UnityEngine;
|
|
|
|
namespace DemonBoss.Summoner
|
|
{
|
|
/// <summary>
|
|
/// FSM Decision: should Summoner cast a ranged spell
|
|
/// </summary>
|
|
[CreateAssetMenu(menuName = "Invector/FSM/Decisions/Summoner/Should Cast Spell")]
|
|
public class DEC_ShouldCastSpell : vStateDecision
|
|
{
|
|
public override string categoryName => "Summoner";
|
|
public override string defaultName => "Should Cast Spell";
|
|
|
|
[Header("Debug")]
|
|
[Tooltip("Enable debug logging")]
|
|
public bool enableDebug = false;
|
|
|
|
public override bool Decide(vIFSMBehaviourController fsmBehaviour)
|
|
{
|
|
var summoner = fsmBehaviour.gameObject.GetComponent<SummonerAI>();
|
|
if (summoner == null)
|
|
{
|
|
if (enableDebug) Debug.LogWarning("[DEC_ShouldCastSpell] No SummonerAI component found!");
|
|
return false;
|
|
}
|
|
|
|
bool canCast = summoner.CanCastSpell();
|
|
if (enableDebug) Debug.Log($"[DEC_ShouldCastSpell] canCast={canCast}");
|
|
return canCast;
|
|
}
|
|
}
|
|
}
|