v0.3.2: rebalanced the Goo fight

This commit is contained in:
Evan Debenham
2015-09-24 18:49:23 -04:00
parent 71f65ec31a
commit c4b3a9503e
2 changed files with 67 additions and 15 deletions
@@ -20,6 +20,7 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.sprites;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.watabou.noosa.TextureFilm;
import com.watabou.noosa.particles.Emitter;
import com.watabou.noosa.particles.PixelParticle;
@@ -34,6 +35,8 @@ public class GooSprite extends MobSprite {
private Animation pump;
private Animation pumpAttack;
private Emitter spray;
public GooSprite() {
super();
@@ -59,25 +62,42 @@ public class GooSprite extends MobSprite {
die = new Animation( 10, false );
die.frames( frames, 5, 6, 7 );
play( idle );
play(idle);
spray = centerEmitter();
spray.autoKill = false;
spray.pour( GooParticle.FACTORY, 0.04f );
spray.on = false;
}
@Override
public void link(Char ch) {
super.link(ch);
if (ch.HP*2 <= ch.HT)
spray(true);
}
public void pumpUp() {
play( pump );
}
public void pumpAttack() { play( pumpAttack ); }
@Override
public void play( Animation anim, boolean force ) {
super.play( anim, force );
}
public void pumpAttack() { play(pumpAttack); }
@Override
public int blood() {
return 0xFF000000;
}
public void spray(boolean on){
spray.on = on;
}
@Override
public void update() {
super.update();
spray.pos(center());
}
public static class GooParticle extends PixelParticle.Shrinking {
public static final Emitter.Factory FACTORY = new Factory() {
@@ -124,6 +144,8 @@ public class GooSprite extends MobSprite {
idle();
ch.onAttackComplete();
} else if (anim == die) {
spray.killAndErase();
}
}
}