v0.3.2c: added visual effect for soul mark, reduced soul mark duration considerably

This commit is contained in:
Evan Debenham 2015-11-23 15:22:29 -05:00
parent 0ef4ad71fc
commit 38d25f33bb
3 changed files with 94 additions and 86 deletions

View File

@ -20,13 +20,12 @@
*/ */
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class SoulMark extends FlavourBuff { public class SoulMark extends FlavourBuff {
public static final float DURATION = 50f; public static final float DURATION = 10f;
{ {
type = buffType.NEGATIVE; type = buffType.NEGATIVE;
@ -38,17 +37,14 @@ public class SoulMark extends FlavourBuff {
} }
@Override @Override
public String toString() { public void fx(boolean on) {
return "Soul Marked"; if (on) target.sprite.add(CharSprite.State.MARKED);
else target.sprite.remove(CharSprite.State.MARKED);
} }
@Override @Override
public boolean attachTo(Char target) { public String toString() {
if (super.attachTo(target) && target.sprite != null){ return "Soul Marked";
target.sprite.emitter().burst(ShadowParticle.UP, 10);
return true;
} else
return false;
} }
@Override @Override

View File

@ -135,7 +135,7 @@ public abstract class Wand extends Item {
if (target != Dungeon.hero && if (target != Dungeon.hero &&
Dungeon.hero.subClass == HeroSubClass.WARLOCK && Dungeon.hero.subClass == HeroSubClass.WARLOCK &&
Random.Float() < .15f + (level()*chargesUsed*0.03f)){ Random.Float() < .15f + (level()*chargesUsed*0.03f)){
SoulMark.prolong(target, SoulMark.class, SoulMark.DURATION); SoulMark.prolong(target, SoulMark.class, SoulMark.DURATION + level());
} }
} }

View File

@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.sprites; package com.shatteredpixel.shatteredpixeldungeon.sprites;
import com.shatteredpixel.shatteredpixeldungeon.effects.DarkBlock; import com.shatteredpixel.shatteredpixeldungeon.effects.DarkBlock;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SnowParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SnowParticle;
import com.watabou.noosa.Game; import com.watabou.noosa.Game;
import com.watabou.noosa.MovieClip; import com.watabou.noosa.MovieClip;
@ -60,7 +61,7 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
private static final float FLASH_INTERVAL = 0.05f; private static final float FLASH_INTERVAL = 0.05f;
public enum State { public enum State {
BURNING, LEVITATING, INVISIBLE, PARALYSED, FROZEN, ILLUMINATED, CHILLED, DARKENED BURNING, LEVITATING, INVISIBLE, PARALYSED, FROZEN, ILLUMINATED, CHILLED, DARKENED, MARKED
} }
protected Animation idle; protected Animation idle;
@ -76,6 +77,7 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
protected Emitter burning; protected Emitter burning;
protected Emitter chilled; protected Emitter chilled;
protected Emitter marked;
protected Emitter levitation; protected Emitter levitation;
protected IceBlock iceBlock; protected IceBlock iceBlock;
@ -259,84 +261,94 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
public void add( State state ) { public void add( State state ) {
switch (state) { switch (state) {
case BURNING: case BURNING:
burning = emitter(); burning = emitter();
burning.pour( FlameParticle.FACTORY, 0.06f ); burning.pour( FlameParticle.FACTORY, 0.06f );
if (visible) { if (visible) {
Sample.INSTANCE.play( Assets.SND_BURNING ); Sample.INSTANCE.play( Assets.SND_BURNING );
} }
break; break;
case LEVITATING: case LEVITATING:
levitation = emitter(); levitation = emitter();
levitation.pour( Speck.factory( Speck.JET ), 0.02f ); levitation.pour( Speck.factory( Speck.JET ), 0.02f );
break; break;
case INVISIBLE: case INVISIBLE:
PotionOfInvisibility.melt( ch ); PotionOfInvisibility.melt( ch );
break; break;
case PARALYSED: case PARALYSED:
paused = true; paused = true;
break; break;
case FROZEN: case FROZEN:
iceBlock = IceBlock.freeze( this ); iceBlock = IceBlock.freeze( this );
paused = true; paused = true;
break; break;
case ILLUMINATED: case ILLUMINATED:
GameScene.effect( halo = new TorchHalo( this ) ); GameScene.effect( halo = new TorchHalo( this ) );
break; break;
case CHILLED: case CHILLED:
chilled = emitter(); chilled = emitter();
chilled.pour(SnowParticle.FACTORY, 0.1f); chilled.pour(SnowParticle.FACTORY, 0.1f);
break; break;
case DARKENED: case DARKENED:
darkBlock = DarkBlock.darken( this ); darkBlock = DarkBlock.darken( this );
break; break;
case MARKED:
marked = emitter();
marked.pour(ShadowParticle.UP, 0.1f);
break;
} }
} }
public void remove( State state ) { public void remove( State state ) {
switch (state) { switch (state) {
case BURNING: case BURNING:
if (burning != null) { if (burning != null) {
burning.on = false; burning.on = false;
burning = null; burning = null;
} }
break; break;
case LEVITATING: case LEVITATING:
if (levitation != null) { if (levitation != null) {
levitation.on = false; levitation.on = false;
levitation = null; levitation = null;
} }
break; break;
case INVISIBLE: case INVISIBLE:
alpha( 1f ); alpha( 1f );
break; break;
case PARALYSED: case PARALYSED:
paused = false; paused = false;
break; break;
case FROZEN: case FROZEN:
if (iceBlock != null) { if (iceBlock != null) {
iceBlock.melt(); iceBlock.melt();
iceBlock = null; iceBlock = null;
} }
paused = false; paused = false;
break; break;
case ILLUMINATED: case ILLUMINATED:
if (halo != null) { if (halo != null) {
halo.putOut(); halo.putOut();
} }
break; break;
case CHILLED: case CHILLED:
if (chilled != null){ if (chilled != null){
chilled.on = false; chilled.on = false;
chilled = null; chilled = null;
} }
break; break;
case DARKENED: case DARKENED:
if (darkBlock != null) { if (darkBlock != null) {
darkBlock.lighten(); darkBlock.lighten();
darkBlock = null; darkBlock = null;
} }
break; break;
case MARKED:
if (marked != null){
marked.on = false;
marked = null;
}
break;
} }
} }