From 4d5d69033565d4609c15cb4d9783eb76c5cb6ac0 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 6 Jun 2015 21:29:06 -0400 Subject: [PATCH] v0.3.0c: rebalanced wand of venom --- .../actors/blobs/VenomGas.java | 36 ++++++++++++++++--- .../actors/buffs/Venom.java | 11 ++++-- .../items/wands/WandOfVenom.java | 5 +-- 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/VenomGas.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/VenomGas.java index 2b61dee65..76f55237c 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/VenomGas.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/VenomGas.java @@ -6,25 +6,51 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Venom; import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; +import com.watabou.utils.Bundle; /** * Created by Evan on 12/04/2015. */ public class VenomGas extends Blob { + private int strength = 0; + @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.immunities().contains(this.getClass())) - Buff.affect(ch, Venom.class).set(2f); + if (volume == 0){ + strength = 0; + } else { + Char ch; + for (int i = 0; i < LENGTH; i++) { + if (cur[i] > 0 && (ch = Actor.findChar(i)) != null) { + if (!ch.immunities().contains(this.getClass())) + Buff.affect(ch, Venom.class).set(2f, strength); + } } } } + public void setStrength(int str){ + if (str > strength) + strength = str; + } + + private static final String STRENGTH = "strength"; + + @Override + public void restoreFromBundle(Bundle bundle) { + super.restoreFromBundle(bundle); + strength = bundle.getInt( STRENGTH ); + } + + @Override + public void storeInBundle(Bundle bundle) { + super.storeInBundle(bundle); + bundle.put( STRENGTH, strength ); + } + @Override public void use( BlobEmitter emitter ) { super.use( emitter ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Venom.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Venom.java index 7c58c6c88..14c59eb1b 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Venom.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Venom.java @@ -10,7 +10,7 @@ import com.watabou.utils.Bundle; */ public class Venom extends Poison implements Hero.Doom { - private int damage = 1+ Dungeon.depth/5; + private int damage = 1; private static final String DAMAGE = "damage"; @@ -31,8 +31,12 @@ public class Venom extends Poison implements Hero.Doom { damage = bundle.getInt( DAMAGE ); } + public void set(float duration, int damage) { + set(duration); + this.damage = damage; + } + @Override - //TODO: new icon? public int icon() { return BuffIndicator.POISON; } @@ -55,7 +59,8 @@ public class Venom extends Poison implements Hero.Doom { public boolean act() { if (target.isAlive()) { target.damage(damage, this); - damage = Math.min(damage+1+Dungeon.depth/10, ((Dungeon.depth+1)/2)+1); + if (damage < ((Dungeon.depth+1)/2)+1) + damage++; //want it to act after the cloud of venom it came from. spend( TICK+0.1f ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfVenom.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfVenom.java index 913161fae..cb26da768 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfVenom.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfVenom.java @@ -27,8 +27,9 @@ public class WandOfVenom extends Wand { @Override protected void onZap(Ballistica bolt) { - //TODO: final balancing - GameScene.add(Blob.seed(bolt.collisionPos, 40+20*level, VenomGas.class)); + Blob venomGas = Blob.seed(bolt.collisionPos, 50 + 10 * level, VenomGas.class); + ((VenomGas)venomGas).setStrength(level+1); + GameScene.add(venomGas); } @Override