v0.3.0: added wand of transfusion

This commit is contained in:
Evan Debenham
2015-05-14 02:25:47 -04:00
parent 610cffcb9e
commit edadf3f38e
6 changed files with 257 additions and 3 deletions
@@ -64,6 +64,12 @@ public class Beam extends Image {
super(s, e, Effects.Type.LIGHT_RAY, 1f);
}
}
public static class HealthRay extends Beam{
public HealthRay(PointF s, PointF e){
super(s, e, Effects.Type.HEALTH_RAY, 0.75f);
}
}
@Override
public void update() {
@@ -28,7 +28,8 @@ public class Effects {
WOUND,
EXCLAMATION,
DEATH_RAY,
LIGHT_RAY
LIGHT_RAY,
HEALTH_RAY
};
public static Image get( Type type ) {
@@ -52,6 +53,9 @@ public class Effects {
case LIGHT_RAY:
icon.frame(icon.texture.uvRect(16, 23, 32, 31));
break;
case HEALTH_RAY:
icon.frame(icon.texture.uvRect(16, 30, 32, 38));
break;
}
return icon;
}
@@ -20,6 +20,8 @@ package com.shatteredpixel.shatteredpixeldungeon.effects.particles;
import com.watabou.noosa.particles.Emitter;
import com.watabou.noosa.particles.PixelParticle;
import com.watabou.noosa.particles.Emitter.Factory;
import com.watabou.utils.PointF;
import com.watabou.utils.Random;
public class BloodParticle extends PixelParticle.Shrinking {
@@ -29,6 +31,17 @@ public class BloodParticle extends PixelParticle.Shrinking {
((BloodParticle)emitter.recycle( BloodParticle.class )).reset( x, y );
}
};
public static final Emitter.Factory BURST = new Factory() {
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
((BloodParticle)emitter.recycle( BloodParticle.class )).resetBurst( x, y );
}
@Override
public boolean lightMode() {
return true;
}
};
public BloodParticle() {
super();
@@ -50,6 +63,18 @@ public class BloodParticle extends PixelParticle.Shrinking {
size = 4;
speed.set( 0 );
}
public void resetBurst( float x, float y ) {
revive();
this.x = x;
this.y = y;
speed.polar( Random.Float(PointF.PI2), Random.Float( 16, 32 ) );
size = 5;
left = 0.5f;
}
@Override
public void update() {