符文副本主界面

This commit is contained in:
xiekaidong 2023-09-07 19:14:39 +08:00
parent c65718119f
commit c0a3356cfd
27 changed files with 624 additions and 4 deletions

View File

@ -199,6 +199,7 @@ BIReport.BATTLE_TYPE = {
["6"] = "DungeonWeapon", ["6"] = "DungeonWeapon",
["7"] = "DungeonArmor", ["7"] = "DungeonArmor",
["8"] = "ActBossRush", ["8"] = "ActBossRush",
["9"] = "DungeonRune",
} }
BIReport.GIFT_TYPE = { BIReport.GIFT_TYPE = {

View File

@ -75,6 +75,8 @@ local MODULE_PATHS = {
ActBossRushManager = "app/module/activity/act_boss_rush/act_boss_rush_manager", ActBossRushManager = "app/module/activity/act_boss_rush/act_boss_rush_manager",
-- 新手14天乐 -- 新手14天乐
FourteenDayManager = "app/module/activity/fourteen_day/fourteen_day_manager", FourteenDayManager = "app/module/activity/fourteen_day/fourteen_day_manager",
-- 符文副本
DungeonRuneManager = "app/module/dungeon_rune/dungeon_rune_manager",
} }
-- 这里的key对应func_open里的id -- 这里的key对应func_open里的id
@ -106,6 +108,7 @@ ModuleManager.MODULE_KEY = {
EQUIP_WEAPON = "equip_weapon_open", -- 武器 EQUIP_WEAPON = "equip_weapon_open", -- 武器
EQUIP_ARMOR = "equip_armor_open", -- 防具 EQUIP_ARMOR = "equip_armor_open", -- 防具
SKIN = "skin_open", -- 皮肤 SKIN = "skin_open", -- 皮肤
RUNES_OPEN = "runes_open", -- 符文
} }
local _moduleMgrs = {} local _moduleMgrs = {}

View File

