49 lines
1.4 KiB
C#
49 lines
1.4 KiB
C#
/*
|
||
* @Author: 白哉
|
||
* @Description:
|
||
* @Date: 2025年06月06日 星期五 19:06:16
|
||
* @Modify:
|
||
*/
|
||
|
||
|
||
using System;
|
||
using Logic.AI;
|
||
using Logic.Skill;
|
||
using NodeCanvas.Framework;
|
||
using ParadoxNotion.Design;
|
||
using RuntimeData;
|
||
|
||
|
||
namespace NodeCanvas.Tasks.Actions
|
||
{
|
||
[Name("小兵能移动能攻击(特殊判断,GetActionPoint(ActionPointType.Move) GetActionPoint(ActionPointType.Attack) > 0, Dash Trigger False)")]
|
||
[Category("AI节点")]
|
||
[Serializable]
|
||
public class AIUnitCanMoveAndAttack : BaseActionTask
|
||
{
|
||
protected override string desc => $"小兵能移动能攻击";
|
||
|
||
|
||
protected override void OnExecute()
|
||
{
|
||
base.OnExecute();
|
||
// 直接从Blackboard获取AICalculatorData
|
||
var data = blackboard.GetVariable<AICalculatorData>("Data");
|
||
if (data?.value?.TargetParam.UnitData == null)
|
||
{
|
||
EndAction(false);
|
||
return;
|
||
}
|
||
|
||
var unit = data.value.TargetParam.UnitData;
|
||
if (unit.GetActionPoint(ActionPointType.Move) > 0 && unit.GetActionPoint(ActionPointType.Attack) > 0 && unit.GetSkill(SkillType.DASH, out var skill) &&
|
||
skill is DashSkill dashSkill && !dashSkill.IsTrigger)
|
||
{
|
||
EndAction(true);
|
||
return;
|
||
}
|
||
|
||
EndAction(false);
|
||
}
|
||
}
|
||
} |