Commit 3e5be8ebc20ee3c8aaa305bdeaafbbe9d6d8fc18
Merge branch 'develop' of 120.26.43.151:wasteland/server into develop
Showing
2 changed files
with
25 additions
and
17 deletions
Show diff stats
src/actions/HeroAction.lua
... | ... | @@ -846,8 +846,8 @@ function _M.drawHeroRpc(agent, data) |
846 | 846 | local isNewerSSR = btype == 4 and (newerHadSSR == 0 and newerDrawCount >= globalCsv.draw_newer[1]) or false |
847 | 847 | |
848 | 848 | local ssrUp = 0 |
849 | - if draw_ssr_up_count_rate then | |
850 | - ssrUp = math.min(math.floor(ssrUpCount / draw_ssr_up_count_rate[1]) * draw_ssr_up_count_rate[2], draw_ssr_up_count_rate[3]) / 100 | |
849 | + if draw_ssr_up_count_rate and ssrUpCount > draw_ssr_up_count_rate[1] then | |
850 | + ssrUp = math.min((ssrUpCount - draw_ssr_up_count_rate[1]) * draw_ssr_up_count_rate[2], draw_ssr_up_count_rate[3]) / 100 | |
851 | 851 | end |
852 | 852 | while not next(resultPool) do |
853 | 853 | if isNewerSSR then |
... | ... | @@ -892,13 +892,13 @@ function _M.drawHeroRpc(agent, data) |
892 | 892 | |
893 | 893 | if draw_floor_back_counts then |
894 | 894 | local floorHero = role:getProperty("floorHero") |
895 | - floorHero[pool] = floorHeroCount | |
895 | + floorHero[btype] = floorHeroCount | |
896 | 896 | role:setProperty("floorHero", floorHero) |
897 | 897 | end |
898 | 898 | |
899 | 899 | if draw_ssr_up_count_rate then |
900 | 900 | local ssrUp = role:getProperty("ssrUp") |
901 | - ssrUp[pool] = ssrUpCount | |
901 | + ssrUp[btype] = ssrUpCount | |
902 | 902 | role:setProperty("ssrUp", ssrUp) |
903 | 903 | end |
904 | 904 | ... | ... |
src/models/RolePlugin.lua
... | ... | @@ -68,9 +68,16 @@ function RolePlugin.bind(Role) |
68 | 68 | local itemTypeAward = { |
69 | 69 | [ItemType.Hero] = function() |
70 | 70 | pms.type = itemId - ItemStartId.Hero |
71 | - for _= 1, count do | |
72 | - self:addHero(pms) | |
71 | + local status = self:addHero(pms) | |
72 | + local gcount = 1 | |
73 | + if not status then | |
74 | + gcount = 0 | |
75 | + end | |
76 | + if count - gcount > 0 then | |
77 | + local heroData = csvdb["unitCsv"][pms.type] | |
78 | + change[pms.type] = (change[pms.type] or 0) + (count - gcount) * globalCsv.draw_unit_tofragment[heroData.rare] | |
73 | 79 | end |
80 | + count = gcount | |
74 | 81 | end, |
75 | 82 | [ItemType.EquipBase] = function() |
76 | 83 | local typ = math.floor((itemId-7000)/100) |
... | ... | @@ -106,7 +113,7 @@ function RolePlugin.bind(Role) |
106 | 113 | end |
107 | 114 | end |
108 | 115 | |
109 | - return count, change -- count 刷新实际发放的奖励个数 change 物品实际奖励与当前id 不符 就发生转换 而不实际发奖 | |
116 | + return count, change -- count 实际发放的奖励个数 change 物品实际奖励与当前id 不符 就发生转换 而不实际发奖 | |
110 | 117 | end |
111 | 118 | |
112 | 119 | |
... | ... | @@ -123,17 +130,18 @@ function RolePlugin.bind(Role) |
123 | 130 | end |
124 | 131 | local reward, allChange = {}, {} |
125 | 132 | |
126 | - for itemId, count in pairs(tgift) do | |
127 | - local count, change = _award(self, itemId, count, params) | |
133 | + for itemId, rcount in pairs(tgift) do | |
134 | + local count, change = _award(self, itemId, rcount, params) | |
135 | + if count > 0 then | |
136 | + reward[itemId] = (reward[itemId] or 0) + count | |
137 | + end | |
128 | 138 | if next(change) then |
129 | - local cr, cc = self:award(change, params) -- 内部转换忽略 | |
130 | - for _id, _ct in pairs(cr) do | |
131 | - reward[_id] = (reward[_id] or 0) + _ct | |
132 | - end | |
133 | - table.insert(allChange, {form = {[itemId] = count}, to = cr}) | |
134 | - else | |
135 | - if count > 0 then | |
136 | - reward[itemId] = (reward[itemId] or 0) + count | |
139 | + local cr, _ = self:award(change, params) -- 内部转换忽略 防止死循环 | |
140 | + if next(cr) then | |
141 | + for _id, _ct in pairs(cr) do | |
142 | + reward[_id] = (reward[_id] or 0) + _ct | |
143 | + end | |
144 | + table.insert(allChange, {form = {[itemId] = rcount - count}, to = cr}) | |
137 | 145 | end |
138 | 146 | end |
139 | 147 | end | ... | ... |