diff --git a/src/adv/Adv.lua b/src/adv/Adv.lua index 1ffc4d0..1389c92 100644 --- a/src/adv/Adv.lua +++ b/src/adv/Adv.lua @@ -809,7 +809,7 @@ function Adv:doActive(activeId, target) table.insert(targers, block) end end - elseif activeData.usetype == 4 then -- 自己或者没有目标 + elseif activeData.usetype == 4 then -- 没有目标 全体成员 elseif activeData.usetype == 5 then -- 空地板 if not target or not target.roomId or not target.blockId then return end local block = self:getBlock(target.roomId, target.blockId) @@ -826,12 +826,23 @@ function Adv:doActive(activeId, target) -- 1=map_buff_id:为范围内所有目标附加mapbuff doActiveEffect[1] = function(_, buffId) - if not next(targers) and (activeData.usetype == 1 or activeData.usetype == 4)then - table.insert(targers, self.battle.player) + if not next(targers) then + if activeData.usetype == 1 then + table.insert(targers, self.battle.player) + elseif activeData.usetype == 4 then + targers = self.battle.player:getTeam(2) + else + return + end end for _, target in ipairs(targers) do - target:addBuff(buffId, self.battle.player) + if target.class.__cname == "AdvBlock" then + target = self.battle:getEnemy(target.room.roomId, target.blockId) + end + if target then + target:addBuff(buffId, self.battle.player) + end end return true @@ -856,7 +867,7 @@ function Adv:doActive(activeId, target) for _, target in ipairs(targers) do if not target.lock and not target.isDead then self.battle:removeEnemyById(target.id) - self:getCurMap():addNewMonsterRand(monsterId, {target.roomId, target.blockId}) + self:getCurMap():addNewMonsterRand(monsterId, {self:getRoom(target.roomId), self:getBlock(target.roomId, target.blockId)}) self:backBlockChange(target.roomId, target.blockId) end end -- libgit2 0.21.2