Merge branch 'china/dev' of http://60.1.1.230/gaoxin/JL_Client into china/dev

dev_chengFeng
jiaoyangna 2021-12-13 15:52:00 +08:00
commit b31036ccc5
10 changed files with 167 additions and 13 deletions

View File

@ -188,6 +188,7 @@ SITUATIONCHALLENGERESPONSE_DROP_FIELD = protobuf.FieldDescriptor();
SITUATIONCHALLENGERESPONSE_FIGHTDATA_FIELD = protobuf.FieldDescriptor();
JOURNEYGETINFORESPONSE = protobuf.Descriptor();
JOURNEYGETINFORESPONSE_INFOS_FIELD = protobuf.FieldDescriptor();
JOURNEYGETINFORESPONSE_FINISHNUM_FIELD = protobuf.FieldDescriptor();
JOURNEYGETONEINFOREQUEST = protobuf.Descriptor();
JOURNEYGETONEINFOREQUEST_MAPID_FIELD = protobuf.FieldDescriptor();
JOURNEYGETONEINFORESPONSE = protobuf.Descriptor();
@ -1959,11 +1960,21 @@ JOURNEYGETINFORESPONSE_INFOS_FIELD.message_type = CommonProto_pb.JOURNEYINFO
JOURNEYGETINFORESPONSE_INFOS_FIELD.type = 11
JOURNEYGETINFORESPONSE_INFOS_FIELD.cpp_type = 10
JOURNEYGETINFORESPONSE_FINISHNUM_FIELD.name = "finishNum"
JOURNEYGETINFORESPONSE_FINISHNUM_FIELD.full_name = ".rpc.protocols.JourneyGetInfoResponse.finishNum"
JOURNEYGETINFORESPONSE_FINISHNUM_FIELD.number = 2
JOURNEYGETINFORESPONSE_FINISHNUM_FIELD.index = 1
JOURNEYGETINFORESPONSE_FINISHNUM_FIELD.label = 1
JOURNEYGETINFORESPONSE_FINISHNUM_FIELD.has_default_value = false
JOURNEYGETINFORESPONSE_FINISHNUM_FIELD.default_value = 0
JOURNEYGETINFORESPONSE_FINISHNUM_FIELD.type = 5
JOURNEYGETINFORESPONSE_FINISHNUM_FIELD.cpp_type = 1
JOURNEYGETINFORESPONSE.name = "JourneyGetInfoResponse"
JOURNEYGETINFORESPONSE.full_name = ".rpc.protocols.JourneyGetInfoResponse"
JOURNEYGETINFORESPONSE.nested_types = {}
JOURNEYGETINFORESPONSE.enum_types = {}
JOURNEYGETINFORESPONSE.fields = {JOURNEYGETINFORESPONSE_INFOS_FIELD}
JOURNEYGETINFORESPONSE.fields = {JOURNEYGETINFORESPONSE_INFOS_FIELD, JOURNEYGETINFORESPONSE_FINISHNUM_FIELD}
JOURNEYGETINFORESPONSE.is_extendable = false
JOURNEYGETINFORESPONSE.extensions = {}
JOURNEYGETONEINFOREQUEST_MAPID_FIELD.name = "mapId"

View File

@ -21,7 +21,6 @@ end
function this.GetHaveEquipDatas()
return this.HaveEquipDatas
end
--upHeroDid
function this.InitUpdateEquipData(id, upHeroDid, isFindHandBook)
if not this.equipDatas then
@ -70,6 +69,33 @@ function this.InitUpdateEquipData(id, upHeroDid, isFindHandBook)
end
end
-- 获取拥有某星级以上的装备数量
function this.GetLimitStarEquipNum(star)
local allNum = 0
-- 背包里面的
local equips = BagManager.GetBagItemDataByItemType(ItemBaseType.Equip)
for _, e in ipairs(equips) do
if e.id and e.num > 0 then
if equipConfig[e.id].Star >= star then
allNum = allNum + e.num
end
end
end
-- 身上穿的
local allHeroDatas = HeroManager.GetAllHeroList()
for _, hero in pairs(allHeroDatas) do
if hero.equipIdList and #hero.equipIdList > 0 then
for i = 1, #hero.equipIdList do
local id = hero.equipIdList[i]
if equipConfig[id].Star >= star then
allNum = allNum + 1
end
end
end
end
return allNum
end
function this.UpdateEquipData(idlist, heroDid)
for i = 1, #idlist do
this.InitUpdateEquipData(idlist[i], heroDid, false)

View File

