Blame view

src/models/Daily.lua 12.2 KB
be9c9ca6   zhouahaihai   角色评论
1
2
  -- 日常数据
  
fa992c94   liuzujun   添加daily,diner,act...
3
  local Daily = class("Daily", require("shared.ModelBaseMysql"))
be9c9ca6   zhouahaihai   角色评论
4
  
a85b344f   zhangqijia   feat: 挂机图鉴
5
6
  oneDay = 60*60*24
  
be9c9ca6   zhouahaihai   角色评论
7
  function Daily:ctor(properties)
a43410e1   zhengshouren   整理格式,使用tab替代空格
8
  	Daily.super.ctor(self, properties)
be9c9ca6   zhouahaihai   角色评论
9
10
11
  end
  
  Daily.schema = {
fa992c94   liuzujun   添加daily,diner,act...
12
13
  	id 				= {"number", 0, "pri"},		-- 角色id
  	commentHero		= {"string", "", "blob"},		-- 单日评论食灵记录 type=1
87cc3a35   zhengshouren   餐厅建筑升级逻辑
14
15
  	hangQC			= {"number", 0},		-- 挂机快速次数
  	dinerQC			= {"number", 0},		-- 贩卖加速次数
e38b9c49   zhouhaihai   无尽次数
16
  	advElC			= {"number", 0},		-- 无尽次数(消耗体力)
09be9059   zhouhaihai   冒险接口
17
  	advBC			= {"number", 0},		-- 冒险次数购买次数(冒险体力购买次数)
e38b9c49   zhouhaihai   无尽次数
18
  	advElBC			= {"number", 0},		-- 无尽次数购买次数(冒险体力购买次数)
f60b89b1   zhouhaihai   奖励副本
19
  	advWs			= {"table", {}}, 		-- 冒险队工坊
62920af9   zhangqijia   fix: 奖励关卡挑战卡消耗逻辑调整
20
  	bonusC			= {"table", {}}, 		-- 奖励副本 次数 {[type] = {c = 0, b = 0}} 修改为 {c=0, b=0}
c384626d   zhouhaihai   好友
21
22
  	giveFP			= {"table", {}},		-- 给谁送过心心
  	getFP			= {"table", {}},		-- 领过谁的心心
4cf74232   zhouhaihai   pvp
23
  	pvpFree			= {"number", 0},		-- pvp使用免费次数
8641a577   zhangqijia   fix: 增加竞技场门票次数的字段
24
25
  	pvpFreeH		= {"number", 0},		-- 高级pvp使用免费次
  	pvpBought		= {"number", 0},		-- 门票购买次数
cccc9c70   zhouhaihai   商城
26
27
28
  
  	dailySDC		= {"table", {}},		-- daily shop diamond  count {[id] = count} -- 每日商城购买次数统计
  	dailySDD		= {"table", {}},		-- daily shop diamond  disount {[id] = 1} -- 每日商城折扣统计
9ced5432   zhouhaihai   冒险支援效果 保底事件
29
  
d51114bd   wangyujie   完成需求:每日金币购买
30
31
  	advSupRe		= {"number", 0}, 		-- 冒险支援效果刷新次数
  	goldBuyT		= {"number", 0}, 		-- 金币购买次数
317a46a9   liuzujun   添加特权卡
32
  
1a0b3c56   liuzujun   抽卡保底,切换定向卡池
33
34
  	unlockPool		= {"table", {}},		-- 解锁的属性卡池
  	curPool 		= {"number", 0},		-- 属性卡池当前索引
7113ad0c   liuzujun   每日抽卡次数触发礼包
35
  	drawHeroCnt		= {"number", 0},		-- 每日抽卡次数
a85b344f   zhangqijia   feat: 挂机图鉴
36
  
f0de8a60   zhangqijia   挖宝跨天,前一天天正在挖的宝被刷掉...
37
  	treasureBase	= {"number", 0}, 		-- 资源值
a85b344f   zhangqijia   feat: 挂机图鉴
38
  	treasureList 	= {"table", {}}, 		--挂机图鉴
171abf99   liuzujun   每日世界聊天上限
39
40
  
  	chatTimes 		= {"number", 0},		--每日发言次数
be9c9ca6   zhouahaihai   角色评论
41
42
  }
  
be9c9ca6   zhouahaihai   角色评论
43
  function Daily:updateProperty(params)
a43410e1   zhengshouren   整理格式,使用tab替代空格
44
45
46
  	local type, default = table.unpack(self.schema[params.field])
  
  	if params.delta then
4faef572   zhouhaihai   冒险任务,冒险扫荡, 冒险中继
47
  		self:incrProperty(params.field, params.delta)
440aa055   zhouhaihai   聊天
48
49
50
  		if not params.notNotify then
  			self.owner:notifyUpdateProperty(params.field, self:getProperty(params.field))
  		end
a43410e1   zhengshouren   整理格式,使用tab替代空格
51
52
53
54
  		return true
  	end
  	if params.value then
  		self:setProperty(params.field, params.value)
440aa055   zhouhaihai   聊天
55
56
57
  		if not params.notNotify then
  			self.owner:notifyUpdateProperty(params.field, self:getProperty(params.field))
  		end
a43410e1   zhengshouren   整理格式,使用tab替代空格
58
59
60
  		return true
  	end
  	return false
be9c9ca6   zhouahaihai   角色评论
61
62
63
  end
  
  function Daily:refreshDailyData(notify)
c384626d   zhouhaihai   好友
64
  	redisproxy:del(FRIEND_POINT:format(self.owner:getProperty("id")))
cccc9c70   zhouhaihai   商城
65
  	local dataMap = {}
a43410e1   zhengshouren   整理格式,使用tab替代空格
66
  	for field, schema in pairs(self.schema) do
fc316d1f   zhouhaihai   冒险体力优化
67
  		if field == "advElC" then
6f3959ce   zhouhaihai   bug
68
  			if self:getProperty(field) > 0 then
0e3ab88d   zhouhaihai   中继层
69
70
  				dataMap[field] = 0
  			end
7104ee66   liuzujun   重复过新手bug, daily错误...
71
72
  		elseif field == "id" then
              -- skip
63c0245e   zhangqijia   fix: 跨天资源值未重置的bug
73
  		elseif field == "treasureBase" then
cea66efd   zhangqijia   fix: 等级效果的bug,
74
  			dataMap[field] = globalCsv.idle_treasure_base + self.owner:getBnousTreasureBaseMaximum()
a85b344f   zhangqijia   feat: 挂机图鉴
75
76
  		elseif field == "treasureList" then
  			dataMap[field] = self:getTreasrueList()
8641a577   zhangqijia   fix: 增加竞技场门票次数的字段
77
78
  		elseif field == "pvpBought" then
  			dataMap[field] = 0
0e3ab88d   zhouhaihai   中继层
79
  		elseif field ~= "key" then
a43410e1   zhengshouren   整理格式,使用tab替代空格
80
  			local typ, def = table.unpack(schema)
cccc9c70   zhouhaihai   商城
81
82
83
84
85
86
  			dataMap[field] = def
  		end
  	end
  	-- 每日折扣搞一下
  	local dailySDD = {}
  	local sddPool = {}
c5825110   saicom   新增用户商城相关数据
87
88
  	for id, data in pairs(csvdb["shop_normalCsv"]) do
  		if data.shop == 1 and data.disount ~= 0 then
cccc9c70   zhouhaihai   商城
89
  			table.insert(sddPool, id)
a43410e1   zhengshouren   整理格式,使用tab替代空格
90
91
  		end
  	end
