Commit 8e892c718da5d6b41e29480307897c17022cb38c

Authored by liuzujun
1 parent 598bd73f

挑战关卡活动打完再扣门票

src/actions/ActivityAction.lua
... ... @@ -472,9 +472,10 @@ function _M.startBattleRpc(agent, data)
472 472 -- check cost
473 473 local changeFlag = false
474 474 local ticket = actData["ticket"]
  475 + local num = 0 -- cost num
475 476 if battleCfg.type ~= "" then
476 477 role.activity:getBattleTicket(actid)
477   - local num = battleCfg.type:toArray(true, "=")[3]
  478 + num = battleCfg.type:toArray(true, "=")[3]
478 479 if count and count > 0 then
479 480 if battleCfg.rank == 0 then
480 481 return 7
... ... @@ -490,7 +491,6 @@ function _M.startBattleRpc(agent, data)
490 491 if ticket < num then
491 492 return 6
492 493 end
493   - actData["ticket"] = ticket - num
494 494 changeFlag = true
495 495 end
496 496  
... ... @@ -524,6 +524,7 @@ function _M.startBattleRpc(agent, data)
524 524 SendPacket(actionCodes.Activity_startBattleRpc, MsgPack.pack(role:packReward(reward, change)))
525 525  
526 526 bi["sum"] = bi["sum"] + bi["top"]
  527 + actData["ticket"] = ticket - num
527 528 actData[id] = bi
528 529 changeFlag = true
529 530  
... ... @@ -654,6 +655,11 @@ function _M.endBattleRpc(agent, data)
654 655 end
655 656  
656 657 if battleCfg.rank ~= 0 then
  658 + -- 消耗门票
  659 + role.activity:getBattleTicket(actid)
  660 + local num = battleCfg.type:toArray(true, "=")[3]
  661 + actData["ticket"] = math.max(actData["ticket"] - num, 0)
  662 +
657 663 -- 更新排行榜 最高伤害
658 664 battleInfo["top"] = math.max(battleInfo["top"] or 0, dmg)
659 665 battleInfo["sum"] = (battleInfo["sum"] or 0) + dmg
... ...
src/models/Activity.lua
... ... @@ -27,6 +27,7 @@ Activity.ActivityType = {
27 27  
28 28 WishHeroPool = 23, -- 心愿卡池
29 29 ActHeroPool = 24, -- 活动卡池
  30 + ActShopGoods = 25, -- 活动商品
30 31 }
31 32  
32 33  
... ...
src/models/RolePlugin.lua
... ... @@ -1579,7 +1579,12 @@ function RolePlugin.bind(Role)
1579 1579 local rechargeRecord = self:getProperty("payR") or {}
1580 1580 if limit ~= 0 and limit <= (rechargeRecord[rechargeId] or 0) then
1581 1581 return ""
1582   - end
  1582 + end
  1583 +
  1584 + --判断是否是活动商品
  1585 + local actCfg = csvdb["activity_ctrlCsv"][rechargeData.actid]
  1586 + if not actCfg then return "" end
  1587 + if not self.activity:isOpenById(rechargeData.actid, "ActShopGoods") then return "" end
1583 1588  
1584 1589 local orderId = redisproxy:hget(string.format(R_ORDERS, roleId), rechargeId)
1585 1590 if orderId then
... ...
src/models/Store.lua
... ... @@ -298,6 +298,8 @@ function Store:resetStoreReored(resetId)
298 298 end
299 299 end
300 300 end
  301 + else
  302 + payRecord[k] = nil
301 303 end
302 304 end
303 305 self:updateProperty({field = "payR", value = payRecord})
... ... @@ -307,6 +309,8 @@ function Store:resetStoreReored(resetId)
307 309 if config.resetTime == resetId then
308 310 buyRecord[k] = nil
309 311 end
  312 + else
  313 + buyRecord[k] = nil
310 314 end
311 315 end
312 316 self:updateProperty({field = "buyR", value = buyRecord})
... ...