using UnityEngine; using Bolt; namespace Game { [UnitTitle("设置目标")] [UnitSubtitle("NodeSetTarget")] [UnitCategory("Game-AI")] public class NodeSetTarget : NodeDefault { public ValueInput target; protected override void Def() { target = ValueInput("target"); } protected override void Run(Flow flow) { var e = data.Entity; var t = flow.GetValue(target); Util.GetEntity(e).SetTarget(t); } } [UnitTitle("获取难度等级")] [UnitSubtitle("NodeGetDifficulty")] [UnitCategory("Game-AI")] public class NodeGetDifficulty : NodeDefault { public ValueOutput difficulty; protected override void Def() { difficulty = ValueOutput("difficulty"); } protected override void Run(Flow flow) { var d = Util.GetDifficulty(); flow.SetValue(difficulty, d); } } [UnitTitle("设置思考频率")] [UnitSubtitle("NodeSetThinkCD")] [UnitCategory("Game-AI")] public class NodeSetThinkCD : NodeDefault { public ValueInput cd; protected override void Def() { cd = ValueInput("cd", 1); } protected override void Run(Flow flow) { var e = data.Entity; var t = flow.GetValue(cd); Util.SetThinkCd(e, t); } } [UnitTitle("设置饥饿值基础配置")] [UnitSubtitle("NodeHungryBasic")] [UnitCategory("Game-AI")] public class NodeHungryBasic : NodeDefault { public ValueInput max; public ValueInput now; public ValueInput inc; protected override void Def() { max = ValueInput("max", 1); now = ValueInput("now", 0); inc = ValueInput("inc", 0); } protected override void Run(Flow flow) { var e = data.Entity; var m = flow.GetValue(max); var n = flow.GetValue(now); var i = flow.GetValue(inc); Util.SetHungryBasic(e, m, n, i); } } [UnitTitle("设置饥饿值自增倍率")] [UnitSubtitle("NodeHungryIncreaseRate")] [UnitCategory("Game-AI")] public class NodeHungryIncreaseRate : NodeDefault { public ValueInput rate; protected override void Def() { rate = ValueInput("rate", 0); } protected override void Run(Flow flow) { var e = data.Entity; var r = flow.GetValue(rate); Util.SetHungryIncreaseRate(e, r); } } [UnitTitle("释放技能")] [UnitSubtitle("NodeCastSkill")] [UnitCategory("Game-AI")] public class NodeCastSkill : NodeDefault { public ValueInput skill; public ValueInput dir; protected override void Def() { skill = ValueInput("skill", 0); dir = ValueInput("dir"); } protected override void Run(Flow flow) { var e = data.Entity; var s = flow.GetValue(skill); var d = flow.GetValue(dir); var ett = Util.GetEntity(e); if (ett == null) { return; } Util.CastSkillMonster(Util.GetEntity(e), s, d); } } }