From c8a8683be0d4139e5059455b7654e81a9748c7dd Mon Sep 17 00:00:00 2001 From: gaoxin Date: Thu, 27 May 2021 16:38:31 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=B1=B1=E6=B2=B3=E7=A4=BE=E7=A8=B7?= =?UTF-8?q?=E5=9B=BE=E3=80=91=E6=9D=A1=E4=BB=B6=EF=BC=9A5=E5=9B=9E?= =?UTF-8?q?=E5=90=88=E5=86=85=E6=89=93=E5=87=BA8=E4=B8=87=E4=BC=A4?= =?UTF-8?q?=E5=AE=B3=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=88=91=E5=9C=A8=E7=AC=AC?= =?UTF-8?q?=E4=B8=89=E5=9B=9E=E5=90=88=E6=89=93=E5=87=BA7=E4=B8=87?= =?UTF-8?q?=E4=BC=A4=E5=AE=B3=EF=BC=8C=E7=AC=AC=E5=9B=9B=E5=9B=9E=E5=90=88?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E7=A7=92=E6=9D=80=E6=80=AA=E7=89=A9=EF=BC=8C?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=80=BB=E8=AE=A1=E9=80=A0=E6=88=9012?= =?UTF-8?q?=E4=B8=87=E4=BC=A4=E5=AE=B3=E4=BD=86=E6=98=AF=E4=B8=8D=E7=BB=99?= =?UTF-8?q?=E6=98=9F=E6=98=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/Logic/BattleLogic.lua | 20 +++++++++---------- .../Battle/Logic/HardStageCondition.lua | 10 ++++------ .../Battle/Logic/HardStageEventManager.lua | 18 +++++------------ 3 files changed, 19 insertions(+), 29 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua index 97fd061a8c..f5144eafe3 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua @@ -452,17 +452,17 @@ function BattleLogic.BattleEnd(result) BattleLogic.Event:DispatchEvent(BattleEventName.BattleEnd, result) if hardStageId and hardStageId~=0 then --获取精英副本 星级信息 - local hardStageConfig=ConfigManager.GetConfigData(ConfigName.HardStage,hardStageId) - if hardStageConfig then - if hardStageConfig.ConditionValue then - for i = 1, #hardStageConfig.ConditionValue do - local harConfig = ConfigManager.GetConfigData(ConfigName.HardStageCondition,hardStageConfig.ConditionValue[i]) - local v1=HardStageCondition.CheckCondition(harConfig.ConditionType,harConfig.ConditionValue) - table.insert(levelStarRecord,hardStageConfig.ConditionValue[i]) - table.insert(levelStarRecord,v1) - end + local hardStageConfig=ConfigManager.GetConfigData(ConfigName.HardStage,hardStageId) + if hardStageConfig then + if hardStageConfig.ConditionValue then + for i = 1, #hardStageConfig.ConditionValue do + local harConfig = ConfigManager.GetConfigData(ConfigName.HardStageCondition,hardStageConfig.ConditionValue[i]) + local v1 = HardStageCondition.CheckCondition(harConfig.ConditionType,harConfig.ConditionValue) + table.insert(levelStarRecord,hardStageConfig.ConditionValue[i]) + table.insert(levelStarRecord,v1) + end + end end - end end -- 打印结果 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/HardStageCondition.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/HardStageCondition.lua index 2c8b306fcf..2a42fc055d 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/HardStageCondition.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/HardStageCondition.lua @@ -31,13 +31,11 @@ local _ConditionConfig = { [4]=function(condition) local v1 = condition[1] local v2 = condition[2] - local record=HardStageEventManager.GetRoundDamageRecord() + local record = HardStageEventManager.GetRoundDamageRecord() if record then - for key, value in pairs(record) do - if key<=v1 and value[2]>=v2 then - return 1 - end - end + if record[v1] and record[v1] >= v2 then + return 1 + end end return 0 end, diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/HardStageEventManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/HardStageEventManager.lua index f85e856df1..b70d8db2e0 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/HardStageEventManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/HardStageEventManager.lua @@ -79,23 +79,15 @@ end function this.OnRecordDamage(atkRole,defRole,damage) if not atkRole or atkRole.camp==1 then return - end - local curRound,maxRound=BattleLogic.GetCurRound() - CurRound=curRound - --如果进入下一回合,记录上一回合的伤害 - if CurRound==recordRound+1 then - table.insert(recordRoundDamage,{recordRound,roundDamage}) - recordRound=CurRound - end - roundDamage=roundDamage+damage + end + local curRound,maxRound=BattleLogic.GetCurRound() + CurRound=curRound + roundDamage=roundDamage+damage + recordRoundDamage[CurRound] = roundDamage end --获取回合伤害记录 function this.GetRoundDamageRecord() - --如果一回合就结束战斗了,就直接把记录的回合数伤害加进去 - if CurRound==1 then - table.insert(recordRoundDamage,{recordRound,roundDamage}) - end return recordRoundDamage end