local FuncNode_CanUseSkillType = class("FuncNode_CanUseSkillType") --[[ 初始化 --]] function FuncNode_CanUseSkillType:initialize(entity) self.LimitChildCount = 3 self.Type = LuaConst.ConditionFuncType.CanUseSkillType end --[[ 执行 --]] function FuncNode_CanUseSkillType:Run(conditionDataNode, entity, missile) local skillBaseComponent = entity.components.skillBase local skillType = conditionDataNode.FirstNode:Run(entity, missile) local monsterID = nil if conditionDataNode.SecondNode then local targetType = FP.tonumberV1(conditionDataNode.SecondNode:Run(entity, missile)) if targetType == 2 then monsterID = FP.tonumberV1(conditionDataNode.ThirdNode:Run(entity, missile)) end end local target = nil if monsterID then for i,_entity in ipairs(LogicUpdateManager.EntityList_Normal) do if _entity:IsMonster() and _entity:GetCharacterID() == monsterID then target = _entity break end end else target = entity end if target then local buffComponent = entity.components.buff if buffComponent.CurrentBuffStates:Get(LuaConst.SpecialBuffs.CanSkill) then for i,value in ipairs(skillBaseComponent.CurSkillDataList) do if FP.Equals(skillType, value.AiSkillType) and skillBaseComponent:CanUseSkill(value) then return FP.Const.One end end end end return FP.Const.Zero end return FuncNode_CanUseSkillType