限时召唤提交
parent
37316136f1
commit
fb9b646553
File diff suppressed because it is too large
Load Diff
|
|
@ -8,20 +8,41 @@ local privilegeConfig=ConfigManager.GetConfig(ConfigName.PrivilegeTypeConfig)
|
|||
local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
|
||||
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
local heroConfig=ConfigManager.GetConfig(ConfigName.HeroConfig)
|
||||
|
||||
local activityId = 0
|
||||
local singleRecruit = nil
|
||||
local tenRecruit = nil
|
||||
--按钮类型
|
||||
local bType={
|
||||
Btn1=1,
|
||||
Btn10=2
|
||||
}
|
||||
|
||||
local activityType = {
|
||||
--破阵诛仙 限时召唤
|
||||
[4301] = {
|
||||
bg = "Bg1",
|
||||
hero = {
|
||||
[1]={name="Bg1/hero1",id=10001,hero="x_xianshizaohuan_fx"},
|
||||
[2]={name="Bg1/hero3",id=10041,hero="x_xianshizaohuan_ttjz"},
|
||||
[3]={name="Bg1/hero2",id=10089,hero="x_xianshizaohuan_rd"},
|
||||
},
|
||||
helptype = HELP_TYPE.TimeLimitedCall
|
||||
},
|
||||
--叱咤风云 限时召唤
|
||||
[4302] = {
|
||||
bg = "Bg2",
|
||||
hero = {
|
||||
[1]={name="Bg2/hero1",id=10006,hero="c_ccfy_kuang02"},
|
||||
[2]={name="Bg2/hero3",id=10023,hero="c_ccfy_kuang03"},
|
||||
[3]={name="Bg2/hero2",id=10014,hero="c_ccfy_kuang01"},
|
||||
},
|
||||
helptype = HELP_TYPE.TimeLimitedCall
|
||||
},
|
||||
}
|
||||
--type与lotterySetting表中的id对应
|
||||
local btns={ [bType.Btn1]={name="btngroup/once",isInfo=Language[10644],type=RecruitType.TimeLimitSingle}, [bType.Btn10]={name="btngroup/ten",isInfo=Language[12182],type=RecruitType.TimeLimitTen}}
|
||||
|
||||
local tabs={"activity","reward"}
|
||||
|
||||
local secectTab=-1
|
||||
|
||||
local hero={[1]={name="Bg/hero1",id=10001,hero="x_xianshizaohuan_fx"},[2]={name="Bg/hero3",id=10041,hero="x_xianshizaohuan_ttjz"},[3]={name="Bg/hero2",id=10089,hero="x_xianshizaohuan_rd"}}
|
||||
local curLv=0 --当前阶段id
|
||||
local curLv = 0 --当前阶段id
|
||||
local itemView
|
||||
|
||||
function TimeLimitedCall:ctor(mainPanel, gameObject)
|
||||
|
|
@ -34,48 +55,40 @@ end
|
|||
function TimeLimitedCall:InitComponent(gameObject)
|
||||
self.helpBtn = Util.GetGameObject(self.gameObject,"help")
|
||||
self.helpPosition=self.helpBtn:GetComponent("RectTransform").localPosition
|
||||
|
||||
self.activityBtn = Util.GetGameObject(self.gameObject,"activity")
|
||||
self.rewardBtn = Util.GetGameObject(self.gameObject,"reward")
|
||||
self.rewardBtn:SetActive(false)--(暂时关闭)
|
||||
self.timeupdate=Util.GetGameObject(self.gameObject,"timeupdate"):GetComponent("Text") --剩余时间
|
||||
|
||||
self.timeupdate=Util.GetGameObject(self.gameObject,"timeupdate"):GetComponent("Text") --免费次数剩余刷新时间
|
||||
self.upper=Util.GetGameObject(self.gameObject,"maxtimes/times"):GetComponent("Text") ---召唤上限
|
||||
self.slider = Util.GetGameObject(self.gameObject, "nextlevel/Slider"):GetComponent("Slider")
|
||||
self.sliderText=Util.GetGameObject(self.gameObject,"nextlevel/Text"):GetComponent("Text")
|
||||
self.curtext = Util.GetGameObject(self.gameObject, "curvalue/Text"):GetComponent("Text")
|
||||
self.frame = Util.GetGameObject(self.gameObject, "curvalue/frame"):GetComponent("Image")
|
||||
self.nextReward = Util.GetGameObject(self.gameObject, "nextlevel/reward")
|
||||
self.icon = Util.GetGameObject(self.frame.gameObject, "icon"):GetComponent("Image")
|
||||
|
||||
self.getBtn=Util.GetGameObject(self.gameObject,"nextlevel")
|
||||
self.slider = Util.GetGameObject(self.getBtn, "Slider"):GetComponent("Slider")
|
||||
self.sliderText=Util.GetGameObject(self.getBtn,"Text"):GetComponent("Text")
|
||||
self.nextReward = Util.GetGameObject(self.getBtn, "reward")
|
||||
|
||||
self.detail= Util.GetGameObject(self.gameObject, "detail")
|
||||
self.detail.gameObject:SetActive(false)
|
||||
self.reward= Util.GetGameObject(self.gameObject, "reward")
|
||||
self.reward.gameObject:SetActive(false)
|
||||
self.getBtn=Util.GetGameObject(self.gameObject,"nextlevel")
|
||||
self.effect=Util.GetGameObject(self.gameObject,"juneng_chenggong")
|
||||
|
||||
self.effect=Util.GetGameObject(self.nextReward,"juneng_chenggong")
|
||||
|
||||
self.hero1 = Util.GetGameObject(self.gameObject,"Bg/hero1")
|
||||
self.hero2 = Util.GetGameObject(self.gameObject,"Bg/hero2")
|
||||
self.hero3 = Util.GetGameObject(self.gameObject,"Bg/hero3")
|
||||
|
||||
self.recruitTimeUpdate = Util.GetGameObject(self.gameObject,"recruitTimesUpdate/Text1") :GetComponent("Text") --时间
|
||||
self.recruitTimesUpdate = Util.GetGameObject(self.gameObject,"recruitTimesUpdate/Text") :GetComponent("Text") --剩余次数
|
||||
self.recruitTimeUpdate = Util.GetGameObject(self.gameObject,"recruitTimesUpdate/Text1") :GetComponent("Text") --活动剩余时间
|
||||
self.recruitTimesUpdate = Util.GetGameObject(self.gameObject,"recruitTimesUpdate/Text") :GetComponent("Text") --保底剩余次数
|
||||
end
|
||||
|
||||
function TimeLimitedCall:BindEvent()
|
||||
|
||||
Util.AddClick(self.helpBtn, function()
|
||||
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.TimeLimitedCall,self.helpPosition.x,self.helpPosition.y)
|
||||
--UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.TimeLimitedCall,self.helpPosition.x,self.helpPosition.y)
|
||||
UIManager.OpenPanel(UIName.HelpPopup,activityType[activityId].helptype,self.helpPosition.x,self.helpPosition.y)
|
||||
end)
|
||||
Util.AddClick(self.activityBtn, function()
|
||||
secectTab=1
|
||||
self:RefreshTabBtn()
|
||||
ActivityDetail.new(self.detail,1)
|
||||
end)
|
||||
|
||||
Util.AddClick(self.rewardBtn, function()
|
||||
secectTab=2
|
||||
self:RefreshTabBtn()
|
||||
|
||||
Util.AddClick(self.rewardBtn, function()
|
||||
local fb = ConfigManager.GetConfigData(ConfigName.FakeBattle, 1001)
|
||||
local testFightData = {
|
||||
fightData = loadstring("return "..fb.FightData)(),
|
||||
|
|
@ -86,57 +99,53 @@ function TimeLimitedCall:BindEvent()
|
|||
UIManager.OpenPanel(UIName.BattlePanel, testFightData, BATTLE_TYPE.Test)
|
||||
end)
|
||||
|
||||
Util.AddClick(self.hero1, function()
|
||||
UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, 10001, 5)
|
||||
Util.AddClick(Util.GetGameObject(self.gameObject,activityType[activityId].hero[1].name), function()
|
||||
UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, activityType[activityId].hero[1].id, 5)
|
||||
end)
|
||||
Util.AddClick(self.hero2, function()
|
||||
UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, 10089, 5)
|
||||
Util.AddClick(Util.GetGameObject(self.gameObject,activityType[activityId].hero[2]), function()
|
||||
UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, activityType[activityId].hero[2].id, 5)
|
||||
end)
|
||||
Util.AddClick(self.hero3, function()
|
||||
UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, 10041, 5)
|
||||
Util.AddClick(Util.GetGameObject(self.gameObject,activityType[activityId].hero[3]), function()
|
||||
UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, activityType[activityId].hero[3].id, 5)
|
||||
end)
|
||||
end
|
||||
|
||||
function TimeLimitedCall:OnShow(_sortingOrder)
|
||||
sortingOrder = _sortingOrder
|
||||
self.gameObject:SetActive(true)
|
||||
local UpHero=RecruitManager.GetRewardPreviewData(PRE_REWARD_POOL_TYPE.TIME_LIMITED_UP)
|
||||
table.sort(UpHero,function(a,b) return a.Reward[1]<b.Reward[1] end)
|
||||
for n,m in ipairs(hero) do
|
||||
|
||||
for n,m in pairs(activityType) do
|
||||
Util.GetGameObject(self.gameObject,m.bg):SetActive(false)
|
||||
end
|
||||
|
||||
activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy)
|
||||
Util.GetGameObject(self.gameObject,activityType[activityId].bg):SetActive(true)
|
||||
|
||||
local array = ConfigManager.GetAllConfigsDataByKey(ConfigName.LotterySetting,"ActivityId",activityId)
|
||||
singleRecruit = array[1]
|
||||
tenRecruit = array[2]
|
||||
|
||||
local UpHero = RecruitManager.GetRewardPreviewData(PRE_REWARD_POOL_TYPE.TIME_LIMITED_UP)
|
||||
table.sort(UpHero,function(a,b) return a.Reward[1] < b.Reward[1] end)
|
||||
for n,m in ipairs(activityType[activityId].hero) do
|
||||
Util.GetGameObject(self.gameObject,m.name.."/hero"):GetComponent("Image").sprite=Util.LoadSprite(m.hero)
|
||||
local configinfo= ConfigManager.GetConfigDataByKey(ConfigName.HeroConfig, "Id", UpHero[n].Reward[1])
|
||||
Util.GetGameObject(self.gameObject,m.name.."/icon"):GetComponent("Image").sprite=Util.LoadSprite(GetJobSpriteStrByJobNum(configinfo.PropertyName))
|
||||
Util.GetGameObject(self.gameObject,m.name.."/name"):GetComponent("Text").text=configinfo.ReadingName
|
||||
--SetHeroStars(Util.GetGameObject(self.gameObject,m.name.."/starlayout"),5)
|
||||
end
|
||||
|
||||
secectTab=-1
|
||||
self:RefreshTabBtn()
|
||||
self:RefreshGetHeroTimes()
|
||||
self:TimeCountDown()
|
||||
self:RefreshNextLevelReward()
|
||||
end
|
||||
|
||||
|
||||
function TimeLimitedCall:RefreshTabBtn()
|
||||
for n, m in pairs(tabs) do
|
||||
if n~=secectTab then
|
||||
Util.GetGameObject(self.gameObject,tabs[n].."/select").gameObject:SetActive(false)
|
||||
else
|
||||
Util.GetGameObject(self.gameObject,tabs[n].."/select").gameObject:SetActive(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function TimeLimitedCall:RefreshNextLevelReward()
|
||||
local curActivityId=0
|
||||
local curLvstate = 0
|
||||
local curTimes = 0
|
||||
curActivityId=ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy)
|
||||
local data1= ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",curActivityId) --通过活动id获取阶段任务
|
||||
local curTimes = ActivityGiftManager.GetActivityValueInfo(activityId)
|
||||
local data1 = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",activityId) --通过活动id获取阶段任务
|
||||
local rewarditem
|
||||
for n,m in ipairs(data1) do
|
||||
curTimes,curLvstate = self:GetMissionStateById(m.Id,curActivityId)
|
||||
curLvstate = self:GetMissionStateById(m.Id,activityId)
|
||||
if(curTimes>=m.Values[1][1]) then
|
||||
if curLvstate==0 then
|
||||
curLvstate=0
|
||||
|
|
@ -175,7 +184,7 @@ function TimeLimitedCall:RefreshNextLevelReward()
|
|||
self.sliderText.text=Language[12183]
|
||||
self.sliderText.fontSize=26
|
||||
Util.AddOnceClick(self.getBtn,function()
|
||||
NetManager.GetActivityRewardRequest(curLv, curActivityId,
|
||||
NetManager.GetActivityRewardRequest(curLv, activityId,
|
||||
function(respond)
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup, respond, 1)
|
||||
self:RefreshNextLevelReward()
|
||||
|
|
@ -184,8 +193,6 @@ function TimeLimitedCall:RefreshNextLevelReward()
|
|||
end)
|
||||
self.effect.gameObject:SetActive(true)
|
||||
elseif (curLvstate==-1) then
|
||||
-- self.slider.gameObject:SetActive(false)
|
||||
-- self.sliderText.gameObject:SetActive(false)
|
||||
self.slider.value=1
|
||||
Util.GetGameObject(self.slider.gameObject,"Text"):GetComponent("Text").text="300/300"
|
||||
self.sliderText.text=Language[12322]
|
||||
|
|
@ -197,7 +204,7 @@ function TimeLimitedCall:RefreshNextLevelReward()
|
|||
Util.GetGameObject(self.slider.gameObject,"Text"):GetComponent("Text").text=curTimes.."/"..rewarditem.Values[1][1]
|
||||
local vec=self.sliderText.transform:GetComponent("RectTransform").anchoredPosition3D
|
||||
vec.y=22.4
|
||||
self.sliderText.transform:GetComponent("RectTransform").anchoredPosition3D=vec
|
||||
self.sliderText.transform:GetComponent("RectTransform").anchoredPosition3D = vec
|
||||
self.sliderText.text=Language[12184]..curTimes.."/"..rewarditem.Values[1][1]
|
||||
self.sliderText.fontSize=26
|
||||
self.slider.value=curTimes/rewarditem.Values[1][1]
|
||||
|
|
@ -207,14 +214,17 @@ function TimeLimitedCall:RefreshNextLevelReward()
|
|||
end)
|
||||
end
|
||||
|
||||
local reMaintimes = ActivityGiftManager.GetActivityValueInfo(curActivityId)
|
||||
reMaintimes = ConfigManager.GetConfigData(ConfigName.LotterySpecialConfig,18).Count - reMaintimes
|
||||
local info= ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FindFairy)
|
||||
|
||||
local reMaintimes = info.value
|
||||
local totalTimes = ConfigManager.GetConfigDataByKey(ConfigName.LotterySpecialConfig,"Type",singleRecruit.MergePool)
|
||||
reMaintimes = totalTimes - reMaintimes
|
||||
if reMaintimes == 0 then
|
||||
reMaintimes = ConfigManager.GetConfigData(ConfigName.LotterySpecialConfig,18).Count
|
||||
reMaintimes = totalTimes
|
||||
end
|
||||
|
||||
self.recruitTimesUpdate.text = string.format(Language[12229],reMaintimes)
|
||||
|
||||
local info= ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FindFairy)
|
||||
info = info.endTime - PlayerManager.serverTime
|
||||
info = self:TimeToDHMS(info)
|
||||
self.recruitTimeUpdate.text = string.format(Language[12230]..info)
|
||||
|
|
@ -234,13 +244,13 @@ end
|
|||
|
||||
function TimeLimitedCall:GetMissionStateById(num,activityId)
|
||||
local mission= ActivityGiftManager.GetActivityInfo(activityId,num) --从后端获取到的阶段数据
|
||||
return mission.progress,mission.state
|
||||
return mission.state
|
||||
end
|
||||
|
||||
--刷新剩余次数
|
||||
function TimeLimitedCall:RefreshGetHeroTimes()
|
||||
local freeTimesId=lotterySetting[RecruitType.TimeLimitSingle].FreeTimes
|
||||
local maxtimesId=lotterySetting[RecruitType.TimeLimitSingle].MaxTimes --lotterySetting表中的MaxTimes对应privilegeConfig表中的id
|
||||
local freeTimesId=lotterySetting[singleRecruit.Id].FreeTimes
|
||||
local maxtimesId=lotterySetting[singleRecruit.Id].MaxTimes --lotterySetting表中的MaxTimes对应privilegeConfig表中的id
|
||||
local curTimes=PrivilegeManager.GetPrivilegeUsedTimes(maxtimesId)
|
||||
self.curtext.text=curTimes
|
||||
self.upper.text= Language[12225]..curTimes.."/"..privilegeConfig[maxtimesId].Condition[1][2]--特权上限
|
||||
|
|
|
|||
|
|
@ -84,15 +84,6 @@ function this.CheckRecuritNormalPoint()
|
|||
end
|
||||
end
|
||||
|
||||
--刷新限时招募红点
|
||||
-- function this.CheckRecuritNormalPoint()
|
||||
-- if (this.freeUseTimeList[32] >= 1) then
|
||||
-- return true
|
||||
-- else
|
||||
-- return false
|
||||
-- end
|
||||
-- end
|
||||
|
||||
function this.InitPreData()
|
||||
this.previewHeroData = {}
|
||||
this.previewFriendData={}
|
||||
|
|
@ -108,49 +99,16 @@ function this.InitPreData()
|
|||
return
|
||||
end
|
||||
|
||||
-- 根据当前期获取卡池信息
|
||||
local curActivityId=ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy)
|
||||
local data=nil
|
||||
if curActivityId~=nil then --活动招募
|
||||
data= ConfigManager.GetConfigDataByDoubleKey(ConfigName.LotterySetting,"ActivityId",curActivityId,"LotteryType",3)
|
||||
end
|
||||
for i, v in ConfigPairs(lotteryRewardConfig) do
|
||||
if(v.Pool==1) then--钻石招募
|
||||
table.insert(this.previewHeroData, v)
|
||||
end
|
||||
|
||||
if v.Pool==2 then--友情
|
||||
elseif v.Pool==2 then--友情
|
||||
table.insert(this.previewFriendData,v)
|
||||
end
|
||||
|
||||
if v.Pool==3 then --普抽
|
||||
elseif v.Pool==3 then --普抽
|
||||
table.insert(this.previewNormalData,v)
|
||||
end
|
||||
|
||||
if(v.Pool==11 or v.Pool==12 or v.Pool==13 or v.Pool==14) then-- or v.Pool==15 光暗被移除
|
||||
elseif(v.Pool==11 or v.Pool==12 or v.Pool==13 or v.Pool==14) then-- or v.Pool==15 光暗被移除
|
||||
table.insert(this.previewElementData, v)
|
||||
end
|
||||
|
||||
if(v.Pool==101) then--限时招募
|
||||
table.insert(this.previewTimeLimitedData, v)
|
||||
end
|
||||
|
||||
if(v.Pool==1011) then--限时招募up英雄
|
||||
table.insert(this.previewTimeLimitedUPData, v)
|
||||
end
|
||||
if(v.Pool==4401) then--乾坤宝囊其他奖励
|
||||
table.insert(this.previewLotterySoulData, v)
|
||||
end
|
||||
|
||||
if(v.Pool==1021) then--乾坤宝囊魂印up保底
|
||||
table.insert(this.previewLotterySoulUPData, v)
|
||||
end
|
||||
|
||||
if data~=nil then
|
||||
if(v.Pool == data.DiamondBoxContain[1][1]) then
|
||||
table.insert(this.previewGhostFindData, v)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for key, value in ConfigPairs(dailyRewardConfig) do
|
||||
|
|
@ -216,43 +174,6 @@ function this.InitPreData()
|
|||
return itemConfig[a.Reward[1]].Quantity > itemConfig[b.Reward[1]].Quantity
|
||||
end
|
||||
end)
|
||||
|
||||
-- 东海找鬼
|
||||
table.sort(this.previewGhostFindData, function(a, b)
|
||||
if itemConfig[a.Reward[1]].Quantity == itemConfig[b.Reward[1]].Quantity then
|
||||
return a.Weight > b.Weight
|
||||
else
|
||||
return itemConfig[a.Reward[1]].Quantity > itemConfig[b.Reward[1]].Quantity
|
||||
end
|
||||
end)
|
||||
|
||||
-- 限时招募
|
||||
table.sort(this.previewTimeLimitedData, function(a, b)
|
||||
if itemConfig[a.Reward[1]].Quantity == itemConfig[b.Reward[1]].Quantity then
|
||||
return a.Weight > b.Weight
|
||||
else
|
||||
return itemConfig[a.Reward[1]].Quantity > itemConfig[b.Reward[1]].Quantity
|
||||
end
|
||||
end)
|
||||
|
||||
--乾坤宝囊其他奖励
|
||||
table.sort(this.previewLotterySoulData, function(a, b)
|
||||
if itemConfig[a.Reward[1]].Quantity == itemConfig[b.Reward[1]].Quantity then
|
||||
return a.Weight > b.Weight
|
||||
else
|
||||
return itemConfig[a.Reward[1]].Quantity > itemConfig[b.Reward[1]].Quantity
|
||||
end
|
||||
end)
|
||||
|
||||
--乾坤宝囊魂印Up保底
|
||||
table.sort(this.previewLotterySoulUPData, function(a, b)
|
||||
if itemConfig[a.Reward[1]].Quantity == itemConfig[b.Reward[1]].Quantity then
|
||||
return a.Weight > b.Weight
|
||||
else
|
||||
return itemConfig[a.Reward[1]].Quantity > itemConfig[b.Reward[1]].Quantity
|
||||
end
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
|
@ -270,17 +191,59 @@ function this.GetRewardPreviewData(type)
|
|||
return this.previewFriendData
|
||||
elseif type==PRE_REWARD_POOL_TYPE.NORMAL then
|
||||
return this.previewNormalData
|
||||
elseif type==PRE_REWARD_POOL_TYPE.TIME_LIMITED then
|
||||
return this.previewTimeLimitedData
|
||||
elseif type==PRE_REWARD_POOL_TYPE.TIME_LIMITED_UP then
|
||||
return this.previewTimeLimitedUPData
|
||||
elseif type==PRE_REWARD_POOL_TYPE.LOTTERY_SOUL then--乾坤宝囊其他奖励
|
||||
return this.previewLotterySoulData
|
||||
elseif type==PRE_REWARD_POOL_TYPE.LOTTERY_SOUL_UP then--乾坤宝囊魂印Up保底
|
||||
return this.previewLotterySoulUPData
|
||||
elseif type==PRE_REWARD_POOL_TYPE.TIME_LIMITED
|
||||
or type==PRE_REWARD_POOL_TYPE.TIME_LIMITED_UP
|
||||
or type==PRE_REWARD_POOL_TYPE.LOTTERY_SOUL
|
||||
or type==PRE_REWARD_POOL_TYPE.LOTTERY_SOUL_UP then
|
||||
return this.GetActivityPreviewData(type)
|
||||
end
|
||||
end
|
||||
|
||||
function this.GetActivityPreviewData(type)
|
||||
local previewData = {}
|
||||
-- 根据当前期获取卡池信息
|
||||
local curActivityId = nil
|
||||
if type==PRE_REWARD_POOL_TYPE.TIME_LIMITED
|
||||
or type==PRE_REWARD_POOL_TYPE.TIME_LIMITED_UP then
|
||||
curActivityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy)
|
||||
elseif type==PRE_REWARD_POOL_TYPE.LOTTERY_SOUL
|
||||
or type==PRE_REWARD_POOL_TYPE.LOTTERY_SOUL_UP then
|
||||
curActivityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.QianKunBox)
|
||||
end
|
||||
local data = nil
|
||||
if curActivityId ~= nil then --活动招募
|
||||
data = ConfigManager.GetConfigDataByDoubleKey(ConfigName.LotterySetting,"ActivityId",curActivityId,"PerCount",1)
|
||||
else
|
||||
LogRed("活动没开,你不应该看到这儿"..curActivityId)
|
||||
end
|
||||
local poolId = nil
|
||||
if data ~= nil then
|
||||
if type == PRE_REWARD_POOL_TYPE.TIME_LIMITED
|
||||
or type == PRE_REWARD_POOL_TYPE.LOTTERY_SOUL then
|
||||
poolId = data.DiamondBoxContain[1][1]
|
||||
elseif type == PRE_REWARD_POOL_TYPE.TIME_LIMITED_UP
|
||||
or type == PRE_REWARD_POOL_TYPE.LOTTERY_SOUL_UP then
|
||||
data = ConfigManager.GetConfigDataByKey(ConfigName.LotterySpecialConfig,"Type",data.MergePool)
|
||||
poolId = data.pool_id
|
||||
end
|
||||
else
|
||||
LogRed("lotterySetting表里没有这个活动:"..curActivityId)
|
||||
end
|
||||
for i, v in ConfigPairs(lotteryRewardConfig) do
|
||||
if(v.Pool == poolId) then
|
||||
table.insert(previewData, v)
|
||||
end
|
||||
end
|
||||
table.sort(previewData, function(a, b)
|
||||
if itemConfig[a.Reward[1]].Quantity == itemConfig[b.Reward[1]].Quantity then
|
||||
return a.Weight > b.Weight
|
||||
else
|
||||
return itemConfig[a.Reward[1]].Quantity > itemConfig[b.Reward[1]].Quantity
|
||||
end
|
||||
end)
|
||||
return previewData
|
||||
end
|
||||
|
||||
--获取英雄星级数据的最大长度(动态) type 数据类型 star 星级
|
||||
function this.GetHeroMaxLengthByStar_Dynamic(type,star)
|
||||
local d={}
|
||||
|
|
|
|||
Loading…
Reference in New Issue