From e6dc06ccda26cecf9e2d98875bf59d96f4ea65e1 Mon Sep 17 00:00:00 2001 From: zhouhaihai Date: Thu, 10 Dec 2020 19:49:05 +0800 Subject: [PATCH] 拾荒bug 增加bug log --- src/GlobalVar.lua | 9 +++++++++ src/adv/AdvBuff.lua | 4 ++++ src/adv/AdvPassive.lua | 7 +++++++ 3 files changed, 20 insertions(+), 0 deletions(-) diff --git a/src/GlobalVar.lua b/src/GlobalVar.lua index bfd7bd8..5890bd4 100644 --- a/src/GlobalVar.lua +++ b/src/GlobalVar.lua @@ -1,3 +1,12 @@ +BUG_LOG = false + +function buglog(tag, advstr, ...) + if BUG_LOG then + print(string.format("[%s] %s", tag, string.format(advstr, ...))) + end +end + + XXTEA_KEY = "699D448D6D24f7F941E9F6E99F823E18" RESET_TIME = 4 diff --git a/src/adv/AdvBuff.lua b/src/adv/AdvBuff.lua index 7074873..b4593db 100644 --- a/src/adv/AdvBuff.lua +++ b/src/adv/AdvBuff.lua @@ -490,6 +490,7 @@ function Buff:createAfter(layer) self:_init() end self:pushBackEffect(1) + buglog("Buff", "who: %s create buffId: %s", self.owner.monsterId, self.id) end function Buff:initByDB(data) @@ -632,6 +633,7 @@ function Buff:pushBackEffect(etype) end function Buff:effect() + buglog("Buff", "who: %s effect buffId: %s", self.owner.monsterId, self.id) self:decCount() self:pushBackEffect(2) if self._effectValue then @@ -655,6 +657,7 @@ function Buff:endBuff() if self._endBuff then self:_endBuff() end + buglog("Buff", "who: %s endBuff buffId: %s", self.owner.monsterId, self.id) end function Buff:getType() @@ -709,6 +712,7 @@ function Buff:overlay(releaser, data, layer) end self:pushBackEffect(1) + buglog("Buff", "who: %s overlay buffId: %s", self.owner.monsterId, self.id) end end diff --git a/src/adv/AdvPassive.lua b/src/adv/AdvPassive.lua index 1821bb5..a3fcc01 100644 --- a/src/adv/AdvPassive.lua +++ b/src/adv/AdvPassive.lua @@ -354,6 +354,7 @@ function Passive:effect(triggerPms) end if hadEffect then self.owner.battle.adv:pushBackEvent(AdvBackEventType.PassiveEffect, {id = self.id, level = self.level, roomId = self.owner.roomId, blockId = self.owner.blockId}) + buglog("Passive", "who: %s effect id: %s", self.owner.monsterId, self.id) end if self.count > 0 then self.count = self.count < 999 and self.count - 1 or self.count @@ -404,6 +405,8 @@ function Passive:trigger(condType, params) --触发检查 params = params or {} if self.isDel or self.owner.isDead then return end if self:getCondType() ~= condType then return end + + buglog("Passive", "who: %s trigger id: %s", self.owner.monsterId, self.id) if not self:canTrigger() then return end if self._trigger then if not self:_trigger(params) then return end --检查 @@ -600,5 +603,9 @@ function Passive:effect16(value, triggerPms, changeType) self.owner.battle.adv:blockDropChange(changeType, blocks) end +--17=玩家获得buff +function Passive:effect17(value, triggerPms) + self.owner.battle.player:addBuff(value, self.owner) +end return Passive \ No newline at end of file -- libgit2 0.21.2