diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index 45c6be4be5..110d965325 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -4114,16 +4114,21 @@ local passivityList = { if maxNum and maxNum > 0 then cf = cf/maxNum end - local targets = skill:GetDirectTargets() - if not targets or #targets == 0 then return end - - for _, target in ipairs(targets) do - BattleUtil.RandomAction(cf, function() - BattleLogic.BuffMgr:ClearBuff(target, function(buff) - return buff.type == BuffName.Shield and buff.shieldType == ShieldTypeName.AllReduce - end) + BattleUtil.RandomAction(cf, function() + BattleLogic.BuffMgr:ClearBuff(defRole, function(buff) + return buff.type == BuffName.Shield and buff.shieldType == ShieldTypeName.AllReduce end) - end + end) + --local targets = skill:GetDirectTargets() + --if not targets or #targets == 0 then return end + -- for _, target in ipairs(targets) do + -- LogError("11111111111") + -- BattleUtil.RandomAction(cf, function() + -- BattleLogic.BuffMgr:ClearBuff(target, function(buff) + -- return buff.type == BuffName.Shield and buff.shieldType == ShieldTypeName.AllReduce + -- end) + -- end) + -- end end end role.Event:AddEvent(BattleEventName.RoleDamageBefore, OnRoleDamageBefore,nil,nil,role) @@ -7936,7 +7941,12 @@ local passivityList = { return end local rDamage =floor(f1 * damage) - role:AddBuff(Buff.Create(role, BuffName.Blood,0, rDamage)) + + if role.bloodShield then + role.bloodShield:AddValue(rDamage) + else + role:AddBuff(Buff.Create(role, BuffName.Blood,0, rDamage)) + end end role.Event:AddEvent(BattleEventName.RoleBeHit, onBeHit,nil,nil,role) @@ -8276,6 +8286,23 @@ local passivityList = { BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, onRoundChange) end, + + --每回合开始,为自己添加[a][b]%的御甲 + --a[int],b[float] + [351] = function(role, args,id,judge) + local pro = args[1] + local v1 = args[2] + local onRoundChange=function(curRound) + local val = floor(BattleUtil.FP_Mul(v1, role:GetRoleData(BattlePropList[pro]))) + --如果身上有御甲就添加御甲的值 + if role.bloodShield then + role.bloodShield:AddValue(val) + else--没有就上御甲buff + role:AddBuff(Buff.Create(role, BuffName.Blood,0, val)) + end + end + BattleLogic.Event:AddEvent(BattleEventName.BattleRoundStart, onRoundChange,nil,nil,role) + end -- 行动击杀目标,追加[a]次普攻 -- a[int 目标选择系数] b[flaot] c[int 伤害类型] [352] = function(role, args,id,judge) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua index bb45ba8e7f..0cbed82875 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua @@ -1,4 +1,4 @@ -require("Modules.Battle.Logic.HardStageCondition") +require("Modules.Battle.Logic.HardStageCondition") require("Modules.Battle.Logic.HardStageEventManager") BattleLogic = {} local floor = math.floor @@ -234,8 +234,12 @@ function BattleLogic.TurnRound(debugTurn) -- 第一次进入 或者 本轮结束 初始化流程状态 if CurRound == 0 or (CurSkillPos[0] == 6 and CurSkillPos[1] == 6) then if CurRound ~= 0 then - -- 上一轮结束 - BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoundEnd, CurRound) + if BattleLogic.CheckHaveInsertRole() then + return + else + -- 上一轮结束 + BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoundEnd, CurRound) + end end -- 检测一次灵兽技能 SkillManager.CheckMonsterSkill(function() @@ -378,6 +382,61 @@ function BattleLogic.CheckBattleLogic() SkillRole:CastSkill() end +--检测是否有插入得英雄 +function BattleLogic.CheckHaveInsertRole() + if insertSkillRole then + local SkillRole=insertSkillRole + insertSkillRole=nil + -- 如果找不到下一个人,直接交换阵营 + if not SkillRole then + BattleLogManager.Log( "No Skill Position" ) + BattleLogic.TurnRoundNextFrame() + return + end + -- + BattleLogManager.Log( + "Position Change", + "position", CurSkillPos[CurCamp] + ) + + -- 行动 + SkillRole.Event:DispatchEvent(BattleEventName.RoleTurnStart, SkillRole) -- 开始行动 + BattleLogic.Event:DispatchEvent(BattleEventName.RoleTurnStart, SkillRole) -- 开始行动 + -- buff计算 + BattleLogic.BuffMgr:TurnUpdate(1) -- 计算恢复血量 + BattleLogic.BuffMgr:TurnUpdate(2) -- 计算持续伤害(除去流血) + -- 设置行动完成回调 + SkillManager.SetTurnRoundFunc(function() + 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() + end) + + -- 如果角色无法释放技能 + if not SkillRole:IsAvailable() -- 角色不能释放技能 + or (SkillRole:IsDead() -- 将死状态 + and not BattleLogic.BuffMgr:HasBuff(SkillRole,BuffName.NoDead) --将死但没有不死buff + and not SkillManager.HaveMySkill(SkillRole)) -- 也没有要释放的技能 + then + SkillManager.CheckTurnRound() + return + end + + -- 释放技能后,递归交换阵营 + SkillRole:CastSkill() + return true + else + return false + end + +end + + + function BattleLogic.WaitForTrigger(delayTime, action) delayTime = BattleUtil.ErrorCorrection(delayTime) local delayFrame = floor(delayTime * BattleLogic.GameFrameRate + 0.5) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Blood.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Blood.lua index d88bbadc76..050447c982 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Blood.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Blood.lua @@ -9,6 +9,11 @@ function Blood:SetData(...) end +function Blood:AddValue(value) + self.bloodValue=self.bloodValue+value +end + + --初始化后调用一次 function Blood:OnStart()