local FuncNode_IsHeroOfProfession = class("FuncNode_IsHeroOfProfession") --[[ 初始化 --]] function FuncNode_IsHeroOfProfession:initialize(entity) self.LimitChildCount = 2 self.Type = LuaConst.ConditionFuncType.IsHeroOfProfession end --[[ 执行 --]] function FuncNode_IsHeroOfProfession:Run(conditionDataNode, entity, missile) local professionType = FP.tonumberV1(conditionDataNode.FirstNode:Run(entity, missile)) local targetType = FP.tonumberV1(conditionDataNode.SecondNode:Run(entity, missile)) local target if targetType == 2 then target = entity.components.target.Target else target = entity end if target then return target:GetProfessionType() == professionType and FP.Const.One or FP.Const.Zero else return FP.Const.Zero end end return FuncNode_IsHeroOfProfession