From 194160cc404cd162148005bb9119e2f23282428d Mon Sep 17 00:00:00 2001 From: zhangqiang <657634622@qq.com> Date: Fri, 19 Mar 2021 11:45:08 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=902=E5=80=8D=E9=80=9F=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/View/BattlePanel.lua | 5 +++- .../~Lua/Modules/Player/PrivilegeManager.lua | 30 ++++++++++--------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua index d5a587d657..8e578686aa 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua @@ -232,7 +232,10 @@ function this:OnOpen(_fightData, _fightType, _endFunc) BattleView:SetNameStr(nil) this.DefResult:SetActive(false) this.AtkResult:SetActive(false) - + local lvOpenTimeScaleConFig = ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.PrivilegeTypeConfig,"PrivilegeType",PRIVILEGE_TYPE.DoubleTimesFight,"UnlockType",1) + if lvOpenTimeScaleConFig and PlayerManager.level == lvOpenTimeScaleConFig.Condition[1][1] and BattleManager.GetTimeScale() == BATTLE_TIME_SCALE_ONE then + BattleManager.SetTimeScale(BATTLE_TIME_SCALE_TWO) + end -- 开始战斗 BattleView:StartBattle() diff --git a/Assets/ManagedResources/~Lua/Modules/Player/PrivilegeManager.lua b/Assets/ManagedResources/~Lua/Modules/Player/PrivilegeManager.lua index ef7b30d955..e51d05c383 100644 --- a/Assets/ManagedResources/~Lua/Modules/Player/PrivilegeManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Player/PrivilegeManager.lua @@ -241,23 +241,25 @@ function PrivilegeManager.GetPrivilegeOpenTip(privilegeType) end --当存在多解锁类型时 - if #privilegeList>1 then - local infoList={} + -- if #privilegeList>1 then + -- local infoList={} --解锁2倍速的处理 - for i,v in ipairs(privilegeList) do - if (v.UnlockType==2 or v.UnlockType==3) and privilegeType==PRIVILEGE_TYPE.DoubleTimesFight then - for _, con in ipairs(v.Condition) do - if con[2] > 0 then - table.insert(infoList, con[1]) - end - end - end - end + -- for i,v in ipairs(privilegeList) do + -- if (v.UnlockType==1) and privilegeType==PRIVILEGE_TYPE.DoubleTimesFight then + -- for _, con in ipairs(v.Condition) do + -- if con[2] > 0 then + -- table.insert(infoList, con[1]) + -- end + -- end + -- end + -- end if privilegeType==PRIVILEGE_TYPE.DoubleTimesFight then - local fightConfig = ConfigManager.GetConfigData(ConfigName.MainLevelConfig, infoList[1]) - return string.format(Language[11402],GetLanguageStrById(fightConfig.Name),infoList[2]) + local lvOpenTimeScaleConFig = ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.PrivilegeTypeConfig,"PrivilegeType",PRIVILEGE_TYPE.DoubleTimesFight,"UnlockType",1) + -- local fightConfig = ConfigManager.GetConfigData(ConfigName.MainLevelConfig, infoList[1]) + -- return string.format(Language[11402],GetLanguageStrById(fightConfig.Name),infoList[2]) + return string.format("玩家等级达到 %s 级解锁",lvOpenTimeScaleConFig.Condition[1][1]) end - end + -- end local privilegeData = privilegeList[1] -- 没有条件直接返回0