Commit 7ecbc95479774e26d3d708d7d155dcbae05f6163

Authored by jiyue
2 parents 0cd001ee d85ecb3f

Merge branch 'cn/develop' into cn/publish/release

src/actions/ActivityAction.lua
... ... @@ -799,12 +799,18 @@ function _M.endBattleRpc(agent, data)
799 799 if newStarNum > oldStarNum then
800 800 battleInfo["star"] = curStar
801 801 end
802   -
803   - if battleCfg.rank ~= 0 and isWin then
  802 + if battleCfg.type ~= "" then
804 803 -- 消耗门票
805 804 role.activity:getBattleTicket(actid)
806 805 local num = battleCfg.type:toArray(true, "=")[3]
807 806 actData["ticket"] = math.max(actData["ticket"] - num, 0)
  807 + end
  808 +
  809 + if battleCfg.rank ~= 0 and isWin then
  810 + -- 消耗门票
  811 + --role.activity:getBattleTicket(actid)
  812 + --local num = battleCfg.type:toArray(true, "=")[3]
  813 + --actData["ticket"] = math.max(actData["ticket"] - num, 0)
808 814  
809 815 -- 更新排行榜 最高伤害
810 816 battleInfo["top"] = math.max(battleInfo["top"] or 0, dmg)
... ... @@ -1486,7 +1492,7 @@ function _M.buyBattleTicketRpc(agent, data)
1486 1492 end
1487 1493 local cost = globalCsv.activity_scrofa_tickets[curCount + 1]
1488 1494 if not role:checkItemEnough({[ItemId.Jade] = cost}) then return 3 end
1489   - role:costItems({[ItemId.Jade] = cost}, {log = {desc = "buyActivityBattleTicket", int1 = actid, int2 = count, cint1 = curCount}})
  1495 + role:costItems({[ItemId.Jade] = cost}, {log = {desc = "buyActivityBattleTicket", int1 = actid, int2 = count, long1 = curCount}})
1490 1496 actData["ticket"] = (actData["ticket"] or 0) + 1
1491 1497 actData["buyC"] = curCount + count
1492 1498  
... ...
src/models/RolePlugin.lua
... ... @@ -2437,6 +2437,11 @@ function RolePlugin.bind(Role)
2437 2437 end
2438 2438 elseif rechargeData.shop == 3 then -- 礼包商店
2439 2439 reward, _ = self:award(rechargeData.itemFirst, {isRecharge = true, log = {desc = "recharge", int1 = id}})
  2440 +
  2441 + --增加购买记录
  2442 + local buyRecord = self.storeData:getProperty("buyR") or {}
  2443 + buyRecord[id] = (buyRecord[id] or 0) + 1
  2444 + self.storeData:updateProperty({field = "buyR", value = buyRecord})
2440 2445 else
2441 2446 skynet.error("[recharge] invalid recharge shop type " .. id)
2442 2447 return 3
... ...
src/models/Store.lua
... ... @@ -474,7 +474,7 @@ function Store:onBuyCard(type, duration, id, actid)
474 474 self:updateProperty({field = "bpInfo", value = bpInfo})
475 475 elseif type == CardType.ActBattleCommandCard then
476 476 if not self.owner.activity:isOpenById(actid, "ActShopGoods") then
477   - return
  477 + return nil
478 478 end
479 479 local actCfg = csvdb["activity_ctrlCsv"][actid]
480 480 if not actCfg then return end
... ... @@ -486,6 +486,10 @@ function Store:onBuyCard(type, duration, id, actid)
486 486 end
487 487 self.owner:mylog("act_action", {desc="buyBc", int1=id, int2=actData["lvl"] or 0})
488 488 self.owner.activity:updateActData("BattleCommand", actData)
  489 + local rechargeData = csvdb["shop_rechargeCsv"][id]
  490 + if rechargeData then
  491 + return self.owner:award(rechargeData.itemFirst, {isRecharge = true, log = {desc = "recharge", int1 = id}})
  492 + end
489 493 end
490 494 return nil, nil
491 495 end
... ...