Merge branch 'dev_hero' into dev_equip
This commit is contained in:
commit
fa6e612330
@ -752,6 +752,7 @@ local LocalizationGlobalConst =
|
||||
EQUIP_QLT_SELECT_ALL_1 = "EQUIP_QLT_SELECT_ALL_1",
|
||||
EQUIP_QLT_SELECT_ALL_2 = "EQUIP_QLT_SELECT_ALL_2",
|
||||
REBACK_MATERIAL_DESC = "REBACK_MATERIAL_DESC",
|
||||
DAILY_CHALLENGE_DESC_9 = "DAILY_CHALLENGE_DESC_9",
|
||||
}
|
||||
|
||||
return LocalizationGlobalConst
|
||||
@ -634,7 +634,7 @@ local localization_global =
|
||||
["EVENT_COUNTDOWN"] = "活动倒计时:",
|
||||
["SUMMON_FREE_TIME"] = "{0}后免费",
|
||||
["SUMMON_FORCE_4"] = "<color=#ff9c00>{0}</color>次内必出<color=#ffa729>传说英雄</color>",
|
||||
["ITEM_NOT_ENOUGH_DESC"] = "是否使用<color=#c40e0e>钻石*{0}</color>补充<color=#c45f0e>魔法石*{1}</color>,进行召唤?",
|
||||
["ITEM_NOT_ENOUGH_DESC"] = "是否使用<color=#c40e0e>钻石*{0}</color>补充<color=#c45f0e>{1}*{2}</color>,进行召唤?",
|
||||
["SUMMON_ONE"] = "召唤1次",
|
||||
["SUMMON_TEN"] = "召唤10次",
|
||||
["FREE_DESC_1"] = "本次免费",
|
||||
@ -752,6 +752,7 @@ local localization_global =
|
||||
["EQUIP_QLT_SELECT_ALL_1"] = "所有品质",
|
||||
["EQUIP_QLT_SELECT_ALL_2"] = "所有部位",
|
||||
["REBACK_MATERIAL_DESC"] = "分解获得",
|
||||
["DAILY_CHALLENGE_DESC_9"] = "难度:{0}",
|
||||
}
|
||||
|
||||
return localization_global
|
||||
@ -244,9 +244,9 @@ function BattleUI:showTutorialFinger(posIdList)
|
||||
for index, posId in ipairs(posIdList) do
|
||||
local curPos = self:getPosInfo(posId)
|
||||
if index == 1 then
|
||||
self.tutorialFinger:setAnchoredPosition(curPos.x, curPos.y)
|
||||
self.tutorialFinger:setAnchoredPosition(curPos.x, curPos.y - 47)
|
||||
else
|
||||
table.insert(path, curPos)
|
||||
table.insert(path, {x = curPos.x, y = curPos.y - 47})
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
|
||||
@ -27,13 +27,13 @@ function PowerToastManager:showToast(before, after, posY)
|
||||
self.bg = uiMap["power_change_toast.bg"]
|
||||
self.powerTx = uiMap["power_change_toast.bg.power_tx"]
|
||||
self.powerChange = uiMap["power_change_toast.bg.power_change_tx"]
|
||||
-- self.powerSpine = uiMap["power_change_toast.bg.ui_spine_obj"]
|
||||
self.powerSpine = uiMap["power_change_toast.bg.ui_spine_obj"]
|
||||
-- self.effect1 = uiMap["power_change_toast.content.vfx_ui_zhanli_b01"]
|
||||
-- self.effect2 = uiMap["power_change_toast.content.vfx_ui_zhanli_b03"]
|
||||
|
||||
self:showEffect(false)
|
||||
self:showModuleUnlockAppearAnim()
|
||||
-- self.powerSpine:playAnim("idle", false, true)
|
||||
self.powerSpine:playAnim("idle", false, true)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@ -52,6 +52,7 @@ function DailyChallengeUI:onLoadRootComplete()
|
||||
self.debuffBtn = uiMap["daily_challenge_ui.buffs.debuff"]
|
||||
self.bossSpine = uiMap["daily_challenge_ui.spine_node"]
|
||||
self.countdownTx = uiMap["daily_challenge_ui.countdown.time_tx"]
|
||||
self.diffTx = uiMap["daily_challenge_ui.diff_tx"]
|
||||
|
||||
self.fightBtn = uiMap["daily_challenge_ui.fight_btn"]
|
||||
-- 体力消耗
|
||||
@ -246,8 +247,8 @@ function DailyChallengeUI:refreshDiffBtn()
|
||||
self.upDiffBtn:setActive(true)
|
||||
local cfg = DataManager.DailyChallengeData:getDifficultyCfg(diffChapter + 1)
|
||||
local chapterId = DataManager.ChapterData:getMaxChapterId()
|
||||
local chapterPage = DataManager.ChapterData:getChapterPage(diffChapter + 1)
|
||||
local chapterStage = DataManager.ChapterData:getChapterStage(diffChapter + 1)
|
||||
local chapterPage = DataManager.ChapterData:getChapterPage(cfg.max_chapter)
|
||||
local chapterStage = DataManager.ChapterData:getChapterStage(cfg.max_chapter)
|
||||
local str
|
||||
if cfg.max_chapter <= chapterId then
|
||||
str = I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_3, chapterPage, chapterStage, "<color=#87FF9E>(" .. I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_8) .. ")</color>")
|
||||
@ -257,6 +258,7 @@ function DailyChallengeUI:refreshDiffBtn()
|
||||
self.upDiffBtnDescTx:setText(str)
|
||||
end
|
||||
self.downDiffBtn:setActive(diffChapter > 1)
|
||||
self.diffTx:setText(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_9, diffChapter))
|
||||
end
|
||||
|
||||
return DailyChallengeUI
|
||||
@ -14,10 +14,12 @@ end
|
||||
|
||||
function ChapterBoxUI:onLoadRootComplete()
|
||||
local uiMap = self.root:genAllChildren()
|
||||
|
||||
uiMap["chapter_box_ui.bg.close_btn"]:addClickListener(function()
|
||||
self:closeUI()
|
||||
end)
|
||||
uiMap["chapter_box_ui.mask"]:addClickListener(function()
|
||||
self:closeUI()
|
||||
end)
|
||||
|
||||
self.selImg = uiMap["chapter_box_ui.bg.bg1.sel_img"]
|
||||
self.maxWaveTx = uiMap["chapter_box_ui.bg.max_wave_tx"]
|
||||
|
||||
@ -7,43 +7,8 @@ local HERO_SPINE_ASSET_PATH = "assets/arts/spines/characters/%s/%s_skeletondata.
|
||||
local CHAPTER_PATH = "assets/prefabs/ui/chapter/%s.prefab"
|
||||
local CHAPTER_PAGE = 5
|
||||
|
||||
function MainComp:onOpen()
|
||||
self.startMonsterAction = true
|
||||
if self.bossNode then
|
||||
self.bossNode:setAnchoredPositionX(0)
|
||||
end
|
||||
-- if self.bossShadow then
|
||||
-- self.bossShadow:setAnchoredPositionX(0)
|
||||
-- end
|
||||
if self.dialogueNode then
|
||||
self.dialogueNode:setAnchoredPositionX(0)
|
||||
end
|
||||
end
|
||||
|
||||
function MainComp:onClose()
|
||||
if self.chapterMoveSeq then
|
||||
self.chapterMoveSeq:Kill()
|
||||
self.chapterMoveSeq = nil
|
||||
end
|
||||
if self.chapterMonsterGenerateSeq then
|
||||
self.chapterMonsterGenerateSeq:Kill()
|
||||
self.chapterMonsterGenerateSeq = nil
|
||||
end
|
||||
self.currChapterId = nil
|
||||
self.isTopTurn = nil
|
||||
self.startMonsterAction = false
|
||||
GFunc.killDOTween(GConst.DOTWEEN_IDS.CHAPTER_MONSTER)
|
||||
self.monsterSpineTopPool = {}
|
||||
self.monsterSpineDownPool = {}
|
||||
self.monsterSpineTopList = {}
|
||||
self.monsterSpineDownList = {}
|
||||
-- self.monsterShadowPool = {}
|
||||
self.monsterSmokePool = {}
|
||||
self.monsterNodeTop:removeAllChildren()
|
||||
self.monsterNodeDown:removeAllChildren()
|
||||
-- self.shadowNode:removeAllChildren()
|
||||
self.smokeNodeTop:removeAllChildren()
|
||||
self.smokeNodeDown:removeAllChildren()
|
||||
end
|
||||
|
||||
function MainComp:init()
|
||||
@ -58,22 +23,6 @@ function MainComp:init()
|
||||
self.dailyChallengeBtn = uiMap["main_comp.daily_challenge_btn"]
|
||||
|
||||
self.chapterBg = uiMap["main_comp.bg"]
|
||||
-- self.chapterBg:setAnchoredPositionX(-720)
|
||||
self.smokeNodeTop = uiMap["main_comp.smoke_node_1"]
|
||||
self.monsterNodeTop = uiMap["main_comp.monster_node_1"]
|
||||
self.bossNode = uiMap["main_comp.boss_node"]
|
||||
self.bossNode:setActive(false)
|
||||
self.bossSpine = uiMap["main_comp.boss_node.boss"]
|
||||
self.smokeNodeDown = uiMap["main_comp.smoke_node_2"]
|
||||
self.monsterNodeDown = uiMap["main_comp.monster_node_2"]
|
||||
self.monsterSpineTopPool = {}
|
||||
self.monsterSpineDownPool = {}
|
||||
self.monsterSpineTopList = {}
|
||||
self.monsterSpineDownList = {}
|
||||
-- self.monsterShadowPool = {}
|
||||
self.monsterSmokePool = {}
|
||||
self.startMonsterAction = true
|
||||
|
||||
self.fightBtn = uiMap["main_comp.fight_btn"]
|
||||
-- 体力消耗
|
||||
self.fightCost = uiMap["main_comp.fight_btn.cost"]
|
||||
@ -89,6 +38,20 @@ function MainComp:init()
|
||||
|
||||
self.leftBtn = uiMap["main_comp.left_btn"]
|
||||
self.rightBtn = uiMap["main_comp.right_btn"]
|
||||
self.heroSpineList = {}
|
||||
self.heroNodeList = {}
|
||||
for i = 1, 5 do
|
||||
self.heroNodeList[i] = uiMap["main_comp.formation.hero_" .. i]
|
||||
self.heroNodeList[i]:addClickListener(function()
|
||||
local heroId = self.curFormation[i]
|
||||
if heroId then
|
||||
local hero = DataManager.HeroData:getHeroById(heroId)
|
||||
if hero then
|
||||
ModuleManager.HeroManager:showHeroDetailUI(heroId, nil, nil, GConst.BattleConst.FORMATION_TYPE.STAGE)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
self.chapterMiddleBg = uiMap["main_comp.middle_bg"]
|
||||
self.chapterTx = uiMap["main_comp.middle_bg.chapter_tx"]
|
||||
@ -181,6 +144,7 @@ end
|
||||
function MainComp:refresh()
|
||||
self:refreshChapter()
|
||||
self:refreshRedPoint()
|
||||
self:refreshHero()
|
||||
end
|
||||
|
||||
function MainComp:refreshChapter(force)
|
||||
@ -192,12 +156,9 @@ function MainComp:refreshChapter(force)
|
||||
self.chapterStage = DataManager.ChapterData:getChapterStage(chapterId)
|
||||
self:refreshChapterBg()
|
||||
self:refreshFightBtn()
|
||||
self:doBossAction()
|
||||
end
|
||||
self.currChapterId = chapterId
|
||||
self:refreshChapterInfo()
|
||||
-- self:doChapterMove()
|
||||
-- self:doMonsterAction()
|
||||
self:refreshChapterBtn()
|
||||
|
||||
self.leftBtn:setActive(ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.IDLE_DROP, true))
|
||||
@ -269,7 +230,13 @@ function MainComp:refreshChapterInfo()
|
||||
end
|
||||
self.chapterPageNode:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_HORIZONTAL_OR_VERTICAL_LAYOUT):RefreshLayout()
|
||||
|
||||
self.fightBtn:setActive(chapterId <= chapterMaxId + 1)
|
||||
if chapterId <= chapterMaxId + 1 then
|
||||
self.fightBtn:setTouchEnable(true)
|
||||
self.fightBtn:setSprite(GConst.ATLAS_PATH.MAIN, "main_btn_1")
|
||||
else
|
||||
self.fightBtn:setTouchEnable(false)
|
||||
self.fightBtn:setSprite(GConst.ATLAS_PATH.MAIN, "main_btn_4")
|
||||
end
|
||||
|
||||
local chapterI18NInfo = I18N:getConfig("chapter")[chapterId]
|
||||
if chapterI18NInfo then
|
||||
@ -333,304 +300,36 @@ end
|
||||
function MainComp:getSummonBtnPosition()
|
||||
return self.rightBtn:getPosition()
|
||||
end
|
||||
-- region 动画
|
||||
-- function MainComp:doChapterMove()
|
||||
-- if self.chapterMoveSeq then
|
||||
-- return
|
||||
-- end
|
||||
-- self.chapterBg:setAnchoredPositionX(-720)
|
||||
-- self.chapterMoveSeq = self.chapterBg:createBindTweenSequence()
|
||||
-- local moveTween = self.chapterBg:getTransform():DOAnchorPosX(720, 20):SetEase(CS.DG.Tweening.Ease.Linear)
|
||||
-- self.chapterMoveSeq:Append(moveTween)
|
||||
-- self.chapterMoveSeq:AppendCallback(function()
|
||||
-- self.chapterBg:setAnchoredPositionX(-720)
|
||||
-- end)
|
||||
-- self.chapterMoveSeq:SetLoops(-1)
|
||||
-- end
|
||||
|
||||
function MainComp:doBossAction()
|
||||
if self.currChapterId == nil then
|
||||
function MainComp:refreshHero()
|
||||
self.curFormation = DataManager.FormationData:getStageFormation()
|
||||
for i = 1, 5 do
|
||||
local heroId = self.curFormation[i]
|
||||
local hero = DataManager.HeroData:getHeroById(heroId)
|
||||
if hero and hero:getLv() > 0 then
|
||||
if self.heroSpineList[i] and self.heroSpineList[i]:getModelId() == hero:getModelId() then
|
||||
self.heroSpineList[i]:setActive(true)
|
||||
self.heroSpineList[i]:playAnimation("move", true)
|
||||
else
|
||||
SpineManager:loadHeroAsync(hero:getModelId(), self.heroNodeList[i], function(spineObject)
|
||||
if heroId ~= self.curFormation[i] then
|
||||
return
|
||||
end
|
||||
local chapterInfo = ConfigManager:getConfig("chapter")[self.currChapterId]
|
||||
if chapterInfo == nil then
|
||||
return
|
||||
if self.heroSpineList[i] then
|
||||
self.heroSpineList[i]:destroy()
|
||||
end
|
||||
local monsterIdList = chapterInfo.monster
|
||||
-- monsterIdList = {20001, 10001, 10002}
|
||||
if monsterIdList == nil then
|
||||
return
|
||||
end
|
||||
self.chapterMonsterShowList = monsterIdList
|
||||
if self.chapterBossId == nil then -- 还没显示boss模型
|
||||
self.chapterBossId = self.chapterMonsterShowList[#self.chapterMonsterShowList]
|
||||
local chapterBossId = self.chapterBossId
|
||||
local monsterCfg = ConfigManager:getConfig("monster")
|
||||
local monsterInfo = monsterCfg[self.chapterBossId]
|
||||
if monsterInfo then
|
||||
local modelId = monsterInfo.model_id
|
||||
local path = string.format(HERO_SPINE_ASSET_PATH, modelId, modelId)
|
||||
self.bossNode:setActive(false)
|
||||
local scale = monsterInfo.ui or 1
|
||||
self.bossSpine:loadAssetAsync(modelId, function()
|
||||
if chapterBossId == self.chapterBossId then
|
||||
self.bossNode:setActive(true)
|
||||
self.bossSpine:setLocalScale(scale, scale, scale)
|
||||
self.bossSpine:playAnim("move", true, true, true)
|
||||
else -- 加载完成后,已经切换到其他boss了
|
||||
self:doChangeBossAction()
|
||||
end
|
||||
end, path)
|
||||
spineObject:playAnimation("move", true)
|
||||
spineObject:setLocalScale(0.7, 0.7, 0.7)
|
||||
self.heroSpineList[i] = spineObject
|
||||
self.heroSpineList[i]:setLocalPosition(0, -60, 0)
|
||||
end)
|
||||
end
|
||||
else
|
||||
local chapterBossId = self.chapterMonsterShowList[#self.chapterMonsterShowList]
|
||||
if self.chapterBossId ~= chapterBossId then
|
||||
self.chapterBossId = chapterBossId
|
||||
self:doChangeBossAction()
|
||||
if self.heroSpineList[i] then
|
||||
self.heroSpineList[i]:setActive(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- 切换boss
|
||||
function MainComp:doChangeBossAction()
|
||||
local chapterBossId = self.chapterBossId
|
||||
local monsterCfg = ConfigManager:getConfig("monster")
|
||||
local monsterInfo = monsterCfg[self.chapterBossId]
|
||||
if monsterInfo then
|
||||
local modelId = monsterInfo.model_id
|
||||
local path = string.format(HERO_SPINE_ASSET_PATH, modelId, modelId)
|
||||
self.bossNode:setActive(false)
|
||||
local scale = monsterInfo.ui or 1
|
||||
self.bossSpine:loadAssetAsync(modelId, function()
|
||||
if chapterBossId == self.chapterBossId then
|
||||
self.bossNode:setActive(true)
|
||||
self.bossSpine:setLocalScale(scale, scale, scale)
|
||||
self.bossSpine:playAnim("move", true, true, true)
|
||||
else -- 加载完成后,已经切换到其他boss了
|
||||
self:doChangeBossAction()
|
||||
end
|
||||
end, path)
|
||||
end
|
||||
end
|
||||
|
||||
-- function MainComp:doMonsterAction()
|
||||
-- if self.chapterMonsterGenerateSeq then
|
||||
-- return
|
||||
-- end
|
||||
-- self.chapterMonsterGenerateSeq = DOTweenManager:createSeqWithIntId()
|
||||
-- local interval = GFunc.getConstValue("chapter_idel_monster_x") / 1000
|
||||
-- interval = 2
|
||||
-- self.chapterMonsterGenerateSeq:AppendCallback(function()
|
||||
-- self:generateChapterMonsters()
|
||||
-- end)
|
||||
-- self.chapterMonsterGenerateSeq:AppendInterval(interval)
|
||||
-- self.chapterMonsterGenerateSeq:SetLoops(-1)
|
||||
-- end
|
||||
|
||||
-- function MainComp:generateChapterMonsters()
|
||||
-- local monsterId
|
||||
-- if #self.chapterMonsterShowList <= 2 then
|
||||
-- monsterId = self.chapterMonsterShowList[2]
|
||||
-- else
|
||||
-- monsterId = self.chapterMonsterShowList[math.random(2, #self.chapterMonsterShowList)]
|
||||
-- end
|
||||
-- if monsterId == nil then
|
||||
-- return
|
||||
-- end
|
||||
-- local monsterCfg = ConfigManager:getConfig("monster_base")
|
||||
-- local monsterInfo = monsterCfg[monsterId]
|
||||
-- if monsterInfo == nil then
|
||||
-- return
|
||||
-- end
|
||||
-- if self.isTopTurn == nil then
|
||||
-- self.isTopTurn = math.random(1, 100) > 50
|
||||
-- end
|
||||
-- local modelId = monsterInfo.model_id
|
||||
-- local pool
|
||||
-- local list
|
||||
-- local parent
|
||||
-- local posY
|
||||
-- if self.isTopTurn then -- 刷上面
|
||||
-- pool = self.monsterSpineTopPool[modelId]
|
||||
-- list = self.monsterSpineTopList
|
||||
-- parent = self.monsterNodeTop
|
||||
-- posY = math.random(1, 300)
|
||||
-- else -- 刷下面
|
||||
-- pool = self.monsterSpineDownPool[modelId]
|
||||
-- list = self.monsterSpineDownList
|
||||
-- parent = self.monsterNodeDown
|
||||
-- posY = -math.random(1, 240)
|
||||
-- end
|
||||
-- self.isTopTurn = not self.isTopTurn
|
||||
-- if pool and #pool > 0 then
|
||||
-- local spine = table.remove(pool)
|
||||
-- table.insert(list, spine)
|
||||
-- spine:setActive(true)
|
||||
-- self:doMonsterMove(modelId, spine, posY, monsterInfo, not self.isTopTurn)
|
||||
-- else
|
||||
-- SpineManager:loadUIHeroSpineWidgetAsync(modelId, parent, function(spine)
|
||||
-- if not self.startMonsterAction then
|
||||
-- spine:destroy()
|
||||
-- return
|
||||
-- end
|
||||
-- table.insert(list, spine)
|
||||
-- local scale = monsterInfo.ui or 1
|
||||
-- spine:setLocalScale(-scale, scale, scale)
|
||||
-- self:doMonsterMove(modelId, spine, posY, monsterInfo, not self.isTopTurn)
|
||||
-- end)
|
||||
-- end
|
||||
-- end
|
||||
|
||||
-- function MainComp:doMonsterMove(modelId, spine, posY, monsterInfo, isTopTurn)
|
||||
-- spine:playAnim("move", true, true, true)
|
||||
-- local posX = GConst.UI_SCREEN_WIDTH / 2 + 100
|
||||
-- local targetPosX = -GConst.UI_SCREEN_WIDTH / 2 - 300
|
||||
-- spine:setAnchoredPosition(posX, posY)
|
||||
-- local seq = DOTweenManager:createSeqWithIntId(GConst.DOTWEEN_IDS.CHAPTER_MONSTER)
|
||||
-- if self.chapterMonsterSpeed == nil then
|
||||
-- -- self.chapterMonsterSpeed = GFunc.getConstValue("chapter_idel_monstermove")
|
||||
-- self.chapterMonsterSpeed = 150
|
||||
-- end
|
||||
-- local distance = posX - targetPosX
|
||||
-- local moveTime = distance / self.chapterMonsterSpeed
|
||||
-- local moveTween = spine:getTransform():DOAnchorPosX(targetPosX, moveTime):SetEase(CS.DG.Tweening.Ease.Linear)
|
||||
-- seq:Append(moveTween)
|
||||
-- end
|
||||
|
||||
-- function MainComp:enterChapterBattle()
|
||||
-- -- boss等一会再跑
|
||||
-- local bossWaitTime = GFunc.getConstValue("chapter_fight_bosswait") / 1000
|
||||
-- local bossSeq = DOTweenManager:createSeqWithIntId(GConst.DOTWEEN_IDS.CHAPTER_MONSTER)
|
||||
-- bossSeq:AppendInterval(bossWaitTime)
|
||||
-- local bossSpeed = GFunc.getConstValue("chapter_fight_bossmove")
|
||||
-- local distance = GConst.UI_SCREEN_WIDTH/2 + 100
|
||||
-- local moveTime = distance / bossSpeed
|
||||
-- local targetPosX = -GConst.UI_SCREEN_WIDTH / 2 - 300
|
||||
-- local moveTween = self.bossNode:getTransform():DOAnchorPosX(targetPosX, moveTime):SetEase(CS.DG.Tweening.Ease.Linear)
|
||||
-- bossSeq:Append(moveTween)
|
||||
-- local moveTween2 = self.dialogueNode:getTransform():DOAnchorPosX(targetPosX, moveTime):SetEase(CS.DG.Tweening.Ease.Linear)
|
||||
-- bossSeq:Join(moveTween2)
|
||||
-- -- local moveTween3 = self.bossShadow:getTransform():DOAnchorPosX(targetPosX, moveTime):SetEase(CS.DG.Tweening.Ease.Linear)
|
||||
-- -- bossSeq:Join(moveTween3)
|
||||
|
||||
|
||||
-- -- 出来一批小怪从右边跑向左边
|
||||
-- local monsterCount = GFunc.getConstIntValue("chapter_fight_monster_num")
|
||||
-- self.chapterFightMonsterCount = monsterCount
|
||||
-- local wave = 5
|
||||
-- local monsterCountPerWave = math.ceil(monsterCount / wave)
|
||||
-- -- 分批处理
|
||||
-- local monsterSeq = DOTweenManager:createSeqWithIntId(GConst.DOTWEEN_IDS.CHAPTER_MONSTER)
|
||||
-- for i = 1, wave do
|
||||
-- monsterSeq:AppendCallback(function ()
|
||||
-- if monsterCountPerWave > monsterCount then
|
||||
-- monsterCountPerWave = monsterCount
|
||||
-- end
|
||||
-- monsterCount = monsterCount - monsterCountPerWave
|
||||
-- for j = 1, monsterCountPerWave do
|
||||
-- self:generateChapterFightMonsters()
|
||||
-- end
|
||||
-- end)
|
||||
-- monsterSeq:AppendInterval(0.03)
|
||||
-- end
|
||||
-- return GFunc.getConstValue("chapter_fight_wait") / 1000
|
||||
-- end
|
||||
|
||||
-- function MainComp:generateChapterFightMonsters()
|
||||
-- local monsterId
|
||||
-- if #self.chapterMonsterShowList <= 2 then
|
||||
-- monsterId = self.chapterMonsterShowList[2]
|
||||
-- else
|
||||
-- monsterId = self.chapterMonsterShowList[math.random(2, #self.chapterMonsterShowList)]
|
||||
-- end
|
||||
-- if monsterId == nil then
|
||||
-- return
|
||||
-- end
|
||||
-- local monsterCfg = ConfigManager:getConfig("monster_base")
|
||||
-- local monsterInfo = monsterCfg[monsterId]
|
||||
-- if monsterInfo == nil then
|
||||
-- return
|
||||
-- end
|
||||
-- local modelId = monsterInfo.model_id
|
||||
-- local pool
|
||||
-- local list
|
||||
-- local parent
|
||||
-- local posY
|
||||
-- if self.isTopTurn then -- 刷上面
|
||||
-- pool = self.monsterSpineTopPool[modelId]
|
||||
-- list = self.monsterSpineTopList
|
||||
-- parent = self.monsterNodeTop
|
||||
-- posY = math.random(1, 300)
|
||||
-- else -- 刷下面
|
||||
-- pool = self.monsterSpineDownPool[modelId]
|
||||
-- list = self.monsterSpineDownList
|
||||
-- parent = self.monsterNodeDown
|
||||
-- posY = -math.random(1, 240)
|
||||
-- end
|
||||
-- self.isTopTurn = not self.isTopTurn
|
||||
-- if pool and #pool > 0 then
|
||||
-- local spine = table.remove(pool)
|
||||
-- table.insert(list, spine)
|
||||
-- spine:setActive(true)
|
||||
-- self:doMonsterFightMove(modelId, spine, posY, monsterInfo, not self.isTopTurn)
|
||||
-- else
|
||||
-- SpineManager:loadUIHeroSpineWidgetAsync(modelId, parent, function(spine)
|
||||
-- if not self.startMonsterAction then
|
||||
-- spine:destroy()
|
||||
-- return
|
||||
-- end
|
||||
-- table.insert(list, spine)
|
||||
-- local scale = monsterInfo.ui or 1
|
||||
-- spine:setLocalScale(-scale, scale, scale)
|
||||
-- self:doMonsterFightMove(modelId, spine, posY, monsterInfo, not self.isTopTurn)
|
||||
-- end)
|
||||
-- end
|
||||
-- end
|
||||
|
||||
-- function MainComp:doMonsterFightMove(modelId, spine, posY, monsterInfo, isTopTurn)
|
||||
-- spine:playAnim("move", true, true, true)
|
||||
-- local posX = GConst.UI_SCREEN_WIDTH / 2 + math.random(100, math.floor(GConst.UI_SCREEN_WIDTH*2/3))
|
||||
-- spine:setAnchoredPosition(posX, posY)
|
||||
-- local seq = DOTweenManager:createSeqWithIntId(GConst.DOTWEEN_IDS.CHAPTER_MONSTER)
|
||||
-- if self.chapterMonsterFightSpeed == nil then
|
||||
-- -- self.chapterMonsterFightSpeed = GFunc.getConstValue("chapter_fight_monstermove")
|
||||
-- self.chapterMonsterFightSpeed = 880
|
||||
-- end
|
||||
-- local distance = posX + GConst.UI_SCREEN_WIDTH/2 + 100
|
||||
-- local moveTime = distance / self.chapterMonsterFightSpeed
|
||||
-- local targetPosX = -GConst.UI_SCREEN_WIDTH / 2 - 100
|
||||
-- local moveTween = spine:getTransform():DOAnchorPosX(targetPosX, moveTime):SetEase(CS.DG.Tweening.Ease.Linear)
|
||||
-- seq:Append(moveTween)
|
||||
|
||||
-- if self.chapterFightMonsterCount then
|
||||
-- self.chapterFightMonsterCount = self.chapterFightMonsterCount - 1
|
||||
-- if self.chapterFightMonsterCount == 0 then -- 最后一个怪物生成完毕后,重新排一下序
|
||||
-- self:sortChapterFightMonstersOrder()
|
||||
-- self:sortChapterFightMonstersOrder()
|
||||
-- self:sortChapterFightMonstersOrder()
|
||||
-- self:sortChapterFightMonstersOrder()
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
|
||||
-- function MainComp:sortChapterFightMonstersOrder()
|
||||
-- self:sortChildrenOrder(self.monsterNodeTop)
|
||||
-- self:sortChildrenOrder(self.monsterNodeDown)
|
||||
-- end
|
||||
|
||||
-- function MainComp:sortChildrenOrder(parent)
|
||||
-- local children = parent:getChildList()
|
||||
-- if children and #children > 0 then
|
||||
-- table.sort(children, function(a, b)
|
||||
-- return a:getAnchoredPositionY() > b:getAnchoredPositionY()
|
||||
-- end)
|
||||
|
||||
-- for i = #children, 1, -1 do
|
||||
-- children[i]:getTransform():SetSiblingIndex(i - 1)
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
|
||||
-- endregion
|
||||
|
||||
return MainComp
|
||||
@ -10,9 +10,9 @@ function SummonRewardCell:init()
|
||||
self.bg = uiMap["summon_reward_cell.bg"]
|
||||
self.bg1 = uiMap["summon_reward_cell.bg1"]
|
||||
self.effectQlts = {}
|
||||
self.effectQlts[2] = uiMap["summon_reward_cell.bg1.vfx_b13_chouka_lan_b01"]
|
||||
self.effectQlts[3] = uiMap["summon_reward_cell.bg1.vfx_b13_chouka_zi_b01"]
|
||||
self.effectQlts[4] = uiMap["summon_reward_cell.bg1.vfx_b13_chouka_cheng_b01"]
|
||||
self.effectQlts[3] = uiMap["summon_reward_cell.bg1.vfx_b13_chouka_lan_b01"]
|
||||
self.effectQlts[4] = uiMap["summon_reward_cell.bg1.vfx_b13_chouka_zi_b01"]
|
||||
self.effectQlts[5] = uiMap["summon_reward_cell.bg1.vfx_b13_chouka_cheng_b01"]
|
||||
end
|
||||
function SummonRewardCell:getEffectQlts()
|
||||
return self.effectQlts
|
||||
@ -22,9 +22,9 @@ function SummonRewardCell:refresh(reward, index, parentUI)
|
||||
if self.effectQlts[5] then
|
||||
self.effectQlts[5]:setActive(false)
|
||||
end
|
||||
self.effectQlts[5]:setActive(false)
|
||||
self.effectQlts[4]:setActive(false)
|
||||
self.effectQlts[3]:setActive(false)
|
||||
self.effectQlts[2]:setActive(false)
|
||||
local cfg = DataManager.HeroData:getHeroConfig(reward.item.id)
|
||||
self.imgIcon:setSprite(GConst.ATLAS_PATH.ICON_HERO_SUMMON, tostring(cfg.icon))
|
||||
self.bg:setSprite(GConst.ATLAS_PATH.ICON_HERO_SUMMON, "summon_card_b_" .. cfg.qlt)
|
||||
@ -38,7 +38,7 @@ function SummonRewardCell:refresh(reward, index, parentUI)
|
||||
end, 0.3)
|
||||
end
|
||||
function SummonRewardCell:playEffect(qlt)
|
||||
if qlt == 5 and self.effectQlts[5] == nil then
|
||||
if qlt == 6 and self.effectQlts[6] == nil then
|
||||
local tranInfo = self.imgIcon:getComponent(GConst.TYPEOF_UNITY_CLASS.TRANSFORM).parent
|
||||
if tranInfo then
|
||||
local infoBase = UIPrefabObject:create()
|
||||
@ -46,11 +46,11 @@ function SummonRewardCell:playEffect(qlt)
|
||||
infoBase:initPrefabHelper()
|
||||
EffectManager:loadUIEffectAsync("assets/prefabs/effects/ui/vfx_b13_chouka_hong_b01.prefab", self.patentUI, infoBase, 0,
|
||||
function(obj)
|
||||
if self.effectQlts[5] then
|
||||
self.effectQlts[5]:destroy()
|
||||
self.effectQlts[5] = nil
|
||||
if self.effectQlts[6] then
|
||||
self.effectQlts[6]:destroy()
|
||||
self.effectQlts[6] = nil
|
||||
end
|
||||
self.effectQlts[5] = obj
|
||||
self.effectQlts[6] = obj
|
||||
end)
|
||||
end
|
||||
else
|
||||
|
||||
@ -338,7 +338,7 @@ function SummonMainUI:onSummon(count, isAd)
|
||||
local costNum = (count - DataManager.BagData.ItemData:getItemNumById(costId))
|
||||
local gemCost = DataManager.SummonData:getSummonGemCost(self.page)
|
||||
local costGemNum = gemCost.num * costNum
|
||||
params.content = I18N:getGlobalText(I18N.GlobalConst.ITEM_NOT_ENOUGH_DESC, costGemNum, costNum)
|
||||
params.content = I18N:getGlobalText(I18N.GlobalConst.ITEM_NOT_ENOUGH_DESC, costGemNum, GFunc.getRewardName(GConst.REWARD_TYPE.ITEM, costId), costNum)
|
||||
params.boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL
|
||||
params.showToday = GConst.MESSAGE_BOX_SHOW_TODAY.SUMMON_FORCE
|
||||
params.okFunc = function()
|
||||
@ -355,7 +355,7 @@ function SummonMainUI:onSummon(count, isAd)
|
||||
return
|
||||
else
|
||||
for i, cost in ipairs(costs) do
|
||||
if not GFunc.checkCost(cost.id, GFunc.getRewardNum(cost), true) then
|
||||
if not GFunc.checkCost(cost.id, GFunc.getRewardNum(cost) * count, true) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
@ -17,6 +17,9 @@ end
|
||||
|
||||
function TalentInfoUI:onLoadRootComplete()
|
||||
local uiMap = self.root:genAllChildren()
|
||||
self.root:addClickListener(function()
|
||||
self:closeUI()
|
||||
end)
|
||||
|
||||
self.talentCell = uiMap["talent_info_ui.node.talent_cell"]:addLuaComponent(TALENT_CELL)
|
||||
self.descTx = uiMap["talent_info_ui.desc_tx"]
|
||||
@ -24,25 +27,29 @@ function TalentInfoUI:onLoadRootComplete()
|
||||
self.rightArrowBtn = uiMap["talent_info_ui.right_arrow_btn"]
|
||||
local continue = uiMap["talent_info_ui.continue"]
|
||||
continue:setText(I18N:getGlobalText(I18N.GlobalConst.CLICK_TO_CONTINUE))
|
||||
continue:addClickListener(function()
|
||||
self:closeUI()
|
||||
end)
|
||||
|
||||
self.leftArrowBtn:addClickListener(function()
|
||||
self.id = self.id - 1
|
||||
self.idx = self.idx - 1
|
||||
self:onRefresh()
|
||||
end)
|
||||
self.rightArrowBtn:addClickListener(function()
|
||||
self.id = self.id + 1
|
||||
self.idx = self.idx + 1
|
||||
self:onRefresh()
|
||||
end)
|
||||
self.list = DataManager.TalentData:getActiveList()
|
||||
for i, cfg in ipairs(self.list) do
|
||||
if cfg.id == self.id then
|
||||
self.idx = i
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function TalentInfoUI:onRefresh()
|
||||
self.list = DataManager.TalentData:getCfgList()
|
||||
self.talentCell:refresh(self.id, self.list[self.id])
|
||||
self.leftArrowBtn:setActive(self.id > 1)
|
||||
self.rightArrowBtn:setActive(self.id < #self.list)
|
||||
self.id = self.list[self.idx].id
|
||||
self.talentCell:refresh(self.id, self.list[self.idx])
|
||||
self.leftArrowBtn:setActive(self.idx > 1 and #self.list ~= 1)
|
||||
self.rightArrowBtn:setActive(self.idx < #self.list and #self.list ~= 1)
|
||||
local attr, num = DataManager.TalentData:getAttrById(self.id)
|
||||
local str = I18N:getText("talent", self.id, "desc")
|
||||
if attr and #attr > 0 then
|
||||
|
||||
@ -90,8 +90,8 @@ function HelpTips:showStyleArena()
|
||||
self.arenaTxClose:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK))
|
||||
self.arenaTxDesc:setText(self.params.desc)
|
||||
|
||||
local height = self.arenaTxDesc:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredHeight
|
||||
self.arenaContent:setSizeDeltaY(height + 5)
|
||||
local height = self.arenaTxDesc:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredHeight + 5
|
||||
self.arenaContent:setSizeDeltaY(math.max(height, 360))
|
||||
self.arenaContent:setAnchoredPosition(0, 0)
|
||||
end
|
||||
|
||||
|
||||
@ -28,6 +28,19 @@ function TalentData:getCfgList()
|
||||
return TalentCfg
|
||||
end
|
||||
|
||||
function TalentData:getActiveList()
|
||||
local list = {}
|
||||
for id = 1, #TalentCfg do
|
||||
local cfg = TalentCfg[id]
|
||||
cfg.id = id
|
||||
local lv = self:getLevels(id)
|
||||
if lv and lv > 0 then
|
||||
table.insert(list, cfg)
|
||||
end
|
||||
end
|
||||
return list
|
||||
end
|
||||
|
||||
function TalentData:getPlayerExpCfgList(stage)
|
||||
if stage then
|
||||
return PlayerExpCfg[stage]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user