Commit 3e6d391be3f83466e3a5c4e81bbbc5fe77802cbf
1 parent
61386225
fix: 等级效果的bug-修复无法获得奖励关卡每次扫荡额外获得道具
Showing
1 changed file
with
18 additions
and
8 deletions
Show diff stats
src/models/RolePlugin.lua
... | ... | @@ -2787,8 +2787,8 @@ function RolePlugin.bind(Role) |
2787 | 2787 | return self:getDeltaValue(result, value) + self:getDeltaValue(levelReault, value) |
2788 | 2788 | end |
2789 | 2789 | |
2790 | - local function appendBnous(dstBnous, srcBnous) | |
2791 | - if not dstBnous or not srcBnous then return end | |
2790 | + local function appendAdvBnous(dstBnous, srcBnous) | |
2791 | + if not dstBnous and not srcBnous then return end | |
2792 | 2792 | for time, set in pairs(srcBnous) do |
2793 | 2793 | if not dstBnous[time] then |
2794 | 2794 | dstBnous[time] = {} |
... | ... | @@ -2798,12 +2798,20 @@ function RolePlugin.bind(Role) |
2798 | 2798 | end |
2799 | 2799 | end |
2800 | 2800 | end |
2801 | + | |
2802 | + local function appendTableBnous(dstBnous, srcBnous) | |
2803 | + if not dstBnous and not srcBnous then return end | |
2804 | + for k, v in pairs(srcBnous) do | |
2805 | + dstBnous[k] = (dstBnous[k] or 0) + v | |
2806 | + end | |
2807 | + end | |
2801 | 2808 | function Role:getBnousAdv() |
2802 | 2809 | local towerBnous = self:getTowerBnousActive() |
2803 | 2810 | local levelBnous = self:getLevelBnous() |
2804 | 2811 | local adv = levelBnous[SystemBnousType.Adv] or {} |
2805 | - appendBnous(towerBnous[SystemBnousType.Adv], adv) | |
2806 | - return towerBnous[SystemBnousType.Adv] or {} | |
2812 | + towerBnous[SystemBnousType.Adv] = towerBnous[SystemBnousType.Adv] or {} | |
2813 | + appendAdvBnous(towerBnous[SystemBnousType.Adv], adv) | |
2814 | + return towerBnous[SystemBnousType.Adv] | |
2807 | 2815 | end |
2808 | 2816 | |
2809 | 2817 | function Role:getBnousHangTime() |
... | ... | @@ -2817,16 +2825,18 @@ function RolePlugin.bind(Role) |
2817 | 2825 | local towerBnous = self:getTowerBnousActive() |
2818 | 2826 | local levelBnous = self:getLevelBnous() |
2819 | 2827 | local pvpTicket = levelBnous[SystemBnousType.PvpTicket] or {} |
2820 | - appendBnous(towerBnous[SystemBnousType.PvpTicket], pvpTicket) | |
2821 | - return towerBnous[SystemBnousType.PvpTicket] or {} | |
2828 | + towerBnous[SystemBnousType.PvpTicket] = towerBnous[SystemBnousType.PvpTicket] or {} | |
2829 | + appendTableBnous(towerBnous[SystemBnousType.PvpTicket], pvpTicket) | |
2830 | + return towerBnous[SystemBnousType.PvpTicket] | |
2822 | 2831 | end |
2823 | 2832 | |
2824 | 2833 | function Role:getBnousSweep() |
2825 | 2834 | local towerBnous = self:getTowerBnousActive() |
2826 | 2835 | local levelBnous = self:getLevelBnous() |
2827 | 2836 | local sweepReward = levelBnous[SystemBnousType.SweepReward] or {} |
2828 | - appendBnous(towerBnous[SystemBnousType.SweepReward], sweepReward) | |
2829 | - return towerBnous[SystemBnousType.SweepReward] or {} | |
2837 | + towerBnous[SystemBnousType.SweepReward] = towerBnous[SystemBnousType.SweepReward] or {} | |
2838 | + appendTableBnous(towerBnous[SystemBnousType.SweepReward], sweepReward) | |
2839 | + return towerBnous[SystemBnousType.SweepReward] | |
2830 | 2840 | end |
2831 | 2841 | |
2832 | 2842 | function Role:getBnousDismantlingMaximum() | ... | ... |