Commit 2445248da69ba4aaa843bf463129d22a750088ac
1 parent
497f9a67
去掉热门料理
Showing
4 changed files
with
6 additions
and
49 deletions
Show diff stats
src/actions/CarAction.lua
... | ... | @@ -128,7 +128,7 @@ function _M.saleEquipRpc(agent, data ) |
128 | 128 | local backs = msg.backs |
129 | 129 | if not backs then return end |
130 | 130 | for id, count in pairs(backs) do |
131 | - if not csvdb["ItemCsv"][id] then return end | |
131 | + if not csvdb["itemCsv"][id] then return end | |
132 | 132 | local typ = math.floor((id-7000)/100) |
133 | 133 | local lv = (id-7000)%100 |
134 | 134 | local own = role:getEquipCount(typ,lv) |
... | ... | @@ -136,7 +136,7 @@ function _M.saleEquipRpc(agent, data ) |
136 | 136 | end |
137 | 137 | local reward = {} |
138 | 138 | for id, count in pairs(backs) do |
139 | - local itemData = csvdb["ItemCsv"][id] | |
139 | + local itemData = csvdb["itemCsv"][id] | |
140 | 140 | local typ = math.floor((id-7000)/100) |
141 | 141 | local lv = (id-7000)%100 |
142 | 142 | role:addEquip(typ, lv, -count) -- 删掉装备 |
... | ... | @@ -158,11 +158,11 @@ function _M.saleRuneRpc(agent, data ) |
158 | 158 | if not backs then return end |
159 | 159 | |
160 | 160 | local reward = {} |
161 | - for _, id in pairs(backs) do | |
161 | + for _, uid in pairs(backs) do | |
162 | 162 | local rune = role.runeBag[uid] |
163 | 163 | if not rune then return end |
164 | 164 | if rune:getProperty("refer") ~= 0 then return end |
165 | - local itemData = csvdb["ItemCsv"][rune:getProperty("id")] | |
165 | + local itemData = csvdb["itemCsv"][rune:getProperty("id")] | |
166 | 166 | if not itemData then return end |
167 | 167 | local one = itemData.sell_effect:toNumMap() |
168 | 168 | for k ,v in pairs(one) do | ... | ... |
src/actions/DinerAction.lua
... | ... | @@ -79,7 +79,6 @@ function _M.addSellRpc( agent, data ) |
79 | 79 | sells[slot].level = dishLevel |
80 | 80 | sells[slot].count = count |
81 | 81 | sells[slot].time = skynet.timex() - calSell.deltaTime |
82 | - sells[slot].hot = role.dinerData:getProperty("hot"):getv(sells[slot].dish, 0) | |
83 | 82 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) |
84 | 83 | end |
85 | 84 | SendPacket(actionCodes.Diner_addSellRpc, "") | ... | ... |
src/models/Diner.lua
... | ... | @@ -8,7 +8,6 @@ Diner.schema = { |
8 | 8 | buildL = {"string", ""}, -- 家具等级 1=1 2=1 3=1 |
9 | 9 | order = {"string", "[]"}, -- 特殊订单 |
10 | 10 | sells = {"string", "[]"}, -- 贩卖位置 |
11 | - hot = {"string", ""}, -- 今日热门 | |
12 | 11 | dishTree = {"string", "1=1 101=1 201=1"}, -- 料理天赋 |
13 | 12 | skillTree = {"string", ""}, -- 支援天赋 |
14 | 13 | popular = {"number",0}, -- 累计人气 |
... | ... | @@ -17,34 +16,6 @@ Diner.schema = { |
17 | 16 | } |
18 | 17 | |
19 | 18 | function Diner:refreshDailyData(notify) |
20 | - -- 热门料理 | |
21 | - local hotPool = {} | |
22 | - local dishTree = self:getProperty("dishTree"):toNumMap() | |
23 | - local hangPass = self.owner:getProperty("hangPass") | |
24 | - | |
25 | - for index, dishData in ipairs(csvdb["diner_dishCsv"]) do | |
26 | - local check = true | |
27 | - local dish = dishData[1] | |
28 | - if not dishTree[dish.id] then | |
29 | - check = false | |
30 | - end | |
31 | - if dish.unlock_carbon > 0 and not hangPass[dish.unlock_carbon] then | |
32 | - check = false | |
33 | - end | |
34 | - if check then | |
35 | - table.insert(hotPool, index) | |
36 | - end | |
37 | - end | |
38 | - if #hotPool >= 2 then | |
39 | - local hot = "" | |
40 | - for n = 1, 2 do | |
41 | - local index = math.random(1, #hotPool) | |
42 | - hot = hot:setv(hotPool[index], 1) | |
43 | - table.remove(hotPool, index) | |
44 | - end | |
45 | - self:updateProperty({field = "hot", value = hot, notNotify = not notify}) | |
46 | - self:setProperty("hot", hot) | |
47 | - end | |
48 | 19 | -- 每日加速次数 |
49 | 20 | self:updateProperty({field = "expedite", value = 1, notNotify = not notify}) |
50 | 21 | self:setProperty("expedite", 1) |
... | ... | @@ -131,12 +102,6 @@ function Diner:calSellReward(sell, delta, dishData) |
131 | 102 | reward = reward:incrv(key, value * delta) |
132 | 103 | end |
133 | 104 | popular = popular + dishData.famous_normal * delta |
134 | - if sell.hot > 0 then | |
135 | - for key, value in pairs(dishData.item_popular:toNumMap()) do | |
136 | - reward = reward:incrv(key, value * delta) | |
137 | - end | |
138 | - popular = popular + dishData.famous_popular * delta | |
139 | - end | |
140 | 105 | |
141 | 106 | for buildType = 1, 6 do |
142 | 107 | local level = self:getProperty("buildL"):getv(buildType, 1) |
... | ... | @@ -174,9 +139,6 @@ function Diner:updateSell(slot, calOnly) |
174 | 139 | local deltaCount = 0 |
175 | 140 | local timePass = skynet.timex() - sell.time |
176 | 141 | local sellTime = dishData.sell_time |
177 | - if slot.hot then | |
178 | - sellTime = sellTime * dishData.popularity | |
179 | - end | |
180 | 142 | |
181 | 143 | deltaCount = math.floor(timePass / sellTime) |
182 | 144 | if deltaCount < sell.count then |
... | ... | @@ -190,7 +152,6 @@ function Diner:updateSell(slot, calOnly) |
190 | 152 | sells[slot].time = skynet.timex() - deltaTime |
191 | 153 | sells[slot].count = lastCount |
192 | 154 | sells[slot].level = self:getProperty("dishTree"):getv(sell.dish, 1) |
193 | - sells[slot].hot = self:getProperty("hot"):getv(sell.dish, 0) | |
194 | 155 | sells[slot].reward = reward |
195 | 156 | self:setProperty("sells", json.encode(sells)) |
196 | 157 | self:incrProperty("popular",popular) |
... | ... | @@ -215,9 +176,6 @@ function Diner:expediteSell(slot) |
215 | 176 | local expediteCount = 0 |
216 | 177 | local expediteTime = 7200 |
217 | 178 | local sellTime = dishData.sell_time |
218 | - if slot.hot then | |
219 | - sellTime = sellTime * dishData.popularity | |
220 | - end | |
221 | 179 | expediteCount = math.floor(expediteTime / sellTime) |
222 | 180 | expediteCount = math.min(expediteCount, sell.count) |
223 | 181 | local lastCount = sell.count - expediteCount |
... | ... | @@ -264,7 +222,7 @@ function Diner:getMaxDishs() |
264 | 222 | end |
265 | 223 | |
266 | 224 | function Diner:data() |
267 | - local properties = {"buildL", "order", "sells", "hot", "dishTree", "skillTree","popular","expedite","gTime"} | |
225 | + local properties = {"buildL", "order", "sells", "dishTree", "skillTree","popular","expedite","gTime"} | |
268 | 226 | local data = self:getProperties(properties) |
269 | 227 | return data |
270 | 228 | end | ... | ... |
src/models/RolePlugin.lua
... | ... | @@ -474,7 +474,7 @@ function RolePlugin.bind(Role) |
474 | 474 | function Role:delRunes(runeIds) -- 批量删除 {id, } |
475 | 475 | local roleId = self:getProperty('id') |
476 | 476 | local bDel = {} |
477 | - for _, runeId in paris(runeIds) do | |
477 | + for _, runeId in pairs(runeIds) do | |
478 | 478 | local rune = self.runeBag[runeId] |
479 | 479 | if rune and rune:getProperty("refer") == 0 then |
480 | 480 | self.runeBag[runeId] = nil | ... | ... |