Commit 318c573a85c268fd9db18f7441758b33efcd7b82

Authored by zhouhaihai
1 parent 4f0a5fae

冒险bug

Showing 1 changed file with 16 additions and 5 deletions   Show diff stats
@@ -809,7 +809,7 @@ function Adv:doActive(activeId, target) @@ -809,7 +809,7 @@ function Adv:doActive(activeId, target)
809 table.insert(targers, block) 809 table.insert(targers, block)
810 end 810 end
811 end 811 end
812 - elseif activeData.usetype == 4 then -- 自己或者没有目标 812 + elseif activeData.usetype == 4 then -- 没有目标 全体成员
813 elseif activeData.usetype == 5 then -- 空地板 813 elseif activeData.usetype == 5 then -- 空地板
814 if not target or not target.roomId or not target.blockId then return end 814 if not target or not target.roomId or not target.blockId then return end
815 local block = self:getBlock(target.roomId, target.blockId) 815 local block = self:getBlock(target.roomId, target.blockId)
@@ -826,12 +826,23 @@ function Adv:doActive(activeId, target) @@ -826,12 +826,23 @@ function Adv:doActive(activeId, target)
826 826
827 -- 1=map_buff_id:为范围内所有目标附加mapbuff 827 -- 1=map_buff_id:为范围内所有目标附加mapbuff
828 doActiveEffect[1] = function(_, buffId) 828 doActiveEffect[1] = function(_, buffId)
829 - if not next(targers) and (activeData.usetype == 1 or activeData.usetype == 4)then  
830 - table.insert(targers, self.battle.player) 829 + if not next(targers) then
  830 + if activeData.usetype == 1 then
  831 + table.insert(targers, self.battle.player)
  832 + elseif activeData.usetype == 4 then
  833 + targers = self.battle.player:getTeam(2)
  834 + else
  835 + return
  836 + end
831 end 837 end
832 838
833 for _, target in ipairs(targers) do 839 for _, target in ipairs(targers) do
834 - target:addBuff(buffId, self.battle.player) 840 + if target.class.__cname == "AdvBlock" then
  841 + target = self.battle:getEnemy(target.room.roomId, target.blockId)
  842 + end
  843 + if target then
  844 + target:addBuff(buffId, self.battle.player)
  845 + end
835 end 846 end
836 847
837 return true 848 return true
@@ -856,7 +867,7 @@ function Adv:doActive(activeId, target) @@ -856,7 +867,7 @@ function Adv:doActive(activeId, target)
856 for _, target in ipairs(targers) do 867 for _, target in ipairs(targers) do
857 if not target.lock and not target.isDead then 868 if not target.lock and not target.isDead then
858 self.battle:removeEnemyById(target.id) 869 self.battle:removeEnemyById(target.id)
859 - self:getCurMap():addNewMonsterRand(monsterId, {target.roomId, target.blockId}) 870 + self:getCurMap():addNewMonsterRand(monsterId, {self:getRoom(target.roomId), self:getBlock(target.roomId, target.blockId)})
860 self:backBlockChange(target.roomId, target.blockId) 871 self:backBlockChange(target.roomId, target.blockId)
861 end 872 end
862 end 873 end