Commit 40b19300e2ecb9cc128c9c35255db7ffdd39187e
1 parent
04da65df
电波塔激活加成效果后对各个系统的加成
Showing
9 changed files
with
77 additions
and
32 deletions
Show diff stats
src/GlobalVar.lua
@@ -389,5 +389,5 @@ SystemBnousType = { | @@ -389,5 +389,5 @@ SystemBnousType = { | ||
389 | Adv = 7, -- 代理拾荒获得额外道具 | 389 | Adv = 7, -- 代理拾荒获得额外道具 |
390 | HangTime = 8, -- 挂机时间上限 | 390 | HangTime = 8, -- 挂机时间上限 |
391 | PvpTicket = 9, -- 每周额外获得竞技场门票数量 | 391 | PvpTicket = 9, -- 每周额外获得竞技场门票数量 |
392 | - SweepReward = 10, -- 每次扫荡额外获得道具 | 392 | + SweepReward = 10, -- 奖励关卡每次扫荡额外获得道具 |
393 | } | 393 | } |
src/actions/AdvAction.lua
@@ -276,7 +276,9 @@ function _M.startHangRpc(agent, data) | @@ -276,7 +276,9 @@ function _M.startHangRpc(agent, data) | ||
276 | if not adv_idle_time or not adv_idle_energy or not adv_idle_reward_coef then | 276 | if not adv_idle_time or not adv_idle_energy or not adv_idle_reward_coef then |
277 | return 2 | 277 | return 2 |
278 | end | 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 | local advHang = role:getProperty("advHang") | 283 | local advHang = role:getProperty("advHang") |
282 | if advHang[chapterId] then return 3 end --正在挂机 | 284 | if advHang[chapterId] then return 3 end --正在挂机 |
@@ -416,7 +418,8 @@ function _M.endHangRpc(agent, data) | @@ -416,7 +418,8 @@ function _M.endHangRpc(agent, data) | ||
416 | if not adv_idle_time or not adv_idle_energy or not adv_idle_reward_coef then | 418 | if not adv_idle_time or not adv_idle_energy or not adv_idle_reward_coef then |
417 | return 2 | 419 | return 2 |
418 | end | 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 | local reward, isFull, change, heroFaithMap | 424 | local reward, isFull, change, heroFaithMap |
422 | local heroCnt = 0 | 425 | local heroCnt = 0 |
@@ -463,6 +466,15 @@ function _M.endHangRpc(agent, data) | @@ -463,6 +466,15 @@ function _M.endHangRpc(agent, data) | ||
463 | for itemId, count in pairs(idleReward) do | 466 | for itemId, count in pairs(idleReward) do |
464 | idleReward[itemId] = count * adv_idle_reward_coef | 467 | idleReward[itemId] = count * adv_idle_reward_coef |
465 | end | 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 | reward, change = role:award(idleReward, {log = {desc = "advHang", int1 = chapterId}}) | 478 | reward, change = role:award(idleReward, {log = {desc = "advHang", int1 = chapterId}}) |
467 | else | 479 | else |
468 | if cancel then | 480 | if cancel then |
src/actions/DinerAction.lua
@@ -75,7 +75,8 @@ function _M.addSellRpc( agent, data ) | @@ -75,7 +75,8 @@ function _M.addSellRpc( agent, data ) | ||
75 | sells[slot].count = count | 75 | sells[slot].count = count |
76 | sells[slot].time = skynet.timex() - calSell.deltaTime | 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 | role:pushMsg({type = "food", slot = slot, time = needTime}) | 80 | role:pushMsg({type = "food", slot = slot, time = needTime}) |
80 | 81 | ||
81 | -- 检查解锁的顾客 | 82 | -- 检查解锁的顾客 |
@@ -742,11 +743,15 @@ function _M.getGreenhouseRpc( agent, data ) | @@ -742,11 +743,15 @@ function _M.getGreenhouseRpc( agent, data ) | ||
742 | local now = skynet.timex() | 743 | local now = skynet.timex() |
743 | local gfood = role.dinerData:getProperty("gfood") | 744 | local gfood = role.dinerData:getProperty("gfood") |
744 | if not next(gfood) then return end | 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 | for k , v in pairs(gfood) do | 750 | for k , v in pairs(gfood) do |
746 | local itemId = v.id | 751 | local itemId = v.id |
747 | local st = v.st | 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 | local endTime2 = math.min(now, endTime) | 755 | local endTime2 = math.min(now, endTime) |
751 | reward[itemId] = math.floor((endTime2 - st) / speed) | 756 | reward[itemId] = math.floor((endTime2 - st) / speed) |
752 | if endTime2 == endTime then | 757 | if endTime2 == endTime then |
src/actions/HangAction.lua
@@ -508,7 +508,7 @@ function _M.buyBonusCountRpc(agent, data) | @@ -508,7 +508,7 @@ function _M.buyBonusCountRpc(agent, data) | ||
508 | return true | 508 | return true |
509 | end | 509 | end |
510 | 510 | ||
511 | -local function bonusWinReward(role, bonusData, rewardType, count) | 511 | +local function bonusWinReward(role, bonusData, rewardType, count, sweep) |
512 | count = count or 1 | 512 | count = count or 1 |
513 | 513 | ||
514 | local reward, change = {} | 514 | local reward, change = {} |
@@ -548,6 +548,13 @@ local function bonusWinReward(role, bonusData, rewardType, count) | @@ -548,6 +548,13 @@ local function bonusWinReward(role, bonusData, rewardType, count) | ||
548 | end | 548 | end |
549 | end | 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 | reward, change = role:award(reward, {log = {desc = "bonusBattle", int1 = bonusData.id}}) | 558 | reward, change = role:award(reward, {log = {desc = "bonusBattle", int1 = bonusData.id}}) |
552 | role:checkTaskEnter("BonusPass", {id = bonusData.id, count = count}) | 559 | role:checkTaskEnter("BonusPass", {id = bonusData.id, count = count}) |
553 | return reward, change | 560 | return reward, change |
@@ -589,7 +596,7 @@ function _M.startBonusBattleRpc(agent, data) | @@ -589,7 +596,7 @@ function _M.startBonusBattleRpc(agent, data) | ||
589 | bonusC[bonusData.type]["c"] = bonusC[bonusData.type]["c"] + count | 596 | bonusC[bonusData.type]["c"] = bonusC[bonusData.type]["c"] + count |
590 | role.dailyData:updateProperty({field = "bonusC", value = bonusC}) | 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 | SendPacket(actionCodes.Hang_startBonusBattleRpc, MsgPack.pack({reward = reward, change = change})) | 600 | SendPacket(actionCodes.Hang_startBonusBattleRpc, MsgPack.pack({reward = reward, change = change})) |
594 | 601 | ||
595 | role:checkTaskEnter("BonusQuick", {count = count}) | 602 | role:checkTaskEnter("BonusQuick", {count = count}) |
src/actions/RadioAction.lua
@@ -95,8 +95,9 @@ function _M.startQuestRpc(agent, data) | @@ -95,8 +95,9 @@ function _M.startQuestRpc(agent, data) | ||
95 | return 5 | 95 | return 5 |
96 | end | 96 | end |
97 | -- start quest, set finish time | 97 | -- start quest, set finish time |
98 | + local timeSub = role:getBnousCrusade(config.time) | ||
98 | local taskData = {} | 99 | local taskData = {} |
99 | - taskData["time"] = skynet.timex() + config.time | 100 | + taskData["time"] = skynet.timex() + config.time + timeSub |
100 | taskData["heros"] = heros | 101 | taskData["heros"] = heros |
101 | radioTask[id] = taskData | 102 | radioTask[id] = taskData |
102 | role:updateProperty({field="radioTask", value=radioTask, notNotify=true}) | 103 | role:updateProperty({field="radioTask", value=radioTask, notNotify=true}) |
src/models/Diner.lua
@@ -188,6 +188,10 @@ function Diner:calSellReward(sell, delta, dishData) | @@ -188,6 +188,10 @@ function Diner:calSellReward(sell, delta, dishData) | ||
188 | local addReward = {} | 188 | local addReward = {} |
189 | for key, value in pairs(dishData.item_normal:toNumMap()) do | 189 | for key, value in pairs(dishData.item_normal:toNumMap()) do |
190 | addReward[key] = (addReward[key] or 0) + value * delta | 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 | end | 195 | end |
192 | 196 | ||
193 | popular = dishData.famous_normal * delta | 197 | popular = dishData.famous_normal * delta |
@@ -245,7 +249,7 @@ function Diner:updateSell(slot, calOnly) | @@ -245,7 +249,7 @@ function Diner:updateSell(slot, calOnly) | ||
245 | local deltaTime = 0 | 249 | local deltaTime = 0 |
246 | local deltaCount = 0 | 250 | local deltaCount = 0 |
247 | local timePass = skynet.timex() - sell.time | 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 | deltaCount = math.floor(timePass / sellTime) | 254 | deltaCount = math.floor(timePass / sellTime) |
251 | if deltaCount < sell.count then | 255 | if deltaCount < sell.count then |
@@ -284,7 +288,7 @@ function Diner:expediteSell(slot) | @@ -284,7 +288,7 @@ function Diner:expediteSell(slot) | ||
284 | local dishData = csvdb["diner_dishCsv"][sell.dish][sell.level] | 288 | local dishData = csvdb["diner_dishCsv"][sell.dish][sell.level] |
285 | local expediteCount = 0 | 289 | local expediteCount = 0 |
286 | local expediteTime = globalCsv.diner_sell_expediteTime | 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 | expediteCount = math.floor(expediteTime / sellTime) | 292 | expediteCount = math.floor(expediteTime / sellTime) |
289 | expediteCount = math.min(expediteCount, sell.count) | 293 | expediteCount = math.min(expediteCount, sell.count) |
290 | local lastCount = sell.count - expediteCount | 294 | local lastCount = sell.count - expediteCount |
src/models/RoleLog.lua
@@ -57,6 +57,7 @@ local ItemReason = { | @@ -57,6 +57,7 @@ local ItemReason = { | ||
57 | actBuyBpLevel = 141, -- 购买活动战令等级 | 57 | actBuyBpLevel = 141, -- 购买活动战令等级 |
58 | newSign = 142,-- 新的活动签到 | 58 | newSign = 142,-- 新的活动签到 |
59 | advLevelStage = 143, -- 拾荒活动阶段奖励 | 59 | advLevelStage = 143, -- 拾荒活动阶段奖励 |
60 | + towerBnous = 144, -- 爬塔到一定层数对某些功能的奖励 | ||
60 | 61 | ||
61 | 62 | ||
62 | advHang = 301, -- 拾荒挂机 | 63 | advHang = 301, -- 拾荒挂机 |
src/models/RolePlugin.lua
@@ -2159,8 +2159,6 @@ function RolePlugin.bind(Role) | @@ -2159,8 +2159,6 @@ function RolePlugin.bind(Role) | ||
2159 | return hero:getProperty("faith") | 2159 | return hero:getProperty("faith") |
2160 | end | 2160 | end |
2161 | 2161 | ||
2162 | - -- 电波塔加成 开始 | ||
2163 | - | ||
2164 | function Role:getTowerBnousActive(update) | 2162 | function Role:getTowerBnousActive(update) |
2165 | if not update and self.towerBnousActive then | 2163 | if not update and self.towerBnousActive then |
2166 | return self.towerBnousActive | 2164 | return self.towerBnousActive |
@@ -2205,53 +2203,64 @@ function RolePlugin.bind(Role) | @@ -2205,53 +2203,64 @@ function RolePlugin.bind(Role) | ||
2205 | return self.towerBnousActive | 2203 | return self.towerBnousActive |
2206 | end | 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 | local towerBnous = self:getTowerBnousActive() | 2219 | local towerBnous = self:getTowerBnousActive() |
2210 | return towerBnous[SystemBnousType.TowerBuff] | 2220 | return towerBnous[SystemBnousType.TowerBuff] |
2211 | end | 2221 | end |
2212 | 2222 | ||
2213 | - function Role:getTowerBnousCrusade() | 2223 | + function Role:getBnousCrusade(value) |
2214 | local towerBnous = self:getTowerBnousActive() | 2224 | local towerBnous = self:getTowerBnousActive() |
2215 | - return towerBnous[SystemBnousType.CrusadeTask] | 2225 | + return self:getDeltaValue(towerBnous[SystemBnousType.CrusadeTask], value) |
2216 | end | 2226 | end |
2217 | 2227 | ||
2218 | - function Role:getTowerBnousDiner(type) | 2228 | + function Role:getBnousDiner(type, value) |
2219 | local towerBnous = self:getTowerBnousActive() | 2229 | local towerBnous = self:getTowerBnousActive() |
2220 | type = type or 1 | 2230 | type = type or 1 |
2231 | + local result | ||
2221 | if type == 1 then | 2232 | if type == 1 then |
2222 | - return towerBnous[SystemBnousType.DinerGet] | 2233 | + result = towerBnous[SystemBnousType.DinerGet] |
2223 | elseif type == 2 then | 2234 | elseif type == 2 then |
2224 | - return towerBnous[SystemBnousType.DinerLimit] | 2235 | + result = towerBnous[SystemBnousType.DinerLimit] |
2225 | elseif type == 3 then | 2236 | elseif type == 3 then |
2226 | - return towerBnous[SystemBnousType.DinerSell] | 2237 | + result = towerBnous[SystemBnousType.DinerSell] |
2227 | elseif type == 4 then | 2238 | elseif type == 4 then |
2228 | - return towerBnous[SystemBnousType.DinerPrice] | 2239 | + result = towerBnous[SystemBnousType.DinerPrice] |
2229 | end | 2240 | end |
2230 | - return | 2241 | + return self:getDeltaValue(result, value) |
2231 | end | 2242 | end |
2232 | 2243 | ||
2233 | - function Role:getTowerBnousAdv() | 2244 | + function Role:getBnousAdv() |
2234 | local towerBnous = self:getTowerBnousActive() | 2245 | local towerBnous = self:getTowerBnousActive() |
2235 | - return towerBnous[SystemBnousType.Adv] | 2246 | + return towerBnous[SystemBnousType.Adv] or {} |
2236 | end | 2247 | end |
2237 | 2248 | ||
2238 | - function Role:getTowerBnousHangTime() | 2249 | + function Role:getBnousHangTime() |
2239 | local towerBnous = self:getTowerBnousActive() | 2250 | local towerBnous = self:getTowerBnousActive() |
2240 | - return towerBnous[SystemBnousType.HangTime] | 2251 | + return towerBnous[SystemBnousType.HangTime] or 0 |
2241 | end | 2252 | end |
2242 | 2253 | ||
2243 | - function Role:getTowerBnousPvpTicket() | 2254 | + function Role:getBnousPvpTicket() |
2244 | local towerBnous = self:getTowerBnousActive() | 2255 | local towerBnous = self:getTowerBnousActive() |
2245 | - return towerBnous[SystemBnousType.PvpTicket] | 2256 | + return towerBnous[SystemBnousType.PvpTicket] or {} |
2246 | end | 2257 | end |
2247 | 2258 | ||
2248 | - function Role:getTowerBnousSweep() | 2259 | + function Role:getBnousSweep() |
2249 | local towerBnous = self:getTowerBnousActive() | 2260 | local towerBnous = self:getTowerBnousActive() |
2250 | - return towerBnous[SystemBnousType.SweepReward] | 2261 | + return towerBnous[SystemBnousType.SweepReward] or {} |
2251 | end | 2262 | end |
2252 | 2263 | ||
2253 | - -- 电波塔加成 结束 | ||
2254 | - | ||
2255 | end | 2264 | end |
2256 | 2265 | ||
2257 | return RolePlugin | 2266 | return RolePlugin |
2258 | \ No newline at end of file | 2267 | \ No newline at end of file |
src/models/RoleTimeReset.lua
@@ -48,6 +48,12 @@ ResetFunc["CrossWeek"] = function(self, notify, response) | @@ -48,6 +48,12 @@ ResetFunc["CrossWeek"] = function(self, notify, response) | ||
48 | response.dinerS = {} | 48 | response.dinerS = {} |
49 | 49 | ||
50 | self.activity:refreshWeekData(notify) | 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 | end | 57 | end |
52 | 58 | ||
53 | 59 |