Merge branch 'master_develop' of http://60.1.1.230/gaoxin/JL_Client into master_develop
commit
ca6862831a
|
|
@ -33,10 +33,13 @@ function this.InitializeData()
|
|||
this.rewardData[v.ActivityId][v.Level].state = -2
|
||||
this.rewardData[v.ActivityId][v.Level].Reward = {}
|
||||
local temp = {}
|
||||
this.rewardData[v.ActivityId][v.Level].type = 2
|
||||
if v.Reward then
|
||||
for n,m in ipairs(v.Reward) do
|
||||
table.insert(temp,{ type = 1,item = { m[1] , m[2] } })
|
||||
end
|
||||
else
|
||||
this.rewardData[v.ActivityId][v.Level].type = 1
|
||||
end
|
||||
if v.TreasureReward then
|
||||
for n,m in ipairs(v.TreasureReward) do
|
||||
|
|
@ -65,19 +68,21 @@ end
|
|||
function this.UpdateTreasureState()
|
||||
local level = this.GetLevel()
|
||||
local activityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
||||
for k,v in pairs(this.rewardData[activityId]) do
|
||||
if level < v.level then
|
||||
v.state = -2
|
||||
end
|
||||
end
|
||||
local TreasureRewardState = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.TreasureOfSomeBody)
|
||||
if TreasureRewardState and TreasureRewardState.mission then
|
||||
--state -2 未达成 -1 普通和额外全部领取 0未领取 1激活秘宝,可以再次领取
|
||||
for k,v in ipairs(TreasureRewardState.mission) do
|
||||
if v and level >= v.missionId then
|
||||
this.rewardData[activityId][v.missionId].state = v.state
|
||||
if this.rewardData[activityId] then
|
||||
for k,v in pairs(this.rewardData[activityId]) do
|
||||
if level < v.level then
|
||||
v.state = -2
|
||||
end
|
||||
end
|
||||
end
|
||||
local TreasureRewardState = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.TreasureOfSomeBody)
|
||||
if TreasureRewardState and TreasureRewardState.mission then
|
||||
--state -2 未达成 -1 普通和额外全部领取 0未领取 1激活秘宝,可以再次领取
|
||||
for k,v in ipairs(TreasureRewardState.mission) do
|
||||
if v and level >= v.missionId then
|
||||
this.rewardData[activityId][v.missionId].state = v.state
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -85,11 +90,13 @@ end
|
|||
function this.UpdateTreasureState2()
|
||||
local level = this.GetLevel()
|
||||
local activityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
||||
for k,v in pairs(this.rewardData[activityId]) do
|
||||
if level < k then
|
||||
v.state = -2
|
||||
elseif v.state == -2 then
|
||||
v.state = 0
|
||||
if this.rewardData[activityId] then
|
||||
for k,v in pairs(this.rewardData[activityId]) do
|
||||
if level < k or (level > k and this.GetTreasureState() < 1 and v.type == 1) then
|
||||
v.state = -2
|
||||
elseif v.state == -2 then
|
||||
v.state = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -158,6 +165,9 @@ function this.SetLevel(_level)
|
|||
end
|
||||
|
||||
function this.GetLevel()
|
||||
if this.level > 50 then
|
||||
this.level = 50
|
||||
end
|
||||
return this.level
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -486,7 +486,7 @@ function this.TakeMissionRewardRequest(type, taskId, func)
|
|||
local data = buffer:DataByte()
|
||||
local msg = PlayerInfoProto_pb.TakeMissionRewardResponse()
|
||||
msg:ParseFromString(data)
|
||||
QinglongSerectTreasureManager.SetLevel(msg.treasureScore)
|
||||
--QinglongSerectTreasureManager.SetLevel(msg.treasureScore)
|
||||
if func then
|
||||
func(msg)
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue