NewLogic.lua 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. local Msg = require("core.Msg")
  2. local Broadcast = require("broadcast.Broadcast")
  3. local Lang = require("common.Lang")
  4. local Grid = require("bag.Grid")
  5. local MergeRule = require("excel.mergeConfig").rule
  6. local BagLogic = require("bag.BagLogic")
  7. local Log = require("common.Log")
  8. local Util = require("common.Util")
  9. local ItemLogic = require("bag.ItemLogic")
  10. local HeroLogic = require("hero.HeroLogic")
  11. local HeroExcel = require("excel.hero")
  12. local RoleDefine = require("role.RoleDefine")
  13. local ObjHuman = require("core.ObjHuman")
  14. local HeroGrid = require("hero.HeroGrid")
  15. local Json = require("common.Json")
  16. AD_DRAW_REWARD_TYPE = 10 --观看广告领取召唤券
  17. QUERY_MERGE_INFO_TYPE = 11 --获取融合信息
  18. HATCH_SCCUESS_TYPE = 12 -- 孵化成功
  19. MERGE_HERO_TYPE = 13 --融合
  20. QUICK_HATCH_TYPE = 14 --加速
  21. QUERY_MERGE_BEFORE_INFO_TYPE = 15 --获取融合前信息
  22. GET_MERGE_HERO_TYPE = 16 --获取融合英雄
  23. QUERY_QUICK_HATCH_ZUANSHI = 17 --查询加速孵化需要的钻石
  24. AD_HATCH_RESET_FREECNT = 4 --看广告加速孵化次数
  25. function NewProto(human, type, param)
  26. -- print("newProto:",type,param)
  27. -- local msgRet = Msg.gc.GC_ROLE_CHANGE_BASEINFO
  28. -- msgRet.ret = type
  29. -- msgRet.tip = "test data"
  30. -- Msg.send(msgRet,human.fd)
  31. local msgRet = Msg.gc.GC_ROLE_CHANGE_BASEINFO
  32. -- 观看广告获取召唤券
  33. if type == AD_DRAW_REWARD_TYPE then
  34. human.db.adRewardCnt = human.db.adRewardCnt or 0
  35. if human.db.adRewardCnt > 4 then
  36. Broadcast.sendErr(human, Lang.AD_DRAW_REWARD_LIMIT_ERROR)
  37. return
  38. end
  39. --增加今日观看次数
  40. human.db.adRewardCnt = (human.db.adRewardCnt or 0) + 1
  41. Log.write(Log.LOGID_TEST, "adRewardCnt: " .. human.db.adRewardCnt)
  42. -- 添加高级召唤卷
  43. BagLogic.addItem(human, 118, 1, "draw_ad_reward")
  44. msgRet.ret = AD_DRAW_REWARD_TYPE
  45. msgRet.tip = Lang.AD_DRAW_REWARD_SUCCESS
  46. Msg.send(msgRet, human.fd)
  47. Broadcast.sendErr(human, Lang.AD_DRAW_REWARD_SUCCESS)
  48. return
  49. end
  50. -- 查询加速孵化需要的钻石
  51. if type == QUERY_QUICK_HATCH_ZUANSHI then
  52. -- 初始化
  53. initMergeInfo(human)
  54. local info = {}
  55. local nowTime = os.time
  56. local hatchTime = human.db.mergeInfo.endTime - nowTime
  57. info.zuanshi = doCalcNeedZuanshi(hatchTime)
  58. info.isTip = getTodayIsTip(human)
  59. msgRet.ret = QUERY_QUICK_HATCH_ZUANSHI
  60. msgRet.tip = Json.Encode(info)
  61. Msg.send(msgRet, human.fd)
  62. return
  63. end
  64. -- 获取融合前的信息
  65. if type == QUERY_MERGE_BEFORE_INFO_TYPE then
  66. local tb = Util.split(param, "|")
  67. if tb[1] and tb[2] then
  68. -- 初始化
  69. initMergeInfo(human)
  70. human.db.heroBag = human.db.heroBag or {}
  71. local fatherHeroBagIndex = tonumber(tb[1]) or 0
  72. local motherHeroBagIndex = tonumber(tb[2]) or 0
  73. Log.write(Log.LOGID_TEST, "查询融合前的 fatherHeroBagIndex: " .. fatherHeroBagIndex)
  74. Log.write(Log.LOGID_TEST, "查询融合前的 motherHeroBagIndex: " .. motherHeroBagIndex)
  75. local fatherHeroGrid = human.db.heroBag[fatherHeroBagIndex]
  76. if not fatherHeroGrid then
  77. return
  78. end
  79. Log.write(Log.LOGID_TEST, "查询融合前的 fatherHeroGrid: " .. Json.Encode(fatherHeroGrid))
  80. local motherHeroGrid = human.db.heroBag[motherHeroBagIndex]
  81. if not motherHeroGrid then
  82. return
  83. end
  84. Log.write(Log.LOGID_TEST, "查询融合前的 motherHeroGrid: " .. Json.Encode(motherHeroBagIndex))
  85. local mergeInfo = {}
  86. local heroSimple = {}
  87. local xLv = getxLv(fatherHeroGrid, motherHeroGrid)
  88. local cnt = math.floor(xLv / 2) + 1
  89. local isHatch = 2
  90. local mergeItem = {}
  91. local itemId = 178
  92. for k = 1, 1 do
  93. mergeItem[k] = mergeItem[k] or {}
  94. mergeItem[k].getway = mergeItem[k].getway or {}
  95. mergeItem[k].suipian = mergeItem[k].suipian or {}
  96. mergeItem[k].equip = mergeItem[k].equip or {}
  97. mergeItem[k].fuwen = mergeItem[k].fuwen or {}
  98. Grid.makeItem(mergeItem[k], itemId, cnt)
  99. end
  100. local sonHeroID = mergeHero(fatherHeroGrid.id, motherHeroGrid.id)
  101. local cf = sonHeroID and HeroExcel.hero[sonHeroID]
  102. heroSimple.name = cf and cf.name or ""
  103. if cf.grade >= 6 then
  104. heroSimple.name = "?????"
  105. end
  106. mergeInfo.mergeTime = 0
  107. mergeInfo.xLv = xLv
  108. mergeInfo.mergeItem = mergeItem
  109. mergeInfo.heroData = heroSimple
  110. mergeInfo.isHatch = isHatch
  111. mergeInfo.adHatchRewardCnt = getResetAdHatchCnt(human)
  112. mergeInfo.isTip = getTodayIsTip(human)
  113. Log.write(Log.LOGID_TEST, "查询融合前的 mergeInfo: " .. Json.Encode(mergeInfo))
  114. msgRet.ret = QUERY_MERGE_BEFORE_INFO_TYPE
  115. msgRet.tip = Json.Encode(mergeInfo)
  116. Msg.send(msgRet, human.fd)
  117. end
  118. return
  119. end
  120. -- 开始融合
  121. if type == MERGE_HERO_TYPE then
  122. local tb = Util.split(param, "|")
  123. if tb[1] and tb[2] then
  124. -- 初始化
  125. initMergeInfo(human)
  126. human.db.heroBag = human.db.heroBag or {}
  127. local itemId = 178 --生命雨露
  128. local fatherHeroBagIndex = tonumber(tb[1]) or 0
  129. local motherHeroBagIndex = tonumber(tb[2]) or 0
  130. local fatherHeroGrid = human.db.heroBag[fatherHeroBagIndex]
  131. if not fatherHeroGrid then
  132. return
  133. end
  134. local motherHeroGrid = human.db.heroBag[motherHeroBagIndex]
  135. if not motherHeroGrid then
  136. return
  137. end
  138. local fatherHeroAttr = ObjHuman.getHeroAttrs(human, fatherHeroBagIndex)
  139. local motherHeroAttr = ObjHuman.getHeroAttrs(human, motherHeroBagIndex)
  140. local mergeInfo = {}
  141. local attrs = RoleDefine.PANEL_ATTR_KEY
  142. local sonHeroID = mergeHero(fatherHeroGrid.id, motherHeroGrid.id)
  143. if sonHeroID <= 0 then
  144. return
  145. end
  146. for key, value in pairs(attrs) do
  147. local param1 = fatherHeroAttr[key] or 0
  148. local param2 = motherHeroAttr[key] or 0
  149. attrs[key] = math.floor(((param1 + param2) / 4))
  150. end
  151. Log.write(Log.LOGID_TEST, "融合后的属性: " .. Json.Encode(attrs))
  152. local xLv = getxLv(fatherHeroGrid, motherHeroGrid)
  153. local cnt = math.floor(xLv / 2) + 1
  154. local heroSimple = {}
  155. Log.write(Log.LOGID_TEST, "xLv: " .. xLv)
  156. Log.write(Log.LOGID_TEST, "cnt: " .. cnt)
  157. local bagCnt = BagLogic.getItemCnt(human, itemId, true)
  158. if bagCnt < cnt then
  159. Broadcast.sendErr(human, Lang.ITEM_USE_ERR_NO)
  160. return
  161. end
  162. --使用道具
  163. ItemLogic.use(human, itemId, cnt)
  164. -- 删除英雄
  165. HeroLogic.delHeroByIndex(human, fatherHeroBagIndex, "hero_merge")
  166. HeroLogic.delHeroByIndex(human, motherHeroBagIndex, "hero_merge")
  167. -- 记录融合英雄
  168. human.db.mergeInfo.heroInfo.heroID = sonHeroID
  169. human.db.mergeInfo.heroInfo.xLv = xLv
  170. human.db.mergeInfo.heroInfo.heroAttrs = attrs
  171. human.db.mergeInfo.startTime = os.time()
  172. human.db.mergeInfo.endTime = os.time() + getHatchTime(xLv)
  173. human.db.mergeInfo.heroInfo.fatherHeroBagIndex = fatherHeroBagIndex
  174. human.db.mergeInfo.heroInfo.motherHeroBagIndex = motherHeroBagIndex
  175. local cf = sonHeroID and HeroExcel.hero[sonHeroID]
  176. heroSimple.name = cf and cf.name or ""
  177. if cf.grade >= 6 then
  178. heroSimple.name = "?????"
  179. end
  180. mergeInfo.mergeTime = getHatchTime(xLv)
  181. mergeInfo.xLv = xLv
  182. mergeInfo.heroData = heroSimple
  183. mergeInfo.isHatch = 1
  184. mergeInfo.adHatchRewardCnt = getResetAdHatchCnt(human)
  185. mergeInfo.isTip = getTodayIsTip(human)
  186. Log.write(Log.LOGID_TEST, "融合 mergeInfo: " .. Json.Encode(mergeInfo))
  187. Broadcast.sendErr(human, Lang.MERGE_SUCCESS)
  188. msgRet.ret = MERGE_HERO_TYPE
  189. msgRet.tip = Json.Encode(mergeInfo)
  190. Msg.send(msgRet, human.fd)
  191. end
  192. return
  193. end
  194. -- 获取融合中的信息
  195. if type == QUERY_MERGE_INFO_TYPE then
  196. -- 初始化
  197. initMergeInfo(human)
  198. human.db.heroBag = human.db.heroBag or {}
  199. local mergeInfo = {}
  200. local mergeTime = 0
  201. local heroSimple = {}
  202. local xLv = human.db.mergeInfo.heroInfo.xLv or 0
  203. local sonHeroID = human.db.mergeInfo.heroInfo.heroID or 0
  204. local isHatch = 2
  205. if sonHeroID == 0 then
  206. mergeInfo.mergeTime = mergeTime
  207. mergeInfo.xLv = xLv
  208. mergeInfo.heroData = heroSimple
  209. mergeInfo.isHatch = isHatch
  210. msgRet.ret = QUERY_MERGE_INFO_TYPE
  211. msgRet.tip = Json.Encode(mergeInfo)
  212. Msg.send(msgRet, human.fd)
  213. return
  214. end
  215. local mergeTime = human.db.mergeInfo.endTime - os.time()
  216. if mergeTime < 0 then
  217. -- 孵化成功
  218. mergeTime = 0
  219. isHatch = 3
  220. else
  221. isHatch = 1
  222. end
  223. local cf = sonHeroID and HeroExcel.hero[sonHeroID]
  224. heroSimple.name = cf and cf.name or ""
  225. if cf.grade >= 6 then
  226. heroSimple.name = "?????"
  227. end
  228. mergeInfo.mergeTime = mergeTime
  229. mergeInfo.xLv = xLv
  230. mergeInfo.heroData = heroSimple
  231. mergeInfo.isHatch = isHatch
  232. mergeInfo.adHatchRewardCnt = getResetAdHatchCnt(human)
  233. mergeInfo.isTip = getTodayIsTip(human)
  234. msgRet.ret = QUERY_MERGE_INFO_TYPE
  235. msgRet.tip = Json.Encode(mergeInfo)
  236. Log.write(Log.LOGID_TEST, "融合中 msgRet: " .. Json.Encode(msgRet))
  237. Msg.send(msgRet, human.fd)
  238. return
  239. end
  240. -- 获取融合英雄
  241. if type == GET_MERGE_HERO_TYPE then
  242. local nowTime = os.time()
  243. local mergeInfo = {}
  244. local heroSimple = {}
  245. local xLv = human.db.mergeInfo.heroInfo.xLv or 0
  246. local sonHeroID = human.db.mergeInfo.heroInfo.heroID or 0
  247. local hatchTime = human.db.mergeInfo.endTime - nowTime
  248. local isHatch = 2
  249. local heroIndex = 0
  250. local msgTyep = GET_MERGE_HERO_TYPE
  251. if hatchTime <= 0 then
  252. -- 孵化成功
  253. hatchTime = 0
  254. heroIndex = hatchHero(human)
  255. local heroGrid = human.db.heroBag[heroIndex]
  256. if not heroGrid then return end
  257. heroSimple.general = heroSimple.general or {}
  258. HeroGrid.makeHeroSimple(heroSimple, heroGrid, heroIndex, human)
  259. else
  260. local cf = sonHeroID and HeroExcel.hero[sonHeroID]
  261. heroSimple.name = cf and cf.name or ""
  262. if cf.grade >= 6 then
  263. heroSimple.name = "?????"
  264. end
  265. isHatch = 1
  266. msgTyep = QUERY_MERGE_INFO_TYPE
  267. end
  268. mergeInfo.mergeTime = hatchTime
  269. mergeInfo.xLv = xLv
  270. mergeInfo.heroData = heroSimple
  271. mergeInfo.isHatch = isHatch
  272. mergeInfo.adHatchRewardCnt = getResetAdHatchCnt(human)
  273. mergeInfo.isTip = getTodayIsTip(human)
  274. msgRet.ret = msgTyep
  275. msgRet.tip = Json.Encode(mergeInfo)
  276. Log.write(Log.LOGID_TEST, "获取英雄 ret: " .. Json.Encode(msgRet))
  277. Msg.send(msgRet, human.fd)
  278. return
  279. end
  280. -- 加速孵化
  281. if type == QUICK_HATCH_TYPE then
  282. local tb = Util.split(param, "|")
  283. local quickType = tonumber(tb[1]) or 0
  284. local cnt = tonumber(tb[2]) or 0
  285. local isHatch = 1
  286. if tb[1] and tb[2] then
  287. -- 初始化
  288. initMergeInfo(human)
  289. -- 剩余时间
  290. local nowTime = os.time()
  291. local hatchTime = human.db.mergeInfo.endTime - nowTime
  292. if hatchTime <= 0
  293. then
  294. Broadcast.sendErr(human, Lang.QUICK_HATCH_TIME_OUT)
  295. return
  296. end
  297. local itemSpeedTime = 0
  298. if quickType == 1 then
  299. local speedTime = (60 * 5 * cnt) -- 正常数量加速券的加速时间
  300. local lastSpeedTime = (60 * 5 * (cnt - 1)) --少一张加速券的加速时间
  301. local itemCnt = 0
  302. if hatchTime > lastSpeedTime and hatchTime <= speedTime then
  303. itemCnt = cnt
  304. elseif hatchTime > 0 and hatchTime <= lastSpeedTime then
  305. itemCnt = cnt - 1
  306. elseif hatchTime >= speedTime then
  307. itemCnt = cnt
  308. else
  309. itemCnt = 0
  310. end
  311. itemSpeedTime = (60 * 5 * itemCnt)
  312. local bagCnt = BagLogic.getItemCnt(human, 179, true)
  313. if bagCnt < itemCnt then
  314. Broadcast.sendErr(human, Lang.ITEM_USE_ERR_NO)
  315. return
  316. end
  317. --使用道具
  318. ItemLogic.use(human, 179, itemCnt)
  319. elseif quickType == 2 then
  320. local zuanshiCnt = doCalcNeedZuanshi(hatchTime)
  321. -- 判断消耗
  322. if not ObjHuman.checkRMB(human, zuanshiCnt) then
  323. return
  324. end
  325. itemSpeedTime = (30 * zuanshiCnt)
  326. -- 扣钻石
  327. ObjHuman.decZuanshi(human, -zuanshiCnt, "hero_merge")
  328. if tb[3] then
  329. human.db.isTip = human.db.isTip or 1
  330. human.db.isTip = tb[3]
  331. end
  332. elseif quickType == 3 then
  333. human.db.adHatchRewardCnt = human.db.adHatchRewardCnt or 0
  334. if human.db.adHatchRewardCnt > 4 then
  335. Broadcast.sendErr(human, Lang.AD_DRAW_REWARD_LIMIT_ERROR)
  336. return
  337. end
  338. --加速30分钟
  339. itemSpeedTime = 30 * 60
  340. --增加今日观看次数
  341. human.db.adHatchRewardCnt = (human.db.adHatchRewardCnt or 0) + 1
  342. end
  343. human.db.mergeInfo.endTime = human.db.mergeInfo.endTime - itemSpeedTime
  344. local hatchTime = human.db.mergeInfo.endTime - nowTime
  345. -- 孵化成功
  346. if hatchTime < 0 then
  347. hatchTime = 0
  348. isHatch = 3
  349. end
  350. local mergeInfo = {}
  351. local heroSimple = {}
  352. local sonHeroID = human.db.mergeInfo.heroInfo.heroID or 0
  353. local cf = sonHeroID and HeroExcel.hero[sonHeroID]
  354. heroSimple.name = cf and cf.name or ""
  355. if cf.grade >= 6 then
  356. heroSimple.name = "?????"
  357. end
  358. mergeInfo.mergeTime = hatchTime
  359. mergeInfo.heroData = heroSimple
  360. mergeInfo.xLv = human.db.mergeInfo.heroInfo.xLv
  361. mergeInfo.isHatch = isHatch
  362. mergeInfo.adHatchRewardCnt = getResetAdHatchCnt(human)
  363. mergeInfo.isTip = getTodayIsTip(human)
  364. msgRet.ret = QUICK_HATCH_TYPE
  365. msgRet.tip = Json.Encode(mergeInfo)
  366. Log.write(Log.LOGID_TEST, "加速孵化 ret: " .. Json.Encode(msgRet))
  367. Msg.send(msgRet, human.fd)
  368. return
  369. end
  370. return
  371. end
  372. end
  373. -- 孵化英雄
  374. function hatchHero(human)
  375. --添加英雄
  376. local heroIndex, fjlist = HeroLogic.addHero(human, human.db.mergeInfo.heroInfo.heroID, nil, 1,
  377. "hero_merge")
  378. Log.write(Log.LOGID_TEST, "孵化英雄成功 下标" .. heroIndex)
  379. local attrs = RoleDefine.PANEL_ATTR_KEY
  380. for key, value in pairs(attrs) do
  381. attrs[key] = 1
  382. end
  383. human.db.mergeInfo.startTime = 0
  384. human.db.mergeInfo.endTime = 0
  385. human.db.mergeInfo.heroInfo = {}
  386. human.db.mergeInfo.heroInfo.heroID = 0
  387. human.db.mergeInfo.heroInfo.xLv = 0
  388. human.db.mergeInfo.heroInfo.fatherHeroBagIndex = 0
  389. human.db.mergeInfo.heroInfo.motherHeroBagIndex = 0
  390. human.db.mergeInfo.heroInfo.heroAttrs = attrs
  391. Log.write(Log.LOGID_TEST, "孵化重置 mergeInfo: " .. Json.Encode(human.db.mergeInfo))
  392. return heroIndex
  393. end
  394. -- 初始化融合信息
  395. function initMergeInfo(human)
  396. human.db.mergeInfo = human.db.mergeInfo or {}
  397. human.db.mergeInfo.startTime = human.db.mergeInfo.startTime or 0 --融合时间 时间戳
  398. human.db.mergeInfo.endTime = human.db.mergeInfo.endTime or 0 --孵化时间 单位s
  399. human.db.mergeInfo.heroInfo = human.db.mergeInfo.heroInfo or {}
  400. human.db.mergeInfo.heroInfo.heroID = human.db.mergeInfo.heroInfo.heroID or 0
  401. human.db.mergeInfo.heroInfo.xLv = human.db.mergeInfo.heroInfo.xLv or 0
  402. human.db.mergeInfo.heroInfo.fatherHeroBagIndex = human.db.mergeInfo.heroInfo.fatherHeroBagIndex or 0
  403. human.db.mergeInfo.heroInfo.motherHeroBagIndex = human.db.mergeInfo.heroInfo.motherHeroBagIndex or 0
  404. human.db.mergeInfo.heroInfo.heroAttrs = human.db.mergeInfo.heroInfo.heroAttrs or RoleDefine.PANEL_ATTR_KEY
  405. end
  406. -- 获取孵化时间 单位s
  407. function getHatchTime(xLv)
  408. local time = (xLv * 5) + (xLv - 1) * (xLv - 1) - 5
  409. if time < 0 then
  410. return 0
  411. end
  412. return time * 60
  413. end
  414. -- 计算需要钻石数量
  415. function doCalcNeedZuanshi(hatchTime)
  416. local cnt = 0
  417. if hatchTime > 0 then
  418. cnt = math.ceil(hatchTime / 30)
  419. end
  420. return cnt
  421. end
  422. -- 获取xlv
  423. function getxLv(fatherHeroGrid, motherHeroGrid)
  424. local fatherHeroXLv = fatherHeroGrid.xLv or 0
  425. local motherHeroXLv = motherHeroGrid.xLv or 0
  426. local params1 = math.max(fatherHeroXLv, motherHeroXLv)
  427. local params2 = math.floor((fatherHeroGrid.lv + motherHeroGrid.lv) / 200) + 1
  428. local xLv = params1 + params2
  429. if xLv > 50 then
  430. return 50
  431. end
  432. return xLv
  433. end
  434. -- 融合获取英雄ID
  435. function mergeHero(fatherHeroID, motherHeroID)
  436. local fatherHeroConfig = HeroExcel.hero[fatherHeroID]
  437. local motherHeroConfig = HeroExcel.hero[motherHeroID]
  438. if not fatherHeroConfig or not motherHeroConfig then
  439. return 0
  440. end
  441. --规则3 heroID + heroID
  442. for _, config in pairs(MergeRule[3].items) do
  443. if fatherHeroID == config[1] and motherHeroID == config[2] then
  444. return config[3]
  445. end
  446. end
  447. --规则2 种族 + heroID
  448. for _, config in pairs(MergeRule[2].items) do
  449. if fatherHeroConfig.camp == config[1] and motherHeroID == config[2] then
  450. return config[3]
  451. end
  452. end
  453. --规则1 种族 + 种族
  454. for _, config in pairs(MergeRule[1].items) do
  455. if fatherHeroConfig.camp == config[1] and motherHeroConfig.camp == config[2] then
  456. return config[3]
  457. end
  458. end
  459. return 0
  460. end
  461. -- 获取剩余融化孵化加速广告观看次数
  462. function getResetAdHatchCnt(human)
  463. local adHatchRewardCnt = human.db.adHatchRewardCnt or 0
  464. return math.max(AD_HATCH_RESET_FREECNT - adHatchRewardCnt, 0)
  465. end
  466. -- 获取是否今日不再提示
  467. function getTodayIsTip(human)
  468. local isTip = human.db.isTip or 1
  469. return isTip
  470. end