137 lines
4.6 KiB
Lua
137 lines
4.6 KiB
Lua
DynamicActivityManager = {}
|
|
local this = DynamicActivityManager
|
|
|
|
this.curLevel = 0--社稷大典的等级
|
|
|
|
function this.Initialize()
|
|
end
|
|
|
|
function this.SheJiGetRankData(type,activityId,fun)
|
|
local allRankData,myRankData
|
|
RankingManager.InitData(type,function ()
|
|
allRankData,myRankData = RankingManager.GetRankingInfo()
|
|
if fun then
|
|
fun(allRankData,myRankData)
|
|
end
|
|
end,activityId)
|
|
end
|
|
|
|
function this.SetCurLevel(level)--社稷大典的等级
|
|
this.curLevel = level
|
|
end
|
|
|
|
function this.SheJiCheckRedPoint()
|
|
local ActInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.Celebration)--活动数据
|
|
local canGetRewardList={}
|
|
if ActInfo then
|
|
local curScore = ActInfo.mission[1].progress
|
|
local actReward = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",ActInfo.activityId)
|
|
local setting = ConfigManager.GetConfigDataByKey(ConfigName.GodSacrificeSetting,"ActivityId",ActInfo.activityId)
|
|
--检测宝箱是否有可领取
|
|
for i = 1, #ActInfo.mission do
|
|
local curLevel = curScore/actReward[1].Values[2][1]
|
|
if ActInfo.mission[i].state == 0 and curLevel >= i then
|
|
table.insert(canGetRewardList,ActInfo.mission[i])
|
|
end
|
|
end
|
|
|
|
local canGet = false
|
|
--检测中央大锅是否可领取
|
|
if GetTimeStamp() > ActInfo.value and GetTimeStamp() < (ActInfo.value + setting.LastTime * 60) then
|
|
--领过--进入倒计时
|
|
canGet = false
|
|
elseif GetTimeStamp() > ActInfo.value and GetTimeStamp() > (ActInfo.value + setting.LastTime * 60) then
|
|
--没到时间--进入倒计时
|
|
canGet = false
|
|
else
|
|
--可领取
|
|
canGet = true
|
|
end
|
|
if #canGetRewardList > 0 or canGet then
|
|
return true
|
|
else
|
|
return false
|
|
end
|
|
end
|
|
end
|
|
|
|
function this.GetBaoKuData()
|
|
|
|
local actData={}--全部数据
|
|
local initCardDatas = {}--35个矿坑的初始数据
|
|
local finalCardDatas = {}--35个矿坑抽取后的数据
|
|
local allData = {}--总奖励数据
|
|
local curBasicPool = 0
|
|
local curFinalPool = 0
|
|
|
|
local ActInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.YiJingBaoKu)--活动数据
|
|
local BlessingConfigNew = ConfigManager.GetConfigDataByKey(ConfigName.BlessingConfigNew,"ActivityId",ActInfo.activityId)
|
|
local RewardAllConfig = ConfigManager.GetConfig(ConfigName.BlessingRewardPoolNew)
|
|
--领取过的数据
|
|
for i = 1, 99 do
|
|
if ActInfo.mission[i] then
|
|
local v = ActInfo.mission[i]
|
|
if v.missionId < 100 then
|
|
local data = {}
|
|
data.rewardId = v.progress
|
|
data.reward = {}
|
|
if v.progress ~= 0 then
|
|
data.reward = RewardAllConfig[v.progress].Reward
|
|
end
|
|
table.insert(finalCardDatas,data)
|
|
end
|
|
end
|
|
end
|
|
|
|
--大奖和当前层数数据
|
|
for i = 1, 1100 do
|
|
if ActInfo.mission[i] then
|
|
local v = ActInfo.mission[i]
|
|
if v.missionId == 100 then
|
|
-- LogBlue("v.progress:"..v.progress)
|
|
actData.curLevel = v.progress
|
|
curBasicPool = BlessingConfigNew.BasicPoolId[v.progress]
|
|
curFinalPool = BlessingConfigNew.FinalPoolId
|
|
elseif v.missionId > 1000 then
|
|
local data = {}
|
|
data.rewardId = v.missionId-1000
|
|
data.progress = v.progress
|
|
table.insert(allData,data)
|
|
end
|
|
end
|
|
end
|
|
--初始的坑数据
|
|
local RewardConfig = ConfigManager.GetAllConfigsDataByKey(ConfigName.BlessingRewardPoolNew,"PoolId",curBasicPool)
|
|
local index = 1
|
|
for i = 1, #RewardConfig do
|
|
local j = 1
|
|
while(j <= RewardConfig[i].InitializeNum) do
|
|
local data = {}
|
|
if index ~= 18 then
|
|
data.rewardId = RewardConfig[i].Id
|
|
data.reward = {}
|
|
data.reward = RewardConfig[i].Reward
|
|
j = j + 1
|
|
else
|
|
data.rewardId = 0
|
|
data.reward = nil
|
|
end
|
|
table.insert(initCardDatas,data)
|
|
index = index + 1
|
|
end
|
|
end
|
|
|
|
actData.activityId = ActInfo.activityId
|
|
actData.curBasicPool = curBasicPool
|
|
actData.curFinalPool = curFinalPool
|
|
actData.selectId = ActInfo.value
|
|
actData.endTime = ActInfo.endTime
|
|
|
|
actData.initCardDatas = initCardDatas
|
|
actData.finalCardDatas = finalCardDatas
|
|
actData.allData = allData
|
|
|
|
return actData
|
|
end
|
|
|
|
return this |