From dad8dbf11b142ee278467777f404d2d7bf8e33c3 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Wed, 7 Jul 2021 15:09:06 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[=E5=85=AC=E4=BC=9A=E7=BA=A2=E5=8C=85]=3D?= =?UTF-8?q?=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=E7=BA=A2=E5=8C=85=E6=8A=A2?= =?UTF-8?q?=E5=AE=8C=E6=98=BE=E7=A4=BA=E7=99=BD=E7=89=87=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Guild/RedPacketView/RedPacketPopup.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacketPopup.lua b/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacketPopup.lua index 86c6b0cbc5..dc2168eba5 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacketPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacketPopup.lua @@ -6,7 +6,7 @@ this.sendPlayerHead={}--发送者头像 --红包资源名 local RedPacketName={"g_ghhb_ming_01_zh","g_ghhb_ming_02_zh","g_ghhb_ming_03_zh","g_ghhb_ming_04_zh"} --红包按钮状态图片 -local BtnStateImage={"g_ghhb_qiang","g_ghhb_lingqu","g_ghhb_lingwan"}--抢 已领取 已领完 +local BtnStateImage={"g_ghhb_qiang","g_ghhb_lingqu","g_ghhb_lingwan_zh"}--抢 已领取 已领完 function RedPacketPopup:InitComponent() this.spLoader = SpriteLoader.New() From f247221fcce991b1e55d941cd5c5061d14910b89 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Wed, 7 Jul 2021 20:29:37 +0800 Subject: [PATCH 2/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=3D=3D=E8=A2=AB=E5=8A=A8104=20=20=20267=20=20319?= =?UTF-8?q?=20=20=20=E4=BF=AE=E6=94=B9=EF=BC=9B=20=20=E6=88=98=E6=96=97?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BF=AE=E6=94=B9=20=20=E5=87=BB=E6=9D=80?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E7=BB=99=E6=95=8C=E4=BA=BA=E4=B8=8Abuff=20?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BAbuff=E5=9B=BE=E6=A0=87=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=EF=BC=88=E9=99=A4=E4=B8=8D=E7=81=AD=E3=80=82=E6=AD=BB?= =?UTF-8?q?=E4=BA=A1=E6=8A=80=E8=83=BD=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Battle/Logic/Base/Passivity.lua | 54 +++++++++++-------- .../Modules/Battle/View/Unit/BuffCtrl.lua | 15 ++++-- 2 files changed, 42 insertions(+), 27 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index 72342eaadb..65041d2192 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -1841,11 +1841,12 @@ local passivityList = { - -- 释放技能后给除自己外己方生命最少的[a]名武将附加无敌盾持续[b]回合(只剩自己则不加) - -- a[int] b[int] + -- 释放技能后给除自己外己方生命最少的[a]名武将附加无敌盾持续[b]回合(只剩自己则不加)无敌盾目标额外添加 [c]点怒气(c不填/填0 不会触发) + -- a[int] b[int] c[int] [104] = function(role, args,id,judge) local i1 = args[1] local num = args[2] + local rageNum = args[3] -- 释放技能后 local onSkillEnd = function(skill) if skill and not skill.isTriggerJudge and judge==1 then @@ -1867,6 +1868,9 @@ local passivityList = { for i = 1, i1 do if heros[i] then heros[i]:AddBuff(Buff.Create(role, BuffName.Shield, num, ShieldTypeName.AllReduce, 0, 0)) + if rageNum and rageNum~=0 then + BattleUtil.CalRage(role,heros[i],rageNum,CountTypeName.Add) + end end end end @@ -1877,7 +1881,7 @@ local passivityList = { - -- 释放技能后增加友方全体[a]点怒气,是否 + -- 释放技能后增加友方全体[a]点怒气 -- a[int] [105] = function(role, args,id,judge) local i1 = args[1] @@ -2425,7 +2429,7 @@ local passivityList = { - -- TODO + -- TODO 后端用被动 会在战前显示 -- 全体蜀国武将增加[a]%[b] -- a[float]b[属性] -- [129] = {}, @@ -5139,7 +5143,6 @@ local passivityList = { -- 紫+橙 local num = OutDataManager.GetOutData(role.camp, id) - --LogError("笔使用次数:"..num) num = min(maxNum, num) BattleUtil.AddProp(role, pro1, f1 * num, ct1) end, @@ -5839,7 +5842,7 @@ local passivityList = { end local num=0 for key, value in pairs(list) do - local isHave=BattleLogic.BuffMgr:HasBuff(value, BuffName.Control, function(buff) return buff.ctrlType == dot and buff.caster==role and buff.startRound == BattleLogic.GetCurRound() end) + local isHave=BattleLogic.BuffMgr:HasBuff(value, BuffName.Control, function(buff) return buff.ctrlType == dot end) if isHave then BattleUtil.CalRage(role, value, i1, CountTypeName.Sub) end @@ -6159,6 +6162,7 @@ local passivityList = { local shieldType = args[3] local ele =args[4] local OnBuffEnd=function(buff) + if buff.caster~=role then return end @@ -6168,6 +6172,7 @@ local passivityList = { if shieldType and buff and buff.type==BuffName.Shield and buff.shieldType~=shieldType then return end + if buff and not buff.target:IsDead() and buff.type==BuffName.Shield then local val = floor(BattleUtil.FP_Mul(v1, buff.target:GetRoleData(BattlePropList[pro]))) BattleUtil.CalTreat(role,buff.target, val) @@ -7237,22 +7242,27 @@ local passivityList = { local v2 = args[2] local OnDead = function(atkRole,skill) - local arr=RoleManager.Query(function(v) return v.camp==role.camp and v~=role end) - local len=#arr - local rage1=role.Rage*v1 - if rage1 Date: Fri, 9 Jul 2021 11:54:02 +0800 Subject: [PATCH 3/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=3D=3D=3D=3D=3D=3D=E8=A2=AB=E5=8A=A8=20108=20=20?= =?UTF-8?q?=20200=20=20=20283=20=20=20322=20=E4=BF=AE=E6=94=B9=20=20=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=A2=AB=E5=8A=A8=20337?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Battle/Logic/Base/EffectCaster.lua | 3 + .../Modules/Battle/Logic/Base/Passivity.lua | 189 +++++++++++++----- .../Modules/Battle/Logic/Misc/BattleUtil.lua | 8 +- .../Modules/Battle/Logic/Role/RoleLogic.lua | 5 +- 4 files changed, 145 insertions(+), 60 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/EffectCaster.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/EffectCaster.lua index 17a70c58c3..ebaa09d592 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/EffectCaster.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/EffectCaster.lua @@ -125,6 +125,9 @@ function EffectCaster:Cast() if count == 0 then count = #arr end + table.sort(arr, function(a, b) + return a.position < b.position + end) -- 全部同时生效 for j=1, count do if arr[j] and not arr[j]:IsRealDead() then diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index 65041d2192..7dc954a67c 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -1960,6 +1960,10 @@ local passivityList = { [108] = function(role, args) local f1 = args[1] local onBeHit = function(caster, damage, bCrit, finalDmg, damageType, skill) + --damagetype为3 是 舍身济世分摊伤害 + if damageType==3 then + return + end --如果角色死亡就不会反弹伤害 if role:IsDead() then return @@ -3898,58 +3902,60 @@ local passivityList = { if not skill then return end - -- 伤害降低 - local finalDamage = BattleUtil.CountValue(damage, f1, ct) - local curHp = role:GetRoleData(RoleDataName.Hp) - --如果敌方忽略分摊就只减伤 - 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 - end - -- 不是致死伤害 - if finalDamage < curHp then - -- 找到除自身外的血量最高的两人 - local list = RoleManager.Query(function(v) - return v.camp == role.camp and v.position ~= role.position - end) - local ff = 1 -- 分摊比 - -- 检测被动对分摊比的影响 - local cl = {} - local function _CallBack(v, ct) - if v then - table.insert(cl, {v, ct}) + --BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime,function() + -- 伤害降低 + local finalDamage = BattleUtil.CountValue(damage, f1, ct) + local curHp = role:GetRoleData(RoleDataName.Hp) + --如果敌方忽略分摊就只减伤 + 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 + end + -- 不是致死伤害 + if finalDamage < curHp then + -- 找到除自身外的血量最高的两人 + local list = RoleManager.Query(function(v) + return v.camp == role.camp and v.position ~= role.position + end) + local ff = 1 -- 分摊比 + -- 检测被动对分摊比的影响 + local cl = {} + local function _CallBack(v, ct) + if v then + table.insert(cl, {v, ct}) + end + end + role.Event:DispatchEvent(BattleEventName.PassiveDamageShare, _CallBack,skill) + atkRole.Event:DispatchEvent(BattleEventName.PassiveDamageBeShare, _CallBack,skill) + ff = BattleUtil.CountChangeList(ff, cl) + + -- 计算分摊伤害 + local fenDamage = finalDamage * ff -- 需要分摊的总伤害 + --根据血量百分比排序 + BattleUtil.SortByHpFactor(list, 0) + local targets = {role, list[1], list[2]} + local fd = floor(BattleUtil.ErrorCorrection(fenDamage/#targets)) -- 每个人需要分摊的伤害 + + -- 自身伤害 + if damagingFunc then + local unFenDamage = floor(BattleUtil.ErrorCorrection(finalDamage * (1 - ff))) -- 不被分摊的伤害 + damagingFunc(floor(BattleUtil.ErrorCorrection(damage - (unFenDamage + fd)))) + end + -- 平分给别人 + if fd > 0 then + for i = 2, #targets do + --不触发被动 + BattleUtil.FinalDamage(nil, atkRole, targets[i], fd, nil, 0, dotType) + end end end - role.Event:DispatchEvent(BattleEventName.PassiveDamageShare, _CallBack,skill) - atkRole.Event:DispatchEvent(BattleEventName.PassiveDamageBeShare, _CallBack,skill) - ff = BattleUtil.CountChangeList(ff, cl) - - -- 计算分摊伤害 - local fenDamage = finalDamage * ff -- 需要分摊的总伤害 - --根据血量百分比排序 - BattleUtil.SortByHpFactor(list, 0) - local targets = {role, list[1], list[2]} - local fd = floor(BattleUtil.ErrorCorrection(fenDamage/#targets)) -- 每个人需要分摊的伤害 - - -- 自身伤害 - if damagingFunc then - local unFenDamage = floor(BattleUtil.ErrorCorrection(finalDamage * (1 - ff))) -- 不被分摊的伤害 - damagingFunc(floor(BattleUtil.ErrorCorrection(damage - (unFenDamage + fd)))) - end - -- 平分给别人 - if fd > 0 then - for i = 2, #targets do - --不触发被动 - BattleUtil.FinalDamage(nil, atkRole, targets[i], fd, nil, 0, dotType) - end - end - end + --end) end role.Event:AddEvent(BattleEventName.FinalBeDamage, onFinalBeDamage,nil,nil,role) @@ -4261,7 +4267,7 @@ local passivityList = { damagingFunc(shareDamage) end -- 分担伤害 - BattleUtil.ApplyDamage(skill, atkRole, role, shareDamage,false,damageType,dotType,true) + BattleUtil.ApplyDamage(skill, atkRole, role, shareDamage,false,3,dotType,true) end end BattleLogic.Event:AddEvent(BattleEventName.FinalDamage, onFinalDamage,nil,nil,role) @@ -6288,7 +6294,9 @@ local passivityList = { if not num then num=1 end + local onSkillCastEnd=function(skill) + local fireNum=0 if skill and not skill.isTriggerJudge and judge==1 then return end @@ -6304,19 +6312,20 @@ local passivityList = { end --查找敌方燃烧数量 if num==10 then - num=0 + fireNum=0 local arr=skill:GetDirectTargets() -- local arr=RoleManager.Query(function (v) return v.camp~=role.camp end) for i = 1, #arr do local aaa=BattleLogic.BuffMgr:HasBuff(arr[i], BuffName.DOT, function (buff) return buff.damageType==1 end,role,1) if aaa then - num=num+1 + fireNum=fireNum+1 end end end list=BattleUtil.SortByRage(list,0) + for i = 1, #list do - if i<=num then + if i<=fireNum then BattleUtil.CalRage(role, list[i], v1, ct) end end @@ -7332,6 +7341,9 @@ local passivityList = { return end if skill and skill.owner==role and (skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra) and target:IsDead() and not BattleUtil.CheckIsNoDead(target) then + if damage~=target.killDamage then + return + end local dmg= floor(BattleUtil.ErrorCorrection((damage-finalDmg)*f1)) if target:IsDead() then allDamage=allDamage+dmg @@ -7739,5 +7751,74 @@ local passivityList = { role.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging,nil,nil,role) end, + -- 直接伤害击杀目标后下回合必定暴击 + -- a[int] + [337] = function(role, args,id,judge) + + local currRound = 1 + local isKill=false + local isRoundCrit=false + -- 释放技能后 + local onRoleHit = function(target,damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end + --如果是技能并且这个被动已经被触发过 return + if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then + return + end + if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then + currRound = BattleLogic.GetCurRound() + isKill=true + if skill then + table.insert(skill.triggerPassivityId,id) + end + end + end + role.Event:AddEvent(BattleEventName.RoleHit, onRoleHit,nil,nil,role) + + local function onRoleDamageAfter(skill) + if isRoundCrit then + role.mustCrit = false + role.Event:RemoveEvent(BattleEventName.SkillCastEnd, onRoleDamageAfter) + end + end + local function onRoleDamageBefore(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end + --最加的普攻不触发这个被动 + if skill.type==BattleSkillType.Normal and skill.isAdd then + return + end + if isRoundCrit then + role.mustCrit = true + role.Event:AddEvent(BattleEventName.SkillCastEnd, onRoleDamageAfter,nil,nil,role) + end + end + role.Event:AddEvent(BattleEventName.SkillCast, onRoleDamageBefore,nil,nil,role) + + + local onRoundChange=function(round2) + if round2==currRound+1 and isKill then + isRoundCrit=true + else + isRoundCrit=false + isKill=false + end + currRound=round2 + end + + BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, onRoundChange,nil,nil,role) + + + local onRoundStart=function(round2) + isKill=false + end + + BattleLogic.Event:AddEvent(BattleEventName.BattleRoundStart, onRoundStart,nil,nil,role) + + + end, } return passivityList \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index a434289bd3..87b5d7024d 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -515,7 +515,7 @@ function BattleUtil.Seckill(skill, atkRole, defRole) local finalDmg = defRole.data:SubValue(RoleDataName.Hp, damage) if finalDmg >= 0 then if defRole:GetRoleData(RoleDataName.Hp) <= 0 and not defRole:IsDead() then - defRole:SetDead() + defRole:SetDead(damage) defRole.Event:DispatchEvent(BattleEventName.RoleDead, atkRole,skill) atkRole.Event:DispatchEvent(BattleEventName.RoleKill, defRole,skill) BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoleDead, defRole, atkRole) @@ -547,7 +547,7 @@ function BattleUtil.SeckillHP(skill, atkRole, defRole, pro) local finalDmg = defRole.data:SubValue(RoleDataName.Hp, damage) if finalDmg >= 0 then if defRole:GetRoleData(RoleDataName.Hp) <= 0 and not defRole:IsDead() then - defRole:SetDead() + defRole:SetDead(damage) defRole.Event:DispatchEvent(BattleEventName.RoleDead, atkRole) atkRole.Event:DispatchEvent(BattleEventName.RoleKill, defRole,skill) BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoleDead, defRole, atkRole) @@ -679,7 +679,7 @@ function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageTy local finalDmg = defRole.data:SubValue(RoleDataName.Hp, damage) if finalDmg >= 0 then if defRole:GetRoleData(RoleDataName.Hp) <= 0 and not defRole:IsDead() then - defRole:SetDead() + defRole:SetDead(damage) defRole.Event:DispatchEvent(BattleEventName.RoleDead, atkRole) atkRole.Event:DispatchEvent(BattleEventName.RoleKill, defRole,skill) BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoleDead, defRole, atkRole,skill,dotType) @@ -707,6 +707,7 @@ function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageTy atkRole.Event:DispatchEvent(BattleEventName.RoleHit, defRole, damage, bCrit, finalDmg, damageType, skill,isDirect) defRole.Event:DispatchEvent(BattleEventName.RoleBeHit, atkRole, damage, bCrit, finalDmg, damageType, skill,isDirect) end + end -- 战斗记录用 @@ -799,7 +800,6 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i -- 计算额外暴击伤害 critDamageFactor = 1.3 + atkRole:GetRoleData(RoleDataName.CritDamageFactor) - critDamageReduceFactor - --加入被动效果 触发暴击被动 local critFunc = function(critEx) critDamageFactor = critEx end atkRole.Event:DispatchEvent(BattleEventName.PassiveCriting, critFunc,skill) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua index 2698cb66e9..b9d53fd630 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua @@ -28,7 +28,7 @@ function RoleLogic:Init(uid, data, position) self.data:Init(self, data.property) self.isDead = self:GetRoleData(RoleDataName.Hp) <= 0 self.isRealDead = self.isDead - + self.killDamage = 0 --致死伤害 self.camp = data.camp --阵营 0:我方 1:敌方 self.name = data.name self.element = data.element @@ -560,8 +560,9 @@ function RoleLogic:SetDeadFilter(filter) self.deadFilter = filter end -- 要死了 -function RoleLogic:SetDead() +function RoleLogic:SetDead(damage) self.isDead = true + self.killDamage=damage RoleManager.AddDeadRole(self) end -- 判断是否死亡