cccc9c70   zhouhaihai   商城
92
93
94
95
96
97
98
  	for i = 1, math.min(#sddPool, globalCsv.shop_diamond_disount_count) do
  		local idx = math.randomInt(1, #sddPool)
  		dailySDD[sddPool[idx]] = 1
  		table.remove(sddPool, idx)
  	end
  	dataMap["dailySDD"] = dailySDD
  	self:setProperties(dataMap)
a43410e1   zhengshouren   整理格式,使用tab替代空格
99
100
101
  	if notify then
  		self.owner:notifyUpdateProperties(self:data())
  	end
be9c9ca6   zhouahaihai   角色评论
102
103
  end
  
a85b344f   zhangqijia   feat: 挂机图鉴
104
105
106
107
108
109
  --解锁
  function Daily:checkUnlock(treaval)
  	local role = self.owner
  	local treasureC = treaval.unlock:toArray(true, "=")
  	local show = false
  	if treasureC[1] == 1 then --通关关卡
4d684a8b   zhangqijia   fix: 宝藏图鉴-优化 检查拾荒...
110
  		show = self.owner:checkHangPass(treasureC[2])
a85b344f   zhangqijia   feat: 挂机图鉴
111
  	elseif treasureC[1] == 2 then --通关拾荒章节=x层
4d684a8b   zhangqijia   fix: 宝藏图鉴-优化 检查拾荒...
112
  		show = role:checkAdvChapterPass(treasureC[2])
a85b344f   zhangqijia   feat: 挂机图鉴
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
  	elseif treasureC[1] == 3 then --拥有指定id的角色时
  		local hero = role:getHeroByID(treasureC[2])
  		if hero then show = true end
  	else
  		show = true
      end
  	return show
  end
  
  --CD
  function Daily:checkTreasureExpired(treasureAttr, treasureList)
  	local curInfo = treasureList[treasureAttr.id]
  	if curInfo then
  		-- check finish
  		if curInfo["expire_time"] then
  			if curInfo.cool_time > 1 then
e639a6b9   zhangqijia   fix: 挂机图鉴-绑定关卡
129
  				if skynet.timex() >= curInfo["expire_time"] then
a85b344f   zhangqijia   feat: 挂机图鉴
130
  					treasureList[treasureAttr.id] = nil
e639a6b9   zhangqijia   fix: 挂机图鉴-绑定关卡
131
132
  					curInfo = clone(treasureAttr)
  				elseif skynet.timex() >= curInfo["expire_time"] -  curInfo.cool_time * oneDay then --未冷却
a85b344f   zhangqijia   feat: 挂机图鉴
133
  					curInfo = nil
e639a6b9   zhangqijia   fix: 挂机图鉴-绑定关卡
134
135
  				else
  					curInfo = clone(treasureAttr)
a85b344f   zhangqijia   feat: 挂机图鉴
136
137
  				end
  			else
1199daf9   zhangqijia   fix: 挂机图鉴, 增加宝藏CD检查
138
  				if skynet.timex() >= curInfo["expire_time"] then
a85b344f   zhangqijia   feat: 挂机图鉴
139
140
  					treasureList[treasureAttr.id] = nil
  				end
e639a6b9   zhangqijia   fix: 挂机图鉴-绑定关卡
141
  				curInfo = clone(treasureAttr)
a85b344f   zhangqijia   feat: 挂机图鉴
142
  			end
a85b344f   zhangqijia   feat: 挂机图鉴
143
144
145
146
147
148
149
150
151
152
153
  		end
  	else
  		curInfo = clone(treasureAttr)
  	end
  
  	return curInfo
  end
  
  --资源
  function Daily:checkTreasureBase(treasureList, treasureBase, removeId)
  	local tmptreasure = {}
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
154
  	local num = 0
a85b344f   zhangqijia   feat: 挂机图鉴
155
156
  	for k, val in pairs(treasureList) do
  		if removeId and val.id == removeId then
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
157
  			treasureList[k] = nil
a85b344f   zhangqijia   feat: 挂机图鉴
158
159
160
161
  		else
  			if treasureBase >= val.treasure_value then
  				treasureBase = treasureBase - val.treasure_value
  				tmptreasure[val.id] = val
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
162
  				num = num + 1
a85b344f   zhangqijia   feat: 挂机图鉴
163
164
  			end
  		end
e639a6b9   zhangqijia   fix: 挂机图鉴-绑定关卡
165
  
a85b344f   zhangqijia   feat: 挂机图鉴
166
  	end
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
167
  	return tmptreasure, num
a85b344f   zhangqijia   feat: 挂机图鉴
168
169
  end
  
e639a6b9   zhangqijia   fix: 挂机图鉴-绑定关卡
170
171
172
173
174
  --绑定通关关卡
  function Daily:checkChapters()
  	local  chapters = {}
  	local tmp_chapters = {}
  	local treasureList = self:getProperty("treasureList")
041ee0b2   zhangqijia   fix: 挂机图鉴的bug
175
176
177
178
  	if next(treasureList) then
  		for _, curInfo in pairs(treasureList) do
  			if curInfo["expire_time"] or not curInfo["end_time"] then
  				tmp_chapters[curInfo.chapter_id] = curInfo
e639a6b9   zhangqijia   fix: 挂机图鉴-绑定关卡
179
180
181
  			end
  		end
  	end
041ee0b2   zhangqijia   fix: 挂机图鉴的bug
182
  	local hangInfo = self.owner:getProperty("hangInfo") or {}
e639a6b9   zhangqijia   fix: 挂机图鉴-绑定关卡
183
  	for chapter_id, val in pairs(csvdb["idle_battleCsv"]) do
041ee0b2   zhangqijia   fix: 挂机图鉴的bug
184
185
186
187
188
  		if chapter_id ~= hangInfo.carbonId then
  			if self.owner:checkHangPass(chapter_id) then
  				if next(tmp_chapters) and not tmp_chapters[chapter_id] then
  					chapters[chapter_id] = val
  				else
e639a6b9   zhangqijia   fix: 挂机图鉴-绑定关卡
189
190
191
192
  					chapters[chapter_id] = val
  				end
  			end
  		end
041ee0b2   zhangqijia   fix: 挂机图鉴的bug
193
  
e639a6b9   zhangqijia   fix: 挂机图鉴-绑定关卡
194
195
196
197
  	end
  	return chapters
  end
  
a85b344f   zhangqijia   feat: 挂机图鉴
198
199
200
  --权重
  function Daily:checkTreasureWeight(treasureList, tmptreasure, treasureBase)
  	local removeId
e639a6b9   zhangqijia   fix: 挂机图鉴-绑定关卡
201
  	local chapters = self:checkChapters()
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
202
  	local treasure
e639a6b9   zhangqijia   fix: 挂机图鉴-绑定关卡
203
204
  	if next(chapters) == nil then return end
  
92b6691c   zhangqijia   fix: 部分账号在加速探索后无法...
205
206
207
208
209
210
211
      --扣除在挖宝列表里未过期宝藏的资源值
  	for _, val in pairs(treasureList) do
  		if not val["expire_time"] then
  			treasureBase = treasureBase - val["treasure_value"]
  		end
  	end
  
a85b344f   zhangqijia   feat: 挂机图鉴
212
  	while next(tmptreasure) do
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
213
214
215
  		local tmp, num = self:checkTreasureBase(tmptreasure, treasureBase, removeId)
  
  		if num == 0 then
a85b344f   zhangqijia   feat: 挂机图鉴
216
  			break
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
217
218
219
220
221
222
223
224
225
226
  		elseif num == 1 then
  			for _, val in pairs(tmp) do
  				treasure = val
  			end
  		else
  			local id = math.randWeight(tmp, "weight") --宝藏id
  			if not id then
  				break
  			end
  			treasure = tmp[id]
a85b344f   zhangqijia   feat: 挂机图鉴
227
  		end
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
228
  	
a85b344f   zhangqijia   feat: 挂机图鉴
229
230
231
232
233
234
  		if treasureBase >= treasure.treasure_value  then
  			--扣除资源值
  			treasureBase =  treasureBase - treasure.treasure_value
  		else
  			break
  		end
e639a6b9   zhangqijia   fix: 挂机图鉴-绑定关卡
235
  		local chapterId = math.randWeight(chapters, "treasure_weight") --关卡id
a85b344f   zhangqijia   feat: 挂机图鉴
236
237
238
239
240
  		if not chapterId then
  			break
  		end
  
  		treasure.chapter_id = chapterId
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
241
242
  		treasureList[treasure.id] = treasure
  		removeId = treasure.id
a85b344f   zhangqijia   feat: 挂机图鉴
243
244
245
246
247
248
249
250
  	end
  end
  
  --chapterId
  function Daily:checkTreasureChapterId(curInfo, treasureList, chapterId)
  	local treasure = nil
  
  	if not curInfo then
a85b344f   zhangqijia   feat: 挂机图鉴
251
252
  		return treasure
  	end
e03f9e59   zhangqijia   fix: 修复挂机得到双倍宝藏奖励...
253
  	local treasureBase = self:getProperty("treasureBase")
a85b344f   zhangqijia   feat: 挂机图鉴
254
  
1199daf9   zhangqijia   fix: 挂机图鉴, 增加宝藏CD检查
255
256
257
258
259
  	--开始挖宝关卡ID=挂机关卡ID
  	if chapterId == curInfo.chapter_id then
  		--开始挖宝
  		if not curInfo["end_time"] then
  			curInfo["end_time"] = skynet.timex() + curInfo.working_time
a85b344f   zhangqijia   feat: 挂机图鉴
260
  		else
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
261
262
263
264
  			if skynet.timex() >= curInfo["end_time"] then
  				if curInfo.cool_time > 1 then
  					--宝藏冷却时间
  					if not curInfo["expire_time"] then
e03f9e59   zhangqijia   fix: 修复挂机得到双倍宝藏奖励...
265
266
267
268
269
270
  						if treasureBase >= curInfo["treasure_value"] then
  							treasureBase = treasureBase - curInfo["treasure_value"]
  
  							treasure = treasureList[curInfo.id]
  							curInfo["expire_time"] = skynet.timex() + curInfo.cool_time * oneDay
  						end
1199daf9   zhangqijia   fix: 挂机图鉴, 增加宝藏CD检查
271
  					else
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
272
273
274
275
  						--已经领取宝藏 检索宝藏冷却时间
  						if skynet.timex() >= curInfo["expire_time"] then
  							treasureList[curInfo.id] = nil
  						end
1199daf9   zhangqijia   fix: 挂机图鉴, 增加宝藏CD检查
276
  					end
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
277
  				else
e03f9e59   zhangqijia   fix: 修复挂机得到双倍宝藏奖励...
278
279
280
281
282
283
  					if treasureBase >= curInfo["treasure_value"] then
  						treasureBase = treasureBase - curInfo["treasure_value"]
  
  						treasure = treasureList[curInfo.id]
  						treasureList[curInfo.id] = nil
  					end
1199daf9   zhangqijia   fix: 挂机图鉴, 增加宝藏CD检查
284
  				end
a85b344f   zhangqijia   feat: 挂机图鉴
285
286
287
  			end
  		end
  	else
1199daf9   zhangqijia   fix: 挂机图鉴, 增加宝藏CD检查
288
289
  		--已经开始挖宝
  		if curInfo["end_time"] then
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
290
291
292
293
  			if skynet.timex() >= curInfo["end_time"] then
  				if curInfo.cool_time > 1 then
  					--宝藏冷却时间
  					if not curInfo["expire_time"] then
e03f9e59   zhangqijia   fix: 修复挂机得到双倍宝藏奖励...
294
295
296
297
298
299
300
  						if treasureBase >= curInfo["treasure_value"] then
  							treasureBase = treasureBase - curInfo["treasure_value"]
  
  							treasure = treasureList[curInfo.id]
  							curInfo["expire_time"] = skynet.timex() + curInfo.cool_time * oneDay
  						end
  						
1199daf9   zhangqijia   fix: 挂机图鉴, 增加宝藏CD检查
301
  					else
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
302
303
304
305
  						--已经领取宝藏 检索宝藏冷却时间
  						if skynet.timex() >= curInfo["expire_time"] then
  							treasureList[curInfo.id] = nil
  						end
1199daf9   zhangqijia   fix: 挂机图鉴, 增加宝藏CD检查
306
307
  					end
  				else
e03f9e59   zhangqijia   fix: 修复挂机得到双倍宝藏奖励...
308
309
310
311
312
313
  					if treasureBase >= curInfo["treasure_value"] then
  						treasureBase = treasureBase - curInfo["treasure_value"]
  
  						treasure = treasureList[curInfo.id]
  						treasureList[curInfo.id] = nil
  					end
1199daf9   zhangqijia   fix: 挂机图鉴, 增加宝藏CD检查
314
  				end
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
315
316
  			else
  				curInfo["end_time"]	= nil
a85b344f   zhangqijia   feat: 挂机图鉴
317
318
319
320
321
322
323
324
  			end
  		end
  	end
  	return treasure
  end
  
  function Daily:buyTreasure(treasureList)
  	local boughtTreasurer = {}
f0de8a60   zhangqijia   挖宝跨天,前一天天正在挖的宝被刷掉...
325
  	local treasureBase = self:getProperty("treasureBase")
a85b344f   zhangqijia   feat: 挂机图鉴
326
  	for id, val in pairs(treasureList) do
bfa42833   zhangqijia   feat: 分解铭文返还强化所需铭...
327
  		if treasureBase >= val.treasure_value then
a85b344f   zhangqijia   feat: 挂机图鉴
328
  			boughtTreasurer[id] = val
bfa42833   zhangqijia   feat: 分解铭文返还强化所需铭...
329
  			treasureBase = treasureBase - val.treasure_value
a85b344f   zhangqijia   feat: 挂机图鉴
330
331
  		end
  	end
f0de8a60   zhangqijia   挖宝跨天,前一天天正在挖的宝被刷掉...
332
  	self:updateProperty({field = "treasureBase", value = treasureBase})
a85b344f   zhangqijia   feat: 挂机图鉴
333
334
335
336
337
338
339
340
341
342
  	return boughtTreasurer
  end
  
  --重置宝藏图鉴
  function Daily:resetTreasureList()
  	self:updateProperty({field = "treasureList", value = {}})
  end
  
  --宝藏图鉴
  function Daily:getTreasrueList()
a85b344f   zhangqijia   feat: 挂机图鉴
343
  	local tmpcsv = csvdb["idle_treasureCsv"]
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
344
  	local treasureList = self:getProperty("treasureList") or {} --挖宝列表 过期删除 领取奖励删除 跨天更新
a85b344f   zhangqijia   feat: 挂机图鉴
345
  	local tmptreasure = {}
92b6691c   zhangqijia   fix: 部分账号在加速探索后无法...
346
  	local treasureBase = globalCsv.idle_treasure_base + self.owner:getBnousTreasureBaseMaximum()
a85b344f   zhangqijia   feat: 挂机图鉴
347
348
349
350
351
352
353
354
355
356
357
358
  	for id, val in pairs(tmpcsv) do
  		if self:checkUnlock(val) == true then
  			local treasure = self:checkTreasureExpired(val, treasureList)
  			if treasure then
  				table.insert(tmptreasure, treasure)
  			end
  		end
  	end
  	table.sort(tmptreasure, function (a,b) return a.treasure_value > b.treasure_value end)
  
  	self:checkTreasureWeight(treasureList, tmptreasure, treasureBase)
  	self:updateProperty({field = "treasureList", value = treasureList})
f0de8a60   zhangqijia   挖宝跨天,前一天天正在挖的宝被刷掉...
359
  	self:updateProperty({field = "treasureBase", value = treasureBase})
a85b344f   zhangqijia   feat: 挂机图鉴
360
361
362
363
364
365
  	return treasureList
  end
  
  
  --检索挖宝列表
  function Daily:checkTreasureList(chapterId)
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
366
  	local treasureList = self:getProperty("treasureList") or {}
a85b344f   zhangqijia   feat: 挂机图鉴
367
368
369
370
371
372
373
374
375
  	local tmptreasure = {}
  	for id, val in pairs(treasureList) do
  		local treasure = self:checkTreasureChapterId(val, treasureList, chapterId)
  		if treasure ~= nil then
  			tmptreasure[id] = treasure
  		end
  	end
  
  	if next(tmptreasure) == nil then
251d8e5e   zhangqijia   fix: 挂机宝鉴,宝藏CD的bug
376
  		self:updateProperty({field = "treasureList", value = treasureList})
a85b344f   zhangqijia   feat: 挂机图鉴
377
378
379
380
381
382
383
  		return nil
  	end
  	local boughtTreasurer = self:buyTreasure(tmptreasure)
  	self:updateProperty({field = "treasureList", value = treasureList})
  	return boughtTreasurer
  end
  
c0c49098   zhangqijia   feat: 竞技场门票购买限制;挂...
384
385
386
387
388
389
390
391
392
393
394
395
396
397
  --宝藏加速
  function Daily:quickTreasureList(chapterId, time)
  	local treasureList = self:getProperty("treasureList") or {}
  	if next(treasureList) then
  		for id, val in pairs(treasureList) do
  			if val["end_time"] and val["chapter_id"] and chapterId == val["chapter_id"] then
  				val["end_time"] = val["end_time"] - time
  			end
  		end
  	end
  	self:updateProperty({field = "treasureList", value = treasureList})
  	return self:checkTreasureList(chapterId)
  end
  
be9c9ca6   zhouahaihai   角色评论
398
  function Daily:data()
a43410e1   zhengshouren   整理格式,使用tab替代空格
399
  	return {
a43410e1   zhengshouren   整理格式,使用tab替代空格
400
  		hangQC = self:getProperty("hangQC"),
87cc3a35   zhengshouren   餐厅建筑升级逻辑
401
  		dinerQC = self:getProperty("dinerQC"),
09be9059   zhouhaihai   冒险接口
402
  		advBC = self:getProperty("advBC"),
e38b9c49   zhouhaihai   无尽次数
403
404
  		advElC = self:getProperty("advElC"),
  		advElBC = self:getProperty("advElBC"),
bab30666   zhouhaihai   增加通用功能等级 字段
405
  		advWs = self:getProperty("advWs"),
f60b89b1   zhouhaihai   奖励副本
406
  		bonusC = self:getProperty("bonusC"),
c384626d   zhouhaihai   好友
407
408
  		giveFP = self:getProperty("giveFP"),
  		getFP = self:getProperty("getFP"),
4cf74232   zhouhaihai   pvp
409
  		pvpFree = self:getProperty("pvpFree"),
4c5d72ab   zhouhaihai   高级pvp
410
  		pvpFreeH = self:getProperty("pvpFreeH"),
8641a577   zhangqijia   fix: 增加竞技场门票次数的字段
411
  		pvpBought = self:getProperty("pvpBought"),
cccc9c70   zhouhaihai   商城
412
413
  		dailySDC = self:getProperty("dailySDC"),
  		dailySDD = self:getProperty("dailySDD"),
9ced5432   zhouhaihai   冒险支援效果 保底事件
414
  		advSupRe = self:getProperty("advSupRe"),
d51114bd   wangyujie   完成需求:每日金币购买
415
  		goldBuyT = self:getProperty("goldBuyT"),
1a0b3c56   liuzujun   抽卡保底,切换定向卡池
416
417
  		unlockPool = self:getProperty("unlockPool"),
  		curPool = self:getProperty("curPool"),
63c0245e   zhangqijia   fix: 跨天资源值未重置的bug
418
  		treasureBase = self:getProperty("treasureBase"),
a85b344f   zhangqijia   feat: 挂机图鉴
419
  		treasureList = self:getProperty("treasureList"),
c8981ed2   liuzujun   chatTimes数据下发
420
  		chatTimes = self:getProperty("chatTimes"),
a43410e1   zhengshouren   整理格式,使用tab替代空格
421
  	}
be9c9ca6   zhouahaihai   角色评论
422
423
424
  end
  
  return Daily