【ID1010636】

【优化】灵兽宝阁活动调整
dev_chengFeng
jiaoyangna 2021-11-11 10:48:59 +08:00
parent bdb08206df
commit d1cb61fc18
5 changed files with 45 additions and 9 deletions

View File

@ -212,6 +212,8 @@ GameEvent = {
ContinueRechargeRefresh ="Activity.ContinueRechargeRefresh",
--限时up的英雄改变
TimeLimitUpHeroChange = "Activity.TimeLimitUpHeroChange",
--灵兽宝阁灵兽改变
UpMonsterChange = "Activity.UpMonsterChange",
},
Carbon = {
CarbonCountChange = "Carbon.CarbonCountChange",

View File

@ -292,6 +292,24 @@ function this.GetLeftRewardData()
return data
end
function this.LingShouOrigiUpData()
local ActData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.LingShouBaoGe)
local activityId = ActData.activityId
local LSrewardData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",activityId)
local array = ConfigManager.GetAllConfigsDataByKey(ConfigName.LotterySetting,"ActivityId",activityId)
local singleRecruit = array[1]
local curScore = 0
local mergePool = singleRecruit.MergePool
local poolId = ConfigManager.GetConfigDataByKey(ConfigName.LotterySpecialConfig,"Type",mergePool).pool_id
local tempData = ConfigManager.GetConfigDataByKey(ConfigName.LotteryRewardConfig,"Pool",poolId)
local showData = {}
showData.sasId = 0
showData.monsterId = tempData.Reward[1]
showData.iconId = LSrewardData[1].Reward[1][1]
showData.battleId = tempData.Fakebattle
return showData
end
function this.LingShouBuildData()
local rewardData={}
local showData={}

View File

@ -74,9 +74,9 @@ function LingShouBaoGe:BindEvent()
maxRound = 20
}
UIManager.OpenPanel(UIName.BattlePanel, testFightData, BATTLE_TYPE.Test,function ()
-- Timer.New(function ()
-- self:Refresh()
-- end,3):Start()
Timer.New(function ()
self:Refresh()
end,3):Start()
end)
end)
end
@ -141,13 +141,13 @@ function LingShouBaoGe:SetData()
self.showData={}
self.rewardData,self.showData,self.curScore = DynamicActivityManager.LingShouBuildData()
self.title.sprite = self.spLoader:LoadSprite(PositionList[self.showData.monsterId].title)
if self.Live then
poolManager:UnLoadLive(self.bgName, self.Live)
end
--设置立绘
self.bgName = artConfig[SpiritAnimalConfig[self.showData.monsterId].Live].Name
local pos = SpiritAnimalConfig[self.showData.monsterId].Position
local scale = SpiritAnimalConfig[self.showData.monsterId].Scale
if self.Live then
poolManager:UnLoadLive(self.bgName, self.Live)
end
self.Live = poolManager:LoadLive(self.bgName, self.grid.transform, Vector3.one*scale*0.8, Vector2.New(pos[1],pos[2]+PositionList[self.showData.monsterId].pos))
local RoleLiveGOGraphic = self.Live:GetComponent("SkeletonGraphic")
RoleLiveGOGraphic.AnimationState:SetAnimation(0, "idle", true)
@ -345,12 +345,16 @@ end
--添加事件监听(用于子类重写)
function LingShouBaoGe:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Activity.UpMonsterChange, function()
self:Refresh()
end)
end
--移除事件监听(用于子类重写)
function LingShouBaoGe:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.UpMonsterChange, function()
self:Refresh()
end)
end
return LingShouBaoGe

View File

@ -43,9 +43,11 @@ function this:LookDetailBtnAction()
end
end
function this:AddListener()
end
function this:RemoveListener()
end
function this:OnShow(_parent,_Data)
@ -118,11 +120,20 @@ function this:OnShow(_parent,_Data)
itemList[i].Reward[1]=dic[itemList[i].Reward[1]]
end
end
elseif activityType == ActivityTypeDef.LingShouBaoGe then
local rewardData,showData,curScore = DynamicActivityManager.LingShouBuildData()
local origiUpMonster = DynamicActivityManager.LingShouOrigiUpData()
itemList = RecruitManager.GetRewardPreviewData(poolType)
for i = 1,#itemList do
if itemList[i].Reward[1] == origiUpMonster.monsterId then
UpItemList = {[1] = {Reward = {showData.monsterId,1},WeightShow = itemList[i].WeightShow}}
break
end
end
else
UpItemList = RecruitManager.GetRewardPreviewData(poolUpType)
itemList = RecruitManager.GetRewardPreviewData(poolType)
end
end
local _upRateList,rateList = this:BuildRateData(activityType,itemList,UpItemList)
this:ReFreshUpItem(UpItemList,_upRateList)

View File

@ -32,6 +32,7 @@ function this:BindEvent()
NetManager.ChengeMonsterChooseRequest(ActData.activityId,curMonsterId,function ()
local selectId = ConfigManager.GetConfigDataByDoubleKey(ConfigName.SpiritAnimalSummon,"ActivityID",ActData.activityId,"FocusID",curMonsterId).Id
ActivityGiftManager.ChangeLingShouBaoGeSelectId(ActData.activityId,selectId)
Game.GlobalEvent:DispatchEvent(GameEvent.Activity.UpMonsterChange)
parent:ClosePanel()
end)
end)