Commit bab9a167493149c5883b28c5227d75f042a018db
1 parent
6beca974
电波塔加成错误
Showing
3 changed files
with
28 additions
and
27 deletions
Show diff stats
src/actions/AdvAction.lua
@@ -276,8 +276,7 @@ function _M.startHangRpc(agent, data) | @@ -276,8 +276,7 @@ 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 | - local timeAdd = role:getBnousHangTime() | ||
280 | - adv_idle_time = adv_idle_time * 60 + timeAdd | 279 | + adv_idle_time = adv_idle_time * 60 |
281 | 280 | ||
282 | 281 | ||
283 | local advHang = role:getProperty("advHang") | 282 | local advHang = role:getProperty("advHang") |
@@ -418,8 +417,7 @@ function _M.endHangRpc(agent, data) | @@ -418,8 +417,7 @@ function _M.endHangRpc(agent, data) | ||
418 | if not adv_idle_time or not adv_idle_energy or not adv_idle_reward_coef then | 417 | if not adv_idle_time or not adv_idle_energy or not adv_idle_reward_coef then |
419 | return 2 | 418 | return 2 |
420 | end | 419 | end |
421 | - local timeAdd = role:getBnousHangTime() | ||
422 | - adv_idle_time = adv_idle_time * 60 + timeAdd | 420 | + adv_idle_time = adv_idle_time * 60 |
423 | 421 | ||
424 | local reward, isFull, change, heroFaithMap | 422 | local reward, isFull, change, heroFaithMap |
425 | local heroCnt = 0 | 423 | local heroCnt = 0 |
src/actions/HangAction.lua
@@ -381,8 +381,9 @@ function _M.getRewardRpc(agent , data) | @@ -381,8 +381,9 @@ function _M.getRewardRpc(agent , data) | ||
381 | table.clear(items) | 381 | table.clear(items) |
382 | local hangInfo = role:getProperty("hangInfo") | 382 | local hangInfo = role:getProperty("hangInfo") |
383 | local nowTime = skynet.timex() | 383 | local nowTime = skynet.timex() |
384 | - hangInfo.endItemTime = nowTime + globalCsv.idle_producetime_max | ||
385 | - hangInfo.endCoinTime = nowTime + globalCsv.idle_producetime_max | 384 | + local timeAdd = role:getBnousHangTime() |
385 | + hangInfo.endItemTime = nowTime + globalCsv.idle_producetime_max + timeAdd | ||
386 | + hangInfo.endCoinTime = nowTime + globalCsv.idle_producetime_max + timeAdd | ||
386 | hangInfo.coinTime = nowTime | 387 | hangInfo.coinTime = nowTime |
387 | hangInfo.itemTime = nowTime | 388 | hangInfo.itemTime = nowTime |
388 | role:updateProperty({field = "hangBag", value = items}) | 389 | role:updateProperty({field = "hangBag", value = items}) |
src/models/RolePlugin.lua
@@ -2191,29 +2191,31 @@ function RolePlugin.bind(Role) | @@ -2191,29 +2191,31 @@ function RolePlugin.bind(Role) | ||
2191 | for towerIdx, Set in pairs(towerBnous) do | 2191 | for towerIdx, Set in pairs(towerBnous) do |
2192 | for id, _ in pairs(Set) do | 2192 | for id, _ in pairs(Set) do |
2193 | local data = bnousCsv[towerIdx][id] | 2193 | local data = bnousCsv[towerIdx][id] |
2194 | - local effects = data.effect:toTableArraySec() | ||
2195 | - for _, effect in pairs(effects) do | ||
2196 | - local pm1, pm2, pm3, pm4 = tonumber(effect[1]), tonumber(effect[2]), tonumber(effect[3]), tonumber(effect[4]) | ||
2197 | - if not self.towerBnousActive[pm1] then | ||
2198 | - self.towerBnousActive[pm1] = {} | ||
2199 | - end | ||
2200 | - if pm1 == SystemBnousType.TowerBuff then | ||
2201 | - if not self.towerBnousActive[pm1][pm2] then | ||
2202 | - self.towerBnousActive[pm1][pm2] = {} | ||
2203 | - end | ||
2204 | - table.insert(self.towerBnousActive[pm1][pm2],pm3) | ||
2205 | - elseif pm1 == SystemBnousType.Adv then | ||
2206 | - if not self.towerBnousActive[pm1][pm4] then | ||
2207 | - self.towerBnousActive[pm1][pm4] = {} | 2194 | + if data then |
2195 | + local effects = data.effect:toTableArraySec() | ||
2196 | + for _, effect in pairs(effects) do | ||
2197 | + local pm1, pm2, pm3, pm4 = tonumber(effect[1]), tonumber(effect[2]), tonumber(effect[3]), tonumber(effect[4]) | ||
2198 | + if not self.towerBnousActive[pm1] then | ||
2199 | + self.towerBnousActive[pm1] = {} | ||
2208 | end | 2200 | end |
2209 | - self.towerBnousActive[pm1][pm4][pm2] = (self.towerBnousActive[pm1][pm4][pm2] or 0) + pm3 | ||
2210 | - elseif pm1 == SystemBnousType.HangTime then | ||
2211 | - if type(self.towerBnousActive[pm1]) == "table" then | ||
2212 | - self.towerBnousActive[pm1] = 0 | 2201 | + if pm1 == SystemBnousType.TowerBuff then |
2202 | + if not self.towerBnousActive[pm1][pm2] then | ||
2203 | + self.towerBnousActive[pm1][pm2] = {} | ||
2204 | + end | ||
2205 | + table.insert(self.towerBnousActive[pm1][pm2],pm3) | ||
2206 | + elseif pm1 == SystemBnousType.Adv then | ||
2207 | + if not self.towerBnousActive[pm1][pm4] then | ||
2208 | + self.towerBnousActive[pm1][pm4] = {} | ||
2209 | + end | ||
2210 | + self.towerBnousActive[pm1][pm4][pm2] = (self.towerBnousActive[pm1][pm4][pm2] or 0) + pm3 | ||
2211 | + elseif pm1 == SystemBnousType.HangTime then | ||
2212 | + if type(self.towerBnousActive[pm1]) == "table" then | ||
2213 | + self.towerBnousActive[pm1] = 0 | ||
2214 | + end | ||
2215 | + self.towerBnousActive[pm1] = self.towerBnousActive[pm1] + pm2 | ||
2216 | + else | ||
2217 | + self.towerBnousActive[pm1][pm2] = (self.towerBnousActive[pm1][pm2] or 0) + pm3 | ||
2213 | end | 2218 | end |
2214 | - self.towerBnousActive[pm1] = self.towerBnousActive[pm1] + pm2 | ||
2215 | - else | ||
2216 | - self.towerBnousActive[pm1][pm2] = (self.towerBnousActive[pm1][pm2] or 0) + pm3 | ||
2217 | end | 2219 | end |
2218 | end | 2220 | end |
2219 | end | 2221 | end |