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:
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user