Commit 2f0830e315daaba95206425a0f7afb2b40f2d3fa
Merge branch 'cn/develop' into cn/publish/preview
Showing
6 changed files
with
79 additions
and
37 deletions
Show diff stats
src/actions/ActivityAction.lua
... | ... | @@ -630,12 +630,15 @@ function _M.startBattleRpc(agent, data) |
630 | 630 | local bi = actData[id] |
631 | 631 | local star = bi["star"] or 0 |
632 | 632 | local award = battleCfg.item_clear:toNumMap() |
633 | - if getStarCount(battleCfg, star) == 3 then | |
634 | - local aw = battleCfg.perfect_reward:toNumMap() | |
635 | - for k, v in pairs(aw) do | |
636 | - award[k] = (award[k] or 0) + v | |
637 | - end | |
638 | - end | |
633 | + | |
634 | + if battleCfg.rank ~= 0 then | |
635 | + if getStarCount(battleCfg, star) == 3 then | |
636 | + local aw = battleCfg.perfect_reward:toNumMap() | |
637 | + for k, v in pairs(aw) do | |
638 | + award[k] = (award[k] or 0) + v | |
639 | + end | |
640 | + end | |
641 | + end | |
639 | 642 | for k, v in pairs(award) do |
640 | 643 | award[k] = v * count |
641 | 644 | end | ... | ... |
src/actions/StoreAction.lua
... | ... | @@ -24,7 +24,7 @@ function _M.rechargeRpc(agent , data) |
24 | 24 | skynet.timeout(10, function () |
25 | 25 | role:handlePurchase({ |
26 | 26 | order = partnerOrderId, |
27 | - amount = dataSet.rmb * 100, | |
27 | + amount = dataSet.rmb * 100 / globalCsv.QArecharge, | |
28 | 28 | game_money = dataSet.diamond, |
29 | 29 | product_id = dataSet.productId, |
30 | 30 | pay_time = skynet.timex(), | ... | ... |
src/adv/Adv.lua
... | ... | @@ -1713,7 +1713,7 @@ local function clickTrader(self, room, block, params) |
1713 | 1713 | local goodsData = csvdb["event_trader_goodsCsv"][block.event.shop[buyId][1]] |
1714 | 1714 | if not goodsData then return false, 5 end |
1715 | 1715 | |
1716 | - local costCount = math.ceil(goodsData.price * (1 - (block.event.shop[buyId][2] or 100) / 100)) | |
1716 | + local costCount = math.ceil(goodsData.price * (1 - (block.event.shop[buyId][2] or 0) / 100)) | |
1717 | 1717 | if not self:cost({[goodsData.currency] = costCount}, {log = {desc = "clickTrader", int1 = block.event.id}}) then return false, 6 end --不够 |
1718 | 1718 | self:backCost({[goodsData.currency] = costCount}) |
1719 | 1719 | self:award({[goodsData.item] = goodsData.num}, {log = {desc = "clickTrader", int1 = block.event.id}}, {}) | ... | ... |
src/models/RolePlugin.lua
... | ... | @@ -2342,7 +2342,7 @@ function RolePlugin.bind(Role) |
2342 | 2342 | end |
2343 | 2343 | local rechargeId = back |
2344 | 2344 | local rechargeData = csvdb["shop_rechargeCsv"][rechargeId] |
2345 | - if (params.is_mycard and rechargeData.twd * 100 ~= tonumber(params.amount)) or (not params.is_mycard and rechargeData.rmb * 100 ~= tonumber(params.amount)) then | |
2345 | + if (params.is_mycard and rechargeData.twd * 100 ~= tonumber(params.amount)) or (not params.is_mycard and ((rechargeData.rmb * 100) / globalCsv.QArecharge) ~= tonumber(params.amount)) then | |
2346 | 2346 | skynet.error(string.format("[recharge] fake order: %s, roleId: %d, order: %s, rmb %s, get %s", |
2347 | 2347 | params.transactionId, roleId, partnerOrderStr, rechargeData.rmb, params.amount |
2348 | 2348 | )) |
... | ... | @@ -2377,7 +2377,7 @@ function RolePlugin.bind(Role) |
2377 | 2377 | return 1 |
2378 | 2378 | end |
2379 | 2379 | |
2380 | - if not self.storeData:checkRechargeRecord(rechargeData.limit, id) then | |
2380 | + if not self.storeData:checkRechargeRecord(rechargeData.limit, id) and rechargeData.shop ~= 2 then | |
2381 | 2381 | return 2 |
2382 | 2382 | end |
2383 | 2383 | ... | ... |
src/models/RoleTask.lua
... | ... | @@ -697,7 +697,7 @@ function RoleTask.bind(Role) |
697 | 697 | for _, hero in pairs(self.heros) do |
698 | 698 | local unitData = csvdb["unitCsv"][hero:getProperty("type")] |
699 | 699 | if unitData then |
700 | - if cfg.condition2 <= unitData.rare then | |
700 | + if cfg.condition2 == unitData.rare then | |
701 | 701 | count = count + 1 |
702 | 702 | end |
703 | 703 | end |
... | ... | @@ -758,11 +758,14 @@ function RoleTask.bind(Role) |
758 | 758 | end |
759 | 759 | elseif cfg.type == 15 then -- 通关关卡 |
760 | 760 | if (calTask[id] or 0) == 0 then |
761 | - local hangPass = self:getProperty("hangPass") | |
762 | - local diff = math.floor(cfg.condition2 / 10000) | |
763 | - if (hangPass[diff] or 0) >= cfg.condition1 then | |
761 | + if self:checkHangPass(cfg.condition2) then | |
764 | 762 | calTask[id] = 1 |
765 | - end | |
763 | + end | |
764 | + --local hangPass = self:getProperty("hangPass") | |
765 | + --local diff = math.floor(cfg.condition2 / 10000) | |
766 | + --if (hangPass[diff] or 0) >= cfg.condition2 then | |
767 | + -- calTask[id] = 1 | |
768 | + --end | |
766 | 769 | end |
767 | 770 | elseif cfg.type == 22 then -- 电台任务出勤人数 |
768 | 771 | calTask[id] = (calTask[id] or 0) + (param1 or 0) | ... | ... |
src/models/Store.lua
... | ... | @@ -98,37 +98,67 @@ local SuperMonthCard = {} |
98 | 98 | SuperMonthCard["buy"] = function(self, id) |
99 | 99 | local smonthCards = self:getProperty("smonthCards") or {} |
100 | 100 | |
101 | + local buyLimitFunc = function(buylimit) | |
102 | + for k, v in pairs(buylimit) do | |
103 | + if k == 1 then | |
104 | + if v == 101 then | |
105 | + if self:isMonthCardExpire() then | |
106 | + skynet.error("月卡过期") | |
107 | + return false | |
108 | + end | |
109 | + else | |
110 | + if smonthCards[v] == nil then | |
111 | + skynet.error("没有购买增刊里的条件, %d", v) | |
112 | + return false | |
113 | + end | |
114 | + end | |
115 | + elseif k == 2 then | |
116 | + if smonthCards[v] == nil and v ~= 101 then | |
117 | + skynet.error("没有购买增刊里的条件, %d", v) | |
118 | + return false | |
119 | + end | |
120 | + if SuperMonthCard["isExpired"](self, v) == false and v ~= 101 then | |
121 | + skynet.error("上期特刊奖励没有领取完") | |
122 | + return false | |
123 | + end | |
124 | + end | |
125 | + end | |
126 | + return true | |
127 | + end | |
128 | + | |
101 | 129 | local BuyMonthCard = {} |
102 | 130 | BuyMonthCard["renewal"]= function() |
103 | 131 | --续刊 |
104 | - if self:isMonthCardExpire() then return false end | |
132 | + local card = csvdb["shop_cardCsv"][id] or {} | |
133 | + if card["buyLimit"] and card["buyLimit"] ~= "" then | |
134 | + if buyLimitFunc(card["buyLimit"]:toNumMap()) == false then | |
135 | + skynet.error("不满足购买条件") | |
136 | + return false | |
137 | + end | |
138 | + end | |
105 | 139 | |
106 | 140 | local smonthCard = smonthCards[id] or {} |
107 | 141 | if next(smonthCard) then |
108 | - | |
109 | 142 | smonthCard["buyCount"] = (smonthCard["buyCount"] or 0) + 1 |
110 | - | |
111 | - local card = csvdb["shop_cardCsv"][id] or {} | |
112 | - local periods = SuperMonthCard["periods"](self, id) + (card["cardPlusPeriods"] or 30) | |
143 | + local periods = SuperMonthCard["periods"](self, id) + (card["amount"] or 30) | |
113 | 144 | smonthCard["periods"] = periods |
114 | 145 | |
115 | - self:updateProperty({filed = "smonthCards", value = smonthCards}) | |
146 | + self:updateProperty({field = "smonthCards", value = smonthCards}) | |
116 | 147 | return true |
117 | 148 | end |
118 | 149 | end |
119 | 150 | BuyMonthCard["order"] = function() |
120 | 151 | --增刊条件 |
121 | 152 | local card = csvdb["shop_cardCsv"][id] or {} |
122 | - --判断是否购买过增刊条件里的特刊 | |
123 | - local cardId = card["cardPlusCondition"] or 0 | |
124 | - if self:isMonthCardExpire() or smonthCards[cardId] == nil then return false end | |
125 | - | |
126 | - --如果上期特刊奖励没有领取玩,则不能购买这期特刊。 | |
127 | - if SuperMonthCard["isExpired"](self, cardId) == false and cardId ~= 101 then return false end | |
128 | - | |
129 | - smonthCards[id] = {["periods"] = (card["cardPlusPeriods"] or 30), ["buyCount"] = 1} | |
153 | + if card["buyLimit"] and card["buyLimit"] ~= "" then | |
154 | + if buyLimitFunc(card["buyLimit"]:toNumMap()) == false then | |
155 | + skynet.error("不满足增刊条件") | |
156 | + return false | |
157 | + end | |
158 | + end | |
159 | + smonthCards[id] = {["periods"] = (card["amount"] or 30), ["buyCount"] = 1} | |
130 | 160 | |
131 | - self:updateProperty({filed = "smonthCards", value = smonthCards}) | |
161 | + self:updateProperty({field= "smonthCards", value = smonthCards}) | |
132 | 162 | return true |
133 | 163 | end |
134 | 164 | |
... | ... | @@ -171,6 +201,12 @@ SuperMonthCard["itemDaily"] = function(self, id) |
171 | 201 | return reward, change, cur_ex |
172 | 202 | end |
173 | 203 | |
204 | +SuperMonthCard["itemFirst"] = function(self, id) | |
205 | + local card = csvdb["shop_cardCsv"][id] or {} | |
206 | + local reward, _ = self.owner:award(card["itemFirst"], {isRecharge = true, log = {desc = "recharge", int1 = id}}) | |
207 | + return reward | |
208 | +end | |
209 | + | |
174 | 210 | -- 删除过期商品 |
175 | 211 | function Store:deleteExpireLimitGoods() |
176 | 212 | local timeNow = skynet.timex() |
... | ... | @@ -313,7 +349,7 @@ function Store:getMonthCardDailyReward(id) |
313 | 349 | self:updateProperty({field = "monthCardEx", delta = -1}) |
314 | 350 | local cur_ex = self:getProperty("monthCardEx") |
315 | 351 | |
316 | - local actCfg = csvdb["shop_card"][id] or {} | |
352 | + local actCfg = csvdb["shop_cardCsv"][id] or {} | |
317 | 353 | local award = actCfg.itemDaily:toNumMap() |
318 | 354 | local reward, change = self.owner:award(award, {log = {desc = "monthCardReward", int1 = id, int2 = cur_ex}}) |
319 | 355 | |
... | ... | @@ -354,7 +390,7 @@ function Store:firstBuyMonthCard(id) |
354 | 390 | if self:getProperty("firstMonthCard") == 1 then |
355 | 391 | self:updateProperty({field = "firstMonthCard", value = 0}) |
356 | 392 | local card = csvdb["shop_cardCsv"][id] or {} |
357 | - return self:award(card["cardFirst"], {log = {desc = "monthCardReward", int1 = id, int2 = 30}}) | |
393 | + return self.owner:award(card["itemOnce"], {log = {desc = "monthCardReward", int1 = id, int2 = 30}}) | |
358 | 394 | end |
359 | 395 | return nil |
360 | 396 | end |
... | ... | @@ -377,9 +413,8 @@ function Store:onBuyCard(type, duration, id, actid) |
377 | 413 | end |
378 | 414 | end |
379 | 415 | |
380 | - --签收奖励 | |
381 | - tmpreward, _= self:getMonthCardDailyReward(id) | |
382 | - if tmpreward then | |
416 | + tmpreward = SuperMonthCard["itemFirst"](self, id) | |
417 | + if next(tmpreward) then | |
383 | 418 | for k, v in pairs(tmpreward) do |
384 | 419 | reward[k] = (reward[k] or 0) + v |
385 | 420 | end |
... | ... | @@ -387,9 +422,10 @@ function Store:onBuyCard(type, duration, id, actid) |
387 | 422 | return reward |
388 | 423 | elseif type == CardType.SuperMonthCard then |
389 | 424 | if SuperMonthCard["buy"](self, id) then |
390 | - return self:getSMonthCardDailyReward(id) | |
425 | + skynet.error("特刊购买成功:"..id) | |
426 | + return SuperMonthCard["itemFirst"](self, id) | |
391 | 427 | end |
392 | - return nil, nil | |
428 | + return nil | |
393 | 429 | elseif type == CardType.NormalMonthCardLevelUp then |
394 | 430 | if self:isMonthCardExpire() then |
395 | 431 | skynet.error(string.format("month card expired, can not level up,%d,%d",self.owner:getProperty("id"), id)) | ... | ... |