【七界试炼】提交

dev_chengFeng
ZhangBiao 2021-09-10 15:23:15 +08:00
parent 2d003aaafd
commit 42df2f4af5
8 changed files with 1051 additions and 144 deletions

View File

@ -486,6 +486,7 @@ PanelType = {
XiangYaoDuoBao = {14,16,1220},--降妖夺宝 XiangYaoDuoBao = {14,16,1220},--降妖夺宝
NiuQiChongTian = {14,16,1300},--牛气冲天 NiuQiChongTian = {14,16,1300},--牛气冲天
XiuXing = {14,16,1226},--修行 XiuXing = {14,16,1226},--修行
QiJie = {14,16,16},--七界试炼
} }

View File

@ -162,6 +162,9 @@ function this:InitComponent()
--玉虚论道3队切换 --玉虚论道3队切换
this.switchBar = Util.GetGameObject(self.transform, "SwitchBar") this.switchBar = Util.GetGameObject(self.transform, "SwitchBar")
this.switchBar:SetActive(false) this.switchBar:SetActive(false)
--七界试炼
this.conditionBar = Util.GetGameObject(self.transform, "ConditionBar")
this.conditionBar:SetActive(false)
end end
function this:BindEvent() function this:BindEvent()
@ -244,6 +247,7 @@ function this:OnOpen(_panelType,...)
this.formTip:SetActive(false) this.formTip:SetActive(false)
this.tip:SetActive(false) this.tip:SetActive(false)
this.empty:SetActive(false) this.empty:SetActive(false)
this.opView = require(this.PanelOptionView[_panelType]) this.opView = require(this.PanelOptionView[_panelType])
this.opView.Init(this, ...) this.opView.Init(this, ...)
parameter = ... parameter = ...
@ -256,6 +260,7 @@ function this:OnShow()
this.ElementalResonanceView:OnOpen({sortOrder=self.sortingOrder}) this.ElementalResonanceView:OnOpen({sortOrder=self.sortingOrder})
this.SetDrawLevel() this.SetDrawLevel()
this.RefreshFormation(true,true) this.RefreshFormation(true,true)
this.CheckQiJieConfition()
end end
function this:OnClose() function this:OnClose()
@ -375,6 +380,7 @@ function this.SetCardsData()
UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = tempPowerNum,newValue = newPowerNum,pos=Vector3.New(-467,837.2),duration=0.7,isShowBg=false,isShowOldNum=false,pivot=Vector2.New(0,0.5)}) UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = tempPowerNum,newValue = newPowerNum,pos=Vector3.New(-467,837.2),duration=0.7,isShowBg=false,isShowOldNum=false,pivot=Vector2.New(0,0.5)})
end end
tempPowerNum = this.formationPower tempPowerNum = this.formationPower
this.CheckQiJieConfition()
end end
-- 设置编队上阵位置显隐 -- 设置编队上阵位置显隐
function this.InitArmPos() function this.InitArmPos()
@ -832,9 +838,9 @@ function this.SingleHeroDataShow(_go, _heroData)
PopupTipPanel.ShowTip(Language[10689]) PopupTipPanel.ShowTip(Language[10689])
return return
end end
--如果在玉虚三个队里面的另外一个队 --如果在玉虚三个队里面的另外一个队
local curPos=this.GetPos() local curPos=this.GetPos()
if yxID~=0 and yxID~=this.curFormationIndex then if yxID~=0 and yxID~=this.curFormationIndex then
MsgPanel.ShowTwo("该神将正处于其他队伍,是否要编入当前队伍内",nil, function() MsgPanel.ShowTwo("该神将正处于其他队伍,是否要编入当前队伍内",nil, function()
--改变英雄队伍id改变 --改变英雄队伍id改变
this.opView.ChangeHeroTeam(heroData.dynamicId,this.curFormationIndex,curPos) this.opView.ChangeHeroTeam(heroData.dynamicId,this.curFormationIndex,curPos)
@ -848,7 +854,6 @@ function this.SingleHeroDataShow(_go, _heroData)
table.insert(this.choosedList, {heroId = heroData.dynamicId, position=curPos}) table.insert(this.choosedList, {heroId = heroData.dynamicId, position=curPos})
--如果是玉虚论道 --如果是玉虚论道
if this.curFormationIndex==2001 or this.curFormationIndex==2002 or this.curFormationIndex==2003 then if this.curFormationIndex==2001 or this.curFormationIndex==2002 or this.curFormationIndex==2003 then
this.opView.AddHeroToTeam(heroData.dynamicId,curPos,this.curFormationIndex) this.opView.AddHeroToTeam(heroData.dynamicId,curPos,this.curFormationIndex)
end end
this.SetCardsData(this.choosedList) this.SetCardsData(this.choosedList)
@ -1045,6 +1050,13 @@ function this.SetDrawLevel()
canvas.overrideSorting = false canvas.overrideSorting = false
end end
--检测七界试炼条件
function this.CheckQiJieConfition()
if this.curFormationIndex == FormationTypeDef.FORMATION_QIJIESHILIAN then
this.opView.RefreshConditon(this.choosedList)
end
end
--设置一键上阵 --设置一键上阵
function this.SetOneKeyGo() function this.SetOneKeyGo()
--获取需要上阵的位置 --获取需要上阵的位置

View File

@ -9,6 +9,7 @@ this.nodeData = {}
local curFormationTypeDef local curFormationTypeDef
--- 逻辑初始化 --- 逻辑初始化
function this.Init(root, _nodeData) function this.Init(root, _nodeData)
this.spLoader = SpriteLoader.New()
this.root = root this.root = root
this.nodeData = _nodeData this.nodeData = _nodeData
this.InitView() this.InitView()
@ -52,16 +53,31 @@ function this.InitView()
this.root.btn_1_lab.text = Language[10710] this.root.btn_1_lab.text = Language[10710]
this.root.btn_2_lab.text = Language[10706] this.root.btn_2_lab.text = Language[10706]
MapManager.isCarbonEnter = false MapManager.isCarbonEnter = false
local costTip = this.root.costTip -- local costTip = this.root.costTip
costTip:SetActive(false) -- costTip:SetActive(false)
this.root.conditionBar:SetActive(true)
this.goalList = {}
for i = 1, 3 do
this.goalList[i] = Util.GetGameObject(this.root.conditionBar,"goal ("..i..")")
end
hadClick = false hadClick = false
this.root.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main }) this.root.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main })
end end
function this.RefreshConditon(choosedList)
for i = 1, #this.goalList do
local text = Util.GetGameObject(this.goalList[i],"Text"):GetComponent("Text")
local image = Util.GetGameObject(this.goalList[i],"Image"):GetComponent("Image")
local state = QiJieShiLianManager.CheckGoalIsFinish(this.nodeData.ConditionValue[i],text,choosedList)--检测是否完成此条目(顺便设置文字)
local imgname = state and "q_qjsl_wfzjm_yjh" or "q_qjsl_wfzjm_wjh"
image.sprite = this.spLoader:LoadSprite(imgname)
end
end
-- 开始战斗 -- 开始战斗
function this.StartFight() function this.StartFight()
this.spLoader:Destroy()
PopupTipPanel.ShowTip("开始战斗") PopupTipPanel.ShowTip("开始战斗")
end end

