v0.3.0: added wand of venom & venom gas
This commit is contained in:
parent
d3852a392e
commit
4759cb8a55
|
@ -55,6 +55,11 @@ public class ShatteredPixelDungeon extends Game {
|
|||
com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon.class,
|
||||
"com.shatteredpixel.shatteredpixeldungeon.items.LloydsBeacon" );
|
||||
|
||||
// 0.3.0
|
||||
com.watabou.utils.Bundle.addAlias(
|
||||
com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfVenom.class,
|
||||
"com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfPoison" );
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
|
@ -54,11 +54,12 @@ public class Speck extends Image {
|
|||
public static final int RATTLE = 105;
|
||||
public static final int JET = 106;
|
||||
public static final int TOXIC = 107;
|
||||
public static final int PARALYSIS = 108;
|
||||
public static final int DUST = 109;
|
||||
public static final int STENCH = 110;
|
||||
public static final int FORGE = 111;
|
||||
public static final int CONFUSION = 112;
|
||||
public static final int VENOM = 108;
|
||||
public static final int PARALYSIS = 109;
|
||||
public static final int DUST = 110;
|
||||
public static final int STENCH = 111;
|
||||
public static final int FORGE = 112;
|
||||
public static final int CONFUSION = 113;
|
||||
|
||||
private static final int SIZE = 7;
|
||||
|
||||
|
@ -100,6 +101,7 @@ public class Speck extends Image {
|
|||
break;
|
||||
case JET:
|
||||
case TOXIC:
|
||||
case VENOM:
|
||||
case PARALYSIS:
|
||||
case STENCH:
|
||||
case CONFUSION:
|
||||
|
@ -270,6 +272,13 @@ public class Speck extends Image {
|
|||
lifespan = Random.Float( 1f, 3f );
|
||||
break;
|
||||
|
||||
case VENOM:
|
||||
hardlight( 0x330033 );
|
||||
angularSpeed = 30;
|
||||
angle = Random.Float( 360 );
|
||||
lifespan = Random.Float( 1f, 3f );
|
||||
break;
|
||||
|
||||
case PARALYSIS:
|
||||
hardlight( 0xFFFF66 );
|
||||
angularSpeed = -30;
|
||||
|
@ -404,6 +413,7 @@ public class Speck extends Image {
|
|||
scale.set( 1 + p * 2 );
|
||||
break;
|
||||
|
||||
case VENOM:
|
||||
case STENCH:
|
||||
am = (p < 0.5f ? p : 1 - p) * 2;
|
||||
scale.set( 1 + p * 2 );
|
||||
|
|
|
@ -19,6 +19,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.potions;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ConfusionGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.StenchGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.VenomGas;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
|
@ -58,7 +59,8 @@ public class PotionOfPurity extends Potion {
|
|||
Dungeon.level.blobs.get( ToxicGas.class ),
|
||||
Dungeon.level.blobs.get( ParalyticGas.class ),
|
||||
Dungeon.level.blobs.get( ConfusionGas.class ),
|
||||
Dungeon.level.blobs.get( StenchGas.class )
|
||||
Dungeon.level.blobs.get( StenchGas.class ),
|
||||
Dungeon.level.blobs.get( VenomGas.class )
|
||||
};
|
||||
|
||||
for (int j=0; j < blobs.length; j++) {
|
||||
|
|
|
@ -34,7 +34,7 @@ public class WandOfPoison extends Wand {
|
|||
|
||||
{
|
||||
name = "Wand of Poison";
|
||||
image = ItemSpriteSheet.WAND_ACID;
|
||||
image = ItemSpriteSheet.WAND_VENOM;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.VenomGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Poison;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Callback;
|
||||
|
||||
/**
|
||||
* Created by Evan on 12/04/2015.
|
||||
*/
|
||||
public class WandOfVenom extends Wand {
|
||||
|
||||
{
|
||||
name = "Wand of Venom";
|
||||
//TODO: final sprite
|
||||
image = ItemSpriteSheet.WAND_VENOM;
|
||||
|
||||
collisionProperties = Ballistica.STOP_TARGET | Ballistica.STOP_TERRAIN;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onZap(Ballistica bolt) {
|
||||
//TODO: final balancing
|
||||
GameScene.add(Blob.seed(bolt.collisionPos, 40+20*level, VenomGas.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fx(Ballistica bolt, Callback callback) {
|
||||
//TODO: final visuals
|
||||
MagicMissile.poison(curUser.sprite.parent, bolt.sourcePos, bolt.collisionPos, callback);
|
||||
Sample.INSTANCE.play(Assets.SND_ZAP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
new Poison().proc(staff, attacker, defender, damage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return
|
||||
"This wand has a purple body which opens to a shining green gem. " +
|
||||
"A small amount of foul smelling gas leaks from the gem.\n\n" +
|
||||
"This wand shoots a bolt which explodes into a cloud of vile venomous gas at a targeted location. " +
|
||||
"Anything caught inside this cloud will constantly take damage, increasing with time.";
|
||||
}
|
||||
}
|
|
@ -118,7 +118,7 @@ public class ItemSpriteSheet {
|
|||
public static final int WAND_LIGHTNING = ROW6+3;
|
||||
public static final int WAND_DISINTEGRATION = ROW6+4;
|
||||
public static final int WAND_PRISMATIC_LIGHT= ROW6+5;
|
||||
public static final int WAND_ACID = ROW6+6;
|
||||
public static final int WAND_VENOM = ROW6+6;
|
||||
public static final int WAND_CORRUPTION = ROW6+7;
|
||||
public static final int WAND_WARDING = ROW6+8;
|
||||
public static final int WAND_REGROWTH = ROW6+9;
|
||||
|
|
Loading…
Reference in New Issue
Block a user