v0.9.0b: disarming traps now kill statues

This commit is contained in:
Evan Debenham 2020-10-12 21:04:28 -04:00
parent bc03d17edc
commit 8942fb218e

View File

@ -23,7 +23,9 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.traps;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Statue;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
@ -61,6 +63,12 @@ public class DisarmingTrap extends Trap{
}
}
if (Actor.findChar(pos) instanceof Statue){
Actor.findChar(pos).die(this);
Sample.INSTANCE.play(Assets.Sounds.TELEPORT);
CellEmitter.get(pos).burst(Speck.factory(Speck.LIGHT), 4);
}
if (Dungeon.hero.pos == pos && !Dungeon.hero.flying){
Hero hero = Dungeon.hero;
KindOfWeapon weapon = hero.belongings.weapon;