v1.0.2: fixed more cases of permanent traps getting deactivated
This commit is contained in:
parent
7273342688
commit
bb9ee6450f
|
@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.MetalShard;
|
import com.shatteredpixel.shatteredpixeldungeon.items.quest.MetalShard;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.SummoningTrap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
|
@ -45,7 +46,7 @@ public class ReclaimTrap extends TargetedSpell {
|
||||||
image = ItemSpriteSheet.RECLAIM_TRAP;
|
image = ItemSpriteSheet.RECLAIM_TRAP;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Class<?extends Trap> storedTrap = null;
|
private Class<?extends Trap> storedTrap = SummoningTrap.class;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<String> actions(Hero hero) {
|
public ArrayList<String> actions(Hero hero) {
|
||||||
|
@ -64,7 +65,7 @@ public class ReclaimTrap extends TargetedSpell {
|
||||||
quantity++; //storing a trap doesn't consume the spell
|
quantity++; //storing a trap doesn't consume the spell
|
||||||
Trap t = Dungeon.level.traps.get(bolt.collisionPos);
|
Trap t = Dungeon.level.traps.get(bolt.collisionPos);
|
||||||
if (t != null && t.active && t.visible) {
|
if (t != null && t.active && t.visible) {
|
||||||
t.disarm();
|
t.disarm(); //even disarms traps that normally wouldn't be
|
||||||
|
|
||||||
Sample.INSTANCE.play(Assets.Sounds.LIGHTNING);
|
Sample.INSTANCE.play(Assets.Sounds.LIGHTNING);
|
||||||
ScrollOfRecharging.charge(hero);
|
ScrollOfRecharging.charge(hero);
|
||||||
|
|
|
@ -153,7 +153,7 @@ public class DistortionTrap extends Trap{
|
||||||
for (Mob mob : mobs){
|
for (Mob mob : mobs){
|
||||||
//manually trigger traps first to avoid sfx spam
|
//manually trigger traps first to avoid sfx spam
|
||||||
if ((t = Dungeon.level.traps.get(mob.pos)) != null && t.active){
|
if ((t = Dungeon.level.traps.get(mob.pos)) != null && t.active){
|
||||||
t.disarm();
|
if (t.disarmedByActivation) t.disarm();
|
||||||
t.reveal();
|
t.reveal();
|
||||||
t.activate();
|
t.activate();
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class FlockTrap extends Trap {
|
||||||
CellEmitter.get(i).burst(Speck.factory(Speck.WOOL), 4);
|
CellEmitter.get(i).burst(Speck.factory(Speck.WOOL), 4);
|
||||||
//before the tile is pressed, directly trigger traps to avoid sfx spam
|
//before the tile is pressed, directly trigger traps to avoid sfx spam
|
||||||
if ((t = Dungeon.level.traps.get(i)) != null && t.active){
|
if ((t = Dungeon.level.traps.get(i)) != null && t.active){
|
||||||
t.disarm();
|
if (t.disarmedByActivation) t.disarm();
|
||||||
t.reveal();
|
t.reveal();
|
||||||
t.activate();
|
t.activate();
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class SummoningTrap extends Trap {
|
||||||
for (Mob mob : mobs){
|
for (Mob mob : mobs){
|
||||||
//manually trigger traps first to avoid sfx spam
|
//manually trigger traps first to avoid sfx spam
|
||||||
if ((t = Dungeon.level.traps.get(mob.pos)) != null && t.active){
|
if ((t = Dungeon.level.traps.get(mob.pos)) != null && t.active){
|
||||||
t.disarm();
|
if (t.disarmedByActivation) t.disarm();
|
||||||
t.reveal();
|
t.reveal();
|
||||||
t.activate();
|
t.activate();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user