v0.3.0c: trap refactor pt1, moved all traps to be instance based (not properly tied into level logic yet)

This commit is contained in:
Evan Debenham
2015-06-02 00:35:46 -04:00
parent 512c51dee1
commit 40c0d61dfa
15 changed files with 263 additions and 81 deletions
@@ -26,23 +26,26 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
public class AlarmTrap {
public class AlarmTrap extends Trap {
// 0xDD3333
public static void trigger( int pos, Char ch ) {
{
name = "alarm trap";
image = 4;
}
@Override
public void activate() {
for (Mob mob : Dungeon.level.mobs) {
if (mob != ch) {
mob.beckon( pos );
}
}
if (Dungeon.visible[pos]) {
GLog.w( "The trap emits a piercing sound that echoes throughout the dungeon!" );
CellEmitter.center( pos ).start( Speck.factory( Speck.SCREAM ), 0.3f, 3 );
}
Sample.INSTANCE.play( Assets.SND_ALERT );
}
}