From 8ce40e8099bca98b60706600f12df45eac2c4052 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Wed, 30 Dec 2020 15:29:06 +0900 Subject: [PATCH] =?UTF-8?q?[=E6=88=98=E6=96=97]=3D=3D=3D=3D=E6=B7=BB?= =?UTF-8?q?=E5=8A=A05=EF=BC=8C=206=20condition=20=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=20=20=E6=B7=BB=E5=8A=A0buff=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=20=E9=BA=92=E9=BA=9F=E5=8D=B0=E5=8A=A0=20=20=E6=94=BE?= =?UTF-8?q?=E9=80=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Logic/Monster/MonsterSkill/MCondition.lua | 67 ++++++++++++++++++- .../Modules/Battle/View/Unit/BuffCtrl.lua | 6 ++ 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Monster/MonsterSkill/MCondition.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Monster/MonsterSkill/MCondition.lua index 2ddc8b26b1..7b506bb4bd 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Monster/MonsterSkill/MCondition.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Monster/MonsterSkill/MCondition.lua @@ -52,7 +52,71 @@ local _ConditionConfig = { local comValue = condition[3] -- 当前释放技能的单位的职业 local professionId = skill.owner.professionId - return professionId == comValue + local skillCastEnd=function(skill2) + if skill2.owner.camp==skill.owner.camp then + local list=skill2:GetDirectTargetsNoMiss() + if not list then + return false + end + local num=0 + for key, value in pairs(list) do + local isHave=BattleLogic.BuffMgr:HasBuff(value, BuffName.DOT, function(buff) return buff.damageType == 1 and buff.caster==skill2.owner and buff.startRound == BattleLogic.GetCurRound() end) + if isHave then + return true + end + end + return false + end + end + BattleLogic.Event:AddEvent(BattleEventName.SkillCastEnd,skillCastEnd) + return skillCastEnd + end, + [5] = function(skill, condition) --5:敌方上场神将数量 且概率(万分比) + local conId = condition[1] + local comType = condition[2] + local comValue = condition[3] + local rand = condition[4] + local roleList = RoleManager.Query(function(role) + return role.camp ~= skill.owner.camp + end) + local isEnough=BattleUtil.CompareValue(#roleList, comValue, comType) + local r = Random.Range01() + -- 判断概率 + if isEnough then + return r>rand/10000 + end + return false + end, + [6] = function(skill, condition) --6:敌方任意神将生命百分比 【比较类型】 N(万分比) + local conId = condition[1] + local comType = condition[2] + local comValue = condition[3] + local round = condition[4] + -- 获取该技能相同阵营人物 + local roleList = RoleManager.Query(function(role) + return role.camp ~= skill.owner.camp + end) + -- 判断 + local r = Random.Range01() + for _, role in ipairs(roleList) do + local hpf = role:GetRoleData(RoleDataName.Hp) / role:GetRoleData(RoleDataName.MaxHp) + if BattleUtil.CompareValue(hpf, comValue/10000, comType) then + return round/10000>r + end + end + return false + end, + [7] = function(skill, condition) --7:检测是否有可以放逐的目标 + local list=skill.owner.exileTargets + if list then + local roleList = RoleManager.Query(function(role) + return role.camp ~= skill.owner.camp and not BattleUtil.ChecklistIsContainValue(list,role) + end) + if roleList and #roleList>0 then + return true + end + end + return false end, } @@ -61,6 +125,7 @@ function MCondition.CheckCondition(skill, condition) if not condition then return true end + LogError("skill"..skill.id) local conId = condition[1] local comType = condition[2] local comValue = condition[3] diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua index 4d50b185a7..11549fb5f4 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua @@ -8,6 +8,8 @@ local BuffTypeToConfigType = { [BuffName.Shield] = 5, [BuffName.Immune] = 6, [BuffName.Curse] = 7, + [BuffName.KylinMark] = 8, + [BuffName.Exile] = 9, } local function _GetPropChangeBuffCType(pName) for cType, pn in ipairs(BattlePropList) do @@ -39,6 +41,10 @@ local function _GetBuffEffectConfig(buff) cType = buff.immuneType elseif bType == BuffName.Curse then cType = buff.curseType + elseif bType== BuffName.KylinMark then + cType = 1 + elseif bType== BuffName.Exile then + cType = 1 end local type = BuffTypeToConfigType[bType]