战斗优化调整
This commit is contained in:
parent
61b73d9c8f
commit
1ef1f34c7a
@ -24,9 +24,14 @@ function BattleControllerDungeonRune:initOther()
|
|||||||
self.canRebirthTimes = 1 -- 每次只能复活一次
|
self.canRebirthTimes = 1 -- 每次只能复活一次
|
||||||
self.addRoundCount = runeData:getRebirthAddRoundCount()
|
self.addRoundCount = runeData:getRebirthAddRoundCount()
|
||||||
self.dungeonRuneRemainRoundCount = self:getChapterConfig()[self.chapterId].round or 1
|
self.dungeonRuneRemainRoundCount = self:getChapterConfig()[self.chapterId].round or 1
|
||||||
|
self.dungeonRuneMaxRoundCount = self.dungeonRuneRemainRoundCount
|
||||||
|
|
||||||
if self.battleUI then
|
if self.battleUI then
|
||||||
self.battleUI:refreshWave(self.dungeonRuneRemainRoundCount, GConst.ATLAS_PATH.COMMON, "common_dec_15")
|
local desc = self.dungeonRuneRemainRoundCount
|
||||||
|
if not self.isBossChapter then
|
||||||
|
desc = I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_6, self.chapterId)
|
||||||
|
end
|
||||||
|
self.battleUI:refreshWave(desc, GConst.ATLAS_PATH.COMMON, "common_dec_15")
|
||||||
end
|
end
|
||||||
|
|
||||||
self.runeMaxLv = runeData:getBattleMaxlv() or 1
|
self.runeMaxLv = runeData:getBattleMaxlv() or 1
|
||||||
@ -144,14 +149,22 @@ function BattleControllerDungeonRune:onEnterNextWave()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleControllerDungeonRune:enterRoundBegin()
|
function BattleControllerDungeonRune:enterRoundBegin()
|
||||||
|
if self.battleUI.refreshTaskNode then
|
||||||
|
self.battleUI:refreshTaskNode()
|
||||||
|
end
|
||||||
if self.dungeonRuneRemainRoundCount <= 0 then
|
if self.dungeonRuneRemainRoundCount <= 0 then
|
||||||
if self.canRebirthTimes > 0 and not self.isBossChapter then
|
if self.canRebirthTimes > 0 and not self.isBossChapter then
|
||||||
ModuleManager.DungeonRuneManager:showRebirthUI(function()
|
ModuleManager.DungeonRuneManager:showRebirthUI(function()
|
||||||
self.canRebirthTimes = self.canRebirthTimes - 1
|
self.canRebirthTimes = self.canRebirthTimes - 1
|
||||||
self.dungeonRuneRemainRoundCount = self.dungeonRuneRemainRoundCount + self.addRoundCount
|
self.dungeonRuneRemainRoundCount = self.dungeonRuneRemainRoundCount + self.addRoundCount
|
||||||
|
self.dungeonRuneMaxRoundCount = self.dungeonRuneMaxRoundCount + self.addRoundCount
|
||||||
self.dungeonRuneRemainRoundCount = self.dungeonRuneRemainRoundCount - 1
|
self.dungeonRuneRemainRoundCount = self.dungeonRuneRemainRoundCount - 1
|
||||||
if self.battleUI then
|
if self.battleUI then
|
||||||
self.battleUI:refreshWave(self.dungeonRuneRemainRoundCount + 1, GConst.ATLAS_PATH.COMMON, "common_dec_15")
|
local desc = self.dungeonRuneRemainRoundCount + 1
|
||||||
|
if not self.isBossChapter then
|
||||||
|
desc = I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_6, self.chapterId)
|
||||||
|
end
|
||||||
|
self.battleUI:refreshWave(desc, GConst.ATLAS_PATH.COMMON, "common_dec_15")
|
||||||
end
|
end
|
||||||
BattleController.enterRoundBegin(self)
|
BattleController.enterRoundBegin(self)
|
||||||
end, function()
|
end, function()
|
||||||
@ -169,11 +182,22 @@ function BattleControllerDungeonRune:enterRoundBegin()
|
|||||||
|
|
||||||
self.dungeonRuneRemainRoundCount = self.dungeonRuneRemainRoundCount - 1
|
self.dungeonRuneRemainRoundCount = self.dungeonRuneRemainRoundCount - 1
|
||||||
if self.battleUI then
|
if self.battleUI then
|
||||||
self.battleUI:refreshWave(self.dungeonRuneRemainRoundCount + 1, GConst.ATLAS_PATH.COMMON, "common_dec_15")
|
local desc = self.dungeonRuneRemainRoundCount + 1
|
||||||
|
if not self.isBossChapter then
|
||||||
|
desc = I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_6, self.chapterId)
|
||||||
|
end
|
||||||
|
self.battleUI:refreshWave(desc, GConst.ATLAS_PATH.COMMON, "common_dec_15")
|
||||||
end
|
end
|
||||||
BattleController.enterRoundBegin(self)
|
BattleController.enterRoundBegin(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleControllerDungeonRune:onLinkOverDone(...)
|
||||||
|
if self.battleUI.refreshTaskNode then
|
||||||
|
self.battleUI:refreshTaskNode()
|
||||||
|
end
|
||||||
|
BattleController.onLinkOverDone(self, ...)
|
||||||
|
end
|
||||||
|
|
||||||
function BattleControllerDungeonRune:getNextMonsterId(waveIndex)
|
function BattleControllerDungeonRune:getNextMonsterId(waveIndex)
|
||||||
self:getInitBoard()
|
self:getInitBoard()
|
||||||
waveIndex = waveIndex or self:getWaveIndex() + 1
|
waveIndex = waveIndex or self:getWaveIndex() + 1
|
||||||
@ -374,7 +398,7 @@ function BattleControllerDungeonRune:getRuneTaskNumByType(taskInfo)
|
|||||||
elseif taskType == GConst.DungeonRuneConst.TASK_TYPE.BREAK_GRID_TYPE then
|
elseif taskType == GConst.DungeonRuneConst.TASK_TYPE.BREAK_GRID_TYPE then
|
||||||
return self.totalBreakedGridType[taskParams1] or 0
|
return self.totalBreakedGridType[taskParams1] or 0
|
||||||
elseif taskType == GConst.DungeonRuneConst.TASK_TYPE.KILL_MONSTER then
|
elseif taskType == GConst.DungeonRuneConst.TASK_TYPE.KILL_MONSTER then
|
||||||
return self:getTaskProgress[GConst.BattleConst.BATTLE_TASK_FIELD.KILL_NORMAL_MONSTER]
|
return self.getTaskProgress[GConst.BattleConst.BATTLE_TASK_FIELD.KILL_NORMAL_MONSTER]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -174,12 +174,20 @@ function DungeonRuneManager:getTaskStatus(battleControllerRune, taskInfo)
|
|||||||
local taskProgress = {}
|
local taskProgress = {}
|
||||||
for index, condition in ipairs(taskInfo) do
|
for index, condition in ipairs(taskInfo) do
|
||||||
local progress = battleControllerRune:getRuneTaskNumByType(condition)
|
local progress = battleControllerRune:getRuneTaskNumByType(condition)
|
||||||
if progress then
|
if condition[1] == GConst.DungeonRuneConst.TASK_TYPE.PASS_ROUND then
|
||||||
taskProgress[index] = {
|
taskProgress[index] = {
|
||||||
progress = progress,
|
progress = battleControllerRune.dungeonRuneMaxRoundCount - battleControllerRune.dungeonRuneRemainRoundCount,
|
||||||
totalProgress = condition[3],
|
totalProgress = battleControllerRune.dungeonRuneMaxRoundCount,
|
||||||
over = progress >= condition[3]
|
over = false
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
if progress then
|
||||||
|
taskProgress[index] = {
|
||||||
|
progress = progress,
|
||||||
|
totalProgress = condition[3],
|
||||||
|
over = progress >= condition[3]
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -211,7 +211,8 @@ function BattleRuneResultUI:refreshTaskNode()
|
|||||||
local condition = chapterCondition[newIndex]
|
local condition = chapterCondition[newIndex]
|
||||||
if condition then
|
if condition then
|
||||||
objs.cell:getBaseObject():setActive(true)
|
objs.cell:getBaseObject():setActive(true)
|
||||||
local desc = self.runeData:getConditionDesc(condition)
|
local taskNum = taskProgress[index] and taskProgress[index].progress
|
||||||
|
local desc = self.runeData:getConditionDesc(condition, taskNum)
|
||||||
local over = false
|
local over = false
|
||||||
if taskProgress[newIndex] then
|
if taskProgress[newIndex] then
|
||||||
local info = taskProgress[newIndex]
|
local info = taskProgress[newIndex]
|
||||||
@ -223,7 +224,7 @@ function BattleRuneResultUI:refreshTaskNode()
|
|||||||
desc = desc .. string.format("<color=%s>(%s/%s)</color>", color, info.progress, info.totalProgress)
|
desc = desc .. string.format("<color=%s>(%s/%s)</color>", color, info.progress, info.totalProgress)
|
||||||
end
|
end
|
||||||
objs.cell:refresh(condition)
|
objs.cell:refresh(condition)
|
||||||
objs.desc:setText(self.runeData:getConditionDesc(condition))
|
objs.desc:setText(self.runeData:getConditionDesc(condition, taskNum))
|
||||||
if over then
|
if over then
|
||||||
objs.descUnDone:setText(GConst.EMPTY_STRING)
|
objs.descUnDone:setText(GConst.EMPTY_STRING)
|
||||||
objs.check:setVisible(true)
|
objs.check:setVisible(true)
|
||||||
|
|||||||
@ -37,9 +37,10 @@ function BattleUI:initBaseInfo()
|
|||||||
if not self.taskCells then
|
if not self.taskCells then
|
||||||
self.taskCells = {}
|
self.taskCells = {}
|
||||||
for i = 1, 4 do
|
for i = 1, 4 do
|
||||||
self.taskCells[i] = CellManager:addCellComp(uiMap["battle_ui.top_node.task_node.battle_task_cell_"], BATTLE_TASK_CELL)
|
self.taskCells[i] = CellManager:addCellComp(uiMap["battle_ui.top_node.task_node.battle_task_cell_" .. i], BATTLE_TASK_CELL)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
self.taskNode:setVisible(false)
|
||||||
|
|
||||||
|
|
||||||
if self.topNode then
|
if self.topNode then
|
||||||
@ -490,20 +491,46 @@ function BattleUI:refreshTaskBtn()
|
|||||||
taskBtn:addClickListener(function()
|
taskBtn:addClickListener(function()
|
||||||
ModuleManager.DungeonArmorManager:showBattleTaskUI()
|
ModuleManager.DungeonArmorManager:showBattleTaskUI()
|
||||||
end)
|
end)
|
||||||
elseif self.battleController.battleType == GConst.BattleConst.BATTLE_TYPE.DUNGEON_RUNE then
|
|
||||||
local runeData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.RUNES_OPEN)
|
|
||||||
if runeData:isBossChapter(self.battleController.chapterId) then
|
|
||||||
taskBtn:setActive(false)
|
|
||||||
else
|
|
||||||
taskBtn:setSprite(GConst.ATLAS_PATH.BATTLE, "battle_btn_task_3")
|
|
||||||
taskBtn:setActive(true)
|
|
||||||
taskBtn:addClickListener(function()
|
|
||||||
ModuleManager.DungeonRuneManager:showTaskUI(self.battleController.chapterId)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
taskBtn:setActive(false)
|
taskBtn:setActive(false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleUI:refreshTaskNode()
|
||||||
|
if self.battleController.battleType == GConst.BattleConst.BATTLE_TYPE.DUNGEON_RUNE then
|
||||||
|
self.taskNode:setLocalScale(0.6, 0.6, 0.6)
|
||||||
|
local runeData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.RUNES_OPEN)
|
||||||
|
local isBossChapter = runeData:isBossChapter(self.battleController.chapterId)
|
||||||
|
local chapterCondition = runeData:getChapterCondition(self.battleController.chapterId)
|
||||||
|
local taskProgress = ModuleManager.DungeonRuneManager:getTaskStatus(self.battleController, chapterCondition)
|
||||||
|
for index, cell in ipairs(self.taskCells) do
|
||||||
|
local newIndex = index
|
||||||
|
if isBossChapter then
|
||||||
|
newIndex = index + 1
|
||||||
|
end
|
||||||
|
local condition = chapterCondition[newIndex]
|
||||||
|
if condition then
|
||||||
|
cell:getBaseObject():setActive(true)
|
||||||
|
|
||||||
|
local atlast, iconName = runeData:getConditionIcon(condition)
|
||||||
|
local taskNum = condition[3] or 0
|
||||||
|
Logger.printTable(taskProgress)
|
||||||
|
if taskProgress[newIndex] then
|
||||||
|
taskNum = taskProgress[newIndex].totalProgress - taskProgress[newIndex].progress
|
||||||
|
if taskNum < 0 then
|
||||||
|
taskNum = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
cell:refresh(atlast, iconName, taskNum)
|
||||||
|
cell:addClickListener(function()
|
||||||
|
ModuleManager.DungeonRuneManager:showTaskUI(self.battleController.chapterId)
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
cell:getBaseObject():setActive(false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self.taskNode:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_HORIZONTAL_OR_VERTICAL_LAYOUT):RefreshLayout()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return BattleUI
|
return BattleUI
|
||||||
@ -4,10 +4,10 @@ local BG = {"common_board_131", "common_board_132"} -- 紫绿
|
|||||||
|
|
||||||
function BattleTaskCell:refresh(iconAtlas, iconName, taskNum)
|
function BattleTaskCell:refresh(iconAtlas, iconName, taskNum)
|
||||||
local uiMap = self:getUIMap()
|
local uiMap = self:getUIMap()
|
||||||
local bg = uiMap["rune_task_cell.bg"]
|
local bg = uiMap["battle_task_cell.bg"]
|
||||||
local icon = uiMap["rune_task_cell.icon"]
|
local icon = uiMap["battle_task_cell.icon"]
|
||||||
local point = uiMap["rune_task_cell.point"]
|
local point = uiMap["battle_task_cell.point"]
|
||||||
local desc = uiMap["rune_task_cell.desc"]
|
local desc = uiMap["battle_task_cell.desc"]
|
||||||
icon:setSprite(iconAtlas, iconName)
|
icon:setSprite(iconAtlas, iconName)
|
||||||
|
|
||||||
desc:setText(taskNum)
|
desc:setText(taskNum)
|
||||||
@ -18,8 +18,8 @@ end
|
|||||||
|
|
||||||
function BattleTaskCell:hidePoint(hide)
|
function BattleTaskCell:hidePoint(hide)
|
||||||
local uiMap = self:getUIMap()
|
local uiMap = self:getUIMap()
|
||||||
local point = uiMap["rune_task_cell.point"]
|
local point = uiMap["battle_task_cell.point"]
|
||||||
local desc = uiMap["rune_task_cell.desc"]
|
local desc = uiMap["battle_task_cell.desc"]
|
||||||
point:setVisible(not hide)
|
point:setVisible(not hide)
|
||||||
desc:setVisible(not hide)
|
desc:setVisible(not hide)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -38,16 +38,17 @@ function DungeonRuneTaskUI:_display()
|
|||||||
local condition = chapterCondition[newIndex]
|
local condition = chapterCondition[newIndex]
|
||||||
if condition then
|
if condition then
|
||||||
cell:getBaseObject():setActive(true)
|
cell:getBaseObject():setActive(true)
|
||||||
local desc = self.runeData:getConditionDesc(condition)
|
local taskNum = taskProgress[index] and taskProgress[index].progress
|
||||||
|
local desc = self.runeData:getConditionDesc(condition, taskNum)
|
||||||
local over = false
|
local over = false
|
||||||
if taskProgress[newIndex] then
|
if taskProgress[newIndex] then
|
||||||
local info = taskProgress[newIndex]
|
local info = taskProgress[newIndex]
|
||||||
over = info.over
|
over = info.over
|
||||||
local color = "#FF4949"
|
-- local color = "#FF4949"
|
||||||
if over then
|
-- if over then
|
||||||
color = "#49FF49"
|
-- color = "#49FF49"
|
||||||
end
|
-- end
|
||||||
desc = desc .. string.format("<color=%s>(%s/%s)</color>", color, info.progress, info.totalProgress)
|
-- desc = desc .. string.format("<color=%s>(%s/%s)</color>", color, info.progress, info.totalProgress)
|
||||||
end
|
end
|
||||||
cell:refresh(desc, condition, over)
|
cell:refresh(desc, condition, over)
|
||||||
count = count + 1
|
count = count + 1
|
||||||
|
|||||||
@ -214,18 +214,39 @@ function DungeonRuneEntity:getConditionIcon(taskInfo)
|
|||||||
return GConst.ATLAS_PATH.UI_DUNGEON_RUNE, iconSprite
|
return GConst.ATLAS_PATH.UI_DUNGEON_RUNE, iconSprite
|
||||||
end
|
end
|
||||||
|
|
||||||
function DungeonRuneEntity:getConditionDesc(taskInfo)
|
function DungeonRuneEntity:getConditionDesc(taskInfo, taskNum)
|
||||||
local taskType = taskInfo[1]
|
local taskType = taskInfo[1]
|
||||||
local taskParams1 = taskInfo[2]
|
local taskParams1 = taskInfo[2]
|
||||||
local taskParams2 = taskInfo[3]
|
local taskParams2 = taskInfo[3]
|
||||||
if taskType == TASK_TYPE.PASS_ROUND then
|
if taskType == TASK_TYPE.PASS_ROUND then
|
||||||
|
if taskNum and taskNum > 0 then
|
||||||
|
taskParams1 = taskNum
|
||||||
|
end
|
||||||
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_RUNE_QUEST_1, taskParams1)
|
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_RUNE_QUEST_1, taskParams1)
|
||||||
elseif taskType == TASK_TYPE.ELIMINATION_ELEMENT then
|
elseif taskType == TASK_TYPE.ELIMINATION_ELEMENT then
|
||||||
|
if taskNum and taskNum > 0 then
|
||||||
|
local num = taskParams2 - taskNum
|
||||||
|
if num > 0 then
|
||||||
|
taskParams2 = num
|
||||||
|
end
|
||||||
|
end
|
||||||
local desc = ModuleManager.HeroManager:getMatchTypeName(taskParams1, true)
|
local desc = ModuleManager.HeroManager:getMatchTypeName(taskParams1, true)
|
||||||
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_RUNE_QUEST_2, taskParams2, desc)
|
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_RUNE_QUEST_2, taskParams2, desc)
|
||||||
elseif taskType == TASK_TYPE.BREAK_GRID_TYPE then
|
elseif taskType == TASK_TYPE.BREAK_GRID_TYPE then
|
||||||
|
if taskNum and taskNum > 0 then
|
||||||
|
local num = taskParams2 - taskNum
|
||||||
|
if num > 0 then
|
||||||
|
taskParams2 = num
|
||||||
|
end
|
||||||
|
end
|
||||||
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_RUNE_QUEST_3, taskParams2)
|
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_RUNE_QUEST_3, taskParams2)
|
||||||
elseif taskType == TASK_TYPE.KILL_MONSTER then
|
elseif taskType == TASK_TYPE.KILL_MONSTER then
|
||||||
|
if taskNum and taskNum > 0 then
|
||||||
|
local num = taskParams2 - taskNum
|
||||||
|
if num > 0 then
|
||||||
|
taskParams2 = num
|
||||||
|
end
|
||||||
|
end
|
||||||
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_RUNE_QUEST_4, taskParams2)
|
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_RUNE_QUEST_4, taskParams2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user