diff --git a/src/actions/HangAction.lua b/src/actions/HangAction.lua index b8b9c52..19259c3 100644 --- a/src/actions/HangAction.lua +++ b/src/actions/HangAction.lua @@ -498,7 +498,7 @@ function _M.buyBonusCountRpc(agent, data) return true end -local function bonusWinReward(role, bonusData) +local function bonusWinReward(role, bonusData, bwin) local open, actId = role.activity:isOpen("BonusDouble") local actData = csvdb["activity_ctrlCsv"][actId] local extraCnt = role.storeData:getBonusExtraFightCount() @@ -522,6 +522,11 @@ local function bonusWinReward(role, bonusData) for k, v in pairs(reward) do reward[k] = v * (coef > 1 and actData.condition or 1) end + if bwin then -- 满星 额外奖励 + for k, v in pairs(bonusData.perfect_reward:toNumMap()) do + reward[k] = (reward[k] or 0) + v + end + end reward, change = role:award(reward, {log = {desc = "bonusBattle", int1 = id}}) role:checkTaskEnter("BonusPass", {id = id}) return true, reward, change @@ -597,9 +602,6 @@ function _M.endBonusBattleRpc(agent, data) if starNum and starNum > 0 then -- 胜利扣除次数 - local status, reward, change = bonusWinReward(role, bonusData) - if not status then return 10 + (reward or 0) end - local bTeam = self:getTeamFormatByType(TeamSystemType.BonusBattle) local herosInfo = self:getTeamHerosInfo(bTeam.heros) @@ -652,11 +654,15 @@ function _M.endBonusBattleRpc(agent, data) return msg.info.atime and msg.info.atime <= cond end curStar = 0 - for i, cond in ipairs(bonusData.sweep_condition:toTableArray(true)) do + local sweepConds = bonusData.sweep_condition:toTableArray(true) + for i, cond in ipairs(sweepConds) do if check[cond[1]] and check[cond[1]](table.unpack(cond)) then curStar = curStar + (1 << (i - 1)) end end + local status + status, reward, change = bonusWinReward(role, bonusData, curStar >= (1 << #sweepConds) - 1) + if not status then return 10 + (reward or 0) end else curStar = 0 end -- libgit2 0.21.2