diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/StenchGas.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/StenchGas.java new file mode 100644 index 000000000..dda765fd2 --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/StenchGas.java @@ -0,0 +1,41 @@ +package com.shatteredpixel.shatteredpixeldungeon.actors.blobs; + +import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; +import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter; +import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; + +/** + * Created by debenhame on 08/10/2014. + */ +public class StenchGas extends Blob { + + @Override + protected void evolve() { + super.evolve(); + + Char ch; + for (int i=0; i < LENGTH; i++) { + if (cur[i] > 0 && (ch = Actor.findChar(i)) != null) { + if (!(ch instanceof Ghost.FetidRat)) + Buff.prolong(ch, Paralysis.class, Paralysis.duration(ch)/5); + } + } + } + + @Override + public void use( BlobEmitter emitter ) { + super.use( emitter ); + + emitter.pour( Speck.factory(Speck.STENCH), 0.6f ); + } + + @Override + public String tileDesc() { + return "A cloud of fetid stench is swirling here."; + } +} { +} diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java index a013d5cf2..ba6e5741e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java @@ -20,6 +20,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs; import java.util.HashSet; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire; +import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.StenchGas; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Ooze; @@ -402,7 +403,7 @@ public class Ghost extends Mob.NPC { @Override public int defenseProc( Char enemy, int damage ) { - GameScene.add( Blob.seed( pos, 20, ParalyticGas.class ) ); + GameScene.add( Blob.seed( pos, 20, StenchGas.class ) ); return super.defenseProc(enemy, damage); } @@ -423,16 +424,6 @@ public class Ghost extends Mob.NPC { "The rat carries a cloud of horrible stench with it, it's overpoweringly strong up close.\n\n" + "Dark ooze drips from the rat's teeth, it eats through the floor but seems to dissolve in water."; } - - private static final HashSet> IMMUNITIES = new HashSet>(); - static { - IMMUNITIES.add( Paralysis.class ); - } - - @Override - public HashSet> immunities() { - return IMMUNITIES; - } } public static class GnollTrickster extends Gnoll { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/effects/Speck.java b/src/com/shatteredpixel/shatteredpixeldungeon/effects/Speck.java index a996e29be..7a5a651bb 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/effects/Speck.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/effects/Speck.java @@ -56,7 +56,8 @@ public class Speck extends Image { public static final int TOXIC = 107; public static final int PARALYSIS = 108; public static final int DUST = 109; - public static final int FORGE = 110; + public static final int STENCH = 110; + public static final int FORGE = 111; private static final int SIZE = 7; @@ -100,6 +101,7 @@ public class Speck extends Image { case TOXIC: case PARALYSIS: case DUST: + case STINK: frame( film.get( STEAM ) ); break; default: @@ -279,6 +281,13 @@ public class Speck extends Image { speed.polar( Random.Float( 2 * 3.1415926f ), Random.Float( 16, 48 ) ); lifespan = 0.5f; break; + + case STENCH: + hardlight( 0x383825 ); + angularSpeed = -30; + angle = Random.Float( 360 ); + lifespan = Random.Float( 1f, 3f ); + break; case COIN: speed.polar( -PointF.PI * Random.Float( 0.3f, 0.7f ), Random.Float( 48, 96 ) );