From 889a49576c870b3121960b20c5e305a244bff4bd Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Thu, 9 Dec 2021 14:25:02 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E3=80=90=E6=88=98=E6=96=97=E3=80=91=3D=3D?= =?UTF-8?q?=3D=3D=3D=3D=3D=E7=AC=AC=E4=BA=94=E6=9C=9F=E7=A5=9E=E9=AD=82?= =?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/Logic/Base/Buff.lua | 1 + .../Modules/Battle/Logic/Base/Passivity.lua | 399 +++++++++++++++++- .../Modules/Battle/Logic/Buff/BreakArmor.lua | 33 ++ .../Battle/Logic/Buff/BreakArmor.lua.meta | 7 + .../Battle/Logic/Misc/BattleDefine.lua | 6 + .../Modules/Battle/Logic/Misc/BattleUtil.lua | 36 +- .../Modules/Battle/View/Unit/BuffCtrl.lua | 26 +- .../Modules/Battle/View/Unit/BuffView.lua | 1 + 8 files changed, 496 insertions(+), 13 deletions(-) create mode 100644 Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua create mode 100644 Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua.meta diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua index 9163929c02..c6afb2ecd1 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua @@ -19,6 +19,7 @@ local BuffRegister = { [BuffName.BanBlood] = "BanBlood", [BuffName.SigilSign] = "SigilSign", [BuffName.CommonSign] = "CommonSign", + [BuffName.BreakArmor] = "BreakArmor", } diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index 2687eb5343..10bb34986f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -5839,13 +5839,17 @@ local passivityList = { end role.Event:AddEvent(BattleEventName.SkillCastEnd, OnRoleHit,nil,nil,role) end, - -- 每释放[a]次技能,[b]增加[c]%,可叠加[d]次(d 填0为可叠加无数次) - -- a[int] b[int] c[float] d[int] + -- 每释放[a]次技能,[b]增加[c]%,可叠加[d]次(d 填0为可叠加无数次),[e]属性增加[f]%,[g]属性增加[h]% + -- a[int] b[int] c[float] d[int] e[int] f[float] g[int] h[float] (e,g,g h 不填不添加) [262] = function(role, args,id,judge) local num = args[1] local pro = args[2] local val = args[3] local time = args[4] + local p1 = args[5] + local v1 = args[6] + local p2 = args[7] + local v2 = args[8] local releaseNum=0 local addNum=0 -- 释放技能后 @@ -5860,7 +5864,16 @@ local passivityList = { --role.data:AddValue(BattlePropList[pro],val) local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], val,CountTypeName.Add) role:AddBuff(buff) + if p1~=nil and v1~=nil then + local buff1 = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[p1], v1,CountTypeName.Add) + role:AddBuff(buff1) + end + if p2~=nil and v2~=nil then + local buff2 = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[p2], v2,CountTypeName.Add) + role:AddBuff(buff2) + end addNum=addNum+1 + end end end @@ -10169,6 +10182,388 @@ local passivityList = { role.Event:AddEvent(BattleEventName.BuffCaster, OnBuffStart,nil,nil,role) end, + --被自身添加[a]类型[b]效果的目标,有[c]%概率无法改变[d]怒气 + --a[int],b[int],c[float] + [402]=function(role, args,id,judge) + local t1=args[1] + local t2=args[2] + local pro=args[3] + local ct=args[4] + local onRageChange=function(func,caster,target,value,type) + if target.camp==role.camp then + return + end + if ct~=type then + return + end + if BattleLogic.BuffMgr:HasBuff(target, t1, function (buff) return buff.damageType == t2 and buff.caster==role end ) then + BattleUtil.RandomAction(pro,function() + if func then + func(0) + end + end) + end + end + BattleLogic.Event:AddEvent(BattleEventName.ChangeRoleRage,onRageChange,nil,nil,role) + + end, + --暴击伤害改变[a] [b]%+[c]%*([d]+目标身上[e]类型[f]状态buff层数) + --a[int],b[float],c[float],d[int],e[int],f[int] + [403]=function(role,args,id,judge) + local ct=args[1] + local v1=args[2] + local v2=args[3] + local v3=args[4] + local t1=args[5] + local t2=args[6] + + local addCritDamageFa=function(func,atkRole,defRole) + local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.target==defRole and buff.type==t1 and buff.damageType==t2 end) + local len=BattleUtil.LengthOfTable(list) + if func then + func(v1+v2*(v3+len),ct) + end + end + role.Event:AddEvent(BattleEventName.PassiveAddCritDamageFactor,addCritDamageFa,nil,nil,role) + end, + --直接伤害攻击的目标不足[a]人,爆伤改变[b][c]%,目标达到[d]人额外增加自身[e]点怒气 + --a[int],b[int],c[float],d[int],e[int] + [404]=function(role,args,id,judge) + local v1=args[1] + local ct=args[2] + local v2=args[3] + local v3=args[4] + local v4=args[5] + + local addCritDamageFa=function(func,atkRole,defRole,skill) + if not skill then + return + end + local list = skill:GetDirectTargetsNoExile() + if #list=v3 then + BattleUtil.CalRage(role,role,v4,CountTypeName.Add) + end + end + role.Event:AddEvent(BattleEventName.SkillCastEnd,onSkillEnd,nil,nil,role) + end, + --敌方处于[a]类型[b]状态的单位死亡,自身立即获得全场[c]状态[d]类型buff层数*[e]的怒气 + --a[int],b[int],c[int],d[int],e[float] + [405]=function(role,args,id,judge) + local t1=args[1] + local t2=args[2] + local t3=args[3] + local t4=args[4] + local v1=args[5] + local onRoleDead=function(defRole, atkRole) + + if defRole and defRole.camp==role.camp then + return + end + if BattleLogic.BuffMgr:HasBuff(defRole, t1, function (buff) return buff.damageType == t2 end ) then + local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.type==t1 and buff.damageType==t2 end) + local len=BattleUtil.LengthOfTable(list) + local num= floor(v1*len) + BattleUtil.CalRage(role,role,num,CountTypeName.Add) + end + end + BattleLogic.Event:AddEvent(BattleEventName.BattleRoleDead,onRoleDead,nil,nil,role) + end, + --第[a]回合必定命中 + --a[int] + [406]=function(role,args,id,judge) + local v1=args[1] + local lastHit=false + BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, function(curRound) + -- 第i1回合开始 + if curRound == v1 then + lastHit=role.mustHit + role.mustHit=true + end + -- 第i1+i2回合结束 + if curRound == v1+1 then + role.mustHit=lastHit + end + end,nil,nil,role) + end, + --每次释放技能触发一次[a]类型[b]状态,无视目标[a]%的护甲和[b]%的减伤,期间被控制破解状态解除,破甲叠到[c]层后破甲不可解除 + -- a[int],b[int],c[float],d[float],e[int] + [407]=function(role,args,id,judge) + local t1=args[1] + local t2=args[2] + local v1=args[3] + local v2=args[4] + local num=args[5] + --添加破甲 + local onSkillCastEnd=function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end + if skill.type~=BattleSkillType.Special and skill.type~=BattleSkillType.Extra and skill.type~=BattleSkillType.DeadSkill then + return + end + local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.target==role and buff.type==t1 and buff.signType==t2 end) + local len=BattleUtil.LengthOfTable(list) + if len>=num then + return + end + local buff=Buff.Create(role,t1,0,t2) + role:AddBuff(buff) + end + role.Event:AddEvent(BattleEventName.SkillCastEnd,onSkillCastEnd,nil,nil,role) + + --移除破甲 + local buffBeAdd=function(buff) + if buff.type== BuffName.Control then + local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.target==role and buff.type==t1 and buff.signType==t2 end) + local len=BattleUtil.LengthOfTable(list) + if len>=num then + return + end + BattleLogic.BuffMgr:ClearBuff(role, function(buff) + return buff.type==t1 and buff.signType==t2 + end) + end + end + role.Event:AddEvent(BattleEventName.BuffBeAdd, buffBeAdd,nil,nil,role) + + local ignoreDef=function(func) + if BattleLogic.BuffMgr:HasBuff(role,t1, function (buff) return buff.signType==t2 end ) then + if func then + func(v1,CountTypeName.Add) + end + end + end + role.Event:AddEvent(BattleEventName.PassiveChangeIgnoreDef,ignoreDef,nil,nil,role) + + local addDMGFac=function(func) + if BattleLogic.BuffMgr:HasBuff(role,t1, function (buff) return buff.signType==t2 end ) then + if func then + func(v2,CountTypeName.Add) + end + end + end + role.Event:AddEvent(BattleEventName.PassiveChangeAddDMGFac,addDMGFac,nil,nil,role) + end, + --被自身添加[a]类型[b]效果的目标,己方[c]系神将对其暴击率改变[d][e]%,命中改变[f][g]% + --a[int],b[int],c[int],d[int],e[float],f[float] + [408]=function(role, args,id,judge) + local t1 = args[1] + local t2 = args[2] + local ele = args[3] + local ct = args[4] + local v1 = args[5] + local ct2 = args[6] + local v2 = args[7] + local changeCrit=function(func,atkRole,defRole,skill) + if atkRole.camp~=role.camp or atkRole.element~=ele then + return + end + if not BattleLogic.BuffMgr:HasBuff(defRole, t1, function (buff) return buff.ctrlType==t2 and buff.caster==role end) then + return + end + if func then + func(v1,ct) + end + end + BattleLogic.Event:AddEvent(BattleEventName.TemporaryChangeCrit,changeCrit,nil,nil,role) + + local changeRoleHit=function(func,atkRole,defRole) + if atkRole.camp~=role.camp or atkRole.element~=ele then + return + end + if not BattleLogic.BuffMgr:HasBuff(defRole, t1, function (buff) return buff.ctrlType==t2 and buff.caster==role end) then + return + end + if func then + func(v2,ct2) + end + end + BattleLogic.Event:AddEvent(BattleEventName.PassiveChangeRoleHit,changeRoleHit,nil,nil,role) + end, + --释放技能后有本次被添加[a]类型[b]效果的目标数量*10/100的几率 额外控制[c]属性最[d]且没被控制的目标[e]回合 + --a[int],b[int],c[int],d[int 0:高 1:低] + [409]=function(role, args,id,judge) + local t1=args[1] + local t2=args[2] + local p1=args[3] + local sort=args[4] + local r1=args[5] + local onCastEnd=function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end + if skill.type~=BattleSkillType.Special and skill.type~=BattleSkillType.Extra and skill.type~=BattleSkillType.DeadSkill then + return + end + local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.caster==role and buff.type==t1 and buff.ctrlType==t2 and buff.startRound == BattleLogic.GetCurRound() end) + local len=BattleUtil.LengthOfTable(list) + + if len>0 then + local list=RoleManager.Query(function(target) + if not BattleLogic.BuffMgr:HasBuff(target, t1, function (buff) return buff.ctrlType==t2 end) then + return true + end + end) + if #list>0 then + list = BattleUtil.SortByProp(list, BattlePropList[p1],sort) + if list[1]~=nil then + BattleUtil.RandomControl(len*10/100,t2,role,list[1],r1) + end + end + end + end + role.Event:AddEvent(BattleEventName.SkillCastEnd,onCastEnd,nil,nil,role) + end, + --每次释放技能给敌方所有未处于控制[a]类型的敌人添加[b]类型[c]状态效果,每层效果提高控制概率[d]%,(效果最多叠加[e]层)被控制后状态消失,每层消失额外造成目标[f]属性[g]%的伤害 + --a[int],b[int],c[int],d[float],e[int],f[int],g[float] + [410]=function(role,args,id,judge) + local t1=args[1] + local t2=args[2] + local t3=args[3] + local p1=args[4] + local num=args[5] + local pro=args[6] + local v1=args[7] + --添加buff + local onCastEnd=function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end + if skill.type~=BattleSkillType.Special and skill.type~=BattleSkillType.Extra and skill.type~=BattleSkillType.DeadSkill then + return + end + local list=RoleManager.Query(function(target) + if not BattleLogic.BuffMgr:HasBuff(target, BuffName.Control, function (buff) return buff.ctrlType==t1 end) and target.camp~=role.camp then + return true + end + end) + if #list>0 then + for i = 1, #list do + local list2=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.type==t2 and buff.signType==t3 end) + local len=BattleUtil.LengthOfTable(list2) + if len0 then + if func then + func(p1*len,CountTypeName.Add) + end + end + end + BattleLogic.Event:AddEvent(BattleEventName.PassiveBeRandomControl,changeRoleHit,nil,nil,role) + + --移除破甲 + local buffBeAdd=function(caster,target,buff) + if caster.camp==role.camp and buff.type== BuffName.Control and buff.ctrlType==t1 then + BattleLogic.BuffMgr:ClearBuff(target, function(buff) + return buff.type==t2 and buff.signType==t3 + end) + end + end + BattleLogic.Event:AddEvent(BattleEventName.RecordBuff, buffBeAdd,nil,nil,role) + + local onBuffEnd=function(buff) + if buff.caster==role and buff.type==t2 and buff.signType==t3 then + local isBoss=BattleUtil.CheckIsBoss(buff.target) + if isBoss and pro==12 then + return + end + local damage=floor(BattleUtil.FP_Mul(v1, buff.target:GetRoleData(BattlePropList[pro]))) + BattleUtil.FinalDamageCountShield(nil,role,buff.target,damage) + end + end + BattleLogic.Event:AddEvent(BattleEventName.BuffEnd,onBuffEnd,nil,nil,role) + end, + --每次释放技能未被添加[a]类型[b]效果的敌方,添加[c]类型[d]效果,每层效果添加概率改变[e][f]%,被控制后清除效果 + --a[int],b[int],c[int],d[int],e[int],f[flaot] + [411]=function(role,args,id,judge) + local t1=args[1] + local t2=args[2] + local t3=args[3] + local t4=args[4] + local ct=args[5] + local v1=args[6] + --添加buff + local onCastEnd=function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end + if skill.type~=BattleSkillType.Special and skill.type~=BattleSkillType.Extra and skill.type~=BattleSkillType.DeadSkill then + return + end + local list=RoleManager.Query(function(target) + if not BattleLogic.BuffMgr:HasBuff(target,t1, function (buff) return buff.ctrlType==t2 end) and target.camp~=role.camp then + return true + end + end) + if #list>0 then + for i = 1, #list do + local buff=Buff.Create(role,t3,0,t4) + list[i]:AddBuff(buff) + end + end + end + role.Event:AddEvent(BattleEventName.SkillCastEnd,onCastEnd,nil,nil,role) + + --增加命中 + local changeRoleHit=function(func,ctrl,atkRole,defRole) + if ctrl~=t2 then + return + end + if atkRole.camp~=role.camp then + return + end + local list2=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.type==t3 and buff.signType==t4 end) + local len=BattleUtil.LengthOfTable(list2) + if len>0 then + if func then + func(v1*len,ct) + end + end + end + BattleLogic.Event:AddEvent(BattleEventName.PassiveBeRandomControl,changeRoleHit,nil,nil,role) + + --移除破甲 + local buffBeAdd=function(caster,target,buff) + if caster.camp==role.camp and buff.type== t1 and buff.ctrlType==t2 then + BattleLogic.BuffMgr:ClearBuff(target, function(buff) + return buff.type==t3 and buff.signType==t4 + end) + end + end + BattleLogic.Event:AddEvent(BattleEventName.RecordBuff, buffBeAdd,nil,nil,role) + end, + + } return passivityList \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua new file mode 100644 index 0000000000..719b504691 --- /dev/null +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua @@ -0,0 +1,33 @@ +BreakArmor = Buff:New() + +--初始化Buff,通过传入一些自定义参数控制成长相关的数值 +function BreakArmor:SetData(...) + self.signType=... + -- 刷新排序等级 + self.sort = 4 +end + + +--初始化后调用一次 +function BreakArmor:OnStart() + + +end + +--间隔N帧触发,返回true时表示继续触发,返回false立刻触发OnEnd +function BreakArmor:OnTrigger() + return true +end + +--效果结束时调用一次 +function BreakArmor:OnEnd() + + +end + +--只有当cover字段为true时触发,返回true则被新效果覆盖 +function BreakArmor:OnCover(newBuff) + return true +end + +return BreakArmor \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua.meta b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua.meta new file mode 100644 index 0000000000..c2c83a9069 --- /dev/null +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9198aba4ca48104459b33d94513390b6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua index 6ac45927f3..a3b4dbe402 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua @@ -190,6 +190,11 @@ BattleEventName = { PassiveAddCritDamageFactor = indexAdd(), --被动增加爆伤系数 PassiveChangeIgnoreImmuneValue = indexAdd(),--被动修改无视 ImmuneDebuffSuccess = indexAdd(),--免疫debuff成功 + ChangeRoleRage = indexAdd(),--改变角色怒气 + PassiveChangeIgnoreDef = indexAdd(),--被动改变无视防御比例 + PassiveChangeAddDMGFac = indexAdd(),--被动改变增伤比例 + PassiveChangeRoleHit = indexAdd(),--被动改变角色命中 + } BattleMaxFrame = 1000000 @@ -272,6 +277,7 @@ BuffName = { BanBlood = 14, SigilSign = 15, CommonSign = 16, + BreakArmor = 17, } DotType = { diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index 970680500d..eb7b699d46 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -703,11 +703,18 @@ function BattleUtil.CalRage(caster, target, value, countType,isBorrow) if (countType==3 or countType==4) and target.RoundMaxSubRage~=0 and value+target.AllSubRage>target.RoundMaxSubRage then value=target.RoundMaxSubRage-target.AllSubRage end + local changeRage=function(num) + value=num + end + BattleLogic.Event:DispatchEvent(BattleEventName.ChangeRoleRage,changeRage,caster,target,value,countType) -- 操作怒气 local deltaRage = target:AddRage(value, countType) if (countType==3 or countType==4) and target.RoundMaxSubRage~=0 then target.AllSubRage=target.AllSubRage-deltaRage end + if value==0 then + return + end caster.Event:DispatchEvent(BattleEventName.RecordRageChange, caster, target, deltaRage,countType,value,lastRage,isBorrow) BattleLogic.Event:DispatchEvent(BattleEventName.RecordRageChange, caster, target, deltaRage,countType,value,lastRage,isBorrow) -- 用于记录统计 @@ -972,17 +979,26 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i else defence = defRole:GetRoleData(RoleDataName.MagicDefence) end + if ignoreDef==nil then + ignoreDef=0 + end -- 攻击力 local attack = atkRole:GetRoleData(RoleDataName.Attack)+atkRole.addAttack + local ignoreFunc=function(v1,ct) + ignoreDef=BattleUtil.CountValue(ignoreDef,v1,ct) + end + atkRole.Event:DispatchEvent(BattleEventName.PassiveChangeIgnoreDef,ignoreFunc) -- 无视防御系数 ignoreDef = 1 - (ignoreDef or 0) -- 基础伤害 = 攻击力 - 防御力 baseDamage = max(attack - BattleUtil.FP_Mul(2,defence, ignoreDef), 0) - -- 基础伤害增加系数 local addDamageFactor = 1 + atkRole:GetRoleData(RoleDataName.DamageBocusFactor) - defRole:GetRoleData(RoleDataName.DamageReduceFactor) - + local addDMGFac=function(v1,ct) + addDamageFactor=BattleUtil.CountValue(addDamageFactor,v1,ct) + end + atkRole.Event:DispatchEvent(BattleEventName.PassiveChangeAddDMGFac,addDMGFac) -- 计算暴伤害系数 local critDamageFactor = 1 local critDamageReduceFactor = 0 -- 暴击伤害减免 @@ -995,9 +1011,9 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i table.insert(cl, {v, ct}) end end - atkRole.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole) - defRole.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole) - BattleLogic.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole) + atkRole.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole,skill) + defRole.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole,skill) + BattleLogic.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole,skill) critDamageReduceFactor = max(BattleUtil.CountChangeList(critDamageReduceFactor, cl), 0) local critDamageAddFactor=0 @@ -1008,7 +1024,7 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i table.insert(cl2, {v, ct}) end end - atkRole.Event:DispatchEvent(BattleEventName.PassiveAddCritDamageFactor, onCritDamageAddFactor, atkRole, defRole) + atkRole.Event:DispatchEvent(BattleEventName.PassiveAddCritDamageFactor, onCritDamageAddFactor, atkRole, defRole,skill) critDamageAddFactor = max(BattleUtil.CountChangeList(critDamageAddFactor, cl2), 0) -- 计算额外暴击伤害 critDamageFactor = 1.3 + atkRole:GetRoleData(RoleDataName.CritDamageBonus) - defRole:GetRoleData(RoleDataName.CritDamageReduce)+critDamageAddFactor - critDamageReduceFactor @@ -1221,7 +1237,12 @@ function BattleUtil.CheckIsHit(atkRole, defRole,skill) mustHit=false end local hitRandom = Random.Range01() - local hitCondition = clamp(atkRole:GetRoleData(RoleDataName.Hit) - defRole:GetRoleData(RoleDataName.Dodge), 0, 1) + local addHit=0 + local addHitFunc=function(v1,ct) + addHit=BattleUtil.CountValue(addHit,v1,ct) + end + BattleLogic.Event:DispatchEvent(BattleEventName.PassiveChangeRoleHit,addHitFunc,atkRole,defRole) + local hitCondition = clamp(atkRole:GetRoleData(RoleDataName.Hit)+addHit - defRole:GetRoleData(RoleDataName.Dodge), 0, 1) isHit = hitRandom <= hitCondition return mustHit or isHit end @@ -1271,6 +1292,7 @@ function BattleUtil.RandomControl(rand, ctrl, caster, target, round,skill) end caster.Event:DispatchEvent(BattleEventName.PassiveRandomControl, _CallBack, ctrl, target) target.Event:DispatchEvent(BattleEventName.PassiveBeRandomControl, _CallBack, ctrl, target) + BattleLogic.Event:DispatchEvent(BattleEventName.PassiveBeRandomControl, _CallBack, ctrl,caster,target) rand = BattleUtil.CountChangeList(rand, cl) local buff = Buff.Create(caster, BuffName.Control, round, ctrl) local isAdd=BattleUtil.RandomAction(rand, function() diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua index 989c48c17d..b48d557971 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua @@ -14,6 +14,7 @@ local BuffTypeToConfigType = { [BuffName.BanBlood] = 11, [BuffName.SigilSign] = 12, [BuffName.CommonSign] = 13, + [BuffName.BreakArmor] = 14, } local function _GetPropChangeBuffCType(pName) for cType, pn in ipairs(BattlePropList) do @@ -57,8 +58,11 @@ local function _GetBuffEffectConfig(buff) elseif bType==BuffName.SigilSign then cType = 1 elseif bType==BuffName.CommonSign then - cType = 1 - + cType = 1 + elseif bType==BuffName.BreakArmor then + cType=buff.signType + else + cType = 1 end local type = BuffTypeToConfigType[bType] @@ -242,6 +246,11 @@ function BuffCtrl:AddBuffIcon(buff, icon) self.BuffIconList[key]:SetCount(self.BuffIconList[key].count+1) return end + elseif buffType ==BuffName.BreakArmor then + if self.BuffIconList[key].buffSignType==currBuff.signType then + self.BuffIconList[key]:SetCount(self.BuffIconList[key].count+1) + return + end end end end @@ -333,8 +342,17 @@ function BuffCtrl:RemoveBuffIcon(buff) return end elseif buffType == BuffName.Curse then - if self.BuffIconList[key].curseType==buff.curseType then - + if self.BuffIconList[key].curseType==buff.curseType then + if floor==1 then + self.BuffIconList[key]:Dispose() + self.BuffIconList[key] = nil + else + self.BuffIconList[key]:SetCount(floor-1) + end + return + end + elseif buffType == BuffName.BreakArmor then + if self.BuffIconList[key].buffSignType==buff.signType then if floor==1 then self.BuffIconList[key]:Dispose() self.BuffIconList[key] = nil diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffView.lua index 37ccf9f3b2..d69767edd2 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffView.lua @@ -16,6 +16,7 @@ function BuffView.New(go, buff, icon) instance.healValue = buff.healValue instance.immuneType = buff.immuneType instance.curseType = buff.curseType + instance.buffSignType = buff.signType instance.levelText = Util.GetGameObject(go, "level"):GetComponent("Text") instance.layerText = Util.GetGameObject(go, "layer"):GetComponent("Text") instance.roundText = Util.GetGameObject(go, "round"):GetComponent("Text") From 6f3774c030c0f8e3d075508b4a7041dce15e020a Mon Sep 17 00:00:00 2001 From: gaoxin Date: Thu, 9 Dec 2021 18:04:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E3=80=90=E4=BA=91=E6=A2=A6=E7=A5=88?= =?UTF-8?q?=E7=A6=8F=E3=80=91=E4=B8=8D=E5=86=8D=E8=AF=B7=E6=B1=82=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/ActivityGift/ActivityGiftManager.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua b/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua index 6ebbc4905f..6c4f6a2cf4 100644 --- a/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua @@ -234,10 +234,10 @@ end function this.CheckActiveIsOpen(data) local globalActivityData = GlobalActivity[data.activityId] if globalActivityData then - if globalActivityData.Type == ActivityTypeDef.Pray then - --云梦活动开启 请求数据 - NetManager.InitPrayDataRequest() - end + -- if globalActivityData.Type == ActivityTypeDef.Pray then + -- --云梦活动开启 请求数据 + -- NetManager.InitPrayDataRequest() + -- end end end From ffe01ddf1619a30414b28ce5e1f98270204da1be Mon Sep 17 00:00:00 2001 From: gaoxin Date: Thu, 9 Dec 2021 18:05:47 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E3=80=90=E5=BC=95=E5=AF=BC=E6=88=98?= =?UTF-8?q?=E6=96=97=E3=80=91=E6=B7=BB=E5=8A=A0=E6=A0=B9=E6=8D=AE=E4=B8=BB?= =?UTF-8?q?=E8=A7=92=E9=87=8A=E6=94=BE=E6=8A=80=E8=83=BD=E6=AC=A1=E6=95=B0?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=AF=B9=E8=AF=9D=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/View/BattleView.lua | 9 ++++ .../Modules/Battle/View/GuideBattleLogic.lua | 41 +++++++++++++++++++ .../Modules/Battle/View/GuideBattlePanel.lua | 6 +++ 3 files changed, 56 insertions(+) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua index 0bf3d03cfb..0b011f8152 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua @@ -420,6 +420,7 @@ function this.InitBattleEvent() BattleLogic.Event:AddEvent(BattleEventName.BattleRoundEnd, this.BattleRoundEnd) BattleLogic.Event:AddEvent(BattleEventName.RoleTurnStart, this.RoleTurnChange) BattleLogic.Event:AddEvent(BattleEventName.BattleStart, this.OnBattleStart) + BattleLogic.Event:AddEvent(BattleEventName.SkillCastEnd, this.OnSkillCastEnd) end -- 清除战斗数据 @@ -435,6 +436,7 @@ function this.ClearBattleEvent() BattleLogic.Event:RemoveEvent(BattleEventName.BattleRoundEnd, this.BattleRoundEnd) BattleLogic.Event:RemoveEvent(BattleEventName.RoleTurnStart, this.RoleTurnChange) BattleLogic.Event:RemoveEvent(BattleEventName.BattleStart, this.OnBattleStart) + BattleLogic.Event:RemoveEvent(BattleEventName.SkillCastEnd, this.OnSkillCastEnd) end --敌军出现的表现 @@ -505,6 +507,13 @@ function this.OnBattleStart() this.root.OnBattleStart() end end +-- 技能释放完成 +function this.OnSkillCastEnd(skill) + -- 回调UI层 + if this.root.OnSkillCastEnd then + this.root.OnSkillCastEnd(skill) + end +end -- 角色轮转回调(不出手的位置不会回调) function this.RoleTurnChange(role) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattleLogic.lua index 215cae4a9d..b6a6b0695e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattleLogic.lua @@ -6,6 +6,7 @@ function GuideBattleLogic:Init(guideType) end self.guideType = guideType self.configList = ConfigManager.TryGetAllConfigsDataByKey(ConfigName.GuideBattleConfig, "GuideGroup", self.guideType) + self.PlayerSkillCount = {} -- 主角释放技能次数计数器 end @@ -140,4 +141,44 @@ function GuideBattleLogic:OnBattleEnd(func) end end +-- +function GuideBattleLogic:OnSkillCastEnd(skill) + -- 这里只判断主角技能 + if skill.owner.position ~= 100 then + return + end + if not self.PlayerSkillCount[skill.owner.camp] then + self.PlayerSkillCount[skill.owner.camp] = 0 + end + -- 释放技能次数+1 + self.PlayerSkillCount[skill.owner.camp] = self.PlayerSkillCount[skill.owner.camp] + 1 + + -- 没有就不引导了 + if not self.configList or #self.configList <= 0 then + return + end + local _config = nil + for _, con in ipairs(self.configList) do + -- 主角释放技能次数判断 + if con.Round == -4 and con.Camp == skill.owner.camp and con.Turn == self.PlayerSkillCount[skill.owner.camp] then + _config = con + break + end + end + if not _config then + return + end + -- 对话形式的引导 + if _config.TriggerType == 1 then + BattleManager.SetGuidePause(true) + local storyId = _config.TriggerId + StoryManager.EventTrigger(storyId, function() + BattleManager.SetGuidePause(false) + if func then + func() + end + end) + end +end + return GuideBattleLogic \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattlePanel.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattlePanel.lua index b6c5736a5b..91bb6d728e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattlePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattlePanel.lua @@ -170,6 +170,12 @@ function this.OnBattleStart(order) GuideBattleLogic:OnBattleStart() end +-- 技能释放完成 +function this.OnSkillCastEnd(skill) + -- + GuideBattleLogic:OnSkillCastEnd(skill) +end + function this.OnOrderChanged(order) --显示波次