diff --git a/src/actions/ActivityAction.lua b/src/actions/ActivityAction.lua index de38f16..9efb684 100644 --- a/src/actions/ActivityAction.lua +++ b/src/actions/ActivityAction.lua @@ -472,9 +472,10 @@ function _M.startBattleRpc(agent, data) -- check cost local changeFlag = false local ticket = actData["ticket"] + local num = 0 -- cost num if battleCfg.type ~= "" then role.activity:getBattleTicket(actid) - local num = battleCfg.type:toArray(true, "=")[3] + num = battleCfg.type:toArray(true, "=")[3] if count and count > 0 then if battleCfg.rank == 0 then return 7 @@ -490,7 +491,6 @@ function _M.startBattleRpc(agent, data) if ticket < num then return 6 end - actData["ticket"] = ticket - num changeFlag = true end @@ -524,6 +524,7 @@ function _M.startBattleRpc(agent, data) SendPacket(actionCodes.Activity_startBattleRpc, MsgPack.pack(role:packReward(reward, change))) bi["sum"] = bi["sum"] + bi["top"] + actData["ticket"] = ticket - num actData[id] = bi changeFlag = true @@ -654,6 +655,11 @@ function _M.endBattleRpc(agent, data) end if battleCfg.rank ~= 0 then + -- 消耗门票 + role.activity:getBattleTicket(actid) + local num = battleCfg.type:toArray(true, "=")[3] + actData["ticket"] = math.max(actData["ticket"] - num, 0) + -- 更新排行榜 最高伤害 battleInfo["top"] = math.max(battleInfo["top"] or 0, dmg) battleInfo["sum"] = (battleInfo["sum"] or 0) + dmg diff --git a/src/models/Activity.lua b/src/models/Activity.lua index 3a579b2..af5af74 100644 --- a/src/models/Activity.lua +++ b/src/models/Activity.lua @@ -27,6 +27,7 @@ Activity.ActivityType = { WishHeroPool = 23, -- 心愿卡池 ActHeroPool = 24, -- 活动卡池 + ActShopGoods = 25, -- 活动商品 } diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index 6b1a4bc..f3756f6 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -1579,7 +1579,12 @@ function RolePlugin.bind(Role) local rechargeRecord = self:getProperty("payR") or {} if limit ~= 0 and limit <= (rechargeRecord[rechargeId] or 0) then return "" - end + end + + --判断是否是活动商品 + local actCfg = csvdb["activity_ctrlCsv"][rechargeData.actid] + if not actCfg then return "" end + if not self.activity:isOpenById(rechargeData.actid, "ActShopGoods") then return "" end local orderId = redisproxy:hget(string.format(R_ORDERS, roleId), rechargeId) if orderId then diff --git a/src/models/Store.lua b/src/models/Store.lua index 92e32ee..ffefb2e 100644 --- a/src/models/Store.lua +++ b/src/models/Store.lua @@ -298,6 +298,8 @@ function Store:resetStoreReored(resetId) end end end + else + payRecord[k] = nil end end self:updateProperty({field = "payR", value = payRecord}) @@ -307,6 +309,8 @@ function Store:resetStoreReored(resetId) if config.resetTime == resetId then buyRecord[k] = nil end + else + buyRecord[k] = nil end end self:updateProperty({field = "buyR", value = buyRecord}) -- libgit2 0.21.2