@ -259,9 +259,10 @@ function this.IsCanFight(fightId)
if this.IsChapterClossState() then
-- 以防后端不校验,再来一次
if PlayerManager.level < mainLevelConfig[this.curOpenFight].LevelLimit then
local isOk, tip = this.CheckFightOpenRule(this.curOpenFight)
if not isOk then
Log("等级不足,无法挑战关卡")
return false, tostring(mainLevelConfig[this.curOpenFight].LevelLimit .. Language[10056])
return false, tip
else -- 等级不足未通关时设置一下
if this.curFightState == -1 then
this.curFightState = 1
@ -275,7 +276,7 @@ function this.IsCanFight(fightId)
return true, Language[10617]
elseif state == FIGHT_POINT_STATE.OPEN_LOW_LEVEL then
Log("等级不足,无法挑战关卡")
return false, tostring(mainLevelConfig[this.curOpenFight].LevelLimit .. Language[10056])
return false, "关卡未满足解锁条件"--tostring(mainLevelConfig[this.curOpenFight].LevelLimit .. Language[10056])
elseif state == FIGHT_POINT_STATE.PASS then -- 最后一关
Log("已经通关")
return false, Language[10618]
@ -285,6 +286,101 @@ function this.IsCanFight(fightId)
end
end
-- 检测其他关卡条件
function this.CheckFightOpenRule(fightId)
if not fightId or not mainLevelConfig[fightId] then
return false, "没有这个关卡"
end
if PlayerManager.level < mainLevelConfig[this.curOpenFight].LevelLimit then
local tip = tostring(mainLevelConfig[this.curOpenFight].LevelLimit .. Language[10056])
LogRed(tip .. " 当前:"..PlayerManager.level)
return false, tip
end
local openRule = mainLevelConfig[fightId].OpenRule
if openRule then
local states = {}
local tips = {}
for index, rule in ipairs(openRule) do
if not rule[1] or rule[1] == 0 then
LogRed("当前没有限制条件1")
states[index] = true
elseif rule[1] == 1 then
local star = FightLevelManager.GetAllChapterStars()
if star < rule[2] then
states[index] = false
tips[index] = string.format("山河社稷图星数达%s", rule[2])
LogRed(tips[index]..", 当前:"..star)
end
elseif rule[1] == 2 then
local wave = MonsterCampManager.GetMonsterCampCurWave()
if wave <= rule[2] then
states[index] = false
tips[index] = string.format("心魔试炼通关%s层", rule[2])
LogRed(tips[index]..", 当前:"..wave)
end
elseif rule[1] == 3 then
local lv = HarmonyManager.GetSingleAdditions(HarmonyAddType.AddLv)
if lv < rule[2] then
states[index] = false
tips[index] = string.format("鸿蒙阵共鸣等级达%s", rule[2])
LogRed(tips[index]..", 当前:"..lv)
end
elseif rule[1] == 4 then
-- 指定星级(运算星级)装备数量(初始可用)
local num = EquipManager.GetLimitStarEquipNum(rule[2])
if num < rule[3] then
local equipStarConfig = ConfigManager.GetConfigData(ConfigName.EquipStarsConfig, rule[2])
states[index] = false
tips[index] = string.format("拥有%s个%s%s星装备", rule[3], QualityNameDef[equipStarConfig.Quality], equipStarConfig.Stars)
LogRed(tips[index]..", 当前:"..num)
end
elseif rule[1] == 5 then
local _, tlv, _ = LikabilityManager.GetTotalHeroLikeLv(-1)
if tlv < rule[2] then
states[index] = false
tips[index] = string.format("神将总好感度等级达%s", rule[2])
LogRed(tips[index]..", 当前:"..tlv)
end
elseif rule[1] == 6 then
-- 逍遥游通关次数
local xyPassTimes = XiaoYaoManager.GetCurPassTimes()
if xyPassTimes < rule[2] then
states[index] = false
tips[index] = string.format("通关逍遥游%s次", rule[2])
LogRed(tips[index]..", 当前:"..xyPassTimes)
end
elseif rule[1] == 7 then
local c_lv = rule[2]
local c_num = rule[3]
local num = #HeroManager.GetAllHeroDatas(c_lv)
if num < c_num then
states[index] = false
tips[index] = string.format("拥有%s个等级%s以上的神将", c_num, c_lv)
LogRed(tips[index]..", 当前:"..num)
end
end
end
local tip = ""
local isOk = true
for index, state in pairs(states) do
if not state then
isOk = false
if tip ~= "" then
tip = tip..string.format(",且%s", tips[index])
else
tip = tips[index]
end
end
end
return isOk, tip.."解锁"
end
LogRed("当前没有限制条件2")
return true
end
-- 判断是否显示关卡按钮红点
function this.IsShowFightRP()
return this.IsCanFight(this.curOpenFight)
@ -299,6 +395,10 @@ function this.GetBtnText()
if PlayerManager.level < limitLevel then
return limitLevel .. Language[10056]
end
--
if not this.CheckFightOpenRule(this.curOpenFight) then
return "条件未达成"
end
local offset = 1
offset = mainLevelConfig[this.curOpenFight].Difficulty

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)

View File

@ -61,7 +61,7 @@ function this.EventTrigger(eventId, callBack)
bg = FakeBattleNew[options[1]].BgName
}
local panel = UIManager.OpenPanel(UIName.GuideBattlePanel, testFightData, function()
StoryManager.StoryJumpType(options[3])
StoryManager.StoryJumpType(options[3], nil, callBack)
end, options[2])

View File

@ -14,6 +14,7 @@ this.luckyluckyTurnTableRemainTime = 0
this.isAutoYouli=false --逍遥游自动游历开关
this.first = true
this.finishNum = 0
--打开逍遥游地图列表界面
function this.OpenMapList()
this.first = false
@ -37,7 +38,9 @@ function this.GetOpenMapData(func)
_data[msg.infos[i].mapId].first=msg.infos[i].first
end
this.allMapData=_data
--逍遥游累计通关次数
this.finishNum = msg.finishNum or 0
this.CheckRedPoint2()
if func then
func(_data)
@ -45,6 +48,11 @@ function this.GetOpenMapData(func)
end)
end
-- 获取逍遥游通关总次数
function this.GetCurPassTimes()
return this.finishNum
end
-- 判断地图是否首通
function this.IsFirstPass(mapId)
if not this.allMapData or not this.allMapData[mapId] or this.allMapData[mapId].first ~= 1 then