diff --git a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua index f720dabf41..93ed1a6b30 100644 --- a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua +++ b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua @@ -1499,6 +1499,7 @@ PRIVILEGE_TYPE = { EXPLORE_REWARD = 4, -- 挂机探索特权 ADVENTURE_BOSS = 9, -- 外敌挑战次数 DoubleTimesFight = 501, --2倍速战斗 + ThreeTimesFight = 503, --3倍速战斗 CarbonSweeps = 502, --副本扫荡 SkipFight = 512, --跳过战斗 -- UnlockPickUp=504,--一键领取 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua index aa5a32d8b3..8eb0cf5afd 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua @@ -844,11 +844,14 @@ end function this.IsUnlockBattleSpeed() return PrivilegeManager.GetPrivilegeOpenStatus(PRIVILEGE_TYPE.DoubleTimesFight) end - +-- 是否解锁3倍速 +function this.IsUnlockBattleSpeedThree() + return PrivilegeManager.GetPrivilegeOpenStatus(PRIVILEGE_TYPE.ThreeTimesFight) +end -- 是否解锁跳过功能 function this.IsUnlockBattlePass() -- return false - return PrivilegeManager.GetPrivilegeOpenStatus(PRIVILEGE_TYPE.SkipFight) + return PrivilegeManager.GetPrivilegeOpenStatus(PRIVILEGE_TYPE.SkipFight), "通关简单3-20或充值任意金额后解锁" end -- 战斗暂停控制 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua index b886c623c4..2962089003 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua @@ -29,9 +29,10 @@ local SKIP_STATE = { } local UpdateBtnGMFunc = { [-1] = function() - -- if not BattleManager.IsUnlockBattlePass() then - -- return SKIP_STATE.LOCK, "25级或充值任意金额后解锁" - -- end + local isUnlock, tip = BattleManager.IsUnlockBattlePass() + if not isUnlock then + return SKIP_STATE.LOCK, tip + end return SKIP_STATE.UNLOCK end, [BATTLE_TYPE.BACK]= function() @@ -43,36 +44,36 @@ local UpdateBtnGMFunc = { [BATTLE_TYPE.Test] = function() return SKIP_STATE.UNLOCK end, - [BATTLE_TYPE.MONSTER_CAMP] = function() - return SKIP_STATE.UNLOCK - end, + -- [BATTLE_TYPE.MONSTER_CAMP] = function() + -- return SKIP_STATE.UNLOCK + -- end, -- [BATTLE_TYPE.DAILY_CHALLENGE] = function() -- return SKIP_STATE.NOUSE, "日常副本战斗无法跳过!" -- end, - [BATTLE_TYPE.STORY_FIGHT] = function() - -- if not BattleManager.IsUnlockBattlePass() then - -- return SKIP_STATE.LOCK, "25级或充值任意金额后解锁" - -- end - -- if FightPointPassManager.GetCurOpenFightIdIsBoss() then - -- return SKIP_STATE.NOUSE, "首领关卡无法跳过!" - -- end - if this.curRound <= _NO_JUMP_ROUND then - return SKIP_STATE.NOUSE, "第二回合结束后可以跳过" - end - return SKIP_STATE.UNLOCK - end, - [BATTLE_TYPE.DAILY_CHALLENGE] = function() - -- if not BattleManager.IsUnlockBattlePass() then - -- return SKIP_STATE.LOCK, "25级或充值任意金额后解锁" - -- end - -- if FightPointPassManager.GetCurOpenFightIdIsBoss() then - -- return SKIP_STATE.NOUSE, "首领关卡无法跳过!" - -- end - if this.curRound <= _NO_JUMP_ROUND then - return SKIP_STATE.NOUSE, "第二回合结束后可以跳过" - end - return SKIP_STATE.UNLOCK - end, + -- [BATTLE_TYPE.STORY_FIGHT] = function() + -- if not BattleManager.IsUnlockBattlePass() then + -- return SKIP_STATE.LOCK, "25级或充值任意金额后解锁" + -- end + -- -- if FightPointPassManager.GetCurOpenFightIdIsBoss() then + -- -- return SKIP_STATE.NOUSE, "首领关卡无法跳过!" + -- -- end + -- -- if this.curRound <= _NO_JUMP_ROUND then + -- -- return SKIP_STATE.NOUSE, "第二回合结束后可以跳过" + -- -- end + -- return SKIP_STATE.UNLOCK + -- end, + -- [BATTLE_TYPE.DAILY_CHALLENGE] = function() + -- -- if not BattleManager.IsUnlockBattlePass() then + -- -- return SKIP_STATE.LOCK, "25级或充值任意金额后解锁" + -- -- end + -- -- if FightPointPassManager.GetCurOpenFightIdIsBoss() then + -- -- return SKIP_STATE.NOUSE, "首领关卡无法跳过!" + -- -- end + -- if this.curRound <= _NO_JUMP_ROUND then + -- return SKIP_STATE.NOUSE, "第二回合结束后可以跳过" + -- end + -- return SKIP_STATE.UNLOCK + -- end, } function this:GetSkipState() @@ -106,8 +107,8 @@ function this:InitComponent() this.BtnTimeScale = Util.GetGameObject(this.DownRoot, "option/BtnTimeScale") this.TimeScaleTxt = Util.GetGameObject(this.DownRoot, "option/BtnTimeScale/icon/num"):GetComponent("Text") this.BtnJumpFight = Util.GetGameObject(this.DownRoot, "option/Button") - this.jumpLock = Util.GetGameObject(this.DownRoot, "option/Button/lock_round") - this.jumpLock:GetComponent("Image").fillAmount = 1 + this.jumpLock = Util.GetGameObject(this.DownRoot, "option/Button/lock") + -- this.jumpLock:GetComponent("Image").fillAmount = 1 this.submit = Util.GetGameObject(this.DownRoot, "bg") @@ -151,22 +152,34 @@ function this:BindEvent() Util.AddClick(this.BtnTimeScale, function () + -- 没开始不能调整 if not BattleManager.IsCanOperate() then return end + -- 2倍速没开始表示没解锁倍速 if not BattleManager.IsUnlockBattleSpeed() then PopupTipPanel.ShowTip(PrivilegeManager.GetPrivilegeOpenTip(PRIVILEGE_TYPE.DoubleTimesFight)) return end + -- 判断当前倍速 local scale = BattleManager.GetTimeScale() scale = math.floor(scale*10 + 0.5)/10 + if scale == BATTLE_TIME_SCALE_ONE then + -- 一倍速回到二倍速 BattleManager.SetTimeScale(BATTLE_TIME_SCALE_TWO) - elseif scale == BATTLE_TIME_SCALE_TWO then - BattleManager.SetTimeScale(BATTLE_TIME_SCALE_THREE) + elseif scale == BATTLE_TIME_SCALE_TWO then + -- 2倍速时判断是否解锁了3倍速,没解锁就回到1倍速 + if BattleManager.IsUnlockBattleSpeedThree() then + BattleManager.SetTimeScale(BATTLE_TIME_SCALE_THREE) + else + BattleManager.SetTimeScale(BATTLE_TIME_SCALE_ONE) + end elseif scale == BATTLE_TIME_SCALE_THREE then + -- 三倍速回到一倍速 BattleManager.SetTimeScale(BATTLE_TIME_SCALE_ONE) else + -- 其他异常数据回到一倍速 BattleManager.SetTimeScale(BATTLE_TIME_SCALE_ONE) end end) @@ -405,11 +418,11 @@ function this.SetJumpBtnState() local isLock = state ~= SKIP_STATE.UNLOCK -- 战斗跳过按钮显示 this.jumpLock:SetActive(isLock) - if isLock then - - local filter = 1 - (this.curRound - 1)/_NO_JUMP_ROUND - this.jumpLock:GetComponent("Image").fillAmount = filter > 0 and filter or 0 - end + -- 进度展示 + -- if isLock then + -- local filter = 1 - (this.curRound - 1)/_NO_JUMP_ROUND + -- this.jumpLock:GetComponent("Image").fillAmount = filter > 0 and filter or 0 + -- end end @@ -760,7 +773,7 @@ function this.OnRoundChanged(round) this.roundText.text = string.format(Language[10211], curRound, maxRound) -- 设置跳过按钮的状态 - this.SetJumpBtnState() + -- this.SetJumpBtnState() end -- 角色轮转回调 function this.RoleTurnChange(role)