四灵提交

dev_chengFeng
jiaoyangna 2021-08-30 14:21:41 +08:00
parent 2fbe372c76
commit a76f27ecf0
9 changed files with 2449 additions and 2314 deletions

View File

@ -2452,6 +2452,7 @@ BATTLE_TYPE = {
FIGHT_ASSISTANT_LEVEL = 21, --山河社稷图副关卡战斗
BACK_BATTLE = 1000, -- 系统战斗回放
EndlessMpaFight = 22, -- 无尽副本
FOURELEMENT = 23,
}
--_1 本服 _2 跨服 3_跨服不显示在排行主界面 4 用于十绝阵特殊判断
rankKingList={ [1] = { bgImage = "r_zjm_paihangbang_banner04_zh", name = Language[12096] ,rankType = RANK_TYPE.FIGHT_LEVEL_RANK,activiteId = 0,isRankingMainPanelShow = 1,RankingListMainSortId = 1},

View File

@ -43,6 +43,14 @@ function this.MakeAEmptyTeam(teamId)
oTeam.teamName = "山河社稷图"-- 1701
elseif teamId == FormationTypeDef.FIGHT_ASSISTANTLEVEL then
oTeam.teamName = "山河社稷图"-- 1701
elseif teamId == FormationTypeDef.FourElement_PEOPLE then
oTeam.teamName = "四灵试炼人"-- 1701
elseif teamId == FormationTypeDef.FourElement_BUDDHIST then
oTeam.teamName = "四灵试炼佛"-- 1701
elseif teamId == FormationTypeDef.FourElement_MAGIC then
oTeam.teamName = "四灵试炼妖"-- 1701
elseif teamId == FormationTypeDef.FourElement_TAOIST then
oTeam.teamName = "四灵试炼道"-- 1701
end
oTeam.teamHeroInfos = {}
oTeam.teamPokemonInfos = {}
@ -61,6 +69,7 @@ function this.UpdateFormation(msg)
-- this.curFormationIndex = this.SetCurFormationIndex()
this.curFormationIndex = 1
for i, team in ipairs(msg.TeamPosInfo) do
LogGreen("team.teamId:"..team.teamId)
local oTeam = this.MakeAEmptyTeam(team.teamId)
for j = 1, #team.teamHeroInfos do
@ -129,7 +138,7 @@ function this.RefreshFormation(index, roleList, pokemonList,isDiffmonster)
end
NetManager.TeamInfoSaveRequest(curFormation, function()
Game.GlobalEvent:DispatchEvent(GameEvent.Formation.OnFormationChange,isDiffmonster)
--LogGreen("发送保存编队请求 ,长度:"..#curFormation.teamHeroInfos)
LogGreen("发送保存编队请求 ,长度:"..#curFormation.teamHeroInfos)
end)
this.CheckHeroIdExist()

View File

@ -94,6 +94,7 @@ function this.On_Btn2_Click()
PopupTipPanel.ShowTip("挑战编队为空")
return
end
LogGreen("this.root.curFormationIndex:"..this.root.curFormationIndex)
FormationManager.RefreshFormation(
this.root.curFormationIndex,
this.root.choosedList,

View File

@ -6,7 +6,7 @@ local this = FourElementMonsterCampPanel
this.grid = {}
this.singledataList = {}
this.singlePreList = {}
--this.singlePreList = {}
local curType = 0
local trailData = {}
@ -41,6 +41,7 @@ function FourElementMonsterCampPanel:InitComponent()
this.scrollView.moveTween.Strength = 2
this.titleText = Util.GetGameObject(self.gameObject, "InfoRoot/tiitleRoot/title"):GetComponent("Text")
this.moppingUpBtn = Util.GetGameObject(self.gameObject, "InfoRoot/bottomLayout/moppingUpBtn")
this.canFightWaves = Util.GetGameObject(self.gameObject, "InfoRoot/bottomLayout/canFightWaves"):GetComponent("Text")
this.freeMoppingTimes = Util.GetGameObject(self.gameObject, "InfoRoot/bottomLayout/freeMoppingTimes"):GetComponent("Text")
this.buyMoppingTimes = Util.GetGameObject(self.gameObject, "InfoRoot/bottomLayout/buyMoppingTimes"):GetComponent("Text")
@ -93,6 +94,18 @@ function FourElementMonsterCampPanel:BindEvent()
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.FourElementHelpFight,trailData.monsterWave + 1,curType,data,MyHeroData)
end)
end)
Util.AddClick(this.moppingUpBtn, function ()
if trailData.canFightTime < 1 then
PopupTipPanel.ShowTip("今日挑战次数不足")
return
end
if FormationManager.CheckFormationValid(curType + 2000) then
MonsterCampManager.ExecuteFightBattle(trailData.monsterWave + 1 ,0,function() this:OnShow() end,curType,true)
else
PopupTipPanel.ShowTip("编队不能为空")
return
end
end)
end
this.UpdatePrivilage = function()
@ -170,7 +183,7 @@ function this.InitMonsterShow()
this.scrollView:SetData(monsterInfo, function (index, go)
local tempData = this.SingleDataShow(go, monsterInfo[index])
this.singledataList[monsterInfo[index].wave] = tempData
this.singlePreList[go] = this.singledataList[monsterInfo[index].wave]
--this.singlePreList[go] = this.singledataList[monsterInfo[index].wave]
end,true,true)
if MonsterCampManager.CurOffsetIndex < 0 then
this.scrollView:SetIndex((#monsterInfo-trailData.monsterWave-2))
@ -188,10 +201,10 @@ end
--界面销毁时调用(用于子类重写)
function FourElementMonsterCampPanel:OnDestroy()
this.spLoader:Destroy()
for k,v in pairs(this.singlePreList) do
for k,v in pairs(this.singledataList) do
v:OnDestroy()
end
this.singlePreList = {}
--this.singlePreList = {}
this.singledataList = {}
SubUIManager.Close(this.scrollView)
this.spLoader:Destroy()

View File

@ -169,37 +169,65 @@ function this.GetMonsterTeamInfo(monsterGroupId)
end
end
function this.StraightBattle(id,type,func,curType)
function this.StraightBattle(id,type,func,curType,isQuick)
this.oldpower = FormationManager.GetFormationPower(FormationManager.curFormationIndex)
LogGreen("oldpower:"..this.oldpower)
this.curType = curType
local fightId = ConfigManager.GetConfigDataByDoubleKey(ConfigName.CampTowerConfig,"FloorId",id,"CampId",curType).Id
NetManager.FourChallengeDoRequest(fightId,type,function(msg)
if type == 0 then
local fightData = BattleManager.GetBattleServerData(msg,0)
this.drop = msg.drop
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.FOURELEMENT,function(result)
if func then
func()
end
if result.result == 0 then
elseif result.result == 1 then
this.fourMonsterData[curType].monsterWave = id
end
end)
if isQuick then
local result = {}
result.drop = msg.drop
-- 设置战斗数据用于统计战斗
local _fightData = BattleManager.GetBattleServerData(msg,0)
this.drop = msg.drop
BattleRecordManager.SetBattleRecord(_fightData)
--用一个变量接收最近的战斗结果
this.lastBattleResult = {
result = msg.result,
hpList = {},
drop = msg.drop,
}
BattleManager.SetLastBattleResult(this.lastBattleResult,BATTLE_TYPE.FOURELEMENT)
if not msg.drop or ((not msg.drop.itemlist or #msg.drop.itemlist < 1)
and (not msg.drop.equipId or #msg.drop.equipId < 1)
and (not msg.drop.Hero or #msg.drop.Hero < 1)
and (not msg.drop.soulEquip or #msg.drop.soulEquip < 1)
and (not msg.drop.pokemon or #msg.drop.pokemon < 1)) then
UIManager.OpenPanel(UIName.BattleFailPopup, nil, true, UIName.FourElementMonsterCampPanel,BATTLE_TYPE.FOURELEMENT)
else
this.fourMonsterData[curType].monsterWave = id
UIManager.OpenPanel(UIName.BattleWinPopup, nil, false, BATTLE_TYPE.FOURELEMENT, result, true, true,function()
Game.GlobalEvent:DispatchEvent(GameEvent.FourEle.RefreshView)
end)
end
else
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function()
if func then
func()
end
end)
end
if type == 0 then
local fightData = BattleManager.GetBattleServerData(msg,0)
this.drop = msg.drop
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.FOURELEMENT,function(result)
if func then
func()
end
if result.result == 0 then
elseif result.result == 1 then
this.fourMonsterData[curType].monsterWave = id
end
end)
else
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function()
if func then
func()
end
end)
end
end
end)
end
--开始战斗
function this.ExecuteFightBattle(id,type,func,curType)
this.StraightBattle(id,type,func,curType)
function this.ExecuteFightBattle(id,type,func,curType,isQuick)
this.StraightBattle(id,type,func,curType,isQuick)
-- -- 请求战斗结果
-- NetManager.GetMonsterFightResult(MonsterCampManager.monsterWave, FormationTypeDef.FORMATION_NORMAL, function (msg)
-- if msg.result == 0 then
@ -214,7 +242,7 @@ function this.ExecuteFightBattle(id,type,func,curType)
end
function this.SaveFormation(curType)
local curFormation = FormationManager.GetFormationByID(1700 + curType)
local curFormation = FormationManager.GetFormationByID(2000 + curType)
local data = this.GetFriendHelpHero(curType)
--上阵列表赋值
local choosedList ={}
@ -229,9 +257,9 @@ function this.SaveFormation(curType)
end
end
FormationManager.RefreshFormation(
(1700 + curType),
(2000 + curType),
choosedList,
FormationManager.formationList[(1700 + curType)].teamPokemonInfos
FormationManager.formationList[(2000 + curType)].teamPokemonInfos
)
end
end

View File

@ -409,9 +409,7 @@ function this.SetPropertyShow2(_infos,_preList,_grid)
local preCount=#_preList
for i = 1, dataCount-preCount do
local go = newObject(this.TextPre)
local t = math.floor((i+1)/2)
local trans = Util.GetGameObject(_grid.transform,"line ("..t..")")
go.transform:SetParent(trans.transform)
go.transform:SetParent(_grid.transform)
go.transform.localScale = Vector3.one
go.transform.localPosition = Vector3.zero
go.gameObject:SetActive(false)

View File

@ -9,7 +9,7 @@ local curTreeLevel = 0
local length = 0
function SacredTreePanel:InitComponent()
self.spLoader.New()
self.spLoader = SpriteLoader.New()
--button
self.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft })
self.backBtn = Util.GetGameObject(self.transform, "backBtn")

View File

@ -210,15 +210,8 @@ end
--界面销毁时调用(用于子类重写)
function FourElementSingleWave:OnDestroy()
if self.rewardList then
for i = 1,#self.rewardList do
if self.rewardList[i] and self.rewardList[i].gameObject then
SubUIManager.Close(self.rewardList[i])
end
end
end
self.rewardList = {}
self.spLoader:OnDestroy()
self.spLoader:Destroy()
end
function FourElementSingleWave:NewItemView(config, gameObject, ...)
local view = reimport(config.script)