@ -230,6 +230,7 @@ GConst.ATLAS_PATH = {
ACT_HEROFUND = "assets/arts/atlas/ui/act_herofund.asset", ACT_HEROFUND = "assets/arts/atlas/ui/act_herofund.asset",
ACT_BOSS_RUSH = "assets/arts/atlas/ui/act_bossrush.asset", ACT_BOSS_RUSH = "assets/arts/atlas/ui/act_bossrush.asset",
ACT_COMMON = "assets/arts/atlas/ui/act_common.asset", ACT_COMMON = "assets/arts/atlas/ui/act_common.asset",
UI_DUNGEON_RUNE = "assets/arts/atlas/ui/dungeon_rune.asset",
} }
GConst.TOUCH_EVENT = { GConst.TOUCH_EVENT = {

View File

@ -89,6 +89,7 @@ BattleConst.BATTLE_TYPE = {
DUNGEON_WEAPON = "6", DUNGEON_WEAPON = "6",
DUNGEON_ARMOR = "7", DUNGEON_ARMOR = "7",
ACT_BOSS_RUSH = "8", ACT_BOSS_RUSH = "8",
DUNGEON_RUNE = "9",
} }
BattleConst.IS_PVP_BATTLE = { BattleConst.IS_PVP_BATTLE = {
@ -103,6 +104,7 @@ BattleConst.FORMATION_TYPE = {
DUNGEON_WEAPON = "4", -- 武器副本 DUNGEON_WEAPON = "4", -- 武器副本
DUNGEON_ARMOR = "5", -- 支线副本 DUNGEON_ARMOR = "5", -- 支线副本
BOSS_RUSH = "6", -- boss rush BOSS_RUSH = "6", -- boss rush
DUNGEON_RUNE = "7", -- 符文副本
} }
BattleConst.TYPEOF_LUA_COMP = { BattleConst.TYPEOF_LUA_COMP = {

View File

@ -15,6 +15,7 @@ local BATTLE_CONTROLLER = {
[BattleConst.BATTLE_TYPE.DUNGEON_WEAPON] = "app/module/battle/controller/battle_controller_dungeon_weapon", [BattleConst.BATTLE_TYPE.DUNGEON_WEAPON] = "app/module/battle/controller/battle_controller_dungeon_weapon",
[BattleConst.BATTLE_TYPE.DUNGEON_ARMOR] = "app/module/battle/controller/battle_controller_dungeon_armor", [BattleConst.BATTLE_TYPE.DUNGEON_ARMOR] = "app/module/battle/controller/battle_controller_dungeon_armor",
[BattleConst.BATTLE_TYPE.ACT_BOSS_RUSH] = "app/module/battle/controller/battle_controller_boss_rush", [BattleConst.BATTLE_TYPE.ACT_BOSS_RUSH] = "app/module/battle/controller/battle_controller_boss_rush",
[BattleConst.BATTLE_TYPE.DUNGEON_RUNE] = "app/module/battle/controller/battle_controller_dungeon_rune",
} }
function BattleManager:showPauseUI(battleType, battleController) function BattleManager:showPauseUI(battleType, battleController)

View File

@ -0,0 +1,108 @@
local BattleController = require "app/module/battle/controller/battle_controller"
local BattleControllerDungeonRune = class("BattleControllerDungeonRune", BattleController)
local BattleConst = GConst.BattleConst
local SIDE_ATK = BattleConst.SIDE_ATK
local SIDE_DEF = BattleConst.SIDE_DEF
function BattleControllerDungeonRune:getBoardConfig()
return ConfigManager:getConfig("chapter_board_dungeon_rune")
end
function BattleControllerDungeonRune:getChapterConfig()
return ConfigManager:getConfig("chapter_dungeon_rune")
end
function BattleControllerDungeonRune:getChapterId()
local runeData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.RUNES_OPEN)
return runeData:getCurFightChapterId()
end
function BattleControllerDungeonRune:onLoadComplete(...)
-- 处理技能
local unlockAllSkill = function(side)
local skillPool = self.battleData:getSkillPool(side)
if skillPool then
for elementType, list in pairs(skillPool) do -- 先遍历一下未解锁的技能
if not self.battleData:isUnlockedSkillElementType(elementType, side) then
local skillEntity = self.battleData:getSkillEntityByElement(elementType, side)
if skillEntity then
local skillId = skillEntity:getUnlockId()
if skillId then
self:dealSelectSkill(skillId, nil, side)
end
end
for _, skillId in ipairs(list) do
self:dealSelectSkill(skillId, nil, side)
end
end
end
self.battleUI:refreshSkill(nil, nil, side)
end
end
unlockAllSkill(SIDE_ATK)
unlockAllSkill(SIDE_DEF)
BattleController.onLoadComplete(self, ...)
end
function BattleControllerDungeonRune:controllBattleEnd()
self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_RUNE,
wave = self:getWaveIndex(),
victory = self.victory,
}
local atkReport = {}
local teamEntity = self.battleData:getAtkTeam()
local members = teamEntity:getAllMembers()
for k, v in pairs(members) do
local report = {
heroId = v:getId(),
dmg = v:getDamageCount(),
}
table.insert(atkReport, report)
end
self.combatReport.atkReport = atkReport
if not self.victory then
self.combatReport.wave = self.combatReport.wave - 1
end
ModuleManager.DungeonArmorManager:reqEndChallenge(self.chapterId, self.combatReport, self.taskProgress)
end
function BattleControllerDungeonRune:postWaveOver(atkDead, isQuit)
local deathType = BIReport.FIGHT_DEATH_TYPE.SURVIVE
local waveEndType = BIReport.FIGHT_WAVE_END_TYPE.WIN
if atkDead then
if self.isBossWave then
deathType = BIReport.FIGHT_DEATH_TYPE.BOSS_FAIL
else
deathType = BIReport.FIGHT_DEATH_TYPE.NORMAL_FAIL
end
waveEndType = BIReport.FIGHT_WAVE_END_TYPE.FAIL
end
if isQuit then
waveEndType = BIReport.FIGHT_WAVE_END_TYPE.QUIT
end
local duration = self.waveDurationTime
local totalTime = self.totalDurationTime
local runeData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.RUNES_OPEN)
local startTimes = runeData:getChapterFightCount(self.chapterId)
local isFirstWin = false
if runeData:getPassedMaxId() < self.chapterId and self.victory then
isFirstWin = true
end
local isFianlStep = self:getWaveIndex() >= self.maxWaveIndex
BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.DUNGEON_RUNE, self.battleData, self.chapterId, self:getWaveIndex(), duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount)
end
function BattleControllerDungeonRune:postFightStart()
local runeData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.RUNES_OPEN)
local startTimes = runeData:getChapterFightCount(self.chapterId)
local unlockMaxChapter = runeData:getPassedMaxId() + 1
BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DUNGEON_RUNE, self:getWaveIndex(), self.chapterId, unlockMaxChapter, startTimes)
end
return BattleControllerDungeonRune

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: aa826860d0ee7514cb97e9987cc81970
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 653e48d52b890da40841ac8132ae8139
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,14 @@
local DungeonRuneManager = class("DungeonRuneManager", BaseModule)
function DungeonRuneManager:showMainUI()
UIManager:showUI("app/ui/dungeon_rune/dungeon_rune_main_ui")
end
function DungeonRuneManager:showFightUI(id)
local runeData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.RUNES_OPEN)
if not runeData:canFight(id) then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.PASS_REQUIRE))
end
end
return DungeonRuneManager

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 76e45e325e924d2479fff20458daeea3
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -17,6 +17,8 @@ ItemConst.ITEM_ID_RANDOM_FRAGMENT = 19
ItemConst.ITEM_ID_ARENA_BOUNTY_EXP = 21 ItemConst.ITEM_ID_ARENA_BOUNTY_EXP = 21
ItemConst.ITEM_ID_ARENA_TICKET = 22 ItemConst.ITEM_ID_ARENA_TICKET = 22
ItemConst.ITEM_ID_FOURTEEN_DAY_EXCHANGE = 51 ItemConst.ITEM_ID_FOURTEEN_DAY_EXCHANGE = 51
ItemConst.ITEM_ID_GLOD_WING = 49
ItemConst.ITEM_ID_SLIVER_WING = 50
ItemConst.ITEM_TYPE = { ItemConst.ITEM_TYPE = {
RES = 1, RES = 1,

View File

@ -52,6 +52,11 @@ function ResourceCell:show(itemId, hideAddImg)
ModuleManager.CommerceManager:showBuyArenaTicketUI() ModuleManager.CommerceManager:showBuyArenaTicketUI()
end) end)
self.addImg:setVisible(true) self.addImg:setVisible(true)
elseif itemId == GConst.ItemConst.ITEM_ID_SLIVER_WING then
self.baseObject:addClickListener(function()
-- ModuleManager.CommerceManager:showBuyArenaTicketUI()
end)
self.addImg:setVisible(true)
else else
self.baseObject:removeClickListener() self.baseObject:removeClickListener()
self.addImg:setVisible(false) self.addImg:setVisible(false)

