【2倍速修改】

dev_chengFeng
zhangqiang 2021-03-19 11:45:08 +08:00
parent 1320371eac
commit 194160cc40
2 changed files with 20 additions and 15 deletions

View File

@ -232,7 +232,10 @@ function this:OnOpen(_fightData, _fightType, _endFunc)
BattleView:SetNameStr(nil) BattleView:SetNameStr(nil)
this.DefResult:SetActive(false) this.DefResult:SetActive(false)
this.AtkResult: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() BattleView:StartBattle()

View File

@ -241,23 +241,25 @@ function PrivilegeManager.GetPrivilegeOpenTip(privilegeType)
end end
--当存在多解锁类型时 --当存在多解锁类型时
if #privilegeList>1 then -- if #privilegeList>1 then
local infoList={} -- local infoList={}
--解锁2倍速的处理 --解锁2倍速的处理
for i,v in ipairs(privilegeList) do -- for i,v in ipairs(privilegeList) do
if (v.UnlockType==2 or v.UnlockType==3) and privilegeType==PRIVILEGE_TYPE.DoubleTimesFight then -- if (v.UnlockType==1) and privilegeType==PRIVILEGE_TYPE.DoubleTimesFight then
for _, con in ipairs(v.Condition) do -- for _, con in ipairs(v.Condition) do
if con[2] > 0 then -- if con[2] > 0 then
table.insert(infoList, con[1]) -- table.insert(infoList, con[1])
end -- end
end -- end
end -- end
end -- end
if privilegeType==PRIVILEGE_TYPE.DoubleTimesFight then if privilegeType==PRIVILEGE_TYPE.DoubleTimesFight then
local fightConfig = ConfigManager.GetConfigData(ConfigName.MainLevelConfig, infoList[1]) local lvOpenTimeScaleConFig = ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.PrivilegeTypeConfig,"PrivilegeType",PRIVILEGE_TYPE.DoubleTimesFight,"UnlockType",1)
return string.format(Language[11402],GetLanguageStrById(fightConfig.Name),infoList[2]) -- local fightConfig = ConfigManager.GetConfigData(ConfigName.MainLevelConfig, infoList[1])
end -- 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] local privilegeData = privilegeList[1]
-- 没有条件直接返回0 -- 没有条件直接返回0