diff --git a/assets/goo.png b/assets/goo.png index 5e07a35a8..de000b3fe 100644 Binary files a/assets/goo.png and b/assets/goo.png differ diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java index 714f1d026..b15992892 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java @@ -108,8 +108,21 @@ public class Goo extends Mob { @Override protected boolean doAttack( Char enemy ) { if (pumpedUp || Random.Int( 3 ) > 0) { - - return super.doAttack( enemy ); + + boolean visible = Dungeon.visible[pos]; + + if (visible) { + if (pumpedUp) + ((GooSprite)sprite).pumpAttack(); + else + sprite.attack( enemy.pos ); + } else { + attack( enemy ); + } + + spend( attackDelay() ); + + return !visible; } else { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/sprites/GooSprite.java b/src/com/shatteredpixel/shatteredpixeldungeon/sprites/GooSprite.java index ef6deecbc..7a19cd54e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/sprites/GooSprite.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/sprites/GooSprite.java @@ -23,6 +23,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; public class GooSprite extends MobSprite { private Animation pump; + private Animation pumpAttack; public GooSprite() { super(); @@ -32,19 +33,22 @@ public class GooSprite extends MobSprite { TextureFilm frames = new TextureFilm( texture, 20, 14 ); idle = new Animation( 10, true ); - idle.frames( frames, 0, 1 ); + idle.frames( frames, 2, 1, 0, 0, 1 ); - run = new Animation( 10, true ); - run.frames( frames, 0, 1 ); + run = new Animation( 15, true ); + run.frames( frames, 3, 2, 1, 2 ); pump = new Animation( 20, true ); - pump.frames( frames, 0, 1 ); + pump.frames( frames, 4, 3, 2, 1, 0 ); + + pumpAttack = new Animation ( 20, false ); + pumpAttack.frames( frames, 4, 3, 2, 1, 0, 7); attack = new Animation( 10, false ); - attack.frames( frames, 5, 0, 6 ); + attack.frames( frames, 8, 9, 10 ); die = new Animation( 10, false ); - die.frames( frames, 2, 3, 4 ); + die.frames( frames, 5, 6, 7 ); play( idle ); } @@ -52,9 +56,22 @@ public class GooSprite extends MobSprite { public void pumpUp() { play( pump ); } + + public void pumpAttack() { play( pumpAttack ); } @Override public int blood() { return 0xFF000000; } + + @Override + public void onComplete( Animation anim ) { + super.onComplete(anim); + + if (anim == pumpAttack) { + + idle(); + ch.onAttackComplete(); + } + } }