View File

@ -1,5 +1,11 @@
local DungeonBoardCell = class("DungeonBoardCell", BaseCell) local DungeonBoardCell = class("DungeonBoardCell", BaseCell)
local HIDE_REWARD_MODULE = {
[ModuleManager.MODULE_KEY.DUNGEON_WEAPON] = true,
[ModuleManager.MODULE_KEY.DUNGEON_ARMOR] = true,
[ModuleManager.MODULE_KEY.RUNES_OPEN] = true,
}
function DungeonBoardCell:init() function DungeonBoardCell:init()
self.uiMap = self:getUIMap() self.uiMap = self:getUIMap()
@ -95,8 +101,7 @@ function DungeonBoardCell:refreshInfo()
end end
function DungeonBoardCell:refreshRewards() function DungeonBoardCell:refreshRewards()
if self.moduleKey == ModuleManager.MODULE_KEY.DUNGEON_WEAPON or if HIDE_REWARD_MODULE[self.moduleKey] then
self.moduleKey == ModuleManager.MODULE_KEY.DUNGEON_ARMOR then
self.itemReward:getBaseObject():setActive(false) self.itemReward:getBaseObject():setActive(false)
else else
self.itemReward:getBaseObject():setActive(true) self.itemReward:getBaseObject():setActive(true)

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2e72a01d8b6402048b886bf2c7cacf3d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e148733f22b59274a82b62d49cd69ef0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,89 @@
local RuneChapterCell = class("RuneChapterCell", BaseCell)
local BG = {
"assets/arts/textures/background/dungeon_rune/dungeon_equip_bg_3.png",
"assets/arts/textures/background/dungeon_rune/dungeon_equip_bg_2.png",
"assets/arts/textures/background/dungeon_rune/dungeon_equip_bg_5.png",
}
function RuneChapterCell:refresh(id, index, isFinal, chapterListCount)
local uiMap = self:getUIMap()
local bg = uiMap["chapter_cell.bg"]
local touchNode = uiMap["chapter_cell.touch_node"]
if not isFinal then
local bgAsset = BG[2]
local isLeft = index % 2 ~= 0
if isLeft then
bgAsset = BG[1]
touchNode:setAnchoredPositionX(-190)
else
touchNode:setAnchoredPositionX(190)
end
if chapterListCount - 1 == index then
bgAsset = BG[3]
end
bg:setTexture(bgAsset)
bg:setVisible(chapterListCount ~= index)
end
local runeData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.RUNES_OPEN)
local maxPassedId = runeData:getPassedMaxId()
local fightBg = uiMap["chapter_cell.touch_node.bg"]
local curBg = uiMap["chapter_cell.touch_node.bg_cur"]
local lightImg = uiMap["chapter_cell.touch_node.img_light"]
local sweep = uiMap["chapter_cell.touch_node.sweep_bg"]
lightImg:setVisible(false)
sweep:setVisible(false)
local passed = false
if runeData:curFight(id) then -- 正在可打的
curBg:setVisible(true)
fightBg:setVisible(false)
local layer = uiMap["chapter_cell.touch_node.bg_cur.desc"]
layer:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_6, id))
else
curBg:setVisible(false)
fightBg:setVisible(true)
local descMinRound = uiMap["chapter_cell.touch_node.bg.desc_min_round"]
local layer = uiMap["chapter_cell.touch_node.bg.desc"]
layer:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_6, id))
local lock = uiMap["chapter_cell.touch_node.bg.lock"]
if maxPassedId >= id then -- 已通关的
passed = true
local canSweep = runeData:canSweep(id)
sweep:setVisible(canSweep)
if canSweep then
uiMap["chapter_cell.touch_node.sweep_bg.tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.SMASH))
end
lock:setVisible(false)
layer:setAnchoredPositionX(0)
lightImg:setVisible(true)
descMinRound:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_RUNE_MIN, runeData:getChapterPassRound(id)))
else
lock:setVisible(true)
GFunc.centerImgAndTx(lock, layer, 5)
end
end
if not self.rewardCells then
self.rewardCells = {}
for i = 1, 2 do
self.rewardCells[i] = CellManager:addCellComp(uiMap["chapter_cell.touch_node.reward_cell_" .. i], GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
end
end
local rewards = runeData:getChapterRewards(id)
for i, cell in ipairs(self.rewardCells) do
if rewards[i] then
cell:refreshByConfig(rewards[i], passed, passed)
end
end
end
function RuneChapterCell:addClickListener(func)
local uiMap = self:getUIMap()
uiMap["chapter_cell.touch_node"]:addClickListener(func)
end
return RuneChapterCell

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: c088d6f33138d9f408a31d192f2ece9e
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: da93c46173e2d15498c62350462e5213
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -0,0 +1,143 @@
local DungeonRuneMainUI = class("DungeonRuneMainUI", BaseUI)
local RUNE_CHAPTER_CELL = "app/ui/dungeon_rune/cell/rune_chapter_cell"
function DungeonRuneMainUI:getCurrencyParams()
if self.currencyParams == nil then
self.currencyParams = {
itemIds = {
GConst.ItemConst.ITEM_ID_SLIVER_WING,
GConst.ItemConst.ITEM_ID_GLOD_WING,
},
showType = GConst.CURRENCY_TYPE.HORIZONTAL
}
end
return self.currencyParams
end
function DungeonRuneMainUI:onPressBackspace()
self:closeUI()
end
function DungeonRuneMainUI:getPrefabPath()
return "assets/prefabs/ui/dungeon_rune/dungeon_rune_main_ui.prefab"
end
function DungeonRuneMainUI:ctor()
self.runeData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.RUNES_OPEN)
self.chapterList = {}
self.chapterListCount = 0
for id, info in ipairs(ConfigManager:getConfig(self.runeData:getConfigName())) do
table.insert(self.chapterList, id)
self.chapterListCount = self.chapterListCount + 1
end
self.chapterListCount = self.chapterListCount - 1
self.lastChapterId = table.remove(self.chapterList)
self.targetId = self.runeData:getPassedMaxId()
if self.targetId <= 0 then
self.targetId = 1
end
end
function DungeonRuneMainUI:onLoadRootComplete()
self:_display()
self:_addListeners()
self:_bind()
end
function DungeonRuneMainUI:_display()
local uiMap = self.root:genAllChildren()
uiMap["dungeon_rune_main_ui.banner.btn_formation.tx_ok"]:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_4))
uiMap["dungeon_rune_main_ui.banner.btn_rank.tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_10))
self:refreshScrollrect()
self:refreshFormation()
self:refreshRankBtn()
end
function DungeonRuneMainUI:_addListeners()
local uiMap = self.root:genAllChildren()
uiMap["dungeon_rune_main_ui.banner.btn_formation"]:addClickListener(function()
ModuleManager.CommonManager:showFormationUI(GConst.BattleConst.FORMATION_TYPE.DUNGEON_RUNE)
end)
uiMap["dungeon_rune_main_ui.banner.btn_back"]:addClickListener(function()
self:closeUI()
end)
end
function DungeonRuneMainUI:_bind()
self:bind(self.runeData, "isDirty", function()
self:refreshFormation()
-- self:refreshAllCells()
self:refreshRankBtn()
end)
self:bind(DataManager.FormationData, "dirty", function()
self:refreshFormation()
end)
self:bind(DataManager.HeroData, "isDirty", function()
self:refreshFormation()
end)
end
function DungeonRuneMainUI:refreshFormation()
if not self.formationComp then
local uiMap = self.root:genAllChildren()
self.formationComp = uiMap["dungeon_rune_main_ui.hero_formation_comp"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_FORMATION_COMP)
end
self.formationComp:refreshByFormation(DataManager.FormationData:getDungeonRuneFormation())
end
function DungeonRuneMainUI:refreshRankBtn()
local uiMap = self.root:genAllChildren()
local btn = uiMap["dungeon_rune_main_ui.banner.btn_rank"]
if self.runeData:getRankRp() then
btn:addRedPoint(30, 20, 0.8)
else
btn:removeRedPoint()
end
end
function DungeonRuneMainUI:refreshScrollrect()
local uiMap = self.root:genAllChildren()
if not self.scrollRect then
self.scrollRect = uiMap["dungeon_rune_main_ui.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.scrollRect:addInitCallback(function()
return RUNE_CHAPTER_CELL
end)
self.scrollRect:addRefreshCallback(function(index, cell)
cell:refresh(self.chapterList[index], index, false, self.chapterListCount)
end)
self.scrollRect:addInitFinishCallback(function(cell)
cell:addClickListener(function()
self:onClickCell(self.chapterList[cell:getIndex()])
end)
end)
end
self.scrollRect:refillCells(self.chapterListCount, nil, self.targetId)
local content = uiMap["dungeon_rune_main_ui.scrollrect.viewport.content"]
content:setSizeDeltaY(279 * (self.chapterListCount - 1) + 966)
if not self.lastChapterCell then
self.lastChapterCell = CellManager:addCellComp(uiMap["dungeon_rune_main_ui.scrollrect.viewport.content.last_cell"], RUNE_CHAPTER_CELL)
end
self.lastChapterCell:refresh(self.lastChapterId, nil, true)
self.lastChapterCell:addClickListener(function()
self:onClickCell(self.lastChapterId)
end)
end
function DungeonRuneMainUI:refreshAllCells()
if not self.scrollRect then
return
end
self.scrollRect:refreshAll()
end
function DungeonRuneMainUI:onClickCell(id)
ModuleManager.DungeonRuneManager:showFightUI(id)
end
return DungeonRuneMainUI

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 8354d453e6a43954b9411e730327a55e
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -127,7 +127,7 @@ function DungeonArmorEntity:isNoTotalLimit()
return true return true
end end
function DungeonBaseEntity:isNotShowLimitCount() function DungeonArmorEntity:isNotShowLimitCount()
return true return true
end end

View File

@ -5,6 +5,7 @@ local SORT_ORDER = {
[ModuleManager.MODULE_KEY.DUNGEON_SHARDS] = 2, [ModuleManager.MODULE_KEY.DUNGEON_SHARDS] = 2,
[ModuleManager.MODULE_KEY.DUNGEON_WEAPON] = 3, [ModuleManager.MODULE_KEY.DUNGEON_WEAPON] = 3,
[ModuleManager.MODULE_KEY.DUNGEON_ARMOR] = 4, [ModuleManager.MODULE_KEY.DUNGEON_ARMOR] = 4,
[ModuleManager.MODULE_KEY.RUNES_OPEN] = 5,
} }
-- 所有活动副本数据 -- 所有活动副本数据
@ -98,6 +99,7 @@ function DungeonData:initAllDataClass()
self.dataDungeons[ModuleManager.MODULE_KEY.DUNGEON_SHARDS] = require "app/userdata/dungeon/dungeon_shards_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_ARMOR] = require "app/userdata/dungeon/dungeon_armor_entity":create()
self.dataDungeons[ModuleManager.MODULE_KEY.DUNGEON_WEAPON] = require "app/userdata/dungeon/dungeon_weapon_entity":create() self.dataDungeons[ModuleManager.MODULE_KEY.DUNGEON_WEAPON] = require "app/userdata/dungeon/dungeon_weapon_entity":create()
self.dataDungeons[ModuleManager.MODULE_KEY.RUNES_OPEN] = require "app/userdata/dungeon/dungeon_rune_entity":create()
if EDITOR_MODE then if EDITOR_MODE then
Logger.logHighlight("星期".. tostring(Time:getWeekByTimeStamp())) Logger.logHighlight("星期".. tostring(Time:getWeekByTimeStamp()))

