diff --git a/core/src/main/assets/dm200.png b/core/src/main/assets/dm200.png new file mode 100644 index 000000000..79e2b9924 Binary files /dev/null and b/core/src/main/assets/dm200.png differ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java index 27abe0945..82e35edfe 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java @@ -106,6 +106,7 @@ public class Assets { public static final String SPAWNER = "spawner.png"; public static final String DM100 = "dm100.png"; public static final String PYLON = "pylon.png"; + public static final String DM200 = "dm200.png"; public static final String ITEMS = "items.png"; public static final String TERRAIN_FEATURES = "terrain_features.png"; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/DM200Sprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/DM200Sprite.java index 6c9e1a020..1b3dd65db 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/DM200Sprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/DM200Sprite.java @@ -23,21 +23,20 @@ package com.shatteredpixel.shatteredpixeldungeon.sprites; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.DM200; -import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Shaman; import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile; +import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.watabou.noosa.TextureFilm; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Callback; -//TODO currently just uses DM-300's sprite scaled to 80% public class DM200Sprite extends MobSprite { public DM200Sprite () { super(); - texture( Assets.DM300 ); + texture( Assets.DM200 ); - TextureFilm frames = new TextureFilm( texture, 22, 20 ); + TextureFilm frames = new TextureFilm( texture, 21, 18 ); idle = new Animation( 10, true ); idle.frames( frames, 0, 1 ); @@ -46,15 +45,15 @@ public class DM200Sprite extends MobSprite { run.frames( frames, 2, 3 ); attack = new Animation( 15, false ); - attack.frames( frames, 4, 5, 6, 0 ); + attack.frames( frames, 4, 5, 6 ); - zap = attack.clone(); + zap = new Animation( 15, false ); + zap.frames( frames, 7, 8, 8, 7 ); - die = new Animation( 20, false ); - die.frames( frames, 0, 7, 0, 7, 0, 7, 0, 7, 0, 7, 0, 7, 8 ); + die = new Animation( 8, false ); + die.frames( frames, 9, 10, 11 ); play( idle ); - scale.set( 0.8f ); } public void zap( int cell ) { @@ -75,6 +74,18 @@ public class DM200Sprite extends MobSprite { Sample.INSTANCE.play( Assets.SND_PUFF ); } + @Override + public void place(int cell) { + if (parent != null) parent.bringToFront(this); + super.place(cell); + } + + @Override + public void die() { + emitter().burst( Speck.factory( Speck.WOOL ), 8 ); + super.die(); + } + @Override public void onComplete( Animation anim ) { if (anim == zap) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/DM201Sprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/DM201Sprite.java index 1178f3e18..ce044c431 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/DM201Sprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/DM201Sprite.java @@ -24,40 +24,49 @@ package com.shatteredpixel.shatteredpixeldungeon.sprites; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.DM201; import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile; +import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.watabou.noosa.TextureFilm; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Callback; -//TODO currently just DM-200s with treads chopped off public class DM201Sprite extends MobSprite { public DM201Sprite () { super(); - texture( Assets.DM300 ); + texture( Assets.DM200 ); - TextureFilm frames = new TextureFilm( texture, 22, 16 ); + TextureFilm frames = new TextureFilm( texture, 21, 18 ); + + int c = 12; idle = new Animation( 2, true ); - idle.frames( frames, 0, 1 ); + idle.frames( frames, c+0, c+1 ); run = idle.clone(); attack = new Animation( 15, false ); - attack.frames( frames, 4, 5, 6, 0 ); + attack.frames( frames, c+4, c+5, c+6 ); - zap = attack.clone(); + zap = new Animation( 15, false ); + zap.frames( frames, c+7, c+8, c+8, c+7 ); - die = new Animation( 20, false ); - die.frames( frames, 0, 7, 0, 7, 0, 7, 0, 7, 0, 7, 0, 7, 8 ); + die = new Animation( 8, false ); + die.frames( frames, c+9, c+10, c+11 ); play( idle ); - scale.set( 0.8f ); } @Override - public void resetColor() { - super.resetColor(); + public void place(int cell) { + if (parent != null) parent.bringToFront(this); + super.place(cell); + } + + @Override + public void die() { + emitter().burst( Speck.factory( Speck.WOOL ), 8 ); + super.die(); } public void zap( int cell ) { @@ -79,4 +88,12 @@ public class DM201Sprite extends MobSprite { Sample.INSTANCE.play( Assets.SND_MISS, 0.6f, 0.6f, 1.5f ); } + @Override + public void onComplete( Animation anim ) { + if (anim == zap) { + idle(); + } + super.onComplete( anim ); + } + }