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,6 +59,14 @@ local BuffFactory = { | ||
| 59 | self.owner:hurt(-value, self.release, {hurtType = 2}) | 59 | self.owner:hurt(-value, self.release, {hurtType = 2}) |
| 60 | end | 60 | end |
| 61 | end | 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 | _Buff._effectValue = function(self) | 70 | _Buff._effectValue = function(self) |
| 63 | return self._changeV | 71 | return self._changeV |
| 64 | end | 72 | end |
| @@ -161,15 +169,12 @@ local BuffFactory = { | @@ -161,15 +169,12 @@ local BuffFactory = { | ||
| 161 | [Buff.CLEAR_BUFF] = function(_Buff) | 169 | [Buff.CLEAR_BUFF] = function(_Buff) |
| 162 | _Buff._init = function(self, data) | 170 | _Buff._init = function(self, data) |
| 163 | self.count = self.buffData.effectValue3 | 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 | if not buff.isDel and self:canEffect(buff.id, buff:getGroup()) then | 173 | if not buff.isDel and self:canEffect(buff.id, buff:getGroup()) then |
| 169 | buff.isDel = true | 174 | buff.isDel = true |
| 170 | self:effect() | 175 | self:effect() |
| 171 | end | 176 | end |
| 172 | - end | 177 | + end |
| 173 | end | 178 | end |
| 174 | _Buff._canEffect = function(self, buffId, buffGroup) | 179 | _Buff._canEffect = function(self, buffId, buffGroup) |
| 175 | local cType, aim = self.buffData.effectValue1, self.buffData.effectValue2 | 180 | local cType, aim = self.buffData.effectValue1, self.buffData.effectValue2 |
| @@ -184,6 +189,10 @@ local BuffFactory = { | @@ -184,6 +189,10 @@ local BuffFactory = { | ||
| 184 | local roomNum = self:effect() | 189 | local roomNum = self:effect() |
| 185 | self.owner.battle.adv:openBlockRand(roomNum) | 190 | self.owner.battle.adv:openBlockRand(roomNum) |
| 186 | end | 191 | end |
| 192 | + _Buff._afterTurn = function(self) | ||
| 193 | + local roomNum = self:effect() | ||
| 194 | + self.owner.battle.adv:openBlockRand(roomNum) | ||
| 195 | + end | ||
| 187 | _Buff._effectValue = function(self) | 196 | _Buff._effectValue = function(self) |
| 188 | return self.buffData.effectValue1 | 197 | return self.buffData.effectValue1 |
| 189 | end | 198 | end |
| @@ -195,6 +204,10 @@ local BuffFactory = { | @@ -195,6 +204,10 @@ local BuffFactory = { | ||
| 195 | local value, cType = self:effect() | 204 | local value, cType = self:effect() |
| 196 | self.owner.battle.adv:changePower(value, cType) | 205 | self.owner.battle.adv:changePower(value, cType) |
| 197 | end | 206 | end |
| 207 | + _Buff._afterTurn = function(self) | ||
| 208 | + local value, cType = self:effect() | ||
| 209 | + self.owner.battle.adv:changePower(value, cType) | ||
| 210 | + end | ||
| 198 | _Buff._effectValue = function(self) | 211 | _Buff._effectValue = function(self) |
| 199 | return self.buffData.effectValue1, self.buffData.effectValue2 | 212 | return self.buffData.effectValue1, self.buffData.effectValue2 |
| 200 | end | 213 | end |