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,8 +846,8 @@ function _M.drawHeroRpc(agent, data) | ||
846 | local isNewerSSR = btype == 4 and (newerHadSSR == 0 and newerDrawCount >= globalCsv.draw_newer[1]) or false | 846 | local isNewerSSR = btype == 4 and (newerHadSSR == 0 and newerDrawCount >= globalCsv.draw_newer[1]) or false |
847 | 847 | ||
848 | local ssrUp = 0 | 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 | end | 851 | end |
852 | while not next(resultPool) do | 852 | while not next(resultPool) do |
853 | if isNewerSSR then | 853 | if isNewerSSR then |
@@ -892,13 +892,13 @@ function _M.drawHeroRpc(agent, data) | @@ -892,13 +892,13 @@ function _M.drawHeroRpc(agent, data) | ||
892 | 892 | ||
893 | if draw_floor_back_counts then | 893 | if draw_floor_back_counts then |
894 | local floorHero = role:getProperty("floorHero") | 894 | local floorHero = role:getProperty("floorHero") |
895 | - floorHero[pool] = floorHeroCount | 895 | + floorHero[btype] = floorHeroCount |
896 | role:setProperty("floorHero", floorHero) | 896 | role:setProperty("floorHero", floorHero) |
897 | end | 897 | end |
898 | 898 | ||
899 | if draw_ssr_up_count_rate then | 899 | if draw_ssr_up_count_rate then |
900 | local ssrUp = role:getProperty("ssrUp") | 900 | local ssrUp = role:getProperty("ssrUp") |
901 | - ssrUp[pool] = ssrUpCount | 901 | + ssrUp[btype] = ssrUpCount |
902 | role:setProperty("ssrUp", ssrUp) | 902 | role:setProperty("ssrUp", ssrUp) |
903 | end | 903 | end |
904 | 904 |
src/models/RolePlugin.lua
@@ -68,9 +68,16 @@ function RolePlugin.bind(Role) | @@ -68,9 +68,16 @@ function RolePlugin.bind(Role) | ||
68 | local itemTypeAward = { | 68 | local itemTypeAward = { |
69 | [ItemType.Hero] = function() | 69 | [ItemType.Hero] = function() |
70 | pms.type = itemId - ItemStartId.Hero | 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 | end | 79 | end |
80 | + count = gcount | ||
74 | end, | 81 | end, |
75 | [ItemType.EquipBase] = function() | 82 | [ItemType.EquipBase] = function() |
76 | local typ = math.floor((itemId-7000)/100) | 83 | local typ = math.floor((itemId-7000)/100) |
@@ -106,7 +113,7 @@ function RolePlugin.bind(Role) | @@ -106,7 +113,7 @@ function RolePlugin.bind(Role) | ||
106 | end | 113 | end |
107 | end | 114 | end |
108 | 115 | ||
109 | - return count, change -- count 刷新实际发放的奖励个数 change 物品实际奖励与当前id 不符 就发生转换 而不实际发奖 | 116 | + return count, change -- count 实际发放的奖励个数 change 物品实际奖励与当前id 不符 就发生转换 而不实际发奖 |
110 | end | 117 | end |
111 | 118 | ||
112 | 119 | ||
@@ -123,17 +130,18 @@ function RolePlugin.bind(Role) | @@ -123,17 +130,18 @@ function RolePlugin.bind(Role) | ||
123 | end | 130 | end |
124 | local reward, allChange = {}, {} | 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 | if next(change) then | 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 | end | 145 | end |
138 | end | 146 | end |
139 | end | 147 | end |