From 26fa127b141769b3187dc084043adf0090967066 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Fri, 30 Oct 2020 15:49:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E3=80=90=E6=88=98=E6=96=97=E3=80=91?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=8C=E6=96=B9=E6=95=B0=E6=8D=AE=E6=9C=89?= =?UTF-8?q?=E7=81=B5=E5=85=BD=E6=97=B6=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua index f3b44741fb..8252073b80 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua @@ -417,8 +417,8 @@ function this.GetBattleServerData(msg, isFightPlayer) fightData.enemyData[i].outData = data2.specialPassive -- 灵兽数据 fightData.enemyData[i].monsterList ={} - for i = 1, #data2.pokemonUnitList do - fightData.enemyData[i].monsterList[i] = this.PokemonUnitAdapter(data2.pokemonUnitList[i]) + for k = 1, #data2.pokemonUnitList do + fightData.enemyData[i].monsterList[k] = this.PokemonUnitAdapter(data2.pokemonUnitList[k]) end end local data = { From 4a76f49f7f97f8e8375e841b519ee5f7dd1f68bc Mon Sep 17 00:00:00 2001 From: gaoxin Date: Fri, 30 Oct 2020 16:15:40 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90=E6=88=98=E6=96=97=E3=80=91?= =?UTF-8?q?=E9=92=88=E5=AF=B9=E7=81=B5=E5=85=BD=E6=B7=BB=E5=8A=A0=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E6=95=88=E6=9E=9C=E7=9A=84=E5=B1=8F=E8=94=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/Logic/Base/Buff.lua | 6 ++++- .../Modules/Battle/Logic/Misc/BattleUtil.lua | 25 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua index a3e00fefcd..4aa54c1f9f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua @@ -130,6 +130,10 @@ function BuffManager.GenerateBuffId() return curBuffId end function BuffManager:AddBuff(target, buff) + -- 灵兽无效 + if target.type == BattleUnitType.Monster then + return + end buff.target = target self.buffQueue:Enqueue(buff) -- buff.frameDuration = floor(buff.duration * BattleLogic.GameFrameRate) @@ -252,7 +256,7 @@ function BuffManager:Update() oldBuff.target.Event:DispatchEvent(BattleEventName.BuffEnd, oldBuff) putBuff(oldBuff) -- 覆盖老buff - buffList.buffer[i] = buff + buffList.buffer[i] = buff buff:OnStart() buff.target.Event:DispatchEvent(BattleEventName.BuffStart, buff) buff.target.Event:DispatchEvent(BattleEventName.BuffCover, buff) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index 01bb3c1916..ecdf39485d 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -298,6 +298,10 @@ end -- 秒杀 function BattleUtil.Seckill(skill, atkRole, defRole) + -- 灵兽无效 + if defRole.type == BattleUnitType.Monster then + return + end local damage = defRole:GetRoleData(RoleDataName.Hp) local finalDmg = defRole.data:SubValue(RoleDataName.Hp, damage) if finalDmg >= 0 then @@ -324,6 +328,11 @@ end -- 计算真实伤害 function BattleUtil.ApplyDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType,isDirect) + -- 灵兽无效 + if defRole.type == BattleUnitType.Monster then + return + end + bCrit = bCrit or false damageType = damageType or 0 @@ -396,6 +405,10 @@ function BattleUtil.GetExtraSkillbyId(id) end function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType,isDirect) + -- 灵兽无效 + if defRole.type == BattleUnitType.Monster then + return + end if damage < 0 then damage = 0 end local finalDmg = defRole.data:SubValue(RoleDataName.Hp, damage) if finalDmg >= 0 then @@ -442,6 +455,10 @@ end --执行完整的命中,伤害,暴击计算,返回命中,暴击 --skill造成伤害的技能 atkRole攻击者 defRole受击者 damageType伤害类型 baseFactor伤害系数 ignoreDef无视防御参数 dotType是持续伤害类型 function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, ignoreDef, dotType) + -- 灵兽无效 + if defRole.type == BattleUnitType.Monster then + return + end -- 判断是否命中 if skill and not skill:CheckTargetIsHit(defRole) then BattleLogic.Event:DispatchEvent(BattleEventName.HitMiss, atkRole, defRole, skill) @@ -530,6 +547,10 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i end function BattleUtil.CalTreat(castRole, targetRole, value, baseFactor) + -- 灵兽无效 + if defRole.type == BattleUnitType.Monster then + return + end if targetRole.ctrl_noheal or targetRole:IsDead() then --禁疗和死亡无法加血 return end @@ -553,6 +574,10 @@ function BattleUtil.CalTreat(castRole, targetRole, value, baseFactor) end function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor,critDamageFactor,addDamageFactor) + -- 灵兽无效 + if defRole.type == BattleUnitType.Monster then + return + end if targetRole.ctrl_noheal or targetRole:IsDead() then --禁疗和死亡无法加血 return end