2020-10-24 18:49:32 +08:00
|
|
|
DynamicActivityManager = {}
|
|
|
|
local this = DynamicActivityManager
|
|
|
|
|
2020-11-03 09:58:37 +08:00
|
|
|
this.curLevel = 0--社稷大典的等级
|
2020-10-24 16:18:57 +08:00
|
|
|
|
2020-10-24 18:49:32 +08:00
|
|
|
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
|
|
|
|
|
2020-11-03 09:58:37 +08:00
|
|
|
function this.SetCurLevel(level)--社稷大典的等级
|
2020-10-24 16:18:57 +08:00
|
|
|
this.curLevel = level
|
|
|
|
end
|
|
|
|
|
|
|
|
function this.SheJiCheckRedPoint()
|
|
|
|
local ActInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.Celebration)--活动数据
|
|
|
|
local canGetRewardList={}
|
2020-10-29 09:50:47 +08:00
|
|
|
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
|
2020-10-24 16:18:57 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-11-03 09:58:37 +08:00
|
|
|
function this.GetBaoKuData()
|
2020-11-03 19:01:47 +08:00
|
|
|
local ActInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.YiJingBaoKu)--活动数据
|
|
|
|
local BlessingConfigNew = ConfigManager.GetConfigDataByKey(ConfigName.BlessingConfigNewl,"ActivityId",ActInfo.activityId)
|
|
|
|
local curPool = BlessingConfigNew.BasicPoolId[ActInfo.value]
|
|
|
|
-- local BlessingRewardPoolNew = ConfigManager.GetAllConfigsDataByKey(ConfigName.BlessingRewardPoolNew,"PoolId",curPool)
|
|
|
|
local RewardConfig = ConfigManager.GetConfig(ConfigName.BlessingRewardPoolNew)
|
|
|
|
|
2020-11-03 09:58:37 +08:00
|
|
|
local data={}
|
|
|
|
for i = 1, #ActInfo.mission do
|
2020-11-03 19:01:47 +08:00
|
|
|
data[i].rewardId = ActInfo.mission[i].missionId
|
|
|
|
data[i].progress = ActInfo.mission[i].progress
|
|
|
|
data[i].state = ActInfo.mission[i].state
|
|
|
|
data[i].reward = RewardConfig[data[i].rewardId].Reward
|
2020-11-03 09:58:37 +08:00
|
|
|
end
|
2020-11-03 19:01:47 +08:00
|
|
|
|
|
|
|
local ActInfo={}
|
|
|
|
ActInfo.activityId = ActInfo.activityId
|
|
|
|
ActInfo.curPool = curPool
|
|
|
|
ActInfo.curLevel = ActInfo.value
|
|
|
|
ActInfo.data = data
|
|
|
|
|
|
|
|
return ActInfo
|
2020-11-03 09:58:37 +08:00
|
|
|
end
|
|
|
|
|
2020-10-24 18:49:32 +08:00
|
|
|
return this
|