v0.3.2: rebalanced the Goo fight
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user