Commit e6dc06ccda26cecf9e2d98875bf59d96f4ea65e1
1 parent
e910c2dd
拾荒bug 增加bug log
Showing
3 changed files
with
20 additions
and
0 deletions
Show diff stats
src/GlobalVar.lua
| 1 | +BUG_LOG = false | ||
| 2 | + | ||
| 3 | +function buglog(tag, advstr, ...) | ||
| 4 | + if BUG_LOG then | ||
| 5 | + print(string.format("[%s] %s", tag, string.format(advstr, ...))) | ||
| 6 | + end | ||
| 7 | +end | ||
| 8 | + | ||
| 9 | + | ||
| 1 | XXTEA_KEY = "699D448D6D24f7F941E9F6E99F823E18" | 10 | XXTEA_KEY = "699D448D6D24f7F941E9F6E99F823E18" |
| 2 | RESET_TIME = 4 | 11 | RESET_TIME = 4 |
| 3 | 12 |
src/adv/AdvBuff.lua
| @@ -490,6 +490,7 @@ function Buff:createAfter(layer) | @@ -490,6 +490,7 @@ function Buff:createAfter(layer) | ||
| 490 | self:_init() | 490 | self:_init() |
| 491 | end | 491 | end |
| 492 | self:pushBackEffect(1) | 492 | self:pushBackEffect(1) |
| 493 | + buglog("Buff", "who: %s create buffId: %s", self.owner.monsterId, self.id) | ||
| 493 | end | 494 | end |
| 494 | 495 | ||
| 495 | function Buff:initByDB(data) | 496 | function Buff:initByDB(data) |
| @@ -632,6 +633,7 @@ function Buff:pushBackEffect(etype) | @@ -632,6 +633,7 @@ function Buff:pushBackEffect(etype) | ||
| 632 | end | 633 | end |
| 633 | 634 | ||
| 634 | function Buff:effect() | 635 | function Buff:effect() |
| 636 | + buglog("Buff", "who: %s effect buffId: %s", self.owner.monsterId, self.id) | ||
| 635 | self:decCount() | 637 | self:decCount() |
| 636 | self:pushBackEffect(2) | 638 | self:pushBackEffect(2) |
| 637 | if self._effectValue then | 639 | if self._effectValue then |
| @@ -655,6 +657,7 @@ function Buff:endBuff() | @@ -655,6 +657,7 @@ function Buff:endBuff() | ||
| 655 | if self._endBuff then | 657 | if self._endBuff then |
| 656 | self:_endBuff() | 658 | self:_endBuff() |
| 657 | end | 659 | end |
| 660 | + buglog("Buff", "who: %s endBuff buffId: %s", self.owner.monsterId, self.id) | ||
| 658 | end | 661 | end |
| 659 | 662 | ||
| 660 | function Buff:getType() | 663 | function Buff:getType() |
| @@ -709,6 +712,7 @@ function Buff:overlay(releaser, data, layer) | @@ -709,6 +712,7 @@ function Buff:overlay(releaser, data, layer) | ||
| 709 | end | 712 | end |
| 710 | 713 | ||
| 711 | self:pushBackEffect(1) | 714 | self:pushBackEffect(1) |
| 715 | + buglog("Buff", "who: %s overlay buffId: %s", self.owner.monsterId, self.id) | ||
| 712 | end | 716 | end |
| 713 | end | 717 | end |
| 714 | 718 |
src/adv/AdvPassive.lua
| @@ -354,6 +354,7 @@ function Passive:effect(triggerPms) | @@ -354,6 +354,7 @@ function Passive:effect(triggerPms) | ||
| 354 | end | 354 | end |
| 355 | if hadEffect then | 355 | if hadEffect then |
| 356 | self.owner.battle.adv:pushBackEvent(AdvBackEventType.PassiveEffect, {id = self.id, level = self.level, roomId = self.owner.roomId, blockId = self.owner.blockId}) | 356 | self.owner.battle.adv:pushBackEvent(AdvBackEventType.PassiveEffect, {id = self.id, level = self.level, roomId = self.owner.roomId, blockId = self.owner.blockId}) |
| 357 | + buglog("Passive", "who: %s effect id: %s", self.owner.monsterId, self.id) | ||
| 357 | end | 358 | end |
| 358 | if self.count > 0 then | 359 | if self.count > 0 then |
| 359 | self.count = self.count < 999 and self.count - 1 or self.count | 360 | self.count = self.count < 999 and self.count - 1 or self.count |
| @@ -404,6 +405,8 @@ function Passive:trigger(condType, params) --触发检查 | @@ -404,6 +405,8 @@ function Passive:trigger(condType, params) --触发检查 | ||
| 404 | params = params or {} | 405 | params = params or {} |
| 405 | if self.isDel or self.owner.isDead then return end | 406 | if self.isDel or self.owner.isDead then return end |
| 406 | if self:getCondType() ~= condType then return end | 407 | if self:getCondType() ~= condType then return end |
| 408 | + | ||
| 409 | + buglog("Passive", "who: %s trigger id: %s", self.owner.monsterId, self.id) | ||
| 407 | if not self:canTrigger() then return end | 410 | if not self:canTrigger() then return end |
| 408 | if self._trigger then | 411 | if self._trigger then |
| 409 | if not self:_trigger(params) then return end --检查 | 412 | if not self:_trigger(params) then return end --检查 |
| @@ -600,5 +603,9 @@ function Passive:effect16(value, triggerPms, changeType) | @@ -600,5 +603,9 @@ function Passive:effect16(value, triggerPms, changeType) | ||
| 600 | self.owner.battle.adv:blockDropChange(changeType, blocks) | 603 | self.owner.battle.adv:blockDropChange(changeType, blocks) |
| 601 | end | 604 | end |
| 602 | 605 | ||
| 606 | +--17=玩家获得buff | ||
| 607 | +function Passive:effect17(value, triggerPms) | ||
| 608 | + self.owner.battle.player:addBuff(value, self.owner) | ||
| 609 | +end | ||
| 603 | 610 | ||
| 604 | return Passive | 611 | return Passive |
| 605 | \ No newline at end of file | 612 | \ No newline at end of file |