local FuncNode_CheckBuffOfSource = class("FuncNode_CheckBuffOfSource") --[[ 初始化 --]] function FuncNode_CheckBuffOfSource:initialize(entity) self.LimitChildCount = 2 self.Type = LuaConst.ConditionFuncType.CheckBuffOfSource end --[[ 执行 --]] function FuncNode_CheckBuffOfSource:Run(conditionDataNode, entity, missile) local sourceType = conditionDataNode.FirstNode:Run(entity, missile) local buffID = FP.tonumberV1(conditionDataNode.SecondNode:Run(entity, missile)) local sourceEntity if sourceType == FP.Const.One then --主人 sourceEntity = entity:GetMasterEntity() elseif sourceType == FP.Const.Two then --子弹的发射者 if missile then sourceEntity = missile.Attacker else logging.error(LTAG.ERROR, "HYW : CheckBuffOfSource条件配置了来源为子弹,但是没有子弹参数!") end end if sourceEntity then if entity.components.buff:GetBuffUpdateDataSourced(buffID, sourceEntity.EntityID) then return FP.Const.One end else logging.error(LTAG.ERROR, "HYW : 没有找到sourceEntity @FuncNode_CheckBuffOfSource") end return FP.Const.Zero end return FuncNode_CheckBuffOfSource