From 8eaed74efbdef19ab05996347e921eb9b4bd43a6 Mon Sep 17 00:00:00 2001 From: liuzujun <307836273@qq.com> Date: Tue, 2 Mar 2021 15:59:52 +0800 Subject: [PATCH] 战令活动开启时清除购买记录,新增Boss挑战门票类型道具 type=20 --- src/GlobalVar.lua | 1 + src/models/Activity.lua | 8 ++++++++ src/models/RolePlugin.lua | 6 ++++++ 3 files changed, 15 insertions(+), 0 deletions(-) diff --git a/src/GlobalVar.lua b/src/GlobalVar.lua index 202dc67..f48e662 100644 --- a/src/GlobalVar.lua +++ b/src/GlobalVar.lua @@ -80,6 +80,7 @@ ItemType = { SpeedBox = 16, -- 加速箱子 SelectItemBox = 17, -- 自选箱子 CommonPaster = 18, -- 万能贴纸 + BossTicket = 20, -- boss挑战门票 } --在这个里面的会记录的是功能开放 对应类型open 而不是 ID diff --git a/src/models/Activity.lua b/src/models/Activity.lua index 7743f76..a213545 100644 --- a/src/models/Activity.lua +++ b/src/models/Activity.lua @@ -1039,6 +1039,14 @@ activityFunc[Activity.ActivityType.BattleCommand] = { ["init"] = function (self, actType, isCrossDay, notify, actId) local data = {unlock = 0, freeR = "", payR = "", lvl = 0, sum = 0, week = 0} self:updateActData(actType, data, not notify) + + local rechargeRecord = self.owner.storeData:getProperty("payR") + for id, cfg in pairs(csvdb["shop_rechargeCsv"]) do + if cfg.shop == 2 and cfg.type == CardType.ActBattleCommandCard then + rechargeRecord[id] = nil + end + end + self.owner.storeData:updateProperty({field="payR", value=rechargeRecord}) end, ["check"] = function(self, actType, notify, id, count) -- 检查 itemid, count local isOpen, actId = self:isOpen(actType) diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index d88f70a..755a045 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -134,6 +134,12 @@ function RolePlugin.bind(Role) [ItemType.Potion] = function () self:addPotion({id = itemId, count = count, notNotify = pms.notNotify, log = pms.log}) end, + [ItemType.BossTicket] = function () + if not self.activity:isOpen("ChallengeLevel") then return end + local actData = self.activity:getActData("ChallengeLevel") + actData["ticket"] = (actData["ticket"] or 0) + count + self.activity:updateActData("ChallengeLevel", actData) + end, } if count > 0 then -- libgit2 0.21.2