竞技场修改

zhangqiang 2020-07-07 13:29:40 +08:00
parent 1796c48583
commit 70bbb3cee2
11 changed files with 21761 additions and 6420 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: 048cdcd08f5e14d4c8ca93fdc5a015a0
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 65
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 65
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: eb27e6cd73935f145931fa415dcef1be
vertices: []
indices:
edges: []
weights: []
spritePackingTag: ArenaTopMatchAtlas
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: a161265dfd6867a49aca5d36643e9075
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 65
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 65
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 8a319fa45f3d4dd48a7add7b918b11d9
vertices: []
indices:
edges: []
weights: []
spritePackingTag: ArenaTopMatchAtlas
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -153,6 +153,7 @@ ConfigName = {
TrialQuestionConfig="TrialQuestionConfig",
TrialGameConfig="TrialGameConfig",
FakeBattle = "FakeBattle",
ArenaBattleReward = "ArenaBattleReward",
}
require "Framework/GameDataBase"

View File

@ -101,7 +101,6 @@ GameEvent = {
ShowEnemyInfo="Map.ShowEnemyInfo",
-- 刷新英雄血量
RefreshHeroHp="Map.RefreshHeroHp",
-- 停止走路
StopWalk="Map.StopWalk",
},
Event = {
@ -342,6 +341,7 @@ GameEvent = {
},
ATM_RankView={
OnRankChange="ATM_RankView.OnRankChange",
OnOpenBattle="ATM_RankView.OnOpenBattle",
},
FindTreasure={
RefreshFindTreasure="FindTreasure.RefreshFindTreasure",

View File

@ -162,7 +162,6 @@ GETTRIALBOXREWARDREQUEST = protobuf.Descriptor();
GETTRIALBOXREWARDREQUEST_TYPE_FIELD = protobuf.FieldDescriptor();
GETTRIALBOXREWARDRESPONSE = protobuf.Descriptor();
GETTRIALBOXREWARDRESPONSE_BOXDROP_FIELD = protobuf.FieldDescriptor();
GETTRIALBOXREWARDRESPONSE_BUFFIDS_FIELD = protobuf.FieldDescriptor();
USEADDHPITEMREQUEST = protobuf.Descriptor();
USEADDHPITEMREQUEST_HEROID_FIELD = protobuf.FieldDescriptor();
MAPGAMERESPONSE = protobuf.Descriptor();
@ -1651,21 +1650,11 @@ GETTRIALBOXREWARDRESPONSE_BOXDROP_FIELD.message_type = CommonProto_pb.DROP
GETTRIALBOXREWARDRESPONSE_BOXDROP_FIELD.type = 11
GETTRIALBOXREWARDRESPONSE_BOXDROP_FIELD.cpp_type = 10
GETTRIALBOXREWARDRESPONSE_BUFFIDS_FIELD.name = "buffIds"
GETTRIALBOXREWARDRESPONSE_BUFFIDS_FIELD.full_name = ".com.ljsd.jieling.protocols.GetTrialBoxRewardResponse.buffIds"
GETTRIALBOXREWARDRESPONSE_BUFFIDS_FIELD.number = 2
GETTRIALBOXREWARDRESPONSE_BUFFIDS_FIELD.index = 1
GETTRIALBOXREWARDRESPONSE_BUFFIDS_FIELD.label = 3
GETTRIALBOXREWARDRESPONSE_BUFFIDS_FIELD.has_default_value = false
GETTRIALBOXREWARDRESPONSE_BUFFIDS_FIELD.default_value = {}
GETTRIALBOXREWARDRESPONSE_BUFFIDS_FIELD.type = 5
GETTRIALBOXREWARDRESPONSE_BUFFIDS_FIELD.cpp_type = 1
GETTRIALBOXREWARDRESPONSE.name = "GetTrialBoxRewardResponse"
GETTRIALBOXREWARDRESPONSE.full_name = ".com.ljsd.jieling.protocols.GetTrialBoxRewardResponse"
GETTRIALBOXREWARDRESPONSE.nested_types = {}
GETTRIALBOXREWARDRESPONSE.enum_types = {}
GETTRIALBOXREWARDRESPONSE.fields = {GETTRIALBOXREWARDRESPONSE_BOXDROP_FIELD, GETTRIALBOXREWARDRESPONSE_BUFFIDS_FIELD}
GETTRIALBOXREWARDRESPONSE.fields = {GETTRIALBOXREWARDRESPONSE_BOXDROP_FIELD}
GETTRIALBOXREWARDRESPONSE.is_extendable = false
GETTRIALBOXREWARDRESPONSE.extensions = {}
USEADDHPITEMREQUEST_HEROID_FIELD.name = "heroId"

View File

@ -40,10 +40,14 @@ end
this.ArenaInfo = {}
this.EnemyList = {}
this.hadTakeBox = {}--竞技场宝箱数据
-- 接受服务器竞技场基础数据
function this.ReceiveBaseArenaData(msg)
this.ArenaInfo = msg.arenaInfo
this.EnemyList = msg.arenaInfo.arenaEnemys
for i = 1, #msg.arenaInfo.hadTakeBox do
this.hadTakeBox[msg.arenaInfo.hadTakeBox[i]] = msg.arenaInfo.hadTakeBox[i]
end
Game.GlobalEvent:DispatchEvent(GameEvent.Arena.OnBaseDataChange)
end
@ -101,8 +105,8 @@ function this.RequestArenaChallenge(index, isSkip, func)
return
end
-- 获取挑战队伍,检测挑战队伍是否可用
local teamId = FormationTypeDef.FORMATION_ARENA_ATTACK
local formationList = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_ARENA_ATTACK)
local teamId = FormationTypeDef.FORMATION_NORMAL--FormationTypeDef.FORMATION_ARENA_ATTACK
local formationList = FormationManager.GetFormationByID(teamId)
if #formationList.teamHeroInfos == 0 then
PopupTipPanel.ShowTip(Language[10084])
return
@ -331,5 +335,12 @@ function this.CheckSkipFight()
return isOpen
end
--竞技场宝箱数据获取
function this.GetHadTakeBoxData()
return this.hadTakeBox
end
--竞技场宝箱数据获取
function this.SetHadTakeBoxData(boxId)
this.hadTakeBox[boxId] = boxId
end
return this

View File

@ -1,6 +1,6 @@
local ArenaView = {}
local this = ArenaView
local rewardBoxBtn = {}
--初始化组件(用于子类重写)
function ArenaView:InitComponent()
@ -14,17 +14,17 @@ function ArenaView:InitComponent()
-- this.HelpBtn=Util.GetGameObject(self.gameObject,"btn")
this.FormationBtn = Util.GetGameObject(self.gameObject, "defendbox/orggroup")
this.DiffDemons = {}
for i = 1, 3 do
table.insert(this.DiffDemons, Util.GetGameObject(self.gameObject, "diffdemons/icon_"..i))
end
--this.DiffDemons = {}
--for i = 1, 3 do
-- table.insert(this.DiffDemons, Util.GetGameObject(self.gameObject, "diffdemons/icon_"..i))
--end
this.Demons = {}
for i = 1, 6 do
table.insert(this.Demons, Util.GetGameObject(self.gameObject, "demons/head_"..i))
table.insert(this.Demons, Util.GetGameObject(self.gameObject, "defendbox/Demons/heroPro (" .. i .. ")"))
end
this.Enemys = {}
for i = 1, 5 do
for i = 1, 4 do
table.insert(this.Enemys, Util.GetGameObject(self.gameObject, "challengebox/enemy_"..i))
end
@ -40,6 +40,14 @@ function ArenaView:InitComponent()
--this.formationPower=Util.GetGameObject(self.gameObject,"defendbox/FormationPower/Text"):GetComponent("Text")
this.effect = Util.GetGameObject(self.gameObject, "bg/UI_effect_ArenaMainPanel_particle")
--宝箱部分
this.progressImage = Util.GetGameObject(self.gameObject, "finalTarget/progressbar/progress"):GetComponent("Image")
this.progressText = Util.GetGameObject(self.gameObject, "finalTarget/curProgress/Text"):GetComponent("Text")
this.progressTipText = Util.GetGameObject(self.gameObject, "finalTarget/curProgress/Text (1)"):GetComponent("Text")
rewardBoxBtn = {}
for i = 1, 7 do
rewardBoxBtn[i] = Util.GetGameObject(self.gameObject, "finalTarget/rewardProgress/rewardBoxBtn (" .. i .. ")")
end
end
--绑定事件(用于子类重写)
@ -77,8 +85,11 @@ function ArenaView:BindEvent()
-- 敌方数据获取
local EnemyList = ArenaManager.GetEnemyList()
if EnemyList[i] then
-- UIManager.OpenPanel(UIName.FormationPanel, FORMATION_TYPE.ARENA_ATTACK, i)
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.ARENA_ATTACK, i)
-- UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.ARENA_ATTACK, i)
--直接主线阵容进战斗
-- 请求开始挑战
local isSkip = 0--ArenaManager.IsSkipFight() and 1 or 0
ArenaManager.RequestArenaChallenge(i, isSkip)
end
else
PopupTipPanel.ShowTip(Language[10100])
@ -145,6 +156,7 @@ function ArenaView:OnOpen(...)
this.RefreshRankInfo()
this.ShowRewardBoxProgressData()
-- 延迟刷新一遍数据,避免来回切换页签,向服务器不停发数据
if this.delayRefresh then return end
--
@ -172,29 +184,46 @@ end
function this.RefreshDefendFormation()
local formation = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_ARENA_DEFEND)
for i, demon in ipairs(this.Demons) do
if formation.teamHeroInfos[i] then
demon:SetActive(true)
local demonId = formation.teamHeroInfos[i].heroId
local demonData = HeroManager.GetSingleHeroData(demonId)
demon:GetComponent("Image").sprite = Util.LoadSprite(GetQuantityImageByquality(demonData.heroConfig.Quality))
Util.GetGameObject(demon, "icon"):GetComponent("Image").sprite = Util.LoadSprite(demonData.icon)
else
demon:SetActive(false)
end
Util.GetGameObject(demon, "frame"):GetComponent("Image").sprite = Util.LoadSprite(GetQuantityImageByquality(1))
Util.GetGameObject(demon, "hero"):SetActive(false)
end
for i, hero in ipairs(formation.teamHeroInfos) do
local heroData = HeroManager.GetSingleHeroData(hero.heroId)
local heroGo = Util.GetGameObject(this.Demons[hero.position], "hero")
heroGo:SetActive(true)
Util.GetGameObject(heroGo, "lvbg/levelText"):GetComponent("Text").text = heroData.lv
SetHeroStars(Util.GetGameObject(heroGo, "starGrid"), heroData.star)
local heroConfig = ConfigManager.GetConfigData(ConfigName.HeroConfig, heroData.id)
Util.GetGameObject(this.Demons[hero.position], "frame"):GetComponent("Image").sprite = Util.LoadSprite(GetQuantityImageByquality(heroConfig.Quality))
Util.GetGameObject(heroGo, "icon"):GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(heroConfig.Icon))
Util.GetGameObject(heroGo, "proIcon"):GetComponent("Image").sprite = Util.LoadSprite(GetProStrImageByProNum(heroConfig.PropertyName))
end
--for i, demon in ipairs(this.Demons) do
-- if formation.teamHeroInfos[i] then
-- demon:SetActive(true)
-- local demonId = formation.teamHeroInfos[i].heroId
-- local demonData = HeroManager.GetSingleHeroData(demonId)
-- demon:GetComponent("Image").sprite = Util.LoadSprite(GetQuantityImageByquality(demonData.heroConfig.Quality))
-- Util.GetGameObject(demon, "icon"):GetComponent("Image").sprite = Util.LoadSprite(demonData.icon)
-- else
-- demon:SetActive(false)
-- end
--end
-- 异妖
for i, diffDemon in ipairs(this.DiffDemons) do
if formation.teamPokemonInfos[i] then
diffDemon:SetActive(true)
local demonId = formation.teamPokemonInfos[i].pokemonId
---TODO: 异妖条状头像资源未配置配置后增加根据ID获取资源名称
local resId = ConfigManager.GetConfigData(ConfigName.DifferDemonsConfig, demonId).LiveIcon
diffDemon:GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(resId))
else
diffDemon:SetActive(false)
end
end
--for i, diffDemon in ipairs(this.DiffDemons) do
-- if formation.teamPokemonInfos[i] then
-- diffDemon:SetActive(true)
-- local demonId = formation.teamPokemonInfos[i].pokemonId
-- ---TODO: 异妖条状头像资源未配置配置后增加根据ID获取资源名称
-- local resId = ConfigManager.GetConfigData(ConfigName.DifferDemonsConfig, demonId).LiveIcon
-- diffDemon:GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(resId))
-- else
-- diffDemon:SetActive(false)
-- end
--end
end
-- 刷新基础数据显示
@ -279,6 +308,53 @@ function this.RefreshEnemyData()
end
end
--显示上边积分奖励
function this.ShowRewardBoxProgressData()
local baseData = ArenaManager.GetArenaBaseData()
local allNums = baseData.successNums + baseData.failNums
local allBoxGetState = ArenaManager.GetHadTakeBoxData()
local maxNum = 0
for _, configInfo in ConfigPairs(ConfigManager.GetConfig(ConfigName.ArenaBattleReward)) do
if configInfo.BattleTimes > maxNum then
maxNum = configInfo.BattleTimes
end
end
local arenaBattleReward = ConfigManager.GetConfig(ConfigName.ArenaBattleReward)
for i = 1, #rewardBoxBtn do
if arenaBattleReward[i] then
local state = 1--1 未完成 2 未领取 3 已完成allNums >= arenaBattleReward[i].BattleTimes and false
if allNums < arenaBattleReward[i].BattleTimes then
state = 1
elseif allNums >= arenaBattleReward[i].BattleTimes and not allBoxGetState[i] then
state = 2
else
state = 3
end
Util.GetGameObject(rewardBoxBtn[i], "redPoint"):SetActive(state == 2)
Util.GetGameObject(rewardBoxBtn[i], "Text"):GetComponent("Text").text = arenaBattleReward[i].BattleTimes
Util.GetGameObject(rewardBoxBtn[i], "getFinish"):SetActive(state == 3)
Util.AddOnceClick(rewardBoxBtn[i], function()
if state == 1 then
UIManager.OpenPanel(UIName.BoxRewardShowPopup,arenaBattleReward[i].Reward,rewardBoxBtn[i].transform.localPosition.x,-937,arenaBattleReward[i].BattleTimes .. Language[12205])
return
elseif state == 3 then
PopupTipPanel.ShowTip(Language[10350])
return
elseif state == 2 then
NetManager.TakeArenaBattleRewardRequest(i, function(msg)
UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1,function ()
this.ShowRewardBoxProgressData()
end)
end)
end
end)
end
end
this.progressImage.fillAmount = allNums/maxNum
this.progressText.text = allNums
this.progressTipText.text = Language[12204]
end
-- 层级改变回调
local orginLayer = 0
function ArenaView:OnSortingOrderChange(sort)

View File

@ -4278,7 +4278,21 @@ function NetManager.MiniGameOperateRequest(index, func)
end
end)
end
-- 请求领取竞技场宝箱数据
function this.TakeArenaBattleRewardRequest(missionId, func)
local data = ArenaInfoProto_pb.TakeArenaBattleRewardRequest()
data.missionId = missionId or 1
local msg = data:SerializeToString()
Network:SendMessageWithCallBack(MessageTypeProto_pb.TakeArenaBattleRewardRequest, MessageTypeProto_pb.TakeArenaBattleRewardResponse, msg, function(buffer)
local data = buffer:DataByte()
local msg = ArenaInfoProto_pb.TakeArenaBattleRewardResponse()
msg:ParseFromString(data)
ArenaManager.SetHadTakeBoxData(missionId)
if func then
func(msg)
end
end)
end
return this