diff --git a/lua/app/common/data_manager.lua b/lua/app/common/data_manager.lua index 5f1cbf32..680fbde3 100644 --- a/lua/app/common/data_manager.lua +++ b/lua/app/common/data_manager.lua @@ -133,6 +133,8 @@ function DataManager:initWithServerData(data) self.DailyChallengeData:init(data.chapter_daily_challenge) self.DungeonData:initDungeonGold(data.chapter_gold_challenge) self.DungeonData:initDungeonShards(data.chapter_shards_challenge) + self.DungeonData:initDungeonWeapon(data.chapter_weapon_challenge) + self.DungeonData:initDungeonArmor(data.chapter_armor_challenge) self.HeroData:init(data.bag.heroes) self.BagData:init(data.bag) self.FormationData:init(data.fight_info) diff --git a/lua/app/common/module_manager.lua b/lua/app/common/module_manager.lua index 763a7227..86c61778 100644 --- a/lua/app/common/module_manager.lua +++ b/lua/app/common/module_manager.lua @@ -84,6 +84,8 @@ ModuleManager.MODULE_KEY = { ARENA = "arena_open", -- 竞技场 ARENA_GIFT = "act_arena_gift", -- 竞技场礼包 COLLECT = "collection_open", -- 收集 + DUNGEON_ARMOR = "dungeon_armor_open", -- 支线副本 + DUNGEON_WEAPON = "dungeon_weapon_open", -- 装备副本 } local _moduleMgrs = {} diff --git a/lua/app/config/strings/cn/global.lua b/lua/app/config/strings/cn/global.lua index 466a6261..44e39fa8 100644 --- a/lua/app/config/strings/cn/global.lua +++ b/lua/app/config/strings/cn/global.lua @@ -350,6 +350,14 @@ local localization_global = ["COLLECTION_DESC_12"] = "再升一级可领取", ["TIME_BEFORE_STR_H"] = "{0}小时前", ["TIME_BEFORE_STR_M"] = "{0}分钟前", + + ["DUNGEON_ARMOR_DESC_1"] = "通天藤曼", + ["DUNGEON_ARMOR_DESC_2"] = "通天藤曼帮助文本", + ["DUNGEON_ARMOR_DESC_3"] = "通天藤曼副本描述", + + ["DUNGEON_WEAPON_DESC_1"] = "帝国军械库", + ["DUNGEON_WEAPON_DESC_2"] = "帝国军械库帮助文本", + ["DUNGEON_WEAPON_DESC_3"] = "帝国军械库副本描述", } return localization_global \ No newline at end of file diff --git a/lua/app/ui/dungeon/dungeon_board_cell.lua b/lua/app/ui/dungeon/dungeon_board_cell.lua index a66775a6..3f9e64d4 100644 --- a/lua/app/ui/dungeon/dungeon_board_cell.lua +++ b/lua/app/ui/dungeon/dungeon_board_cell.lua @@ -87,10 +87,15 @@ function DungeonBoardCell:refreshCountdown(txCountdown) self:getBaseObject():unscheduleGlobal(self.countdownSid) self.countdownSid = nil end - self.countdownSid = self:getBaseObject():scheduleGlobal(function() + if DataManager.DungeonData:getIsAllTimeOpen(self.moduleKey) then + txCountdown:setVisible(false) + else + txCountdown:setVisible(true) + self.countdownSid = self:getBaseObject():scheduleGlobal(function() + self:updateTime(txCountdown) + end, 1) self:updateTime(txCountdown) - end, 1) - self:updateTime(txCountdown) + end end function DungeonBoardCell:updateTime(txCountdown) diff --git a/lua/app/userdata/dungeon/dungeon_armor_entity.lua b/lua/app/userdata/dungeon/dungeon_armor_entity.lua new file mode 100644 index 00000000..e2ac5e82 --- /dev/null +++ b/lua/app/userdata/dungeon/dungeon_armor_entity.lua @@ -0,0 +1,64 @@ +local DungeonBaseEntity = require "app/userdata/dungeon/dungeon_base_entity" +local DungeonArmorEntity = class("DungeonArmorEntity", DungeonBaseEntity) + +-- 支线副本数据 + +function DungeonArmorEntity:init(data) + self.maxPassedId = data.max_challenge_id + self.armorInfo = data.armor_info + self.farmCount = data.farm_count + self.heroes = data.heroes + self.fundRewards = data.fund_rewards + self.giftInfo = data.gift_info + self.totalChallengeCount = data.total_challenge_count +end + +function DungeonArmorEntity:getTotalChallengeCount() + return self.totalChallengeCount +end + +function DungeonArmorEntity:getTodayChallengeCount() + return 0 +end + +function DungeonArmorEntity:getPassedMaxId() + return self.maxPassedId +end + +function DungeonArmorEntity:getIsAllTimeOpen() + return true +end + +function DungeonArmorEntity:getModuleKey() + return ModuleManager.MODULE_KEY.DUNGEON_ARMOR +end + +function DungeonArmorEntity:getConfigName() + return "chapter_dungeon_armor" +end + +function DungeonArmorEntity:getTitleString() + return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_ARMOR_DESC_1) +end + +function DungeonArmorEntity:getRuleString() + return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_ARMOR_DESC_2) +end + +function DungeonArmorEntity:getOpenWeekString() + return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_ARMOR_DESC_3) +end + +function DungeonArmorEntity:getBanner() + return "assets/arts/textures/background/dungeon/dungeon_bg_4.png" +end + +function DungeonArmorEntity:getOpenTextColor() + return "#FFEDC5" +end + +function DungeonArmorEntity:getChallengeHpCost() + return GFunc.getConstReward("dungeon_armor_limit") +end + +return DungeonArmorEntity \ No newline at end of file diff --git a/lua/app/userdata/dungeon/dungeon_armor_entity.lua.meta b/lua/app/userdata/dungeon/dungeon_armor_entity.lua.meta new file mode 100644 index 00000000..b10cbd42 --- /dev/null +++ b/lua/app/userdata/dungeon/dungeon_armor_entity.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e6bcb1d833ae6564dbd1fcd0827e589e +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/userdata/dungeon/dungeon_base_entity.lua b/lua/app/userdata/dungeon/dungeon_base_entity.lua index de40104e..4f360319 100644 --- a/lua/app/userdata/dungeon/dungeon_base_entity.lua +++ b/lua/app/userdata/dungeon/dungeon_base_entity.lua @@ -16,6 +16,10 @@ function DungeonBaseEntity:getOpenWeekCycle() return nil end +function DungeonBaseEntity:getIsAllTimeOpen() + return false +end + -- 获取副本配置名称 function DungeonBaseEntity:getConfigName() return nil @@ -63,7 +67,7 @@ end -- 获取今日已挑战次数 function DungeonBaseEntity:getTodayChallengeCount() - return nil + return 0 end -- 获取已通关的最大副本id @@ -78,7 +82,7 @@ end -- 获取每日最大挑战次数 function DungeonBaseEntity:getTodayMaxCount() - return nil + return 1 end -- 获取看板展示的副本奖励(返回id list) @@ -88,12 +92,12 @@ end -- 获取首通奖励个数 function DungeonBaseEntity:getFirstRewardNum() - return nil + return 0 end -- 获取通关奖励个数 function DungeonBaseEntity:getPassRewardNum() - return nil + return 0 end diff --git a/lua/app/userdata/dungeon/dungeon_data.lua b/lua/app/userdata/dungeon/dungeon_data.lua index 5da25d7e..eebc21b1 100644 --- a/lua/app/userdata/dungeon/dungeon_data.lua +++ b/lua/app/userdata/dungeon/dungeon_data.lua @@ -1,5 +1,9 @@ local DungeonData = class("DungeonData", BaseData) +local SORT_ORDER = { + +} + -- 所有活动副本数据 function DungeonData:ctor() @@ -43,12 +47,49 @@ function DungeonData:initDungeonShards(data) self:setDirty() end +-- 初始化支线副本数据 +function DungeonData:initDungeonArmor(data) + if data == nil then + return + end + + if EDITOR_MODE then + Logger.logHighlight("更新支线副本数据") + Logger.printTable(data) + end + + self:initAllDataClass() + self.dataDungeons[ModuleManager.MODULE_KEY.DUNGEON_ARMOR]:init(data) + self.data.armor = data + self:setDirty() +end + +-- 初始化支线副本数据 +function DungeonData:initDungeonWeapon(data) + if data == nil then + return + end + + if EDITOR_MODE then + Logger.logHighlight("更新武器副本数据") + Logger.printTable(data) + end + + self:initAllDataClass() + self.dataDungeons[ModuleManager.MODULE_KEY.DUNGEON_WEAPON]:init(data) + self.data.weapon = data + self:setDirty() +end + + -- 初始化所有副本数据类 function DungeonData:initAllDataClass() if self.dataDungeons == nil then self.dataDungeons = {} self.dataDungeons[ModuleManager.MODULE_KEY.DUNGEON_GOLD] = require "app/userdata/dungeon/dungeon_gold_entity":create() self.dataDungeons[ModuleManager.MODULE_KEY.DUNGEON_SHARDS] = require "app/userdata/dungeon/dungeon_shards_entity":create() + self.dataDungeons[ModuleManager.MODULE_KEY.DUNGEON_ARMOR] = require "app/userdata/dungeon/dungeon_armor_entity":create() + self.dataDungeons[ModuleManager.MODULE_KEY.DUNGEON_WEAPON] = require "app/userdata/dungeon/dungeon_weapon_entity":create() if EDITOR_MODE then Logger.logHighlight("星期".. tostring(Time:getWeekByTimeStamp())) @@ -183,6 +224,10 @@ function DungeonData:isActiveCycle(moduleKey, checkWeek) return false end + if self:getIsAllTimeOpen(moduleKey) then + return true + end + for index, week in ipairs(self.dataDungeons[moduleKey]:getOpenWeekCycle()) do if week == checkWeek then return true @@ -306,6 +351,10 @@ function DungeonData:getCloseTime(moduleKey) return 0 end + if self:getIsAllTimeOpen(moduleKey) then + return 1 + end + local isActive = true local count = 0 while isActive do @@ -398,4 +447,8 @@ function DungeonData:getCurFightChapterId() return self.curFightchapterId or 1 end +function DungeonData:getIsAllTimeOpen(moduleKey) + return self.dataDungeons[moduleKey]:getIsAllTimeOpen() +end + return DungeonData \ No newline at end of file diff --git a/lua/app/userdata/dungeon/dungeon_weapon_entity.lua b/lua/app/userdata/dungeon/dungeon_weapon_entity.lua new file mode 100644 index 00000000..32e707d1 --- /dev/null +++ b/lua/app/userdata/dungeon/dungeon_weapon_entity.lua @@ -0,0 +1,62 @@ +local DungeonBaseEntity = require "app/userdata/dungeon/dungeon_base_entity" +local DungeonWeaponEntity = class("DungeonWeaponEntity", DungeonBaseEntity) + +-- 支线副本数据 + +function DungeonWeaponEntity:init(data) + self.maxPassedId = data.max_challenge_id + self.farmCount = data.farm_count + self.heroes = data.heroes + self.giftInfo = data.gift_info + self.totalChallengeCount = data.total_challenge_count +end + +function DungeonWeaponEntity:getTotalChallengeCount() + return self.totalChallengeCount +end + +function DungeonWeaponEntity:getTodayChallengeCount() + return 0 +end + +function DungeonWeaponEntity:getPassedMaxId() + return self.maxPassedId +end + +function DungeonWeaponEntity:getIsAllTimeOpen() + return true +end + +function DungeonWeaponEntity:getModuleKey() + return ModuleManager.MODULE_KEY.DUNGEON_WEAPON +end + +function DungeonWeaponEntity:getConfigName() + return "chapter_dungeon_equip" +end + +function DungeonWeaponEntity:getTitleString() + return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_1) +end + +function DungeonWeaponEntity:getRuleString() + return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_2) +end + +function DungeonWeaponEntity:getOpenWeekString() + return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_3) +end + +function DungeonWeaponEntity:getBanner() + return "assets/arts/textures/background/dungeon/dungeon_bg_3.png" +end + +function DungeonWeaponEntity:getOpenTextColor() + return "#FFEDC5" +end + +function DungeonWeaponEntity:getChallengeHpCost() + return GFunc.getConstReward("dungeon_armor_limit") +end + +return DungeonWeaponEntity \ No newline at end of file diff --git a/lua/app/userdata/dungeon/dungeon_weapon_entity.lua.meta b/lua/app/userdata/dungeon/dungeon_weapon_entity.lua.meta new file mode 100644 index 00000000..7e238b75 --- /dev/null +++ b/lua/app/userdata/dungeon/dungeon_weapon_entity.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9514a9828a718a24a9ca66021a56545d +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}