Commit 650e90d5baf92c7d9b7a133b3c4e80f8df564504
Merge branch 'bugfix' into tr/cb
* bugfix: 初始化冒险重置时间 被动新 扣层数 被动 取消
Showing
4 changed files
with
19 additions
and
4 deletions
Show diff stats
src/adv/AdvPassive.lua
| ... | ... | @@ -119,6 +119,7 @@ Passive.AFTER_ROUND = 27 --经过 x回合时 |
| 119 | 119 | Passive.GET_BUFF = 28 --获得指定buff |
| 120 | 120 | Passive.OPEN_BLOCK = 29 --翻开格子 |
| 121 | 121 | Passive.OPEN_MONSTER = 30 --翻开怪物 |
| 122 | +Passive.PLAYER_BUFF = 31 --玩家获得buff | |
| 122 | 123 | |
| 123 | 124 | |
| 124 | 125 | -- 不同的开启条件 |
| ... | ... | @@ -180,6 +181,7 @@ PassiveCondFactory[Passive.GET_BUFF] = function(_Passive) |
| 180 | 181 | end |
| 181 | 182 | end |
| 182 | 183 | end |
| 184 | +PassiveCondFactory[Passive.PLAYER_BUFF] = PassiveCondFactory[Passive.GET_BUFF] | |
| 183 | 185 | |
| 184 | 186 | |
| 185 | 187 | PassiveCondFactory[Passive.BORN_ONCE] = function(_Passive) |
| ... | ... | @@ -304,7 +306,8 @@ function Passive:canEffect(effType, effValue) |
| 304 | 306 | end |
| 305 | 307 | --禁用被动技 |
| 306 | 308 | local count = self.owner:getDisablePassiveCount() |
| 307 | - if count and (count == 0 or self.owner:getPassiveIdx(self) <= count) then | |
| 309 | + local idx = self.owner:getPassiveIdx(self) | |
| 310 | + if count and idx and (count == 0 or idx <= count) then | |
| 308 | 311 | return |
| 309 | 312 | end |
| 310 | 313 | return true | ... | ... |
src/adv/AdvPlayer.lua
| ... | ... | @@ -115,10 +115,13 @@ end |
| 115 | 115 | function BaseObject:getPassiveIdx(passive) |
| 116 | 116 | for idx, passive_ in ipairs(self.passives) do |
| 117 | 117 | if passive_ == passive then |
| 118 | - return idx | |
| 118 | + if passive.passiveData.dispel ~= 1 then | |
| 119 | + return idx | |
| 120 | + end | |
| 121 | + return | |
| 119 | 122 | end |
| 120 | 123 | end |
| 121 | - return 999 | |
| 124 | + return | |
| 122 | 125 | end |
| 123 | 126 | |
| 124 | 127 | function BaseObject:getDisablePassiveCount() |
| ... | ... | @@ -667,6 +670,7 @@ function Player:effectBattleBuff() |
| 667 | 670 | for _, buff in ipairs(self.buffs) do |
| 668 | 671 | if not buff:isHide() and (buff:getType() == Buff.BATTLE_BUFF or buff:getType() == Buff.BATTLE_PASSIVE) then |
| 669 | 672 | buff:effect() |
| 673 | + buff:uncover() | |
| 670 | 674 | end |
| 671 | 675 | end |
| 672 | 676 | end |
| ... | ... | @@ -692,6 +696,7 @@ function Player:addBuff(buffId, releaser) |
| 692 | 696 | self.battle.player:attrChangeCondBuffCheck(2, buffId) |
| 693 | 697 | self.battle.adv:checkAchievement(self.battle.adv.AchievType.GetBuff, 1, buffId) |
| 694 | 698 | self.battle.adv:pushBackEvent(AdvBackEventType.Buff, {buffId = buffId}) |
| 699 | + self.battle:triggerPassive(Passive.PLAYER_BUFF, {buffId = buffId}) | |
| 695 | 700 | end |
| 696 | 701 | return status |
| 697 | 702 | end | ... | ... |
src/models/Role.lua
| ... | ... | @@ -29,6 +29,13 @@ function Role:ctor( properties ) |
| 29 | 29 | self.activity = nil |
| 30 | 30 | self.advElChapter = tonum(redisproxy:hget("adv_season", "chapter"), globalCsv.adv_endless_default_chapter) -- 无尽模式记录的赛季对应章节 |
| 31 | 31 | self.advOverTime = tonum(redisproxy:hget("adv_season", "overTime")) -- 无尽模式关闭时间戳 |
| 32 | + if self.advOverTime == 0 then | |
| 33 | + local now = skynet.timex() | |
| 34 | + if math.floor(now / (3600 * 24 * 7)) % 2 == 1 then | |
| 35 | + self.advOverTime = 3600 * 24 * 7 | |
| 36 | + end | |
| 37 | + self.advOverTime = self.advOverTime + specMonday(now) + 3600 * 24 * 6 | |
| 38 | + end | |
| 32 | 39 | self.sendMailFlag = false --发送邮件标识 |
| 33 | 40 | end |
| 34 | 41 | ... | ... |
src/utils/CommonFunc.lua
| ... | ... | @@ -219,7 +219,7 @@ function specMonday(now) |
| 219 | 219 | local wday = (tm.wday + 6) % 7 |
| 220 | 220 | if wday == 0 then wday = 7 end |
| 221 | 221 | |
| 222 | - local time = os.time({year = tm.year, month = tm.month, day = tm.day}) | |
| 222 | + local time = os.time({year = tm.year, month = tm.month, day = tm.day, hour = RESET_TIME}) | |
| 223 | 223 | return time - (wday - 1) * 86400 |
| 224 | 224 | end |
| 225 | 225 | ... | ... |