Commit 8eaed74efbdef19ab05996347e921eb9b4bd43a6

Authored by liuzujun
1 parent 30f12b27

战令活动开启时清除购买记录,新增Boss挑战门票类型道具 type=20

src/GlobalVar.lua
... ... @@ -80,6 +80,7 @@ ItemType = {
80 80 SpeedBox = 16, -- 加速箱子
81 81 SelectItemBox = 17, -- 自选箱子
82 82 CommonPaster = 18, -- 万能贴纸
  83 + BossTicket = 20, -- boss挑战门票
83 84 }
84 85  
85 86 --在这个里面的会记录的是功能开放 对应类型open 而不是 ID
... ...
src/models/Activity.lua
... ... @@ -1039,6 +1039,14 @@ activityFunc[Activity.ActivityType.BattleCommand] = {
1039 1039 ["init"] = function (self, actType, isCrossDay, notify, actId)
1040 1040 local data = {unlock = 0, freeR = "", payR = "", lvl = 0, sum = 0, week = 0}
1041 1041 self:updateActData(actType, data, not notify)
  1042 +
  1043 + local rechargeRecord = self.owner.storeData:getProperty("payR")
  1044 + for id, cfg in pairs(csvdb["shop_rechargeCsv"]) do
  1045 + if cfg.shop == 2 and cfg.type == CardType.ActBattleCommandCard then
  1046 + rechargeRecord[id] = nil
  1047 + end
  1048 + end
  1049 + self.owner.storeData:updateProperty({field="payR", value=rechargeRecord})
1042 1050 end,
1043 1051 ["check"] = function(self, actType, notify, id, count) -- 检查 itemid, count
1044 1052 local isOpen, actId = self:isOpen(actType)
... ...
src/models/RolePlugin.lua
... ... @@ -134,6 +134,12 @@ function RolePlugin.bind(Role)
134 134 [ItemType.Potion] = function ()
135 135 self:addPotion({id = itemId, count = count, notNotify = pms.notNotify, log = pms.log})
136 136 end,
  137 + [ItemType.BossTicket] = function ()
  138 + if not self.activity:isOpen("ChallengeLevel") then return end
  139 + local actData = self.activity:getActData("ChallengeLevel")
  140 + actData["ticket"] = (actData["ticket"] or 0) + count
  141 + self.activity:updateActData("ChallengeLevel", actData)
  142 + end,
137 143 }
138 144  
139 145 if count > 0 then
... ...