diff --git a/lua/app/common/event_manager.lua b/lua/app/common/event_manager.lua index b6700344..5f4fd13f 100644 --- a/lua/app/common/event_manager.lua +++ b/lua/app/common/event_manager.lua @@ -23,9 +23,9 @@ EventManager.CUSTOM_EVENT = { SHOW_ELIMINATION_TUTORAIL = "SHOW_ELIMINATION_TUTORAIL", BOARD_FILL_OVER = "BOARD_FILL_OVER", LOGIN_REQ_SUCCESS = "LOGIN_REQ_SUCCESS", - DAILY_TASK_ADD_PROGRESS = "DAILY_TASK_ADD_PROGRESS", + DAILY_TASK_COMPLETE = "DAILY_TASK_COMPLETE", -- 每日任务完成 BOSS_ENTER_ANI_OVER = "BOSS_ENTER_ANI_OVER", - TIME_TRIGGERED_NEW_EMAIL = "TIME_TRIGGERED_NEW_EMAIL", -- 邮件到时间请求是否有新邮件 + TIME_TRIGGERED_NEW_EMAIL = "TIME_TRIGGERED_NEW_EMAIL", -- 邮件到时间请求是否有新邮件 SKILL_REFRESH_SUCC = "SKILL_REFRESH_SUCC", GO_SHOP = "GO_SHOP", -- 跳转商店 -- BORAD_TOUCH_BEGIN = "BORAD_TOUCH_BEGIN", diff --git a/lua/app/module/battle/team/battle_team.lua b/lua/app/module/battle/team/battle_team.lua index 9682aa24..c6d052f1 100644 --- a/lua/app/module/battle/team/battle_team.lua +++ b/lua/app/module/battle/team/battle_team.lua @@ -278,13 +278,13 @@ function BattleTeam:addBuff(buffEffect) else table.insert(self.buffList, buffEffect) self:updateBuffState(buffEffect.buff, 1) - if buffEffect.buff:getIcon() then - self.battleController:refreshBuff(self.side, self.buffList) - end - needRecycle = buffEffect end + if buffEffect.buff:getIcon() then + self.battleController:refreshBuff(self.side, self.buffList) + end + return needRecycle end diff --git a/lua/app/module/task/task_manager.lua b/lua/app/module/task/task_manager.lua index ad54959e..9621afcd 100644 --- a/lua/app/module/task/task_manager.lua +++ b/lua/app/module/task/task_manager.lua @@ -2,8 +2,10 @@ local TaskManager = class("TaskManager", BaseModule) local BATTLE_TASK_FIELD = GConst.BattleConst.BATTLE_TASK_FIELD function TaskManager:init() - self:addEventListener(EventManager.CUSTOM_EVENT.DAILY_TASK_ADD_PROGRESS, function(id, taskId, from, to) - ModuleManager.TaskToastManager:showToast(id, taskId, from, to) + self:addEventListener(EventManager.CUSTOM_EVENT.DAILY_TASK_COMPLETE, function(id, taskId, from, to) + if DataManager.DailyTaskData:getIsOpen() then + ModuleManager.TaskToastManager:showToast(id, taskId, from, to) + end end) self:addEventListener(EventManager.CUSTOM_EVENT.UI_SHOW_COMPLETE, function() ModuleManager.TaskToastManager:checkOnOpenUI() diff --git a/lua/app/ui/battle/battle_ui.lua b/lua/app/ui/battle/battle_ui.lua index ff40fb45..85dc3ea6 100644 --- a/lua/app/ui/battle/battle_ui.lua +++ b/lua/app/ui/battle/battle_ui.lua @@ -1920,7 +1920,10 @@ function BattleUI:showTutorialFinger(posIdList) end self.showTutorialFingerSeq:AppendCallback(function() self.battleController:clearGridSequence() + self.tutorialFinger:setAnchoredPositionX(DEFAULT_X) + self:showBoardMask(nil) end) + self.showTutorialFingerSeq:AppendInterval(1) self.showTutorialFingerSeq:SetLoops(-1) end diff --git a/lua/app/ui/task/cell/daily_task_cell.lua b/lua/app/ui/task/cell/daily_task_cell.lua index 3bd8ac4f..349c3726 100644 --- a/lua/app/ui/task/cell/daily_task_cell.lua +++ b/lua/app/ui/task/cell/daily_task_cell.lua @@ -37,6 +37,10 @@ function DailyTaskCell:init() self.lockBg = uiMap["task_cell.lock_bg"] local lockBtn = uiMap["task_cell.lock_node.lock_btn.btn"] lockBtn:addClickListener(function() + if DataManager.BountyData:getIsOpen() then + DataManager.BountyData:clearPopBought() + ModuleManager.BountyManager:showBountyMainUI() + end end) local lockBtnTx = uiMap["task_cell.lock_node.lock_btn.btn.text"] lockBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.STR_UNLOCK)) diff --git a/lua/app/ui/task/task_main_ui.lua b/lua/app/ui/task/task_main_ui.lua index 09bff2d7..fe5a7bb3 100644 --- a/lua/app/ui/task/task_main_ui.lua +++ b/lua/app/ui/task/task_main_ui.lua @@ -17,10 +17,10 @@ local function sortTask(taskList) if completeA then return a.id < b.id else -- 没有完成的优先显示战令解锁 - if a.bountyLock == b.bountyLock then + if a.lock == b.lock then return a.id < b.id else - return a.bountyLock + return b.lock end end else diff --git a/lua/app/userdata/battle/skill/battle_skill_entity.lua b/lua/app/userdata/battle/skill/battle_skill_entity.lua index feb962b4..9142ebde 100644 --- a/lua/app/userdata/battle/skill/battle_skill_entity.lua +++ b/lua/app/userdata/battle/skill/battle_skill_entity.lua @@ -115,15 +115,13 @@ function BattleSkillEntity:addSkillEffectParams(effect) for _, entity in ipairs(self.effectList) do if entity:getName() == effect.type then buffEntity = entity - break + buffEntity:setEffectNum(buffEntity:getEffectNum() + effect.num) end end if not buffEntity then buffEntity = BattleBuffEntity:create() buffEntity:init(effect, self.owner, self) table.insert(self.effectList, buffEntity) - else - buffEntity:setEffectNum(buffEntity:getEffectNum() + effect.num) end end @@ -132,15 +130,13 @@ function BattleSkillEntity:addSkillEffectRound(effect) for _, entity in ipairs(self.effectList) do if entity:getName() == effect.type then buffEntity = entity - break + buffEntity:setRound(buffEntity:getRound() + effect.round) end end if not buffEntity then buffEntity = BattleBuffEntity:create() buffEntity:init(effect, self.owner, self) table.insert(self.effectList, buffEntity) - else - buffEntity:setRound(buffEntity:getRound() + effect.round) end end diff --git a/lua/app/userdata/bounty/bounty_data.lua b/lua/app/userdata/bounty/bounty_data.lua index 5b4dfbfd..2b39c96e 100644 --- a/lua/app/userdata/bounty/bounty_data.lua +++ b/lua/app/userdata/bounty/bounty_data.lua @@ -335,6 +335,10 @@ function BountyData:markPopBought() LocalData:setBountyPopTime(self.popBoughtTime) end +function BountyData:clearPopBought() + self.popBoughtTime = 0 +end + function BountyData:getRechargeId(advanced) local cfg = ConfigManager:getConfig("act_gift") local id = self:getGiftId(advanced) diff --git a/lua/app/userdata/task/daily_task_data.lua b/lua/app/userdata/task/daily_task_data.lua index e66ffa3e..ca3dffe7 100644 --- a/lua/app/userdata/task/daily_task_data.lua +++ b/lua/app/userdata/task/daily_task_data.lua @@ -46,24 +46,28 @@ function DailyTaskData:init(data) type = v.type, reset = v.reset } - if not dailyTaskObj.claimed and dailyTaskObj.progress >= dailyTaskObj.needProgress then - dailyTaskObj.redPoint = true - if dailyTaskObj.type == 1 then - dailyRedPoint = dailyRedPoint + 1 - else - challengeRedPoint = challengeRedPoint + 1 - end - else - dailyTaskObj.redPoint = false - end if v.bounty then - if self.isUnlockBountyDailyTask then - dailyTaskObj.lock = false - else - dailyTaskObj.lock = true - end + if self.isUnlockBountyDailyTask then + dailyTaskObj.lock = false + else + dailyTaskObj.lock = true + end + else + dailyTaskObj.lock = false end - if not dailyTaskObj.lock then -- 只有解锁的任务才注册监听任务进度 + if dailyTaskObj.lock then + dailyTaskObj.redPoint = false + else + if not dailyTaskObj.claimed and dailyTaskObj.progress >= dailyTaskObj.needProgress then + dailyTaskObj.redPoint = true + if dailyTaskObj.type == 1 then + dailyRedPoint = dailyRedPoint + 1 + else + challengeRedPoint = challengeRedPoint + 1 + end + else + dailyTaskObj.redPoint = false + end local list = self.taskTypeMap[taskInfo.type] if list == nil then list = {} @@ -130,11 +134,11 @@ function DailyTaskData:refreshDailyTask(task) dailyTaskObj.type = dailyTaskInfo.type dailyTaskObj.reset = dailyTaskInfo.reset local redPoint = false - if not dailyTaskObj.claimed and dailyTaskObj.progress >= dailyTaskObj.needProgress then + if not dailyTaskObj.lock and not dailyTaskObj.claimed and dailyTaskObj.progress >= dailyTaskObj.needProgress then redPoint = true end local originTaskType = originTaskInfo.type - if originTaskType ~= taskInfo.type then -- 任务类型变了 + if not dailyTaskObj.lock and originTaskType ~= taskInfo.type then -- 任务类型变了 self:unregisterTask(id, originTaskType) self:registerTask(dailyTaskObj, taskInfo.type) end @@ -307,6 +311,9 @@ function DailyTaskData:getIfCanClaimTask(task) end function DailyTaskData:addTaskProgress(task, taskType, count) + if task.lock then + return + end local currProgress = task.progress if currProgress >= task.needProgress then return @@ -314,7 +321,7 @@ function DailyTaskData:addTaskProgress(task, taskType, count) local can = self:getIfCanClaimTask(task) task.progress = task.progress + count if not can and self:getIfCanClaimTask(task) then - EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.DAILY_TASK_ADD_PROGRESS, task.id, task.taskId, currProgress, task.needProgress) + EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.DAILY_TASK_COMPLETE, task.id, task.taskId, currProgress, task.needProgress) if task.type == 1 and task.reset == 1 and taskType ~= GConst.TaskConst.TASK_TYPE.COMPLETED_DALY_TASK then ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.COMPLETED_DALY_TASK) end