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,7 +128,7 @@ function _M.saleEquipRpc(agent, data ) | ||
| 128 | local backs = msg.backs | 128 | local backs = msg.backs |
| 129 | if not backs then return end | 129 | if not backs then return end |
| 130 | for id, count in pairs(backs) do | 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 | local typ = math.floor((id-7000)/100) | 132 | local typ = math.floor((id-7000)/100) |
| 133 | local lv = (id-7000)%100 | 133 | local lv = (id-7000)%100 |
| 134 | local own = role:getEquipCount(typ,lv) | 134 | local own = role:getEquipCount(typ,lv) |
| @@ -136,7 +136,7 @@ function _M.saleEquipRpc(agent, data ) | @@ -136,7 +136,7 @@ function _M.saleEquipRpc(agent, data ) | ||
| 136 | end | 136 | end |
| 137 | local reward = {} | 137 | local reward = {} |
| 138 | for id, count in pairs(backs) do | 138 | for id, count in pairs(backs) do |
| 139 | - local itemData = csvdb["ItemCsv"][id] | 139 | + local itemData = csvdb["itemCsv"][id] |
| 140 | local typ = math.floor((id-7000)/100) | 140 | local typ = math.floor((id-7000)/100) |
| 141 | local lv = (id-7000)%100 | 141 | local lv = (id-7000)%100 |
| 142 | role:addEquip(typ, lv, -count) -- 删掉装备 | 142 | role:addEquip(typ, lv, -count) -- 删掉装备 |
| @@ -158,11 +158,11 @@ function _M.saleRuneRpc(agent, data ) | @@ -158,11 +158,11 @@ function _M.saleRuneRpc(agent, data ) | ||
| 158 | if not backs then return end | 158 | if not backs then return end |
| 159 | 159 | ||
| 160 | local reward = {} | 160 | local reward = {} |
| 161 | - for _, id in pairs(backs) do | 161 | + for _, uid in pairs(backs) do |
| 162 | local rune = role.runeBag[uid] | 162 | local rune = role.runeBag[uid] |
| 163 | if not rune then return end | 163 | if not rune then return end |
| 164 | if rune:getProperty("refer") ~= 0 then return end | 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 | if not itemData then return end | 166 | if not itemData then return end |
| 167 | local one = itemData.sell_effect:toNumMap() | 167 | local one = itemData.sell_effect:toNumMap() |
| 168 | for k ,v in pairs(one) do | 168 | for k ,v in pairs(one) do |
src/actions/DinerAction.lua
| @@ -79,7 +79,6 @@ function _M.addSellRpc( agent, data ) | @@ -79,7 +79,6 @@ function _M.addSellRpc( agent, data ) | ||
| 79 | sells[slot].level = dishLevel | 79 | sells[slot].level = dishLevel |
| 80 | sells[slot].count = count | 80 | sells[slot].count = count |
| 81 | sells[slot].time = skynet.timex() - calSell.deltaTime | 81 | sells[slot].time = skynet.timex() - calSell.deltaTime |
| 82 | - sells[slot].hot = role.dinerData:getProperty("hot"):getv(sells[slot].dish, 0) | ||
| 83 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) | 82 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) |
| 84 | end | 83 | end |
| 85 | SendPacket(actionCodes.Diner_addSellRpc, "") | 84 | SendPacket(actionCodes.Diner_addSellRpc, "") |
src/models/Diner.lua
| @@ -8,7 +8,6 @@ Diner.schema = { | @@ -8,7 +8,6 @@ Diner.schema = { | ||
| 8 | buildL = {"string", ""}, -- 家具等级 1=1 2=1 3=1 | 8 | buildL = {"string", ""}, -- 家具等级 1=1 2=1 3=1 |
| 9 | order = {"string", "[]"}, -- 特殊订单 | 9 | order = {"string", "[]"}, -- 特殊订单 |
| 10 | sells = {"string", "[]"}, -- 贩卖位置 | 10 | sells = {"string", "[]"}, -- 贩卖位置 |
| 11 | - hot = {"string", ""}, -- 今日热门 | ||
| 12 | dishTree = {"string", "1=1 101=1 201=1"}, -- 料理天赋 | 11 | dishTree = {"string", "1=1 101=1 201=1"}, -- 料理天赋 |
| 13 | skillTree = {"string", ""}, -- 支援天赋 | 12 | skillTree = {"string", ""}, -- 支援天赋 |
| 14 | popular = {"number",0}, -- 累计人气 | 13 | popular = {"number",0}, -- 累计人气 |
| @@ -17,34 +16,6 @@ Diner.schema = { | @@ -17,34 +16,6 @@ Diner.schema = { | ||
| 17 | } | 16 | } |
| 18 | 17 | ||
| 19 | function Diner:refreshDailyData(notify) | 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 | self:updateProperty({field = "expedite", value = 1, notNotify = not notify}) | 20 | self:updateProperty({field = "expedite", value = 1, notNotify = not notify}) |
| 50 | self:setProperty("expedite", 1) | 21 | self:setProperty("expedite", 1) |
| @@ -131,12 +102,6 @@ function Diner:calSellReward(sell, delta, dishData) | @@ -131,12 +102,6 @@ function Diner:calSellReward(sell, delta, dishData) | ||
| 131 | reward = reward:incrv(key, value * delta) | 102 | reward = reward:incrv(key, value * delta) |
| 132 | end | 103 | end |
| 133 | popular = popular + dishData.famous_normal * delta | 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 | for buildType = 1, 6 do | 106 | for buildType = 1, 6 do |
| 142 | local level = self:getProperty("buildL"):getv(buildType, 1) | 107 | local level = self:getProperty("buildL"):getv(buildType, 1) |
| @@ -174,9 +139,6 @@ function Diner:updateSell(slot, calOnly) | @@ -174,9 +139,6 @@ function Diner:updateSell(slot, calOnly) | ||
| 174 | local deltaCount = 0 | 139 | local deltaCount = 0 |
| 175 | local timePass = skynet.timex() - sell.time | 140 | local timePass = skynet.timex() - sell.time |
| 176 | local sellTime = dishData.sell_time | 141 | local sellTime = dishData.sell_time |
| 177 | - if slot.hot then | ||
| 178 | - sellTime = sellTime * dishData.popularity | ||
| 179 | - end | ||
| 180 | 142 | ||
| 181 | deltaCount = math.floor(timePass / sellTime) | 143 | deltaCount = math.floor(timePass / sellTime) |
| 182 | if deltaCount < sell.count then | 144 | if deltaCount < sell.count then |
| @@ -190,7 +152,6 @@ function Diner:updateSell(slot, calOnly) | @@ -190,7 +152,6 @@ function Diner:updateSell(slot, calOnly) | ||
| 190 | sells[slot].time = skynet.timex() - deltaTime | 152 | sells[slot].time = skynet.timex() - deltaTime |
| 191 | sells[slot].count = lastCount | 153 | sells[slot].count = lastCount |
| 192 | sells[slot].level = self:getProperty("dishTree"):getv(sell.dish, 1) | 154 | sells[slot].level = self:getProperty("dishTree"):getv(sell.dish, 1) |
| 193 | - sells[slot].hot = self:getProperty("hot"):getv(sell.dish, 0) | ||
| 194 | sells[slot].reward = reward | 155 | sells[slot].reward = reward |
| 195 | self:setProperty("sells", json.encode(sells)) | 156 | self:setProperty("sells", json.encode(sells)) |
| 196 | self:incrProperty("popular",popular) | 157 | self:incrProperty("popular",popular) |
| @@ -215,9 +176,6 @@ function Diner:expediteSell(slot) | @@ -215,9 +176,6 @@ function Diner:expediteSell(slot) | ||
| 215 | local expediteCount = 0 | 176 | local expediteCount = 0 |
| 216 | local expediteTime = 7200 | 177 | local expediteTime = 7200 |
| 217 | local sellTime = dishData.sell_time | 178 | local sellTime = dishData.sell_time |
| 218 | - if slot.hot then | ||
| 219 | - sellTime = sellTime * dishData.popularity | ||
| 220 | - end | ||
| 221 | expediteCount = math.floor(expediteTime / sellTime) | 179 | expediteCount = math.floor(expediteTime / sellTime) |
| 222 | expediteCount = math.min(expediteCount, sell.count) | 180 | expediteCount = math.min(expediteCount, sell.count) |
| 223 | local lastCount = sell.count - expediteCount | 181 | local lastCount = sell.count - expediteCount |
| @@ -264,7 +222,7 @@ function Diner:getMaxDishs() | @@ -264,7 +222,7 @@ function Diner:getMaxDishs() | ||
| 264 | end | 222 | end |
| 265 | 223 | ||
| 266 | function Diner:data() | 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 | local data = self:getProperties(properties) | 226 | local data = self:getProperties(properties) |
| 269 | return data | 227 | return data |
| 270 | end | 228 | end |
src/models/RolePlugin.lua
| @@ -474,7 +474,7 @@ function RolePlugin.bind(Role) | @@ -474,7 +474,7 @@ function RolePlugin.bind(Role) | ||
| 474 | function Role:delRunes(runeIds) -- 批量删除 {id, } | 474 | function Role:delRunes(runeIds) -- 批量删除 {id, } |
| 475 | local roleId = self:getProperty('id') | 475 | local roleId = self:getProperty('id') |
| 476 | local bDel = {} | 476 | local bDel = {} |
| 477 | - for _, runeId in paris(runeIds) do | 477 | + for _, runeId in pairs(runeIds) do |
| 478 | local rune = self.runeBag[runeId] | 478 | local rune = self.runeBag[runeId] |
| 479 | if rune and rune:getProperty("refer") == 0 then | 479 | if rune and rune:getProperty("refer") == 0 then |
| 480 | self.runeBag[runeId] = nil | 480 | self.runeBag[runeId] = nil |