【七界试炼】提交

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},--降妖夺宝
NiuQiChongTian = {14,16,1300},--牛气冲天
XiuXing = {14,16,1226},--修行
QiJie = {14,16,16},--七界试炼
}

View File

@ -162,6 +162,9 @@ function this:InitComponent()
--玉虚论道3队切换
this.switchBar = Util.GetGameObject(self.transform, "SwitchBar")
this.switchBar:SetActive(false)
--七界试炼
this.conditionBar = Util.GetGameObject(self.transform, "ConditionBar")
this.conditionBar:SetActive(false)
end
function this:BindEvent()
@ -244,6 +247,7 @@ function this:OnOpen(_panelType,...)
this.formTip:SetActive(false)
this.tip:SetActive(false)
this.empty:SetActive(false)
this.opView = require(this.PanelOptionView[_panelType])
this.opView.Init(this, ...)
parameter = ...
@ -256,6 +260,7 @@ function this:OnShow()
this.ElementalResonanceView:OnOpen({sortOrder=self.sortingOrder})
this.SetDrawLevel()
this.RefreshFormation(true,true)
this.CheckQiJieConfition()
end
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)})
end
tempPowerNum = this.formationPower
this.CheckQiJieConfition()
end
-- 设置编队上阵位置显隐
function this.InitArmPos()
@ -790,7 +796,7 @@ function this.SingleHeroDataShow(_go, _heroData)
PopupTipPanel.ShowTip("激活神将图鉴后才可使用!")
return
end
for k, v in ipairs(this.choosedList) do
if v.heroId == heroData.dynamicId then
choosedObj:SetActive(false)
@ -802,7 +808,7 @@ function this.SingleHeroDataShow(_go, _heroData)
return
end
end
-- 当前可选的最大上阵人数
local maxNum = ActTimeCtrlManager.MaxArmyNum()
if this.curFormationIndex == FormationTypeDef.FIGHT_ASSISTANTLEVEL then--山河社稷图判断上阵数量
@ -832,9 +838,9 @@ function this.SingleHeroDataShow(_go, _heroData)
PopupTipPanel.ShowTip(Language[10689])
return
end
--如果在玉虚三个队里面的另外一个队
local curPos=this.GetPos()
if yxID~=0 and yxID~=this.curFormationIndex then
--如果在玉虚三个队里面的另外一个队
local curPos=this.GetPos()
if yxID~=0 and yxID~=this.curFormationIndex then
MsgPanel.ShowTwo("该神将正处于其他队伍,是否要编入当前队伍内",nil, function()
--改变英雄队伍id改变
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})
--如果是玉虚论道
if this.curFormationIndex==2001 or this.curFormationIndex==2002 or this.curFormationIndex==2003 then
this.opView.AddHeroToTeam(heroData.dynamicId,curPos,this.curFormationIndex)
end
this.SetCardsData(this.choosedList)
@ -1045,6 +1050,13 @@ function this.SetDrawLevel()
canvas.overrideSorting = false
end
--检测七界试炼条件
function this.CheckQiJieConfition()
if this.curFormationIndex == FormationTypeDef.FORMATION_QIJIESHILIAN then
this.opView.RefreshConditon(this.choosedList)
end
end
--设置一键上阵
function this.SetOneKeyGo()
--获取需要上阵的位置
@ -1085,7 +1097,7 @@ function this.SetOneKeyGo()
table.insert(this.choosedList, {heroId = v.dynamicId, position=posArr[n]})
this.opView.AddHeroToTeam(v.dynamicId,posArr[n],this.curFormationIndex)
table.remove(posArr,n)
this.order = this.order + 1
this.order = this.order + 1
break
end
end

View File

@ -9,6 +9,7 @@ this.nodeData = {}
local curFormationTypeDef
--- 逻辑初始化
function this.Init(root, _nodeData)
this.spLoader = SpriteLoader.New()
this.root = root
this.nodeData = _nodeData
this.InitView()
@ -52,16 +53,31 @@ function this.InitView()
this.root.btn_1_lab.text = Language[10710]
this.root.btn_2_lab.text = Language[10706]
MapManager.isCarbonEnter = false
local costTip = this.root.costTip
costTip:SetActive(false)
-- local costTip = this.root.costTip
-- 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
this.root.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main })
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()
this.spLoader:Destroy()
PopupTipPanel.ShowTip("开始战斗")
end

View File

@ -5559,7 +5559,7 @@ function NetManager.SevenWorldRelicRequest(_relicId,func)
end
--七界试炼请求战斗
function NetManager.SevenWorldRelicRequest(_tierId,func)
function NetManager.SevenWorldChallengeRequest(_tierId,func)
local data = PlayerInfoProto_pb.SevenWorldChallengeRequest()
local msg = data:SerializeToString()
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.title = Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
self.Img = Util.GetGameObject(gameObject,"Image"):GetComponent("Image")
self.cost = Util.GetGameObject(gameObject,"cost")
self.costIcon = Util.GetGameObject(gameObject,"cost/Icon"):GetComponent("Image")
self.costNum = Util.GetGameObject(gameObject,"cost/Num"):GetComponent("Text")
self.activeBtn = Util.GetGameObject(gameObject,"activeBtn")
@ -46,6 +47,7 @@ function QiJieSingleTreasure:OnShow(_parent,...)
else
self.attriText.text = "表里是空的!"
end
ForceRebuildLayout(self.cost.transform)
end
function QiJieSingleTreasure:OnClose()

View File

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

View File

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