Commit 40b19300e2ecb9cc128c9c35255db7ffdd39187e
1 parent
04da65df
电波塔激活加成效果后对各个系统的加成
Showing
9 changed files
with
77 additions
and
32 deletions
Show diff stats
src/GlobalVar.lua
src/actions/AdvAction.lua
| ... | ... | @@ -276,7 +276,9 @@ function _M.startHangRpc(agent, data) |
| 276 | 276 | if not adv_idle_time or not adv_idle_energy or not adv_idle_reward_coef then |
| 277 | 277 | return 2 |
| 278 | 278 | end |
| 279 | - adv_idle_time = adv_idle_time * 60 | |
| 279 | + local timeAdd = role:getBnousHangTime() | |
| 280 | + adv_idle_time = adv_idle_time * 60 + timeAdd | |
| 281 | + | |
| 280 | 282 | |
| 281 | 283 | local advHang = role:getProperty("advHang") |
| 282 | 284 | if advHang[chapterId] then return 3 end --正在挂机 |
| ... | ... | @@ -416,7 +418,8 @@ function _M.endHangRpc(agent, data) |
| 416 | 418 | if not adv_idle_time or not adv_idle_energy or not adv_idle_reward_coef then |
| 417 | 419 | return 2 |
| 418 | 420 | end |
| 419 | - adv_idle_time = adv_idle_time * 60 | |
| 421 | + local timeAdd = role:getBnousHangTime() | |
| 422 | + adv_idle_time = adv_idle_time * 60 + timeAdd | |
| 420 | 423 | |
| 421 | 424 | local reward, isFull, change, heroFaithMap |
| 422 | 425 | local heroCnt = 0 |
| ... | ... | @@ -463,6 +466,15 @@ function _M.endHangRpc(agent, data) |
| 463 | 466 | for itemId, count in pairs(idleReward) do |
| 464 | 467 | idleReward[itemId] = count * adv_idle_reward_coef |
| 465 | 468 | end |
| 469 | + | |
| 470 | + local bnousReward = role:getBnousAdv() | |
| 471 | + for time, set in pairs(bnousReward) do | |
| 472 | + local delta = math.floor(adv_idle_time / time) | |
| 473 | + for key, value in pairs(set) do | |
| 474 | + idleReward[key] = (idleReward[key] or 0) + value * delta | |
| 475 | + end | |
| 476 | + end | |
| 477 | + | |
| 466 | 478 | reward, change = role:award(idleReward, {log = {desc = "advHang", int1 = chapterId}}) |
| 467 | 479 | else |
| 468 | 480 | if cancel then | ... | ... |
src/actions/DinerAction.lua
| ... | ... | @@ -75,7 +75,8 @@ function _M.addSellRpc( agent, data ) |
| 75 | 75 | sells[slot].count = count |
| 76 | 76 | sells[slot].time = skynet.timex() - calSell.deltaTime |
| 77 | 77 | |
| 78 | - local needTime = sells[slot].count * dishData.sell_time + sells[slot].time - skynet.timex() | |
| 78 | + local timeSub = role:getBnousDiner(3,dishData.sell_time) | |
| 79 | + local needTime = sells[slot].count * (dishData.sell_time + timeSub) + sells[slot].time - skynet.timex() | |
| 79 | 80 | role:pushMsg({type = "food", slot = slot, time = needTime}) |
| 80 | 81 | |
| 81 | 82 | -- 检查解锁的顾客 |
| ... | ... | @@ -742,11 +743,15 @@ function _M.getGreenhouseRpc( agent, data ) |
| 742 | 743 | local now = skynet.timex() |
| 743 | 744 | local gfood = role.dinerData:getProperty("gfood") |
| 744 | 745 | if not next(gfood) then return end |
| 746 | + | |
| 747 | + local timeSub = role:getBnousDiner(1,buildingData.speed) | |
| 748 | + local timeAdd = role:getBnousDiner(2,globalCsv.diner_get_food_time_max) | |
| 749 | + | |
| 745 | 750 | for k , v in pairs(gfood) do |
| 746 | 751 | local itemId = v.id |
| 747 | 752 | local st = v.st |
| 748 | - local speed = globalCsv.diner_get_food_speed[csvdb["itemCsv"][itemId].quality] * buildingData.speed / 100 | |
| 749 | - local endTime = st + globalCsv.diner_get_food_time_max | |
| 753 | + local speed = globalCsv.diner_get_food_speed[csvdb["itemCsv"][itemId].quality] * (buildingData.speed + timeSub) / 100 | |
| 754 | + local endTime = st + globalCsv.diner_get_food_time_max + timeAdd | |
| 750 | 755 | local endTime2 = math.min(now, endTime) |
| 751 | 756 | reward[itemId] = math.floor((endTime2 - st) / speed) |
| 752 | 757 | if endTime2 == endTime then | ... | ... |
src/actions/HangAction.lua
| ... | ... | @@ -508,7 +508,7 @@ function _M.buyBonusCountRpc(agent, data) |
| 508 | 508 | return true |
| 509 | 509 | end |
| 510 | 510 | |
| 511 | -local function bonusWinReward(role, bonusData, rewardType, count) | |
| 511 | +local function bonusWinReward(role, bonusData, rewardType, count, sweep) | |
| 512 | 512 | count = count or 1 |
| 513 | 513 | |
| 514 | 514 | local reward, change = {} |
| ... | ... | @@ -548,6 +548,13 @@ local function bonusWinReward(role, bonusData, rewardType, count) |
| 548 | 548 | end |
| 549 | 549 | end |
| 550 | 550 | |
| 551 | + if sweep then | |
| 552 | + local bnousReward = role:getBnousSweep() | |
| 553 | + for key, value in pairs(bnousReward) do | |
| 554 | + reward[key] = (reward[key] or 0) + value * count | |
| 555 | + end | |
| 556 | + end | |
| 557 | + | |
| 551 | 558 | reward, change = role:award(reward, {log = {desc = "bonusBattle", int1 = bonusData.id}}) |
| 552 | 559 | role:checkTaskEnter("BonusPass", {id = bonusData.id, count = count}) |
| 553 | 560 | return reward, change |
| ... | ... | @@ -589,7 +596,7 @@ function _M.startBonusBattleRpc(agent, data) |
| 589 | 596 | bonusC[bonusData.type]["c"] = bonusC[bonusData.type]["c"] + count |
| 590 | 597 | role.dailyData:updateProperty({field = "bonusC", value = bonusC}) |
| 591 | 598 | |
| 592 | - local reward, change = bonusWinReward(role, bonusData, 3, count) | |
| 599 | + local reward, change = bonusWinReward(role, bonusData, 3, count, true) | |
| 593 | 600 | SendPacket(actionCodes.Hang_startBonusBattleRpc, MsgPack.pack({reward = reward, change = change})) |
| 594 | 601 | |
| 595 | 602 | role:checkTaskEnter("BonusQuick", {count = count}) | ... | ... |
src/actions/RadioAction.lua
| ... | ... | @@ -95,8 +95,9 @@ function _M.startQuestRpc(agent, data) |
| 95 | 95 | return 5 |
| 96 | 96 | end |
| 97 | 97 | -- start quest, set finish time |
| 98 | + local timeSub = role:getBnousCrusade(config.time) | |
| 98 | 99 | local taskData = {} |
| 99 | - taskData["time"] = skynet.timex() + config.time | |
| 100 | + taskData["time"] = skynet.timex() + config.time + timeSub | |
| 100 | 101 | taskData["heros"] = heros |
| 101 | 102 | radioTask[id] = taskData |
| 102 | 103 | role:updateProperty({field="radioTask", value=radioTask, notNotify=true}) | ... | ... |
src/models/Diner.lua
| ... | ... | @@ -188,6 +188,10 @@ function Diner:calSellReward(sell, delta, dishData) |
| 188 | 188 | local addReward = {} |
| 189 | 189 | for key, value in pairs(dishData.item_normal:toNumMap()) do |
| 190 | 190 | addReward[key] = (addReward[key] or 0) + value * delta |
| 191 | + if key == ItemId.Gold then | |
| 192 | + local goldPriceAdd = self.owner:getBnousDiner(4,value) | |
| 193 | + addReward[key] = addReward[key] + goldPriceAdd * delta | |
| 194 | + end | |
| 191 | 195 | end |
| 192 | 196 | |
| 193 | 197 | popular = dishData.famous_normal * delta |
| ... | ... | @@ -245,7 +249,7 @@ function Diner:updateSell(slot, calOnly) |
| 245 | 249 | local deltaTime = 0 |
| 246 | 250 | local deltaCount = 0 |
| 247 | 251 | local timePass = skynet.timex() - sell.time |
| 248 | - local sellTime = dishData.sell_time | |
| 252 | + local sellTime = dishData.sell_time + self.owner:getBnousDiner(3, dishData.sell_time) | |
| 249 | 253 | |
| 250 | 254 | deltaCount = math.floor(timePass / sellTime) |
| 251 | 255 | if deltaCount < sell.count then |
| ... | ... | @@ -284,7 +288,7 @@ function Diner:expediteSell(slot) |
| 284 | 288 | local dishData = csvdb["diner_dishCsv"][sell.dish][sell.level] |
| 285 | 289 | local expediteCount = 0 |
| 286 | 290 | local expediteTime = globalCsv.diner_sell_expediteTime |
| 287 | - local sellTime = dishData.sell_time | |
| 291 | + local sellTime = dishData.sell_time + self.owner:getBnousDiner(3,dishData.sell_time) | |
| 288 | 292 | expediteCount = math.floor(expediteTime / sellTime) |
| 289 | 293 | expediteCount = math.min(expediteCount, sell.count) |
| 290 | 294 | local lastCount = sell.count - expediteCount | ... | ... |
src/models/RoleLog.lua
src/models/RolePlugin.lua
| ... | ... | @@ -2159,8 +2159,6 @@ function RolePlugin.bind(Role) |
| 2159 | 2159 | return hero:getProperty("faith") |
| 2160 | 2160 | end |
| 2161 | 2161 | |
| 2162 | - -- 电波塔加成 开始 | |
| 2163 | - | |
| 2164 | 2162 | function Role:getTowerBnousActive(update) |
| 2165 | 2163 | if not update and self.towerBnousActive then |
| 2166 | 2164 | return self.towerBnousActive |
| ... | ... | @@ -2205,53 +2203,64 @@ function RolePlugin.bind(Role) |
| 2205 | 2203 | return self.towerBnousActive |
| 2206 | 2204 | end |
| 2207 | 2205 | |
| 2208 | - function Role:getTowerBnousBattleBuff() | |
| 2206 | + function Role:getDeltaValue(result, value) | |
| 2207 | + if not result then return 0 end | |
| 2208 | + local delta = 0 | |
| 2209 | + if result[1] and value then | |
| 2210 | + delta = math.floor(value * result[1] / 100) | |
| 2211 | + end | |
| 2212 | + if result[0] then | |
| 2213 | + delta = delta + result[0] | |
| 2214 | + end | |
| 2215 | + return delta | |
| 2216 | + end | |
| 2217 | + | |
| 2218 | + function Role:getBnousBattleBuff() | |
| 2209 | 2219 | local towerBnous = self:getTowerBnousActive() |
| 2210 | 2220 | return towerBnous[SystemBnousType.TowerBuff] |
| 2211 | 2221 | end |
| 2212 | 2222 | |
| 2213 | - function Role:getTowerBnousCrusade() | |
| 2223 | + function Role:getBnousCrusade(value) | |
| 2214 | 2224 | local towerBnous = self:getTowerBnousActive() |
| 2215 | - return towerBnous[SystemBnousType.CrusadeTask] | |
| 2225 | + return self:getDeltaValue(towerBnous[SystemBnousType.CrusadeTask], value) | |
| 2216 | 2226 | end |
| 2217 | 2227 | |
| 2218 | - function Role:getTowerBnousDiner(type) | |
| 2228 | + function Role:getBnousDiner(type, value) | |
| 2219 | 2229 | local towerBnous = self:getTowerBnousActive() |
| 2220 | 2230 | type = type or 1 |
| 2231 | + local result | |
| 2221 | 2232 | if type == 1 then |
| 2222 | - return towerBnous[SystemBnousType.DinerGet] | |
| 2233 | + result = towerBnous[SystemBnousType.DinerGet] | |
| 2223 | 2234 | elseif type == 2 then |
| 2224 | - return towerBnous[SystemBnousType.DinerLimit] | |
| 2235 | + result = towerBnous[SystemBnousType.DinerLimit] | |
| 2225 | 2236 | elseif type == 3 then |
| 2226 | - return towerBnous[SystemBnousType.DinerSell] | |
| 2237 | + result = towerBnous[SystemBnousType.DinerSell] | |
| 2227 | 2238 | elseif type == 4 then |
| 2228 | - return towerBnous[SystemBnousType.DinerPrice] | |
| 2239 | + result = towerBnous[SystemBnousType.DinerPrice] | |
| 2229 | 2240 | end |
| 2230 | - return | |
| 2241 | + return self:getDeltaValue(result, value) | |
| 2231 | 2242 | end |
| 2232 | 2243 | |
| 2233 | - function Role:getTowerBnousAdv() | |
| 2244 | + function Role:getBnousAdv() | |
| 2234 | 2245 | local towerBnous = self:getTowerBnousActive() |
| 2235 | - return towerBnous[SystemBnousType.Adv] | |
| 2246 | + return towerBnous[SystemBnousType.Adv] or {} | |
| 2236 | 2247 | end |
| 2237 | 2248 | |
| 2238 | - function Role:getTowerBnousHangTime() | |
| 2249 | + function Role:getBnousHangTime() | |
| 2239 | 2250 | local towerBnous = self:getTowerBnousActive() |
| 2240 | - return towerBnous[SystemBnousType.HangTime] | |
| 2251 | + return towerBnous[SystemBnousType.HangTime] or 0 | |
| 2241 | 2252 | end |
| 2242 | 2253 | |
| 2243 | - function Role:getTowerBnousPvpTicket() | |
| 2254 | + function Role:getBnousPvpTicket() | |
| 2244 | 2255 | local towerBnous = self:getTowerBnousActive() |
| 2245 | - return towerBnous[SystemBnousType.PvpTicket] | |
| 2256 | + return towerBnous[SystemBnousType.PvpTicket] or {} | |
| 2246 | 2257 | end |
| 2247 | 2258 | |
| 2248 | - function Role:getTowerBnousSweep() | |
| 2259 | + function Role:getBnousSweep() | |
| 2249 | 2260 | local towerBnous = self:getTowerBnousActive() |
| 2250 | - return towerBnous[SystemBnousType.SweepReward] | |
| 2261 | + return towerBnous[SystemBnousType.SweepReward] or {} | |
| 2251 | 2262 | end |
| 2252 | 2263 | |
| 2253 | - -- 电波塔加成 结束 | |
| 2254 | - | |
| 2255 | 2264 | end |
| 2256 | 2265 | |
| 2257 | 2266 | return RolePlugin |
| 2258 | 2267 | \ No newline at end of file | ... | ... |
src/models/RoleTimeReset.lua
| ... | ... | @@ -48,6 +48,12 @@ ResetFunc["CrossWeek"] = function(self, notify, response) |
| 48 | 48 | response.dinerS = {} |
| 49 | 49 | |
| 50 | 50 | self.activity:refreshWeekData(notify) |
| 51 | + | |
| 52 | + -- 跨周送一些道具 | |
| 53 | + local BnousReward = self:getBnousPvpTicket() | |
| 54 | + if next(BnousReward) then | |
| 55 | + local reward, change = self:award(BnousReward, {log = {desc = "towerBnous"}}) | |
| 56 | + end | |
| 51 | 57 | end |
| 52 | 58 | |
| 53 | 59 | ... | ... |