diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/EarthImbue.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/EarthImbue.java index d20c8aa11..c807ff753 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/EarthImbue.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/EarthImbue.java @@ -1,7 +1,10 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; +import com.shatteredpixel.shatteredpixeldungeon.effects.particles.EarthParticle; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; +import com.watabou.utils.Bundle; import java.util.HashSet; @@ -10,10 +13,11 @@ import java.util.HashSet; */ public class EarthImbue extends FlavourBuff { - public static final float DURATION = 20f; + public static final float DURATION = 30f; public void proc(Char enemy){ - Buff.affect(enemy, Roots.class); + Buff.affect(enemy, Roots.class, 2); + CellEmitter.bottom(enemy.pos).start(EarthParticle.FACTORY, 0.05f, 8); } @Override diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FireImbue.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FireImbue.java index e11fa0292..9c8d73664 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FireImbue.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FireImbue.java @@ -4,7 +4,9 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; +import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; +import com.watabou.utils.Bundle; import com.watabou.utils.Random; import java.util.HashSet; @@ -14,19 +16,46 @@ import java.util.HashSet; */ public class FireImbue extends Buff { - public static final float DURATION = 20f; + public static final float DURATION = 30f; + + protected float left; + + private static final String LEFT = "left"; + + @Override + public void storeInBundle( Bundle bundle ) { + super.storeInBundle( bundle ); + bundle.put( LEFT, left ); + + } + + @Override + public void restoreFromBundle( Bundle bundle ) { + super.restoreFromBundle( bundle ); + left = bundle.getFloat( LEFT ); + } + + public void set( float duration ) { + this.left = duration; + }; @Override public boolean act() { - if (Dungeon.level.map[target.pos] == Terrain.GRASS) + if (Dungeon.level.map[target.pos] == Terrain.GRASS) { Dungeon.level.set(target.pos, Terrain.EMBERS); + GameScene.updateMap(target.pos); + } spend(TICK); + left -= TICK; + if (left <= 0) + detach(); + return true; } public void proc(Char enemy){ - if (Random.Int(3) == 0) + if (Random.Int(2) == 0) Buff.affect( enemy, Burning.class ).reignite( enemy ); enemy.sprite.emitter().burst( FlameParticle.FACTORY, 2 ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ToxicImbue.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ToxicImbue.java index 69c642dcf..3fc4b9948 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ToxicImbue.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ToxicImbue.java @@ -4,6 +4,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; +import com.watabou.utils.Bundle; import java.util.HashSet; @@ -12,13 +13,39 @@ import java.util.HashSet; */ public class ToxicImbue extends Buff { - public static final float DURATION = 20f; + public static final float DURATION = 30f; + + protected float left; + + private static final String LEFT = "left"; + + @Override + public void storeInBundle( Bundle bundle ) { + super.storeInBundle( bundle ); + bundle.put( LEFT, left ); + + } + + @Override + public void restoreFromBundle( Bundle bundle ) { + super.restoreFromBundle( bundle ); + left = bundle.getFloat( LEFT ); + } + + public void set( float duration ) { + this.left = duration; + }; + @Override public boolean act() { GameScene.add(Blob.seed(target.pos, 50, ToxicGas.class)); spend(TICK); + left -= TICK; + if (left <= 0) + detach(); + return true; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/food/Blandfruit.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/food/Blandfruit.java index c2409cedc..5275813c4 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/food/Blandfruit.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/food/Blandfruit.java @@ -103,7 +103,7 @@ public class Blandfruit extends Food { hero.busy(); if (potionAttrib instanceof PotionOfFrost) { - GLog.i("the Frostfruit tastes a bit like Frozen Carpaccio."); + GLog.i("the Icefruit tastes a bit like Frozen Carpaccio."); switch (Random.Int(5)) { case 0: GLog.i("You see your hands turn invisible!"); @@ -130,18 +130,18 @@ public class Blandfruit extends Food { } } else if (potionAttrib instanceof PotionOfLiquidFlame){ GLog.i("You feel a great fire burning within you!"); - Buff.affect(hero, FireImbue.class); + Buff.affect(hero, FireImbue.class).set(FireImbue.DURATION); } else if (potionAttrib instanceof PotionOfToxicGas) { GLog.i("You are imbued with vile toxic power!"); - Buff.affect(hero, ToxicImbue.class); + Buff.affect(hero, ToxicImbue.class).set(ToxicImbue.DURATION); } else if (potionAttrib instanceof PotionOfParalyticGas) { GLog.i("You feel the power of the earth coursing through you!"); - Buff.affect(hero, EarthImbue.class); + Buff.affect(hero, EarthImbue.class, EarthImbue.DURATION); } else potionAttrib.apply(hero); Sample.INSTANCE.play( Assets.SND_EAT ); - + SpellSprite.show(hero, SpellSprite.FOOD); hero.sprite.operate(hero.pos); switch (hero.heroClass) {