Commit 27b8b57ca14fceb230258c8d9adc7e5b87e3c3ba
Merge branch 'taptap' into player
Showing
2 changed files
with
24 additions
and
16 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 |
... | ... | @@ -862,7 +862,7 @@ function _M.drawHeroRpc(agent, data) |
862 | 862 | end |
863 | 863 | |
864 | 864 | -- 引导必送 613 丝路德 |
865 | - local itemId = guide and 613 or math.randWeight(resultPool, 1) | |
865 | + local itemId = (guide and drawType == 1) and 613 or math.randWeight(resultPool, 1) | |
866 | 866 | local itemData = csvdb["itemCsv"][itemId] |
867 | 867 | if itemData.quality == 4 then |
868 | 868 | ssrCount = ssrCount + 1 | ... | ... |
src/models/RolePlugin.lua
... | ... | @@ -67,9 +67,16 @@ function RolePlugin.bind(Role) |
67 | 67 | local itemTypeAward = { |
68 | 68 | [ItemType.Hero] = function() |
69 | 69 | pms.type = itemId - ItemStartId.Hero |
70 | - for _= 1, count do | |
71 | - self:addHero(pms) | |
70 | + local status = self:addHero(pms) | |
71 | + local gcount = 1 | |
72 | + if not status then | |
73 | + gcount = 0 | |
74 | + end | |
75 | + if count - gcount > 0 then | |
76 | + local heroData = csvdb["unitCsv"][pms.type] | |
77 | + change[pms.type] = (change[pms.type] or 0) + (count - gcount) * globalCsv.draw_unit_tofragment[heroData.rare] | |
72 | 78 | end |
79 | + count = gcount | |
73 | 80 | end, |
74 | 81 | [ItemType.EquipBase] = function() |
75 | 82 | local typ = math.floor((itemId-7000)/100) |
... | ... | @@ -105,7 +112,7 @@ function RolePlugin.bind(Role) |
105 | 112 | end |
106 | 113 | end |
107 | 114 | |
108 | - return count, change -- count 刷新实际发放的奖励个数 change 物品实际奖励与当前id 不符 就发生转换 而不实际发奖 | |
115 | + return count, change -- count 实际发放的奖励个数 change 物品实际奖励与当前id 不符 就发生转换 而不实际发奖 | |
109 | 116 | end |
110 | 117 | |
111 | 118 | |
... | ... | @@ -122,17 +129,18 @@ function RolePlugin.bind(Role) |
122 | 129 | end |
123 | 130 | local reward, allChange = {}, {} |
124 | 131 | |
125 | - for itemId, count in pairs(tgift) do | |
126 | - local count, change = _award(self, itemId, count, params) | |
132 | + for itemId, rcount in pairs(tgift) do | |
133 | + local count, change = _award(self, itemId, rcount, params) | |
134 | + if count > 0 then | |
135 | + reward[itemId] = (reward[itemId] or 0) + count | |
136 | + end | |
127 | 137 | if next(change) then |
128 | - local cr, cc = self:award(change, params) -- 内部转换忽略 | |
129 | - for _id, _ct in pairs(cr) do | |
130 | - reward[_id] = (reward[_id] or 0) + _ct | |
131 | - end | |
132 | - table.insert(allChange, {form = {[itemId] = count}, to = cr}) | |
133 | - else | |
134 | - if count > 0 then | |
135 | - reward[itemId] = (reward[itemId] or 0) + count | |
138 | + local cr, _ = self:award(change, params) -- 内部转换忽略 防止死循环 | |
139 | + if next(cr) then | |
140 | + for _id, _ct in pairs(cr) do | |
141 | + reward[_id] = (reward[_id] or 0) + _ct | |
142 | + end | |
143 | + table.insert(allChange, {form = {[itemId] = rcount - count}, to = cr}) | |
136 | 144 | end |
137 | 145 | end |
138 | 146 | end | ... | ... |