local FuncNode_BuffLayerCompare = class("FuncNode_BuffLayerCompare") --[[ 初始化 --]] function FuncNode_BuffLayerCompare:initialize(entity) self.LimitChildCount = 3 self.Type = LuaConst.ConditionFuncType.BuffLayerCompare end function FuncNode_BuffLayerCompare:LayerCompare(compareToLayer, updateData) local curLayer = 0 if updateData then curLayer = updateData.BuffLayer end if compareToLayer >= 0 then return curLayer >= compareToLayer and FP.Const.One or FP.Const.Zero else return curLayer <= -compareToLayer and FP.Const.One or FP.Const.Zero end end --[[ 执行 --]] function FuncNode_BuffLayerCompare:Run(conditionDataNode, entity, missile) local type = conditionDataNode.FirstNode:Run(entity, missile) local buffID = FP.tonumberV1(conditionDataNode.SecondNode:Run(entity, missile)) local layer = FP.tonumberV1(conditionDataNode.ThirdNode:Run(entity, missile)) if type == FP.Const.Zero then --自己 return self:LayerCompare(layer, entity.components.buff:GetBuffUpdateData(buffID)) elseif type == FP.Const.One then --目标 local tempEntity = entity.components.target.Target if tempEntity then return self:LayerCompare(layer, tempEntity.components.buff:GetBuffUpdateData(buffID)) end else logging.error(LTAG.ERROR, "HYW : 错误的类型 @FuncNode_BuffLayerCompare 条件字串 : ", conditionDataNode.conditionStr) end return FP.Const.Zero end return FuncNode_BuffLayerCompare