diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua index bc008234ac..a1b480021b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua @@ -311,6 +311,7 @@ function BuffManager:PassUpdate() and buff.caster.position == curPos and buff.roundDuration > 0 -- 不是无限存在的buff and buff.caster.type~=BattleUnitType.Monster --灵兽的buff在这里处理 + and buff.type~=BuffName.NoDead then -- 当前轮释放的buff不结算 if buff.startRound ~= BattleLogic.GetCurRound() then @@ -325,6 +326,32 @@ function BuffManager:PassUpdate() end end end + +function BuffManager:PassUpdateNoDead() + local curCamp, curPos = BattleLogic.GetCurTurn() + for i=1, self.buffDic.size do + local buffList = self.buffDic.vList[i] + if buffList.size > 0 then + for index = 1, buffList.size do + local buff = buffList.buffer[index] + if not buff.disperse -- 没过期 + and buff.caster.camp == curCamp -- 释放者是当前轮到的人 + and buff.caster.position == curPos + and buff.roundDuration > 0 -- 不是无限存在的buff + and buff.caster.type~=BattleUnitType.Monster --灵兽的buff在这里处理 + then + -- 当前轮释放的buff不结算 + buff.roundPass = buff.roundPass + 1 + if buff.roundPass >= buff.roundDuration then + buff.disperse = true + end + buff.target.Event:DispatchEvent(BattleEventName.BuffRoundChange, buff) + end + end + end + end +end + --计算灵兽buff更新 function BuffManager:PassMonsterUpdate() local curCamp, curPos = BattleLogic.GetCurTurn() diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index cb40982d4b..0f1447f36b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -3638,7 +3638,12 @@ local passivityList = { local finalDamage = BattleUtil.CountValue(damage, f1, ct) local curHp = role:GetRoleData(RoleDataName.Hp) --如果敌方忽略分摊就只减伤 - if atkRole.ignoreShara then + local ignoreShara=atkRole.ignoreShara + --特殊处理 白骨精附加的普攻不会忽略分摊 + if atkRole.roleId==10091 and skill and skill.type==BattleSkillType.Normal and skill.isAdd then + ignoreShara=false + end + if ignoreShara then local dd = damage - finalDamage damagingFunc(floor(BattleUtil.ErrorCorrection(dd))) return @@ -3955,8 +3960,13 @@ local passivityList = { local f1 = args[1] local onFinalDamage = function(damagingFunc, atkRole, defRole, damage, skill, dotType, bCrit, damageType) + local ignoreShara=atkRole.ignoreShara + --特殊处理 白骨精附加的普攻不会忽略分摊 + if atkRole.roleId==10091 and skill and skill.type==BattleSkillType.Normal and skill.isAdd then + ignoreShara=false + end --如果敌人免疫分摊 - if atkRole and atkRole.ignoreShara then + if atkRole and ignoreShara then return end if not role:IsDead() and skill and role.position ~= defRole.position and defRole.camp == role.camp and defRole.element == role.element then @@ -4911,6 +4921,7 @@ local passivityList = { if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return end + --白骨精追加普攻不处罚特性 if skill and judge==1 and skill.type== BattleSkillType.Normal and skill.isAdd and skill.owner.roleId==10091 then return @@ -5935,9 +5946,15 @@ local passivityList = { --造成伤害暴击后,将伤害的[a]%转化为自身生命治疗自己 --a[float] - [289] = function(role, args) + [289] = function(role, args,id,judge) local f1 = args[1] - local OnDamage = function(defRole, damage, bCrit, finalDmg) + + local OnDamage = function(defRole, damage, bCrit, finalDmg,damageType,skill) + + --白骨精追加普攻不处罚特性 + if skill and judge==1 and skill.type== BattleSkillType.Normal and skill.isAdd and skill.owner.roleId==10091 then + return + end BattleUtil.CalTreat(role, role, floor(f1 * damage)) end role.Event:AddEvent(BattleEventName.RoleCrit, OnDamage) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua index 374c983bec..b9609215fe 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua @@ -274,7 +274,7 @@ function BattleLogic.CheckBattleLogic() -- 自己阵营中的位置 + 自己阵营的ID * 6 = 自己在PosList中的位置 local role = RoleManager.GetRole(CurCamp, p) --PosList[p + (CurCamp * 6)] --角色如果被放逐不能行动 by:wangzhenxing 2020/12/23 11:35 - if role and not role:IsRealDead() then + if role and not role:IsRealDead() then SkillRole = role break end @@ -285,6 +285,7 @@ function BattleLogic.CheckBattleLogic() BattleLogic.BuffMgr:TurnUpdate(3) -- 计算持续伤害(流血) BattleLogic.BuffMgr:TurnUpdate(4) -- 计算其他buff BattleLogic.BuffMgr:PassUpdate() -- 计算buff轮数 + BattleLogic.BuffMgr:PassUpdateNoDead() -- 计算buff不灭 end -- 如果找不到下一个人,直接交换阵营 if not SkillRole then @@ -310,6 +311,7 @@ function BattleLogic.CheckBattleLogic() BattleLogic.BuffMgr:TurnUpdate(3) -- 计算持续伤害(流血) BattleLogic.BuffMgr:TurnUpdate(4) -- 计算其他buff BattleLogic.BuffMgr:PassUpdate() -- 计算buff轮数 + BattleLogic.BuffMgr:PassUpdateNoDead() -- 计算buff不灭 SkillRole.Event:DispatchEvent(BattleEventName.RoleTurnEnd, SkillRole) -- 行动结束 BattleLogic.Event:DispatchEvent(BattleEventName.RoleTurnEnd, SkillRole) -- 开始行动 BattleLogic.TurnRoundNextFrame() diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Shield.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Shield.lua index d8d6a261da..aba5e83d41 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Shield.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Shield.lua @@ -40,6 +40,7 @@ end -- 计算护盾 function Shield:CountShield(damage, atkRole,skill) self.atk = atkRole + local isImmuneAllReduceShield=false local finalDamage = 0 if self.shieldType == ShieldTypeName.NormalReduce then @@ -64,7 +65,12 @@ function Shield:CountShield(damage, atkRole,skill) end elseif self.shieldType == ShieldTypeName.AllReduce then --攻击者免疫无敌盾 - if atkRole.isImmuneAllReduceShield and skill then + isImmuneAllReduceShield=atkRole.isImmuneAllReduceShield + --特殊处理 白骨精附加的普攻不会必定暴击 + if atkRole.roleId==10091 and skill and skill.type==BattleSkillType.Normal and skill.isAdd then + isImmuneAllReduceShield=false + end + if isImmuneAllReduceShield and skill then finalDamage=damage else finalDamage = 0 @@ -78,7 +84,7 @@ function Shield:CountShield(damage, atkRole,skill) -- -- self.caster.Event:DispatchEvent(BattleEventName.ShildTrigger, self) - self.target.Event:DispatchEvent(BattleEventName.ShildTrigger, self,atkRole) + self.target.Event:DispatchEvent(BattleEventName.ShildTrigger, self,isImmuneAllReduceShield) BattleLogic.Event:DispatchEvent(BattleEventName.ShildTrigger, self) return finalDamage diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index f9aa664cac..bab1e83f46 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -594,9 +594,14 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i -- 是否暴击: 暴击率 = 自身暴击率 - 对方抗暴率 local bCrit = false local critRandom = Random.Range01() + --特殊处理 白骨精附加的普攻不会必定暴击 + local mustCrit=atkRole.mustCrit + if atkRole.roleId==10091 and skill and skill.type==BattleSkillType.Normal and skill.isAdd then + atkRole.mustCrit=false + end local critCondition = clamp(atkRole:GetRoleData(RoleDataName.Crit) - defRole:GetRoleData(RoleDataName.Tenacity), 0, 1) bCrit = critRandom <= critCondition - bCrit =atkRole.mustCrit or bCrit or defRole.isFlagCrit == true -- 必定暴击 + bCrit =mustCrit or bCrit or defRole.isFlagCrit == true -- 必定暴击 -- 计算暴伤害系数 local critDamageFactor = 1 @@ -727,16 +732,18 @@ end -- 检测命中 -function BattleUtil.CheckIsHit(atkRole, defRole) +function BattleUtil.CheckIsHit(atkRole, defRole,skill) -- 是否命中: 命中 = 自身命中率 - 对方闪避率 local isHit = false - if atkRole.mustHit then - return true + local mustHit = atkRole.mustHit + --特殊处理 白骨精附加的普攻不会必定暴击 + if atkRole.roleId==10091 and skill and skill.type==BattleSkillType.Normal and skill.isAdd then + mustHit=false end local hitRandom = Random.Range01() local hitCondition = clamp(atkRole:GetRoleData(RoleDataName.Hit) - defRole:GetRoleData(RoleDataName.Dodge), 0, 1) isHit = hitRandom <= hitCondition - return isHit + return mustHit or isHit end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua index ed7fcf221f..3223ec9bc6 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua @@ -344,9 +344,9 @@ end -- 盾效果触发 -function EnemyView:OnShieldTrigger(shield,atkRole) +function EnemyView:OnShieldTrigger(shield,isImmuneAllReduceShield) if shield.shieldType == ShieldTypeName.AllReduce then - if atkRole and not atkRole.isImmuneAllReduceShield then + if atkRole and not isImmuneAllReduceShield then self.Floater:ImageBuffFloating("z_zhandou_wudizi") end else diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua index 0ef0e5e36a..0fb2959604 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua @@ -388,9 +388,9 @@ end -- 盾效果触发 -function PlayerView:OnShieldTrigger(shield,atkRole) +function PlayerView:OnShieldTrigger(shield,isImmuneAllReduceShield) if shield.shieldType == ShieldTypeName.AllReduce then - if atkRole and not atkRole.isImmuneAllReduceShield then + if atkRole and not isImmuneAllReduceShield then self.Floater:ImageBuffFloating("z_zhandou_wudizi") end else diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/RoleView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/RoleView.lua index 757c123771..865d8c872b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/RoleView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/RoleView.lua @@ -440,9 +440,9 @@ end -- 盾效果触发 -function RoleView:OnShieldTrigger(shield,atkRole) +function RoleView:OnShieldTrigger(shield,isImmuneAllReduceShield) if shield.shieldType == ShieldTypeName.AllReduce then - if atkRole and not atkRole.isImmuneAllReduceShield then + if atkRole and not isImmuneAllReduceShield then self.Floater:ImageBuffFloating("z_zhandou_wudizi") end else