From 0e23ca3cf826fa8dd8e19c5734d1fbcb3a0cc700 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Thu, 25 Feb 2021 19:48:24 +0900 Subject: [PATCH] =?UTF-8?q?[=E6=88=98=E6=96=97]=3D=3D=3D=3D=3D=3D=3D=20202?= =?UTF-8?q?1-0303=E5=8F=91=E5=B8=83=E8=AE=A1=E5=88=92=20=E6=88=98=E6=96=97?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Battle/Logic/Base/Passivity.lua | 110 ++++++++++-------- .../Modules/Battle/Logic/Misc/BattleUtil.lua | 2 +- .../Modules/Battle/Logic/Role/RoleLogic.lua | 13 +++ 3 files changed, 76 insertions(+), 49 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index ac098a0586..466a9f3877 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -1807,12 +1807,12 @@ local passivityList = { local onSkillEnd = function(skill) if skill and not skill.isTriggerJudge and judge==1 then return - end - if skill.type == BattleSkillType.Special then - for i = 1, i1 do - role:AddSkill(BattleSkillType.Normal, false, true, nil) + end + if skill.type == BattleSkillType.Special then + for i = 1, i1 do + role:AddSkill(BattleSkillType.Normal, false, true, nil) + end end - end end role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd) end, @@ -2089,7 +2089,7 @@ local passivityList = { if skill and skill.type== BattleSkillType.Extra and skill.owner.roleId==10015 and judge==1 then return end - if skill and skill.type==BattleSkillType.Special then + if skill and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Normal) then local dd = BattleUtil.CountValue(damage, f1, ct) - damage if func then func(-floor(BattleUtil.ErrorCorrection(dd))) end end @@ -2184,7 +2184,7 @@ local passivityList = { af = af + f1 end end - role.Event:AddEvent(BattleEventName.SkillCast, onSkillCast) + role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillCast) -- 如果是技能的伤害则判断加成 local onPassiveDamaging = function(func, target, damage, skill) @@ -2456,26 +2456,27 @@ local passivityList = { deadNum = deadNum + 1 if deadNum >= i1 then deadNum = 0 - extra = extra + f1 - -- local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, ct2) - -- role:AddBuff(buff) + --extra = extra + f1 + --处理混乱后普攻不触发任何特性问题改成加buff 王振兴 2021/02/25 + local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[5], f1, ct2) + role:AddBuff(buff) end end end BattleLogic.Event:AddEvent(BattleEventName.BattleRoleDead, OnDead) - local passivityDamaging = function(func, caster, damage, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end - if skill then - if func then - local dd = BattleUtil.CountValue(damage, extra, ct2) - damage - func(-floor(BattleUtil.ErrorCorrection(dd))) - end - end - end - role.Event:AddEvent(BattleEventName.PassiveDamaging, passivityDamaging) + -- local passivityDamaging = function(func, caster, damage, skill) + -- if skill and not skill.isTriggerJudge and judge==1 then + -- return + -- end + -- if skill then + -- if func then + -- local dd = BattleUtil.CountValue(damage, extra, ct2) - damage + -- func(-floor(BattleUtil.ErrorCorrection(dd))) + -- end + -- end + -- end + -- role.Event:AddEvent(BattleEventName.PassiveDamaging, passivityDamaging) end, -- 直接伤害每次击杀目标增加自身伤害[a]%,[b]改变,可叠加持续至战斗结束 @@ -2493,37 +2494,39 @@ local passivityList = { return end if skill and defRole:IsDead() and not BattleUtil.CheckIsNoDead(defRole) then - killNum = killNum + 1 + -- killNum = killNum + 1 + local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[5], f1, ct) + role:AddBuff(buff) end end role.Event:AddEvent(BattleEventName.RoleHit, OnRoleHit) -- 释放技能时计算额外伤害 - local OnSkillCast = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end - if skill then - extra = f1 * killNum - end - end - role.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast) + -- local OnSkillCast = function(skill) + -- if skill and not skill.isTriggerJudge and judge==1 then + -- return + -- end + -- if skill then + -- extra = f1 * killNum + -- end + -- end + -- role.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast) - -- 造成伤害时判断额外伤害 - local passivityDamaging = function(func, caster, damage, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end - if skill then - if func then - local dd = BattleUtil.CountValue(damage, extra, ct) - damage - func(-floor(BattleUtil.ErrorCorrection(dd))) - end - end - end - role.Event:AddEvent(BattleEventName.PassiveDamaging, passivityDamaging) + -- -- 造成伤害时判断额外伤害 + -- local passivityDamaging = function(func, caster, damage, skill) + -- if skill and not skill.isTriggerJudge and judge==1 then + -- return + -- end + -- if skill then + -- if func then + -- local dd = BattleUtil.CountValue(damage, extra, ct) - damage + -- func(-floor(BattleUtil.ErrorCorrection(dd))) + -- end + -- end + -- end + -- role.Event:AddEvent(BattleEventName.PassiveDamaging, passivityDamaging) end, @@ -3093,6 +3096,9 @@ local passivityList = { if skill and not skill.isTriggerJudge and judge==1 then return end + if target:CheckHavePassive(144) then + return + end --白骨精追加普攻不触发特性 if skill and judge==1 and skill.type== BattleSkillType.Normal and skill.isAdd and skill.owner.roleId==10091 then return @@ -4129,9 +4135,9 @@ local passivityList = { BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, onRoundChange) - local function onFinalBeDamage(damagingFunc, atkRole, damage, skill, dotType, bCrit, damageType) + local function onFinalBeDamage(damagingFunc, atkRole, damage, skill, dotType, bCrit, damageType,isDirect) -- 非直接伤害不免除 - if not skill then + if not skill and not isDirect then return end -- @@ -5202,6 +5208,7 @@ local passivityList = { -- a[float] [249] = function(role, args,id,judge) local f1 = args[1] + local round = 0 -- 释放技能后 local onRoleHit = function(target,damage, bCrit, finalDmg, damageType, skill) if skill and not skill.isTriggerJudge and judge==1 then @@ -5211,6 +5218,13 @@ local passivityList = { if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return end + local curRound=BattleLogic.GetCurRound() + --每个回合只会生效一次 + if curRound>round then + round=curRound + else + return + end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then local buff = Buff.Create(role, BuffName.PropertyChange, 1, RoleDataName.Crit, f1, CountTypeName.Add) role:AddBuff(buff) @@ -6653,7 +6667,7 @@ local passivityList = { local f2=args[2] local onRoleHit = function(deadRole) BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function () - if deadRole.camp~=role.camp then + if deadRole.camp~=role.camp then role:InsertExtraSkill(f1,f2) end end) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index 2e7981c913..2d86a93e75 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -563,7 +563,7 @@ function BattleUtil.ApplyDamage(skill, atkRole, defRole, damage, bCrit, damageTy end atkRole.Event:DispatchEvent(BattleEventName.FinalDamage, damagingFunc, defRole, damage, skill, dotType, bCrit, damageType) defRole.Event:DispatchEvent(BattleEventName.FinalBeDamage, damagingFunc, atkRole, damage, skill, dotType, bCrit, damageType) - defRole.Event:DispatchEvent(BattleEventName.FinalBeDamageEnd, damagingFunc, atkRole, damage, skill, dotType, bCrit, damageType) + defRole.Event:DispatchEvent(BattleEventName.FinalBeDamageEnd, damagingFunc, atkRole, damage, skill, dotType, bCrit, damageType,isDirect) BattleLogic.Event:DispatchEvent(BattleEventName.FinalDamage, damagingFunc, atkRole, defRole, damage, skill, dotType, bCrit, damageType) -- diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua index 32dad4a356..313007cc1f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua @@ -126,6 +126,19 @@ function RoleLogic:CanCastSkill() return self.sp >= self.spPass and not self.IsDebug end +--检测是否有某被动 +function RoleLogic:CheckHavePassive(id) + if self.passiveList then + for index, value in ipairs(self.passiveList) do + if value and value[1] and value[1]==id then + return true + end + end + return false + end + return false +end + -- 废弃的方法 function RoleLogic:GetSkillCD() return max(self.spPass - self.sp, 0)