v0.2.3: tweaks/corrections to blandfruit and associated buffs

This commit is contained in:
Evan Debenham 2014-11-20 01:59:32 -05:00
parent 4a3098c208
commit ec8ced5fc4
4 changed files with 71 additions and 11 deletions

View File

@ -1,7 +1,10 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; 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.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle;
import java.util.HashSet; import java.util.HashSet;
@ -10,10 +13,11 @@ import java.util.HashSet;
*/ */
public class EarthImbue extends FlavourBuff { public class EarthImbue extends FlavourBuff {
public static final float DURATION = 20f; public static final float DURATION = 30f;
public void proc(Char enemy){ 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 @Override

View File

@ -4,7 +4,9 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle;
import com.watabou.utils.Random; import com.watabou.utils.Random;
import java.util.HashSet; import java.util.HashSet;
@ -14,19 +16,46 @@ import java.util.HashSet;
*/ */
public class FireImbue extends Buff { 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 @Override
public boolean act() { 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); Dungeon.level.set(target.pos, Terrain.EMBERS);
GameScene.updateMap(target.pos);
}
spend(TICK); spend(TICK);
left -= TICK;
if (left <= 0)
detach();
return true; return true;
} }
public void proc(Char enemy){ public void proc(Char enemy){
if (Random.Int(3) == 0) if (Random.Int(2) == 0)
Buff.affect( enemy, Burning.class ).reignite( enemy ); Buff.affect( enemy, Burning.class ).reignite( enemy );
enemy.sprite.emitter().burst( FlameParticle.FACTORY, 2 ); enemy.sprite.emitter().burst( FlameParticle.FACTORY, 2 );

View File

@ -4,6 +4,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle;
import java.util.HashSet; import java.util.HashSet;
@ -12,13 +13,39 @@ import java.util.HashSet;
*/ */
public class ToxicImbue extends Buff { 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 @Override
public boolean act() { public boolean act() {
GameScene.add(Blob.seed(target.pos, 50, ToxicGas.class)); GameScene.add(Blob.seed(target.pos, 50, ToxicGas.class));
spend(TICK); spend(TICK);
left -= TICK;
if (left <= 0)
detach();
return true; return true;
} }

View File

@ -103,7 +103,7 @@ public class Blandfruit extends Food {
hero.busy(); hero.busy();
if (potionAttrib instanceof PotionOfFrost) { 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)) { switch (Random.Int(5)) {
case 0: case 0:
GLog.i("You see your hands turn invisible!"); GLog.i("You see your hands turn invisible!");
@ -130,18 +130,18 @@ public class Blandfruit extends Food {
} }
} else if (potionAttrib instanceof PotionOfLiquidFlame){ } else if (potionAttrib instanceof PotionOfLiquidFlame){
GLog.i("You feel a great fire burning within you!"); 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) { } else if (potionAttrib instanceof PotionOfToxicGas) {
GLog.i("You are imbued with vile toxic power!"); 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) { } else if (potionAttrib instanceof PotionOfParalyticGas) {
GLog.i("You feel the power of the earth coursing through you!"); 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 } else
potionAttrib.apply(hero); potionAttrib.apply(hero);
Sample.INSTANCE.play( Assets.SND_EAT ); Sample.INSTANCE.play( Assets.SND_EAT );
SpellSprite.show(hero, SpellSprite.FOOD);
hero.sprite.operate(hero.pos); hero.sprite.operate(hero.pos);
switch (hero.heroClass) { switch (hero.heroClass) {