diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/FlockTrap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/FlockTrap.java index cb2fbbcc1..01ebf77bd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/FlockTrap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/FlockTrap.java @@ -43,42 +43,30 @@ public class FlockTrap extends Trap { @Override public void activate() { - //use an actor as we want to put this on a slight delay so all chars get a chance to act this turn first. - Actor.add(new Actor() { - - { actPriority = BUFF_PRIO; } - - protected boolean act() { - PathFinder.buildDistanceMap( pos, BArray.not( Dungeon.level.solid, null ), 2 ); - for (int i = 0; i < PathFinder.distance.length; i++) { - Trap t; - if (PathFinder.distance[i] < Integer.MAX_VALUE) { - if (Dungeon.level.insideMap(i) - && Actor.findChar(i) == null - && !(Dungeon.level.pit[i])) { - Sheep sheep = new Sheep(); - sheep.lifespan = Random.NormalIntRange( 4, 8 ); - sheep.pos = i; - GameScene.add(sheep); - CellEmitter.get(i).burst(Speck.factory(Speck.WOOL), 4); - //before the tile is pressed, directly trigger traps to avoid sfx spam - if ((t = Dungeon.level.traps.get(i)) != null && t.active){ - t.disarm(); - t.reveal(); - t.activate(); - } - Dungeon.level.occupyCell(sheep); - - } + PathFinder.buildDistanceMap( pos, BArray.not( Dungeon.level.solid, null ), 2 ); + for (int i = 0; i < PathFinder.distance.length; i++) { + Trap t; + if (PathFinder.distance[i] < Integer.MAX_VALUE) { + if (Dungeon.level.insideMap(i) + && Actor.findChar(i) == null + && !(Dungeon.level.pit[i])) { + Sheep sheep = new Sheep(); + sheep.lifespan = Random.NormalIntRange( 4, 8 ); + sheep.pos = i; + GameScene.add(sheep); + CellEmitter.get(i).burst(Speck.factory(Speck.WOOL), 4); + //before the tile is pressed, directly trigger traps to avoid sfx spam + if ((t = Dungeon.level.traps.get(i)) != null && t.active){ + t.disarm(); + t.reveal(); + t.activate(); } + Dungeon.level.occupyCell(sheep); + Sample.INSTANCE.play(Assets.Sounds.PUFF); + Sample.INSTANCE.play(Assets.Sounds.SHEEP); } - Sample.INSTANCE.play(Assets.Sounds.PUFF); - Sample.INSTANCE.play(Assets.Sounds.SHEEP); - Actor.remove(this); - return true; } - }); - + } } }