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