View File

@ -5559,7 +5559,7 @@ function NetManager.SevenWorldRelicRequest(_relicId,func)
end end
--七界试炼请求战斗 --七界试炼请求战斗
function NetManager.SevenWorldRelicRequest(_tierId,func) function NetManager.SevenWorldChallengeRequest(_tierId,func)
local data = PlayerInfoProto_pb.SevenWorldChallengeRequest() local data = PlayerInfoProto_pb.SevenWorldChallengeRequest()
local msg = data:SerializeToString() local msg = data:SerializeToString()
Network:SendMessageWithCallBack(MessageTypeProto_pb.SevenWorldChallengeRequest, MessageTypeProto_pb.SevenWorldChallengeResponse, msg, function(buffer) Network:SendMessageWithCallBack(MessageTypeProto_pb.SevenWorldChallengeRequest, MessageTypeProto_pb.SevenWorldChallengeResponse, msg, function(buffer)

View File

@ -11,6 +11,7 @@ function QiJieSingleTreasure:InitComponent(gameObject)
self.attriText = Util.GetGameObject(gameObject,"AttriText"):GetComponent("Text") self.attriText = Util.GetGameObject(gameObject,"AttriText"):GetComponent("Text")
self.title = Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text") self.title = Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
self.Img = Util.GetGameObject(gameObject,"Image"):GetComponent("Image") self.Img = Util.GetGameObject(gameObject,"Image"):GetComponent("Image")
self.cost = Util.GetGameObject(gameObject,"cost")
self.costIcon = Util.GetGameObject(gameObject,"cost/Icon"):GetComponent("Image") self.costIcon = Util.GetGameObject(gameObject,"cost/Icon"):GetComponent("Image")
self.costNum = Util.GetGameObject(gameObject,"cost/Num"):GetComponent("Text") self.costNum = Util.GetGameObject(gameObject,"cost/Num"):GetComponent("Text")
self.activeBtn = Util.GetGameObject(gameObject,"activeBtn") self.activeBtn = Util.GetGameObject(gameObject,"activeBtn")
@ -46,6 +47,7 @@ function QiJieSingleTreasure:OnShow(_parent,...)
else else
self.attriText.text = "表里是空的!" self.attriText.text = "表里是空的!"
end end
ForceRebuildLayout(self.cost.transform)
end end
function QiJieSingleTreasure:OnClose() function QiJieSingleTreasure:OnClose()

View File

@ -40,10 +40,10 @@ end
--界面获取信息 --界面获取信息
function this.GetQiJieData(targetLevel) function this.GetQiJieData(targetLevel)
--上阵列表赋值 --上阵列表赋值
local curFormation = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_NORMAL) -- local curFormation = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_NORMAL)
if FormationManager.GetFormationByID(FormationTypeDef.FORMATION_QIJIESHILIAN) then -- if FormationManager.GetFormationByID(FormationTypeDef.FORMATION_QIJIESHILIAN) then
curFormation = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_QIJIESHILIAN) curFormation = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_QIJIESHILIAN)
end -- end
this.formationList ={} this.formationList ={}
for j = 1, #curFormation.teamHeroInfos do for j = 1, #curFormation.teamHeroInfos do
if curFormation.teamHeroInfos[j] then if curFormation.teamHeroInfos[j] then
@ -86,37 +86,49 @@ function this.GetTabList()
end end
--检测该条目是否达成 --检测该条目是否达成
function this.CheckGoalIsFinish(_dataId,_obj) function this.CheckGoalIsFinish(_dataId,_obj,_formationList)
local goalData = QijieUpgrade[_dataId] local goalData = QijieUpgrade[_dataId]
local tempList = {} local tempList = {}
local final = true local final = true
for i = 1, #this.formationList do local heroList = {}
table.insert(tempList,this.formationList[i]) -- LogRed("Id:"..tostring(goalData.Id).." Describe:"..tostring(goalData.Describe).." PropertyName:"..tostring(goalData.PropertyName).." Profession:"..tostring(goalData.Profession).." Min:"..tostring(goalData.Min).." Max:"..tostring(goalData.Max))
heroList = _formationList and _formationList or this.formationList
if #heroList == 0 then
-- LogYellow("final = false0")
final = false
end end
-- LogGreen("Id:"..tostring(goalData.Id).." Describe:"..tostring(goalData.Describe).." PropertyName:"..tostring(goalData.PropertyName).." Profession:"..tostring(goalData.Profession).." Min:"..tostring(goalData.Min).." Max:"..tostring(goalData.Max)) for i = 1, #heroList do
if goalData.PropertyName and goalData.PropertyName > 0 then table.insert(tempList,HeroConfig[HeroManager.GetSingleHeroData(heroList[i].heroId).id])
end
if #tempList > 0 and final and goalData.PropertyName and goalData.PropertyName > 0 then
for i = #tempList, 1,-1 do for i = #tempList, 1,-1 do
if goalData.PropertyName ~= tempList[i].PropertyName then if goalData.PropertyName ~= tempList[i].PropertyName then
table.remove(tempList,i) table.remove(tempList,i)
if #tempList == 0 then
final = true
end
end end
end end
end end
-- LogGreen("#tempList1:"..tostring(#tempList)) -- LogGreen("#tempList1:"..tostring(#tempList))
if goalData.Profession and goalData.Profession > 0 then if #tempList > 0 and final and goalData.Profession and goalData.Profession > 0 then
for i = #tempList, 1,-1 do for i = #tempList, 1,-1 do
if goalData.Profession ~= tempList[i].Profession then if goalData.Profession ~= tempList[i].Profession then
table.remove(tempList,i) table.remove(tempList,i)
if #tempList == 0 then
final = true
end
end end
end end
end end
-- LogGreen("#tempList1:"..tostring(#tempList)) -- LogGreen("#tempList1:"..tostring(#tempList))
if goalData.Min and goalData.Min >= 0 then if final and goalData.Min and goalData.Min >= 0 then
if #tempList < goalData.Min then if #tempList < goalData.Min then
-- LogYellow("final = false1") -- LogYellow("final = false1")
final = false final = false
end end
end end
if goalData.Max and goalData.Max >= 0 then if final and goalData.Max and goalData.Max >= 0 then
if #tempList > goalData.Max then if #tempList > goalData.Max then
-- LogYellow("final = false2") -- LogYellow("final = false2")
final = false final = false
@ -131,11 +143,11 @@ end
--把服务器发来的遗物数据加到本地数据中 --把服务器发来的遗物数据加到本地数据中
function this.MixTreasureServerAndLocalData(msg) function this.MixTreasureServerAndLocalData(msg)
for k,v in pairs(msg.info) do for i = 1, #msg.info do
if this.treasureList[v.id] then if this.treasureList[msg.info[i].id] then
this.treasureList[v.id].state = v.status this.treasureList[msg.info[i].id].state = msg.info[i].status
else else
LogError("服务器发来了前端不存在的遗物Id"..tostring(v.id)) LogError("服务器发来了前端不存在的遗物Id"..tostring(msg.info[i].id))
end end
end end
end end

View File

@ -88,7 +88,7 @@ function QiJieShiLianPanel:BindEvent()
UIManager.OpenPanel(UIName.GeneralInfoPopup,GENERALINFO_TYPE.QiJieGoalAttri,self.configData) UIManager.OpenPanel(UIName.GeneralInfoPopup,GENERALINFO_TYPE.QiJieGoalAttri,self.configData)
end) end)
Util.AddClick(self.giftBtn,function() Util.AddClick(self.giftBtn,function()
QiJieShiLianManager.MixTreasureServerAndLocalData(function () NetManager.SevenWorldRelicRequest(nil,function (msg)
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.QiJieTreasure) UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.QiJieTreasure)
end) end)
end) end)
@ -156,7 +156,7 @@ end
--跨服 --跨服
function QiJieShiLianPanel:OnOpen() function QiJieShiLianPanel:OnOpen()
self.UpView:OnOpen({showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main}) self.UpView:OnOpen({showType = UpViewOpenType.ShowLeft, panelType = PanelType.QiJie})
end end
--界面打开时调用(用于子类重写) --界面打开时调用(用于子类重写)