【关卡】添加剧情关卡

gaoxin 2021-12-02 01:06:34 +08:00
parent 58ce5ad4d8
commit 8a960ece3b
2 changed files with 45 additions and 20 deletions

View File

@ -419,25 +419,27 @@ function FightPointPassMainPanel:OnShow()
-- 调用onshow
invadeMonster:OnShow()
local curName = GetLanguageStrById(fightLevelConfig[FightPointPassManager.curOpenFight].Name)
local curDifficulty = fightLevelConfig[FightPointPassManager.curOpenFight].Difficulty
local chapterId = 0
local str = ""
if not FightPointPassManager.IsChapterClossState() then
chapterId = math.floor(FightPointPassManager.lastPassFightId / 1000)
str = GetLanguageStrById(fightLevelConfig[FightPointPassManager.lastPassFightId].Name)
else
str = string.format("<color=#%s>%s</color> ", textColor[curDifficulty], curName)
chapterId = FightPointPassManager.GetCurChapterIndex()
end
this.areaName.text = str
if GetCurLanguage() ~= 0 then
this.areaName.gameObject.transform.localPosition = Vector2.New(0,0)
end
this.chapterName.text = GetLanguageStrById(fightLevelSetConfig[chapterId].Name)
if not hasLoad then
timePressStarted = Time.realtimeSinceStartup
isAnimActive = false
local curName = GetLanguageStrById(fightLevelConfig[FightPointPassManager.curOpenFight].Name)
local curDifficulty = fightLevelConfig[FightPointPassManager.curOpenFight].Difficulty
local chapterId = 0
local str = ""
if not FightPointPassManager.IsChapterClossState() then
chapterId = math.floor(FightPointPassManager.lastPassFightId / 1000)
str = GetLanguageStrById(fightLevelConfig[FightPointPassManager.lastPassFightId].Name)
else
str = string.format("<color=#%s>%s</color> ", textColor[curDifficulty], curName)
chapterId = FightPointPassManager.GetCurChapterIndex()
end
this.areaName.text = str
if GetCurLanguage() ~= 0 then
this.areaName.gameObject.transform.localPosition = Vector2.New(0,0)
end
this.chapterName.text = GetLanguageStrById(fightLevelSetConfig[chapterId].Name)
-- 奖励预览
this.IntiReward()
@ -694,10 +696,22 @@ function this.ExcuteBattle()
PopupTipPanel.ShowTip(tip)
return
end
-- 检测是否有前置引导
GuideManager.BeforeFightCheck(curFightId, function()
this.SetInitAnim()
end)
-- 判断是否是剧情节点
if fightLevelConfig[curFightId].StoryId > 0 then
StoryManager.EventTrigger(fightLevelConfig[curFightId].StoryId, function()
FightPointPassManager.ExecuteFightStory(curFightId, function(drop)
UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1, function()
this:OnShow()
end)
end)
end)
else
-- 检测是否有前置引导
GuideManager.BeforeFightCheck(curFightId, function()
this.SetInitAnim()
end)
end
end

View File

@ -352,6 +352,17 @@ function this.ExecuteFightBattle(monsterGroupId, fightId, callBack)
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.STORY_FIGHT, callBack, fightId)
end)
end
-- 剧情关卡
function this.ExecuteFightStory(fightId, func)
NetManager.LevelStarFightDataRequest("", fightId, function (msg)
NetManager.MapFightResultRequest(10000, "", fightId, BATTLE_TYPE.STORY_FIGHT, function (msg)
-- this.lastBattleResult.drop = msg.enventDrop
if func then
func(msg.enventDrop)
end
end)
end)
end
-- 获取当前章节数
function this.GetCurChapterIndex()