49 lines
1.2 KiB
C#
49 lines
1.2 KiB
C#
/*
|
|
* @Author: 白哉
|
|
* @Description:
|
|
* @Date: 2025年06月06日 星期五 19:06:16
|
|
* @Modify:
|
|
*/
|
|
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Logic.AI;
|
|
using NodeCanvas.Framework;
|
|
using ParadoxNotion.Design;
|
|
using RuntimeData;
|
|
|
|
|
|
namespace NodeCanvas.Tasks.Actions
|
|
{
|
|
[Name("存在好感度 >= 的国家")]
|
|
[Category("AI节点")]
|
|
[Serializable]
|
|
public class AIParamAnyPlayerFeelValue : BaseActionTask
|
|
{
|
|
public float Value;
|
|
|
|
protected override string desc => string.Format($"存在好感度 >= {Value} 的国家");
|
|
|
|
|
|
protected override void OnExecute()
|
|
{
|
|
base.OnExecute();
|
|
// 直接从Blackboard获取AICalculatorData
|
|
var data = blackboard.GetVariable<AICalculatorData>("Data");
|
|
if (data?.value == null)
|
|
{
|
|
EndAction(false);
|
|
return;
|
|
}
|
|
|
|
foreach (var info in data.value.Player.DiplomacyData.Info)
|
|
{
|
|
if (info.FeelingValue < Value) continue;
|
|
EndAction(true);
|
|
return;
|
|
}
|
|
EndAction(false);
|
|
}
|
|
}
|
|
} |