87 lines
2.7 KiB
Lua
87 lines
2.7 KiB
Lua
NiuQiChongTianManager = {}
|
|
local this = NiuQiChongTianManager
|
|
|
|
function this.Initialize()
|
|
end
|
|
|
|
--服务器发来的活动进度条数据
|
|
function this.GetActData()
|
|
return ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.NiuQi)
|
|
end
|
|
|
|
--组装后的进度条数据
|
|
function this.GetProgressData()
|
|
local ActData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.NiuQi)
|
|
local configData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",ActData.activityId)
|
|
local curScore = this.GetScore()
|
|
local rewardData = {}
|
|
|
|
for i = 1, #configData do
|
|
local v = configData[i]
|
|
for index, value in ipairs(ActData.mission) do
|
|
if v.Id == value.missionId then
|
|
local data = {}
|
|
data.missionId = value.missionId
|
|
data.reward = v.Reward
|
|
data.value = v.Values
|
|
if curScore >= data.value then
|
|
if value.state == 0 then
|
|
data.state = 1--可领的
|
|
else
|
|
data.state = 2--领完的
|
|
end
|
|
else
|
|
data.state = 0--不可领的
|
|
end
|
|
table.insert(rewardData,data)
|
|
end
|
|
end
|
|
end
|
|
return rewardData
|
|
end
|
|
|
|
--牛气值
|
|
function this.GetScore()
|
|
local configData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",this.GetActData().activityId)
|
|
local itemId = configData[1].Values[1][1]
|
|
return BagManager.GetTotalItemNum()
|
|
end
|
|
|
|
--所有的任务信息数据
|
|
function this.GetAllRewardData()
|
|
local rewardData = {}
|
|
local ArroGantFly = ConfigManager.GetAllConfigsDataByKey(ConfigName.ArroGantFly,"ActivityId",this.GetActData().activityId)
|
|
for i = 1, 3 do
|
|
rewardData[i] = {}
|
|
for j = 1, 2 do
|
|
rewardData[i][j] = {}
|
|
local data = ConfigManager.GetAllConfigsDataByThreeKey(ConfigName.ArroGantFly,"ActivityId",this.GetActData().activityId,"Sort",i,"Type",j)
|
|
rewardData[i][j] = data
|
|
end
|
|
end
|
|
return rewardData
|
|
end
|
|
|
|
--需要显示的任务数据
|
|
function this.GetNeedRewardData()
|
|
local allData = this.GetAllRewardData()
|
|
local needData = {}
|
|
for i = 1, 3 do
|
|
needData[i] = {}
|
|
for j = 1, 2 do
|
|
for k = 1, 2 do
|
|
if allData[i][j][k] then
|
|
local data = {}
|
|
data.Text = allData[i][j][k].Text
|
|
data.Reward = allData[i][j][k].Reward
|
|
data.state = 1
|
|
table.insert(needData[i],data)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
return needData
|
|
end
|
|
|
|
return this
|