From 6d86795403f7b8395c220f20593e12ba1822b2f3 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Wed, 6 Jan 2021 11:22:16 +0900 Subject: [PATCH] =?UTF-8?q?[=E6=88=98=E6=96=97]=3D=3D=3D=3D=3D=E7=81=B5?= =?UTF-8?q?=E5=85=BD=E9=87=91=E4=B9=8C=E6=8A=80=E8=83=BD=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/BattleManager.lua | 1 + .../Logic/Monster/MonsterSkill/MCondition.lua | 24 ++++++++----------- .../Logic/Monster/MonsterSkill/MTrigger.lua | 2 +- .../Modules/Battle/Logic/Role/RoleLogic.lua | 1 + .../Modules/Battle/Logic/SkillManager.lua | 13 +++++++--- .../Modules/Battle/Test/BattleTestPanel.lua | 2 ++ 6 files changed, 25 insertions(+), 18 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua index ac9cfced5f..bd7f41f954 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua @@ -290,6 +290,7 @@ function this.GetBattleServerData(msg, isFightPlayer) camp = 0, type = 1, quality = 0, + job=HeroConfig[rid].Job, element = HeroConfig[rid].PropertyName, professionId = HeroConfig[rid].Profession, passivity = { }, 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 7b506bb4bd..d6f0f75503 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Monster/MonsterSkill/MCondition.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Monster/MonsterSkill/MCondition.lua @@ -46,30 +46,27 @@ local _ConditionConfig = { return isRoundOk and isRandomOk end, - [4] = function(skill, condition) --4:行动单位的职业设定 【比较类型】 N + [4] = function(skill, condition) --4:场上燃烧目标的数量 【比较类型】 N local conId = condition[1] local comType = condition[2] local comValue = condition[3] -- 当前释放技能的单位的职业 local professionId = skill.owner.professionId - local skillCastEnd=function(skill2) - if skill2.owner.camp==skill.owner.camp then - local list=skill2:GetDirectTargetsNoMiss() + + local list = RoleManager.Query(function(role) + return role.camp ~= skill.owner.camp + end) 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) + local isHave=BattleLogic.BuffMgr:HasBuff(value, BuffName.DOT, function(buff) return buff.damageType == 1 end) if isHave then - return true + num=num+1 end - end - return false - end - end - BattleLogic.Event:AddEvent(BattleEventName.SkillCastEnd,skillCastEnd) - return skillCastEnd + end + return BattleUtil.CompareValue(num, comValue, comType) end, [5] = function(skill, condition) --5:敌方上场神将数量 且概率(万分比) local conId = condition[1] @@ -115,7 +112,7 @@ local _ConditionConfig = { if roleList and #roleList>0 then return true end - end + end return false end, } @@ -125,7 +122,6 @@ 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/Logic/Monster/MonsterSkill/MTrigger.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Monster/MonsterSkill/MTrigger.lua index 5ea443bb38..eebb84f5f0 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Monster/MonsterSkill/MTrigger.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Monster/MonsterSkill/MTrigger.lua @@ -90,7 +90,7 @@ local _TriggerConfig = { triggerFunc = function(skill, ...) local args = {...} local castSkill = args[1] - return castSkill.owner.camp == skill.owner.camp + return castSkill.owner.camp == skill.owner.camp and castSkill.owner.job==2 and (castSkill.type==BattleSkillType.DeadSkill or castSkill.type==BattleSkillType.Extra or castSkill.type==BattleSkillType.Special) end }, } diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua index 4a0e4a5c7f..a37870ce3e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua @@ -33,6 +33,7 @@ function RoleLogic:Init(uid, data, position) self.name = data.name self.element = data.element self.professionId = data.professionId + self.job=data.job self.star = data.star or 1 -- LogError("英雄uid".. self.roleId .." " .. self.star) self.shield:Clear() --护盾列表 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua index d820659a29..544a79676b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua @@ -157,15 +157,22 @@ function this.Update() -- 检测一下轮转 this.IsSkilling = false -- this.CheckTurnRound() - -- 检测一次灵兽技能 - this.CheckMonsterSkill(this.MonsterCheckFunc) + if this.MonsterCheckFunc then + this.CheckMonsterSkill(this.MonsterCheckFunc) + else + this.CheckMonsterSkill(this.CheckTurnRound) + end end) else -- 检测一下轮转 this.IsSkilling = false -- this.CheckTurnRound() -- 检测一次灵兽技能 - this.CheckMonsterSkill(this.MonsterCheckFunc) + if this.MonsterCheckFunc then + this.CheckMonsterSkill(this.MonsterCheckFunc) + else + this.CheckMonsterSkill(this.CheckTurnRound) + end end return end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Test/BattleTestPanel.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Test/BattleTestPanel.lua index 43f05b1ceb..a1c123a0e1 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Test/BattleTestPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Test/BattleTestPanel.lua @@ -308,6 +308,7 @@ function this.RefreshFightData(type) data.skinId=role.skinId LogError("skinId==="..role.skinId) data.type = 1 + data.job=roleData.Job local paskill = string.split(role.passivity, "#") data.passivity = BattleManager.GetPassivityData(paskill) or {} data.property = {} @@ -364,6 +365,7 @@ end function this.ApplyMonsterData(data) monsterTestData = data this.RefreshFightData(2) + return true end function this.ClearMonsterData(camp) if camp == 0 then