v0.3.0: added wand of venom & venom gas

This commit is contained in:
Evan Debenham
2015-04-12 23:13:07 -04:00
parent d3852a392e
commit 4759cb8a55
9 changed files with 181 additions and 11 deletions
@@ -21,13 +21,12 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ConfusionGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ParalyticGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.StenchGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.VenomGas;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import java.util.HashSet;
public class GasesImmunity extends FlavourBuff {
public static final float DURATION = 10f;
public static final float DURATION = 15f;
@Override
public int icon() {
@@ -44,5 +43,6 @@ public class GasesImmunity extends FlavourBuff {
immunities.add( ToxicGas.class );
immunities.add( ConfusionGas.class );
immunities.add( StenchGas.class );
immunities.add( VenomGas.class );
}
}
@@ -0,0 +1,58 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle;
/**
* Created by Evan on 12/04/2015.
*/
public class Venom extends Poison implements Hero.Doom {
private int damage = 1+ Dungeon.depth/5;
private static final String DAMAGE = "damage";
@Override
public void storeInBundle( Bundle bundle ) {
super.storeInBundle( bundle );
bundle.put( DAMAGE, damage );
}
@Override
public void restoreFromBundle( Bundle bundle ) {
super.restoreFromBundle( bundle );
damage = bundle.getInt( DAMAGE );
}
@Override
public int icon() {
return BuffIndicator.POISON;
}
@Override
public String toString() {
return "Venomed";
}
@Override
public boolean act() {
if (target.isAlive()) {
target.damage(damage, this);
damage = Math.min(damage+1+Dungeon.depth/10, Dungeon.depth+1);
//want it to act after the cloud of venom it came from.
spend( TICK+0.1f );
if ((left -= TICK) <= 0) {
detach();
}
} else {
detach();
}
return true;
}
}