Commit e4a17692f08a2610340d7757974f7de17fa512b5

Authored by zhouhaihai
1 parent 3139a116

奖励关卡 满星奖励

Showing 1 changed file with 11 additions and 5 deletions   Show diff stats
src/actions/HangAction.lua
... ... @@ -498,7 +498,7 @@ function _M.buyBonusCountRpc(agent, data)
498 498 return true
499 499 end
500 500  
501   -local function bonusWinReward(role, bonusData)
  501 +local function bonusWinReward(role, bonusData, bwin)
502 502 local open, actId = role.activity:isOpen("BonusDouble")
503 503 local actData = csvdb["activity_ctrlCsv"][actId]
504 504 local extraCnt = role.storeData:getBonusExtraFightCount()
... ... @@ -522,6 +522,11 @@ local function bonusWinReward(role, bonusData)
522 522 for k, v in pairs(reward) do
523 523 reward[k] = v * (coef > 1 and actData.condition or 1)
524 524 end
  525 + if bwin then -- 满星 额外奖励
  526 + for k, v in pairs(bonusData.perfect_reward:toNumMap()) do
  527 + reward[k] = (reward[k] or 0) + v
  528 + end
  529 + end
525 530 reward, change = role:award(reward, {log = {desc = "bonusBattle", int1 = id}})
526 531 role:checkTaskEnter("BonusPass", {id = id})
527 532 return true, reward, change
... ... @@ -597,9 +602,6 @@ function _M.endBonusBattleRpc(agent, data)
597 602 if starNum and starNum > 0 then
598 603 -- 胜利扣除次数
599 604  
600   - local status, reward, change = bonusWinReward(role, bonusData)
601   - if not status then return 10 + (reward or 0) end
602   -
603 605 local bTeam = self:getTeamFormatByType(TeamSystemType.BonusBattle)
604 606 local herosInfo = self:getTeamHerosInfo(bTeam.heros)
605 607  
... ... @@ -652,11 +654,15 @@ function _M.endBonusBattleRpc(agent, data)
652 654 return msg.info.atime and msg.info.atime <= cond
653 655 end
654 656 curStar = 0
655   - for i, cond in ipairs(bonusData.sweep_condition:toTableArray(true)) do
  657 + local sweepConds = bonusData.sweep_condition:toTableArray(true)
  658 + for i, cond in ipairs(sweepConds) do
656 659 if check[cond[1]] and check[cond[1]](table.unpack(cond)) then
657 660 curStar = curStar + (1 << (i - 1))
658 661 end
659 662 end
  663 + local status
  664 + status, reward, change = bonusWinReward(role, bonusData, curStar >= (1 << #sweepConds) - 1)
  665 + if not status then return 10 + (reward or 0) end
660 666 else
661 667 curStar = 0
662 668 end
... ...