广告
This commit is contained in:
parent
e6afcd0ccd
commit
71820d787f
@ -233,6 +233,7 @@ BIReport.ADS_CLICK_TYPE = {
|
|||||||
BATTLE_SKILL_DEITY = "BattleSkillDeity",
|
BATTLE_SKILL_DEITY = "BattleSkillDeity",
|
||||||
BATTLE_DOUBLE_BOX = "BattleDoubleBox",
|
BATTLE_DOUBLE_BOX = "BattleDoubleBox",
|
||||||
BATTLE_REVIVE = "BattleRevive",
|
BATTLE_REVIVE = "BattleRevive",
|
||||||
|
BATTLE_RESULT_DOUBLE = "BattleResultDouble",
|
||||||
AD_ENERGY = "AdEnergy",
|
AD_ENERGY = "AdEnergy",
|
||||||
TASK_DAILY_REFRESH = "TaskDailyRefresh",
|
TASK_DAILY_REFRESH = "TaskDailyRefresh",
|
||||||
TASK_DAILY_TASK = "TaskDailyTask",
|
TASK_DAILY_TASK = "TaskDailyTask",
|
||||||
|
|||||||
@ -86,6 +86,7 @@ EventManager.CUSTOM_EVENT = {
|
|||||||
CHANGE_ACTIVITY_PAGE = "CHANGE_ACTIVITY_PAGE",
|
CHANGE_ACTIVITY_PAGE = "CHANGE_ACTIVITY_PAGE",
|
||||||
BATTLE_REVIVE = "BATTLE_REVIVE",
|
BATTLE_REVIVE = "BATTLE_REVIVE",
|
||||||
BATTLE_REVIVE_FAILED = "BATTLE_REVIVE_FAILED",
|
BATTLE_REVIVE_FAILED = "BATTLE_REVIVE_FAILED",
|
||||||
|
BATTLE_DOUBLE_REWARD = "BATTLE_DOUBLE_REWARD",
|
||||||
|
|
||||||
|
|
||||||
CROSS_DAY = "CROSS_DAY",-- 跨天
|
CROSS_DAY = "CROSS_DAY",-- 跨天
|
||||||
|
|||||||
@ -919,7 +919,7 @@ local localization_global =
|
|||||||
["ADS_DESC_5"] = "额外2级齿轮",
|
["ADS_DESC_5"] = "额外2级齿轮",
|
||||||
["ADS_DESC_6"] = "是否观看广告,获得额外2级齿轮",
|
["ADS_DESC_6"] = "是否观看广告,获得额外2级齿轮",
|
||||||
["ADS_DESC_7"] = "时光回溯",
|
["ADS_DESC_7"] = "时光回溯",
|
||||||
["ADS_DESC_9"] = "可回到本波开始前并获得{0}水晶",
|
["ADS_DESC_9"] = "战斗失败,是否复活?",
|
||||||
["ADS_DESC_10"] = "放弃复活",
|
["ADS_DESC_10"] = "放弃复活",
|
||||||
["ADS_DESC_11"] = "刷新齿轮",
|
["ADS_DESC_11"] = "刷新齿轮",
|
||||||
["ADS_DESC_12"] = "是否观看广告,免费刷新齿轮?",
|
["ADS_DESC_12"] = "是否观看广告,免费刷新齿轮?",
|
||||||
|
|||||||
@ -96,8 +96,8 @@ function BattleManager:showBoxOpenUI(rewards, callback)
|
|||||||
UIManager:showUI("app/ui/battle/battle_box_open_ui", {rewards = rewards, callback = callback})
|
UIManager:showUI("app/ui/battle/battle_box_open_ui", {rewards = rewards, callback = callback})
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleManager:showBattleReviveUI(callback)
|
function BattleManager:showBattleReviveUI(battleType, callback)
|
||||||
UIManager:showUI("app/ui/battle/battle_revive_ui", {callback = callback})
|
UIManager:showUI("app/ui/battle/battle_revive_ui", {battleType = battleType, callback = callback})
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleManager:reqSkillRefresh(isAll, deitySkillIdx, isDoubleBox)
|
function BattleManager:reqSkillRefresh(isAll, deitySkillIdx, isDoubleBox)
|
||||||
@ -154,9 +154,6 @@ function BattleManager:rspChapterDoubleReward(result)
|
|||||||
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
|
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if result.rewards then
|
|
||||||
GFunc.showRewardBox(result.rewards)
|
|
||||||
end
|
|
||||||
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.BATTLE_DOUBLE_REWARD)
|
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.BATTLE_DOUBLE_REWARD)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -111,6 +111,18 @@ function BattleBaseController:refreshWave()
|
|||||||
self.battleUI:refreshWave(self:getWaveIndex())
|
self.battleUI:refreshWave(self:getWaveIndex())
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleBaseController:canRevive()
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleBaseController:hadAdDeityCount()
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleBaseController:canGetDoubleRewards()
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
-- 战斗结束
|
-- 战斗结束
|
||||||
function BattleBaseController:controllBattleEnd()
|
function BattleBaseController:controllBattleEnd()
|
||||||
end
|
end
|
||||||
@ -2479,9 +2491,10 @@ function BattleBaseController:getRandomSkillList(getCount, isGodSkill, excludeMa
|
|||||||
local result = table.shuffle(self.randomSkillList)
|
local result = table.shuffle(self.randomSkillList)
|
||||||
|
|
||||||
if isGodSkill then
|
if isGodSkill then
|
||||||
local count = self.battleData:getAdDeityCount()
|
-- local count = self.battleData:getAdDeityCount()
|
||||||
local cfgCount = GFunc.getConstIntValue("ads_deity_get_limit")
|
-- local cfgCount = GFunc.getConstIntValue("ads_deity_get_limit")
|
||||||
if cfgCount > count then
|
-- if cfgCount > count then
|
||||||
|
if self:hadAdDeityCount() then
|
||||||
local randomSkillNewSkillPool = {}
|
local randomSkillNewSkillPool = {}
|
||||||
local randomSkillSkillWeight = {}
|
local randomSkillSkillWeight = {}
|
||||||
for skillId, info in pairs(cfg) do
|
for skillId, info in pairs(cfg) do
|
||||||
@ -3264,11 +3277,14 @@ function BattleBaseController:adRevive(revive)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleBaseController:checkRevive()
|
function BattleBaseController:checkRevive()
|
||||||
|
if not self:canRevive() then
|
||||||
|
return false
|
||||||
|
end
|
||||||
if self.battleData:getIsRevive() then
|
if self.battleData:getIsRevive() then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
self.battleData:setIsRevive(true)
|
self.battleData:setIsRevive(true)
|
||||||
ModuleManager.BattleManager:showBattleReviveUI(function(revive)
|
ModuleManager.BattleManager:showBattleReviveUI(self.battleType, function(revive)
|
||||||
self:adRevive(revive)
|
self:adRevive(revive)
|
||||||
end)
|
end)
|
||||||
return true
|
return true
|
||||||
|
|||||||
@ -3,6 +3,20 @@ local BattleController = require "app/module/battle/controller/battle_controller
|
|||||||
local BattleControllerDailyChallenge = class("BattleControllerDailyChallenge", BattleController)
|
local BattleControllerDailyChallenge = class("BattleControllerDailyChallenge", BattleController)
|
||||||
local BattleBuffEntity = require "app/userdata/battle/skill/battle_buff_entity"
|
local BattleBuffEntity = require "app/userdata/battle/skill/battle_buff_entity"
|
||||||
|
|
||||||
|
function BattleControllerDailyChallenge:canRevive()
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleControllerDailyChallenge:hadAdDeityCount()
|
||||||
|
local count = self.battleData:getAdDeityCount()
|
||||||
|
local cfgCount = GFunc.getConstIntValue("daily_challenge_ads_deity_get_limit")
|
||||||
|
return cfgCount > count
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleControllerDailyChallenge:canGetDoubleRewards()
|
||||||
|
return DataManager.DailyChallengeData:canAdDouble()
|
||||||
|
end
|
||||||
|
|
||||||
function BattleControllerDailyChallenge:getBoardConfig()
|
function BattleControllerDailyChallenge:getBoardConfig()
|
||||||
return ConfigManager:getConfig("chapter_board_daily_challenge")
|
return ConfigManager:getConfig("chapter_board_daily_challenge")
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,6 +1,20 @@
|
|||||||
local BattleController = require "app/module/battle/controller/battle_controller"
|
local BattleController = require "app/module/battle/controller/battle_controller"
|
||||||
local BattleControllerStage = class("BattleControllerStage", BattleController)
|
local BattleControllerStage = class("BattleControllerStage", BattleController)
|
||||||
|
|
||||||
|
function BattleControllerStage:canRevive()
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleControllerStage:hadAdDeityCount()
|
||||||
|
local count = self.battleData:getAdDeityCount()
|
||||||
|
local cfgCount = GFunc.getConstIntValue("ads_deity_get_limit")
|
||||||
|
return cfgCount > count
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleControllerStage:canGetDoubleRewards()
|
||||||
|
return DataManager.ChapterData:canAdDouble()
|
||||||
|
end
|
||||||
|
|
||||||
function BattleControllerStage:getBoardConfig()
|
function BattleControllerStage:getBoardConfig()
|
||||||
return ConfigManager:getConfig("chapter_board")
|
return ConfigManager:getConfig("chapter_board")
|
||||||
end
|
end
|
||||||
|
|||||||
@ -46,6 +46,7 @@ function BattleResultUI:ctor(params)
|
|||||||
GFunc.mergeRewards2(self.rewards, newRewards)
|
GFunc.mergeRewards2(self.rewards, newRewards)
|
||||||
self.rewards = newRewards
|
self.rewards = newRewards
|
||||||
end
|
end
|
||||||
|
self.isDouble = false
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleResultUI:onClose()
|
function BattleResultUI:onClose()
|
||||||
@ -121,6 +122,24 @@ function BattleResultUI:onLoadRootComplete()
|
|||||||
self.arenaBoxBtnGet = uiMap["battle_result_ui.arena_box_node.btn_get"]
|
self.arenaBoxBtnGet = uiMap["battle_result_ui.arena_box_node.btn_get"]
|
||||||
self.arenaBoxTxGet = uiMap["battle_result_ui.arena_box_node.btn_get.tx_get"]
|
self.arenaBoxTxGet = uiMap["battle_result_ui.arena_box_node.btn_get.tx_get"]
|
||||||
|
|
||||||
|
self.doubleNode = uiMap["battle_result_ui.double_node"]
|
||||||
|
self.doubleOkBtn = uiMap["battle_result_ui.double_node.ok_btn"]
|
||||||
|
self.doubleOkBtnTx = uiMap["battle_result_ui.double_node.ok_btn.tx"]
|
||||||
|
self.doubleBtn = uiMap["battle_result_ui.double_node.double_btn"]
|
||||||
|
self.doubleBtnAdImg = uiMap["battle_result_ui.double_node.double_btn.ad_img"]
|
||||||
|
self.doubleBtnTx = uiMap["battle_result_ui.double_node.double_btn.tx"]
|
||||||
|
self.doubleBtnLimitTx = uiMap["battle_result_ui.double_node.double_btn.limit_tx"]
|
||||||
|
self.doubleOkBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK))
|
||||||
|
self.doubleBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_14))
|
||||||
|
|
||||||
|
self.doubleOkBtn:addClickListener(function()
|
||||||
|
self:onClickMask()
|
||||||
|
end)
|
||||||
|
self.doubleBtn:addClickListener(function()
|
||||||
|
SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.BATTLE_RESULT_DOUBLE, function()
|
||||||
|
self:onGetDouble()
|
||||||
|
end)
|
||||||
|
end)
|
||||||
self.victoryMask:addClickListener(function()
|
self.victoryMask:addClickListener(function()
|
||||||
self:onClickMask()
|
self:onClickMask()
|
||||||
end)
|
end)
|
||||||
@ -135,6 +154,9 @@ function BattleResultUI:onLoadRootComplete()
|
|||||||
self:refreshRewards()
|
self:refreshRewards()
|
||||||
self:refreshArenaBoxNode()
|
self:refreshArenaBoxNode()
|
||||||
end)
|
end)
|
||||||
|
self:addEventListener(EventManager.CUSTOM_EVENT.BATTLE_DOUBLE_REWARD, function()
|
||||||
|
self:onReviveDouble()
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleResultUI:onClickMask()
|
function BattleResultUI:onClickMask()
|
||||||
@ -153,6 +175,7 @@ function BattleResultUI:onRefresh()
|
|||||||
self:refreshRewards()
|
self:refreshRewards()
|
||||||
self:refreshArenaNode()
|
self:refreshArenaNode()
|
||||||
self:refreshArenaBoxNode()
|
self:refreshArenaBoxNode()
|
||||||
|
self:refreshDoubleNode()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleResultUI:refreshVictoryNode()
|
function BattleResultUI:refreshVictoryNode()
|
||||||
@ -357,6 +380,9 @@ function BattleResultUI:refreshRewards()
|
|||||||
end
|
end
|
||||||
cell:showRightUpIcon(index <= self.mysteryBoxIdx, GConst.ATLAS_PATH.COMMON, "common_chest_1")
|
cell:showRightUpIcon(index <= self.mysteryBoxIdx, GConst.ATLAS_PATH.COMMON, "common_chest_1")
|
||||||
cell:showFirstPass(index <= self.firstPassIdx)
|
cell:showFirstPass(index <= self.firstPassIdx)
|
||||||
|
if self.isDouble then
|
||||||
|
cell:setNumTx(self.rewards[index].num * 2)
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
if self:hasArenaBoxNode() then
|
if self:hasArenaBoxNode() then
|
||||||
self.rewardScrollRect:setSizeDeltaY(SCROLL_LINE_HEIGHT)
|
self.rewardScrollRect:setSizeDeltaY(SCROLL_LINE_HEIGHT)
|
||||||
@ -444,4 +470,45 @@ function BattleResultUI:showRewardAppearAnim(idx, cell)
|
|||||||
return animRewardAppear
|
return animRewardAppear
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--@region 双倍奖励
|
||||||
|
function BattleResultUI:refreshDoubleNode()
|
||||||
|
if self.battleType ~= GConst.BattleConst.BATTLE_TYPE.STAGE and self.battleType ~= GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE then
|
||||||
|
self.doubleNode:setActive(false)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if self.battleType == GConst.BattleConst.BATTLE_TYPE.STAGE then
|
||||||
|
if not DataManager.ChapterData:canAdDouble() then
|
||||||
|
self.doubleNode:setActive(false)
|
||||||
|
else
|
||||||
|
self.doubleNode:setActive(true)
|
||||||
|
GFunc.setAdsSprite(self.doubleBtnAdImg)
|
||||||
|
self.doubleBtnLimitTx:setText(DataManager.ChapterData:getReDoubleCount() .. "/" .. GFunc.getConstIntValue("ads_double_rewards_limit"))
|
||||||
|
self.doubleOkBtn:setAnchoredPositionX(125)
|
||||||
|
self.doubleBtn:setActive(true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if self.battleType == GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE then
|
||||||
|
if not DataManager.DailyChallengeData:canAdDouble() then
|
||||||
|
self.doubleNode:setActive(false)
|
||||||
|
else
|
||||||
|
self.doubleNode:setActive(true)
|
||||||
|
GFunc.setAdsSprite(self.doubleBtnAdImg)
|
||||||
|
self.doubleBtnLimitTx:setText(DataManager.DailyChallengeData:getReDoubleCount() .. "/" .. GFunc.getConstIntValue("daily_challenge_ads_double_rewards_limit"))
|
||||||
|
self.doubleOkBtn:setAnchoredPositionX(125)
|
||||||
|
self.doubleBtn:setActive(true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleResultUI:onGetDouble()
|
||||||
|
ModuleManager.BattleManager:reqChapterDoubleReward()
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleResultUI:onReviveDouble()
|
||||||
|
self.isDouble = true
|
||||||
|
self:refreshRewards()
|
||||||
|
self.doubleOkBtn:setAnchoredPositionX(0)
|
||||||
|
self.doubleBtn:setActive(false)
|
||||||
|
end
|
||||||
|
--@endregion
|
||||||
return BattleResultUI
|
return BattleResultUI
|
||||||
@ -7,6 +7,7 @@ end
|
|||||||
function BattleReviveUI:ctor(params)
|
function BattleReviveUI:ctor(params)
|
||||||
params = params or {}
|
params = params or {}
|
||||||
self.callback = params.callback
|
self.callback = params.callback
|
||||||
|
self.battleType = params.battleType
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleReviveUI:getPrefabPath()
|
function BattleReviveUI:getPrefabPath()
|
||||||
@ -29,12 +30,19 @@ function BattleReviveUI:_display()
|
|||||||
self.adBtn = uiMap["battle_revive_ui.bg.ad_btn"]
|
self.adBtn = uiMap["battle_revive_ui.bg.ad_btn"]
|
||||||
self.adIcon = uiMap["battle_revive_ui.bg.ad_btn.icon"]
|
self.adIcon = uiMap["battle_revive_ui.bg.ad_btn.icon"]
|
||||||
self.adTx = uiMap["battle_revive_ui.bg.ad_btn.tx"]
|
self.adTx = uiMap["battle_revive_ui.bg.ad_btn.tx"]
|
||||||
|
self.adLimitTx = uiMap["battle_revive_ui.limit_tx"]
|
||||||
self.cancelBtn = uiMap["battle_revive_ui.bg.cancel_btn"]
|
self.cancelBtn = uiMap["battle_revive_ui.bg.cancel_btn"]
|
||||||
self.cancelTx = uiMap["battle_revive_ui.bg.cancel_btn.tx"]
|
self.cancelTx = uiMap["battle_revive_ui.bg.cancel_btn.tx"]
|
||||||
|
|
||||||
self.title1Tx:setText(I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_7))
|
self.title1Tx:setText(I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_7))
|
||||||
|
self.descTx:setText(I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_9))
|
||||||
-- self.title2Tx:setText(I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_8))
|
-- self.title2Tx:setText(I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_8))
|
||||||
self.descTx:setText(I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_9, GFunc.getConstIntValue("ads_revive_limit")))
|
if self.battleType == GConst.BattleConst.BATTLE_TYPE.STAGE then
|
||||||
|
self.adLimitTx:setText(DataManager.ChapterData:getReReviveCount() .. "/" .. GFunc.getConstIntValue("ads_revive_limit"))
|
||||||
|
elseif self.battleType == GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE then
|
||||||
|
self.adLimitTx:setText(DataManager.DailyChallengeData:getReReviveCount() .. "/" .. GFunc.getConstIntValue("daily_challenge_ads_revive_limit"))
|
||||||
|
end
|
||||||
|
|
||||||
self.adTx:setText(I18N:getGlobalText(I18N.GlobalConst.FREE_DESC))
|
self.adTx:setText(I18N:getGlobalText(I18N.GlobalConst.FREE_DESC))
|
||||||
self.cancelTx:setText(I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_10))
|
self.cancelTx:setText(I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_10))
|
||||||
|
|
||||||
@ -53,14 +61,21 @@ function BattleReviveUI:_display()
|
|||||||
-- self.fx:setActive(false)
|
-- self.fx:setActive(false)
|
||||||
|
|
||||||
-- 根据复活次数更新按钮位置
|
-- 根据复活次数更新按钮位置
|
||||||
local canAdRevive = DataManager.ChapterData:canAdRevive()
|
local canAdRevive = false
|
||||||
|
if self.battleType == GConst.BattleConst.BATTLE_TYPE.STAGE then
|
||||||
|
canAdRevive = DataManager.ChapterData:canAdRevive()
|
||||||
|
elseif self.battleType == GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE then
|
||||||
|
canAdRevive = DataManager.DailyChallengeData:canAdRevive()
|
||||||
|
end
|
||||||
if not canAdRevive then
|
if not canAdRevive then
|
||||||
self.costBtn:setActive(true)
|
self.costBtn:setActive(true)
|
||||||
self.adBtn:setActive(false)
|
self.adBtn:setActive(false)
|
||||||
|
self.adLimitTx:setActive(false)
|
||||||
self.costBtn:setAnchoredPositionX(0)
|
self.costBtn:setAnchoredPositionX(0)
|
||||||
else
|
else
|
||||||
self.costBtn:setActive(true)
|
self.costBtn:setActive(true)
|
||||||
self.adBtn:setActive(true)
|
self.adBtn:setActive(true)
|
||||||
|
self.adLimitTx:setActive(true)
|
||||||
self.costBtn:setAnchoredPositionX(-144)
|
self.costBtn:setAnchoredPositionX(-144)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -86,7 +101,15 @@ end
|
|||||||
|
|
||||||
function BattleReviveUI:_addListeners()
|
function BattleReviveUI:_addListeners()
|
||||||
self.costBtn:addClickListener(function()
|
self.costBtn:addClickListener(function()
|
||||||
local cost = GFunc.getConstReward("cost_revive")
|
local cost
|
||||||
|
if self.battleType == GConst.BattleConst.BATTLE_TYPE.STAGE then
|
||||||
|
cost = GFunc.getConstReward("cost_revive")
|
||||||
|
elseif self.battleType == GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE then
|
||||||
|
cost = GFunc.getConstReward("daily_challenge_cost_revive")
|
||||||
|
end
|
||||||
|
if not cost then
|
||||||
|
return
|
||||||
|
end
|
||||||
if GFunc.checkCost(GConst.ItemConst.ITEM_ID_GEM, cost.num, true) then
|
if GFunc.checkCost(GConst.ItemConst.ITEM_ID_GEM, cost.num, true) then
|
||||||
self:doRevive(false)
|
self:doRevive(false)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -92,7 +92,12 @@ function BattleSkillSelectComp:refreshBtns()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local battleController = ModuleManager.BattleManager.battleController
|
local battleController = ModuleManager.BattleManager.battleController
|
||||||
local getAllAdCount = GFunc.getConstIntValue("ads_getall_rogue_limit")
|
local getAllAdCount = 0
|
||||||
|
if ModuleManager.BattleManager.battleController.battleType == GConst.BattleConst.BATTLE_TYPE.STAGE then
|
||||||
|
getAllAdCount = GFunc.getConstIntValue("ads_getall_rogue_limit")
|
||||||
|
elseif ModuleManager.BattleManager.battleController.battleType == GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE then
|
||||||
|
getAllAdCount = GFunc.getConstIntValue("daily_challenge_ads_getall_rogue_limit")
|
||||||
|
end
|
||||||
local allCount = battleController.battleData:getAllSkillCount()
|
local allCount = battleController.battleData:getAllSkillCount()
|
||||||
if getAllAdCount > allCount then
|
if getAllAdCount > allCount then
|
||||||
allBtn:setActive(true)
|
allBtn:setActive(true)
|
||||||
@ -100,7 +105,12 @@ function BattleSkillSelectComp:refreshBtns()
|
|||||||
allBtn:setActive(false)
|
allBtn:setActive(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
local cfgAdCount = GFunc.getConstIntValue("ad_refresh_skill")
|
local cfgAdCount = 0
|
||||||
|
if ModuleManager.BattleManager.battleController.battleType == GConst.BattleConst.BATTLE_TYPE.STAGE then
|
||||||
|
cfgAdCount = GFunc.getConstIntValue("ads_refresh_rogue_limit")
|
||||||
|
elseif ModuleManager.BattleManager.battleController.battleType == GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE then
|
||||||
|
cfgAdCount = GFunc.getConstIntValue("daily_challenge_ads_refresh_rogue_limit")
|
||||||
|
end
|
||||||
local talentCount = DataManager.TalentData:getSkillRefreshCount()
|
local talentCount = DataManager.TalentData:getSkillRefreshCount()
|
||||||
local adCount = battleController.battleData:getADRefreshSkillCount() + talentCount
|
local adCount = battleController.battleData:getADRefreshSkillCount() + talentCount
|
||||||
if cfgAdCount > adCount then
|
if cfgAdCount > adCount then
|
||||||
|
|||||||
@ -45,6 +45,7 @@ function ChapterData:init(data, notChangeChapterId)
|
|||||||
end
|
end
|
||||||
self.revive = data.revive or 0
|
self.revive = data.revive or 0
|
||||||
self.todayRevive = data.today_revive or 0
|
self.todayRevive = data.today_revive or 0
|
||||||
|
self.todayDouble = data.today_double_mystery or 0
|
||||||
|
|
||||||
if not notChangeChapterId then
|
if not notChangeChapterId then
|
||||||
self.data.chapterId = data.max_chapter_id
|
self.data.chapterId = data.max_chapter_id
|
||||||
@ -53,6 +54,11 @@ function ChapterData:init(data, notChangeChapterId)
|
|||||||
self.data.chapterInfo = data.chapter_info or {}
|
self.data.chapterInfo = data.chapter_info or {}
|
||||||
self.boxCanGetState = nil
|
self.boxCanGetState = nil
|
||||||
self.canGetBoxInfo = {}
|
self.canGetBoxInfo = {}
|
||||||
|
|
||||||
|
DataManager:registerCrossDayFunc("ChapterData", function()
|
||||||
|
self.todayRevive = 0
|
||||||
|
self.todayDouble = 0
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function ChapterData:getIsFirstChapter(chapterId)
|
function ChapterData:getIsFirstChapter(chapterId)
|
||||||
@ -587,9 +593,7 @@ function ChapterData:showRedPoint(chapterId)
|
|||||||
end
|
end
|
||||||
--@endregion
|
--@endregion
|
||||||
|
|
||||||
--@region 复活
|
--@region 复活 双倍
|
||||||
-- self.revive = data.revive or 0
|
|
||||||
-- self.todayRevive = data.today_revive or 0
|
|
||||||
function ChapterData:addReviveCount()
|
function ChapterData:addReviveCount()
|
||||||
self.revive = self.revive + 1
|
self.revive = self.revive + 1
|
||||||
self.todayRevive = self.todayRevive + 1
|
self.todayRevive = self.todayRevive + 1
|
||||||
@ -599,10 +603,33 @@ function ChapterData:getReviveCount()
|
|||||||
return self.todayRevive
|
return self.todayRevive
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function ChapterData:getReReviveCount()
|
||||||
|
local cfgAdCount = GFunc.getConstIntValue("ads_revive_limit")
|
||||||
|
return cfgAdCount - self.todayRevive
|
||||||
|
end
|
||||||
|
|
||||||
function ChapterData:canAdRevive()
|
function ChapterData:canAdRevive()
|
||||||
local cfgAdCount = GFunc.getConstIntValue("ads_revive_limit")
|
local cfgAdCount = GFunc.getConstIntValue("ads_revive_limit")
|
||||||
return self.todayRevive < cfgAdCount
|
return self.todayRevive < cfgAdCount
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function ChapterData:addDoubleCount()
|
||||||
|
self.todayDouble = self.todayDouble + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
function ChapterData:getDoubleCount()
|
||||||
|
return self.todayDouble
|
||||||
|
end
|
||||||
|
|
||||||
|
function ChapterData:getReDoubleCount()
|
||||||
|
local cfgAdCount = GFunc.getConstIntValue("ads_double_rewards_limit")
|
||||||
|
return cfgAdCount - self.todayDouble
|
||||||
|
end
|
||||||
|
|
||||||
|
function ChapterData:canAdDouble()
|
||||||
|
local cfgAdCount = GFunc.getConstIntValue("ads_double_rewards_limit")
|
||||||
|
return self.todayDouble < cfgAdCount
|
||||||
|
end
|
||||||
--@endregion
|
--@endregion
|
||||||
|
|
||||||
return ChapterData
|
return ChapterData
|
||||||
@ -27,6 +27,14 @@ function DailyChallengeData:init(data)
|
|||||||
self.initDay = Time:getBeginningOfServerToday()
|
self.initDay = Time:getBeginningOfServerToday()
|
||||||
self.popTaskTime = LocalData:getChallengeTaskPopTime()
|
self.popTaskTime = LocalData:getChallengeTaskPopTime()
|
||||||
self.diffLv = data.level or 1
|
self.diffLv = data.level or 1
|
||||||
|
self.revive = data.revive or 0
|
||||||
|
self.todayRevive = data.today_revive or 0
|
||||||
|
self.double = data.double or 0
|
||||||
|
self.todayDouble = data.today_double or 0
|
||||||
|
DataManager:registerCrossDayFunc("DailyChallengeData", function()
|
||||||
|
self.todayRevive = 0
|
||||||
|
self.todayDouble = 0
|
||||||
|
end)
|
||||||
self:setDirty()
|
self:setDirty()
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -336,4 +344,40 @@ function DailyChallengeData:getDifficultyCfg(id)
|
|||||||
return DAILY_CHALLENGE_LEVEL[id]
|
return DAILY_CHALLENGE_LEVEL[id]
|
||||||
end
|
end
|
||||||
--@endregion
|
--@endregion
|
||||||
|
|
||||||
|
--@region 复活 双倍
|
||||||
|
function DailyChallengeData:addReviveCount()
|
||||||
|
self.revive = self.revive + 1
|
||||||
|
self.todayRevive = self.todayRevive + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
function DailyChallengeData:getReviveCount()
|
||||||
|
return self.todayRevive
|
||||||
|
end
|
||||||
|
|
||||||
|
function DailyChallengeData:canAdRevive()
|
||||||
|
local cfgAdCount = GFunc.getConstIntValue("daily_challenge_ads_revive_limit")
|
||||||
|
return self.todayRevive < cfgAdCount
|
||||||
|
end
|
||||||
|
|
||||||
|
function DailyChallengeData:addDoubleCount()
|
||||||
|
self.double = self.double + 1
|
||||||
|
self.todayDouble = self.todayDouble + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
function DailyChallengeData:getDoubleCount()
|
||||||
|
return self.todayDouble
|
||||||
|
end
|
||||||
|
|
||||||
|
function DailyChallengeData:getReDoubleCount()
|
||||||
|
local cfgAdCount = GFunc.getConstIntValue("daily_challenge_ads_double_rewards_limit")
|
||||||
|
return cfgAdCount - self.todayDouble
|
||||||
|
end
|
||||||
|
|
||||||
|
function DailyChallengeData:canAdDouble()
|
||||||
|
local cfgAdCount = GFunc.getConstIntValue("daily_challenge_ads_double_rewards_limit")
|
||||||
|
return self.todayDouble < cfgAdCount
|
||||||
|
end
|
||||||
|
--@endregion
|
||||||
|
|
||||||
return DailyChallengeData
|
return DailyChallengeData
|
||||||
Loading…
x
Reference in New Issue
Block a user