local FuncNode_EventTargetCasterDistCompare = class("FuncNode_EventTargetCasterDistCompare") --[[ 初始化 --]] function FuncNode_EventTargetCasterDistCompare:initialize(entity) self.LimitChildCount = 2 self.Type = LuaConst.ConditionFuncType.EventTargetCasterDistCompare end --[[ 执行 --]] local tempV1_Dist = FP.newV1(0) function FuncNode_EventTargetCasterDistCompare:Run(conditionDataNode, entity, missile, buffObject, eventParams) if eventParams and eventParams.target and eventParams.caster then eventParams.target:GetLogicPos():DistanceSqr(eventParams.caster:GetLogicPos(), tempV1_Dist) local relationType = FP.tonumberV1(conditionDataNode.FirstNode:Run(entity, missile)) local compareToDistSqr = conditionDataNode.SecondNode:Run(entity, missile) local ConditionAnalysis = require "Battle/Logic/AI/Condition/ConditionAnalysis" return ConditionAnalysis.CommonValueCompare(relationType, tempV1_Dist, compareToDistSqr) else logging.error(LTAG.ERROR, "HYW : EventTargetCasterDistCompare条件只能用于事件触发的Trigger,并且事件必须要有target和caster两个参数") return FP.Const.Zero end end return FuncNode_EventTargetCasterDistCompare