【关卡】条件新增

dev_chengFeng
gaoxin 2021-12-10 17:37:07 +08:00
parent a8186e776c
commit 3835273079
6 changed files with 62 additions and 6 deletions

View File

@ -285,6 +285,53 @@ function this.IsCanFight(fightId)
end
end
function this.CheckFightOpenRule(fightId)
if fightId and mainLevelConfig[fightId] then
return false, "没有这个关卡"
end
local openRule = mainLevelConfig[fightId].OpenRule
if not openRule or openRule[1] == 0 then
return true
elseif openRule[1] == 1 then
local star = FightLevelManager.GetAllChapterStars()
if openRule[2] < star then
return false, string.format("山河社稷图星数达%s解锁", star)
end
elseif openRule[1] == 2 then
local wave = MonsterCampManager.GetMonsterCampCurWave()
if openRule[2] <= wave then
return false, string.format("心魔试炼通关%s层解锁", wave)
end
elseif openRule[1] == 3 then
local lv = HarmonyManager.GetSingleAdditions(HarmonyAddType.AddLv)
if openRule[2] <= lv then
return false, string.format("鸿蒙阵共鸣等级达%s解锁", lv)
end
elseif openRule[1] == 4 then
-- 指定星级(运算星级)装备数量(初始可用)
-- local lv = HarmonyManager.GetSingleAdditions(HarmonyAddType.AddLv)
-- if openRule[2] <= lv then
-- return false, string.format("鸿蒙阵共鸣等级达%s解锁", lv)
-- end
elseif openRule[1] == 5 then
local _, tlv, _ = LikabilityManager.GetTotalHeroLikeLv(1)
if openRule[2] <= tlv then
return false, string.format("神将总好感度等级达%s解锁", tlv)
end
elseif openRule[1] == 6 then
-- 逍遥游通关次数
-- local _, tlv, _ = LikabilityManager.GetTotalHeroLikeLv(1)
elseif openRule[1] == 6 then
-- 达到指定英雄等级及数量(初始可用)
-- local _, tlv, _ = LikabilityManager.GetTotalHeroLikeLv(1)
end
end
-- 判断是否显示关卡按钮红点
function this.IsShowFightRP()
return this.IsCanFight(this.curOpenFight)

View File

@ -91,7 +91,7 @@ function this.StartFight()
local result = {}
result.drop = msg.enventDrop
UIManager.OpenPanel(UIName.BattleWinPopup, nil, false, 5, result, true, true)
MonsterCampManager.monsterWave = MonsterCampManager.monsterWave + 1
MonsterCampManager.SetMonsterCampCurWave(MonsterCampManager.monsterWave + 1)
end
end)
end
@ -105,7 +105,7 @@ function this.StraightBattle()
if result.result == 0 then
Log("扣除一点道具")
else
MonsterCampManager.monsterWave = MonsterCampManager.monsterWave + 1
MonsterCampManager.SetMonsterCampCurWave(MonsterCampManager.monsterWave + 1)
end
this.root:ClosePanel()
-- 返回那个界面

View File

@ -115,6 +115,15 @@ function this.GetFourElementTotalWave()
return waves
end
-- 当前兽潮层数
function this.GetMonsterCampCurWave()
return this.monsterWave
end
function this.SetMonsterCampCurWave(wave)
this.monsterWave = wave
end
function this.GetCurFourElementMonsterInfo(index)
return this.fourMonsterData[index]
end
@ -283,7 +292,7 @@ function this.ExecuteFightBattle(id,type,func,curType,isQuick)
-- local result = {}
-- result.drop = msg.enventDrop
-- UIManager.OpenPanel(UIName.BattleWinPopup, nil, false, BATTLE_TYPE.FOURELEMENT, result, true, true)
-- MonsterCampManager.monsterWave = MonsterCampManager.monsterWave + 1
-- MonsterCampManager.SetMonsterCampCurWave(MonsterCampManager.monsterWave + 1)
-- end
-- end)
end

View File

@ -140,7 +140,7 @@ function this.QuickStartMonsterFightRequest()
Timer.New(function ()
isClick = false
end,1):Start()
MonsterCampManager.monsterWave = MonsterCampManager.monsterWave + 1
MonsterCampManager.SetMonsterCampCurWave(MonsterCampManager.monsterWave + 1)
UIManager.OpenPanel(UIName.BattleWinPopup, nil, false, BATTLE_TYPE.MONSTER_CAMP, result, true, true,function()
-- UIManager.OpenPanel(UIName.RewardItemPopup,msg.enventDrop,1,function()
this.OnShowPanel()--刷新界面

View File

@ -205,7 +205,7 @@ function this.GetQuickResult()
local result = {}
result.drop = msg.enventDrop
UIManager.OpenPanel(UIName.BattleWinPopup, nil, false, 5, result, not haveRecord, nil, function()end)
MonsterCampManager.monsterWave = MonsterCampManager.monsterWave + 1
MonsterCampManager.SetMonsterCampCurWave(MonsterCampManager.monsterWave + 1)
-- 刷新波次显示
this.waveNum.text = MonsterCampManager.monsterWave
this.ChangePreview()

View File

@ -192,7 +192,7 @@ function this.PlayerInfoRequest(func)
-- TreasureOfSomebodyManagerV2.SetCurrentLevel(msg.treasureLevel)
-- TreasureOfSomebodyManagerV2.SetTreasureBuyStatus(msg.hadBuyTreasure)
-- 当前波次
MonsterCampManager.monsterWave = msg.monsterAttackTime
MonsterCampManager.SetMonsterCampCurWave(msg.monsterAttackTime)
MonsterCampManager.SetRewardWave(msg.DemonsTrialRewardInfo)
MonsterCampManager. SetFriendHelpHero(msg.helpFightList)
OperatingManager.SetSignInData(msg.SignInInfo)