v0.3.0: added wand of venom & venom gas
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
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.Venom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
|
||||
/**
|
||||
* Created by Evan on 12/04/2015.
|
||||
*/
|
||||
public class VenomGas extends Blob {
|
||||
//TODO: do I want mobs to avoid this gas?
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void use( BlobEmitter emitter ) {
|
||||
super.use( emitter );
|
||||
|
||||
emitter.pour( Speck.factory(Speck.VENOM), 0.6f );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String tileDesc() {
|
||||
return "A could of foul acidic venom is swirling here.";
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user