46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
/*
|
|
* @Author: 白哉
|
|
* @Description:
|
|
* @Date: 2025年10月21日 星期二 17:10:56
|
|
* @Modify:
|
|
*/
|
|
|
|
|
|
using System;
|
|
using Logic.AI;
|
|
using NodeCanvas.Framework;
|
|
using ParadoxNotion.Design;
|
|
|
|
|
|
namespace NodeCanvas.Tasks.Actions
|
|
{
|
|
[Name("目标英雄是敌军?")]
|
|
[Category("AI节点")]
|
|
[Serializable]
|
|
public class AIParamIsTargetHeroAttacker : BaseActionTask
|
|
{
|
|
protected override string desc => $"目标英雄是敌军?";
|
|
|
|
|
|
protected override void OnExecute()
|
|
{
|
|
base.OnExecute();
|
|
// 直接从Blackboard获取AICalculatorData
|
|
var data = blackboard.GetVariable<AICalculatorData>("Data");
|
|
if (data?.value?.TargetParam == null)
|
|
{
|
|
EndAction(false);
|
|
return;
|
|
}
|
|
|
|
var unit = data.value.TargetParam.UnitData;
|
|
var targetUnit = data.value.TargetParam.TargetUnitData;
|
|
if (unit == null || targetUnit == null || targetUnit.UnitFullType.UnitType != UnitType.Giant)
|
|
{
|
|
EndAction(false);
|
|
return;
|
|
}
|
|
EndAction(!data.value.TargetParam.MapData.IsLeagueUnitByUnit(unit.Id, targetUnit.Id));
|
|
}
|
|
}
|
|
} |