View File

@ -0,0 +1,151 @@
local DungeonBaseEntity = require "app/userdata/dungeon/dungeon_base_entity"
local DungeonRuneEntity = class("DungeonRuneEntity", DungeonBaseEntity)
local FUND_AD_REWARD_ID = 1
function DungeonRuneEntity:ctor()
self.data.isDirty = false
self.maxPassedId = 0
self.curday = 1
self.runeInfo = {}
end
function DungeonRuneEntity:clear()
self.data.isDirty = false
DataManager:unregisterCrossDayFunc("DungeonRuneEntity")
end
function DungeonRuneEntity:init(data)
if EDITOR_MODE then
Logger.logHighlight("-----DungeonRuneEntity------")
Logger.printTable(data)
end
self.totalChallengeCount = data.total_challenge_count
self.maxPassedId = data.max_challenge_id or 0
self.curday = data.curday
self.runeInfo = data.rune_info or {}
self.heroes = data.heroes or {}
self.rankInfo = {}
self.selfRankInfo = {}
self.lastRankInfo = {}
self.needGetRankReward = false
DataManager.FormationData:initFormationByType(GConst.BattleConst.FORMATION_TYPE.DUNGEON_RUNE, self.heroes)
DataManager:registerCrossDayFunc("DungeonRuneEntity", function()
self.curday = self.curday + 1
if self.curday > 30 then
self.maxPassedId = 0
self.curday = 1
self.runeInfo = {}
self.rankInfo = {}
self.selfRankInfo = {}
self.lastRankInfo = {}
self.needGetRankReward = false
end
self:setDirty()
end)
end
function DungeonRuneEntity:setDirty()
self.data.isDirty = not self.data.isDirty
end
function DungeonRuneEntity:getModuleKey()
return ModuleManager.MODULE_KEY.RUNES_OPEN
end
function DungeonRuneEntity:getConfig(chapterId)
return ConfigManager:getConfig(self:getConfigName())[chapterId]
end
function DungeonRuneEntity:getConfigName()
return "chapter_dungeon_rune"
end
function DungeonRuneEntity:getTitleString()
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_RUNE_TITLE)
end
function DungeonRuneEntity:getRuleString()
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_RUNE_HELP)
end
function DungeonRuneEntity:getOpenWeekString()
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_RUNE_DESC)
end
function DungeonRuneEntity:getBanner()
return "assets/arts/textures/background/dungeon/dungeon_bg_4.png"
end
function DungeonRuneEntity:getOpenTextColor()
return "#FFFFFF"
end
function DungeonRuneEntity:isNoTotalLimit()
return true
end
function DungeonRuneEntity:isNotShowLimitCount()
return true
end
function DungeonRuneEntity:getIsAllTimeOpen()
return true
end
function DungeonRuneEntity:onClickFight()
ModuleManager.DungeonRuneManager:showMainUI()
end
function DungeonRuneEntity:getTodayRemainLimitCount()
return DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_GLOD_WING)
end
function DungeonRuneEntity:getBuySliverWingCost()
if not self.buySliverWingCost then
self.buySliverWingCost = GFunc.getConstReward("dungeon_rune_cost")
end
return self.buySliverWingCost
end
function DungeonRuneEntity:getPassedMaxId()
return self.maxPassedId
end
function DungeonRuneEntity:getRankRp()
return true
end
function DungeonRuneEntity:canSweep(id)
if id > self.maxPassedId then
return false
end
return DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_SLIVER_WING) > 0
end
function DungeonRuneEntity:canFight(id)
if self.maxPassedId + 1 >= id then
return true
end
return false
end
function DungeonRuneEntity:curFight(id)
return id == self.maxPassedId + 1
end
function DungeonRuneEntity:getChapterPassRound(id)
if not self.runeInfo[id] then
return 0
end
return self.runeInfo[id].round or 0
end
function DungeonRuneEntity:getChapterRewards(id)
return self:getConfig(id).first_reward
end
return DungeonRuneEntity

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: b4d7cf896fcc1cd4dbe9ac46426cc9f8
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -182,7 +182,7 @@ function DungeonWeaponEntity:doCachePassInfo(chapterId, info)
self:setDirty() self:setDirty()
end end
function DungeonBaseEntity:getCachePassInfo(chapterId) function DungeonWeaponEntity:getCachePassInfo(chapterId)
if not self.cachePassInfo then if not self.cachePassInfo then
self.cachePassInfo = {} self.cachePassInfo = {}
end end

View File

@ -127,6 +127,15 @@ function FormationData:getBossRushFormation()
return formation return formation
end end
function FormationData:getDungeonRuneFormation()
local formation = self:getFormation(GConst.BattleConst.FORMATION_TYPE.DUNGEON_RUNE)
if table.nums(formation) <= 0 then
self:setFormation(GConst.BattleConst.FORMATION_TYPE.DUNGEON_RUNE, self:getFormation(GConst.BattleConst.FORMATION_TYPE.STAGE)) -- 如果没有,则用默认关卡
formation = self:getFormation(GConst.BattleConst.FORMATION_TYPE.DUNGEON_RUNE)
end
return formation
end
function FormationData:getFormation(formationType) function FormationData:getFormation(formationType)
local formation = self.formations[formationType] local formation = self.formations[formationType]
if formation == nil then if formation == nil then