Commit f3c37873d89be278361f6254bd1795c7348a2ae1
1 parent
c843f805
block
Showing
1 changed file
with
12 additions
and
4 deletions
Show diff stats
src/adv/AdvBlock.lua
... | ... | @@ -155,13 +155,18 @@ function Block:randomEvent() |
155 | 155 | adv.battle.player:triggerPassive(Passive.CLICK_TRAP) |
156 | 156 | |
157 | 157 | local buffs = data.effect:toArray(true, "=") |
158 | - for _, buffId in ipairs(buffs) do | |
159 | - adv.battle.player:addBuff(buffId) | |
160 | - end | |
158 | + | |
161 | 159 | |
162 | 160 | local backTrap = true |
163 | - if data.target == 1 then-- 给所有敌人同样增加buff | |
161 | + if data.target == 0 then -- 给玩家增加buff | |
162 | + for _, buffId in ipairs(buffs) do | |
163 | + adv.battle.player:addBuff(buffId) | |
164 | + end | |
165 | + elseif data.target == 1 then-- 给玩家 和 所有敌人同样增加buff | |
164 | 166 | local enemys = adv.battle.player:getTeam(2) |
167 | + for _, buffId in ipairs(buffs) do | |
168 | + adv.battle.player:addBuff(buffId) | |
169 | + end | |
165 | 170 | for k , enemy in ipairs(enemys) do |
166 | 171 | for _, buffId in ipairs(buffs) do |
167 | 172 | enemy:addBuff(buffId) |
... | ... | @@ -170,8 +175,11 @@ function Block:randomEvent() |
170 | 175 | elseif data.target == 2 then -- 翻开房间 |
171 | 176 | self.room.map.adv:getCurMap():openBlocksByRoom(self.room.roomId) |
172 | 177 | backTrap = false |
178 | + elseif data.target == 3 then -- 翻开周围8格,并给怪物附带buff(不伤害玩家) | |
179 | + self.room.map.adv:getCurMap():openBlocksBySize(self.room.roomId, self.blockId, 2) | |
173 | 180 | end |
174 | 181 | |
182 | + | |
175 | 183 | if data.specialEff ~= "" then |
176 | 184 | local effect = data.specialEff:toArray(true, "=") |
177 | 185 | if effect[1] == 1 then | ... | ... |