Commit 7e45c419bca78803a7ce6665baee9e190ad18f38
1 parent
5b3f595a
现有buff补全战斗内生效逻辑
Showing
1 changed file
with
18 additions
and
5 deletions
Show diff stats
src/adv/AdvBuff.lua
| ... | ... | @@ -59,6 +59,14 @@ local BuffFactory = { |
| 59 | 59 | self.owner:hurt(-value, self.release, {hurtType = 2}) |
| 60 | 60 | end |
| 61 | 61 | end |
| 62 | + _Buff._afterTurn = function(self) | |
| 63 | + local value = self:effect() | |
| 64 | + if value > 0 then | |
| 65 | + self.owner:recover(value, self.release) | |
| 66 | + elseif value < 0 then | |
| 67 | + self.owner:hurt(-value, self.release, {hurtType = 2}) | |
| 68 | + end | |
| 69 | + end | |
| 62 | 70 | _Buff._effectValue = function(self) |
| 63 | 71 | return self._changeV |
| 64 | 72 | end |
| ... | ... | @@ -161,15 +169,12 @@ local BuffFactory = { |
| 161 | 169 | [Buff.CLEAR_BUFF] = function(_Buff) |
| 162 | 170 | _Buff._init = function(self, data) |
| 163 | 171 | self.count = self.buffData.effectValue3 |
| 164 | - self:_afterRound() -- 挂上就清除一下子 | |
| 165 | - end | |
| 166 | - _Buff._afterRound = function(self) | |
| 167 | - for _, buff in ipairs(self.buffs) do | |
| 172 | + for _, buff in ipairs(self.buffs) do -- 挂上就清除一下子 | |
| 168 | 173 | if not buff.isDel and self:canEffect(buff.id, buff:getGroup()) then |
| 169 | 174 | buff.isDel = true |
| 170 | 175 | self:effect() |
| 171 | 176 | end |
| 172 | - end | |
| 177 | + end | |
| 173 | 178 | end |
| 174 | 179 | _Buff._canEffect = function(self, buffId, buffGroup) |
| 175 | 180 | local cType, aim = self.buffData.effectValue1, self.buffData.effectValue2 |
| ... | ... | @@ -184,6 +189,10 @@ local BuffFactory = { |
| 184 | 189 | local roomNum = self:effect() |
| 185 | 190 | self.owner.battle.adv:openBlockRand(roomNum) |
| 186 | 191 | end |
| 192 | + _Buff._afterTurn = function(self) | |
| 193 | + local roomNum = self:effect() | |
| 194 | + self.owner.battle.adv:openBlockRand(roomNum) | |
| 195 | + end | |
| 187 | 196 | _Buff._effectValue = function(self) |
| 188 | 197 | return self.buffData.effectValue1 |
| 189 | 198 | end |
| ... | ... | @@ -195,6 +204,10 @@ local BuffFactory = { |
| 195 | 204 | local value, cType = self:effect() |
| 196 | 205 | self.owner.battle.adv:changePower(value, cType) |
| 197 | 206 | end |
| 207 | + _Buff._afterTurn = function(self) | |
| 208 | + local value, cType = self:effect() | |
| 209 | + self.owner.battle.adv:changePower(value, cType) | |
| 210 | + end | |
| 198 | 211 | _Buff._effectValue = function(self) |
| 199 | 212 | return self.buffData.effectValue1, self.buffData.effectValue2 |
| 200 | 213 | end | ... | ... |