v0.2.3: improved blandfruit: previously harmful fruit now give unique buffs.

Renamed fruit to be more heavily tied to their seeds.
New buffs have placeholder graphics, need permanent ones.
This commit is contained in:
Evan Debenham 2014-11-19 17:04:07 -05:00
parent b73ee347f6
commit b8355f0471
5 changed files with 170 additions and 29 deletions

View File

@ -17,30 +17,30 @@
*/ */
package com.shatteredpixel.shatteredpixeldungeon.actors; package com.shatteredpixel.shatteredpixeldungeon.actors;
import java.util.ArrayList;
import java.util.HashSet;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.*;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CloakOfShadows;
import com.watabou.noosa.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.ResultDescriptions; import com.shatteredpixel.shatteredpixeldungeon.ResultDescriptions;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.*;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Bestiary; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Bestiary;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.PoisonParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.PoisonParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CloakOfShadows;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Door; import com.shatteredpixel.shatteredpixeldungeon.levels.features.Door;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Bundlable; import com.watabou.utils.Bundlable;
import com.watabou.utils.Bundle; import com.watabou.utils.Bundle;
import com.watabou.utils.Random; import com.watabou.utils.Random;
import java.util.ArrayList;
import java.util.HashSet;
public abstract class Char extends Actor { public abstract class Char extends Actor {
protected static final String TXT_HIT = "%s hit %s"; protected static final String TXT_HIT = "%s hit %s";
@ -140,6 +140,11 @@ public abstract class Char extends Actor {
Dungeon.hero.interrupt(); Dungeon.hero.interrupt();
} }
if (buff(FireImbue.class) != null)
buff(FireImbue.class).proc(enemy);
if (buff(EarthImbue.class) != null)
buff(EarthImbue.class).proc(enemy);
enemy.sprite.bloodBurstA( sprite.center(), effectiveDamage ); enemy.sprite.bloodBurstA( sprite.center(), effectiveDamage );
enemy.sprite.flash(); enemy.sprite.flash();

View File

@ -0,0 +1,35 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import java.util.HashSet;
/**
* Created by debenhame on 19/11/2014.
*/
public class EarthImbue extends FlavourBuff {
public static final float DURATION = 20f;
public void proc(Char enemy){
Buff.affect(enemy, Roots.class);
}
@Override
public int icon() {
return BuffIndicator.IMMUNITY;
}
@Override
public String toString() {
return "Imbued with Earth";
}
public static final HashSet<Class<?>> IMMUNITIES = new HashSet<Class<?>>();
static {
IMMUNITIES.add( Paralysis.class );
IMMUNITIES.add( Roots.class );
IMMUNITIES.add( Slow.class );
}
}

View File

@ -0,0 +1,49 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Random;
import java.util.HashSet;
/**
* Created by debenhame on 19/11/2014.
*/
public class FireImbue extends Buff {
public static final float DURATION = 20f;
@Override
public boolean act() {
if (Dungeon.level.map[target.pos] == Terrain.GRASS)
Dungeon.level.set(target.pos, Terrain.EMBERS);
spend(TICK);
return true;
}
public void proc(Char enemy){
if (Random.Int(3) == 0)
Buff.affect( enemy, Burning.class ).reignite( enemy );
enemy.sprite.emitter().burst( FlameParticle.FACTORY, 2 );
}
@Override
public int icon() {
return BuffIndicator.IMMUNITY;
}
@Override
public String toString() {
return "Imbued with Fire";
}
public static final HashSet<Class<?>> IMMUNITIES = new HashSet<Class<?>>();
static {
IMMUNITIES.add( Burning.class );
}
}

View File

@ -0,0 +1,40 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import java.util.HashSet;
/**
* Created by debenhame on 19/11/2014.
*/
public class ToxicImbue extends Buff {
public static final float DURATION = 20f;
@Override
public boolean act() {
GameScene.add(Blob.seed(target.pos, 50, ToxicGas.class));
spend(TICK);
return true;
}
@Override
public int icon() {
return BuffIndicator.IMMUNITY;
}
@Override
public String toString() {
return "Imbued with Toxicity";
}
public static final HashSet<Class<?>> IMMUNITIES = new HashSet<Class<?>>();
static {
IMMUNITIES.add( ToxicGas.class );
IMMUNITIES.add( Poison.class );
}
}

View File

@ -7,9 +7,12 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.EarthImbue;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FireImbue;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ToxicImbue;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker;
@ -125,6 +128,15 @@ public class Blandfruit extends Food {
} }
break; break;
} }
} else if (potionAttrib instanceof PotionOfLiquidFlame){
GLog.i("You feel a great fire burning within you!");
Buff.affect(hero, FireImbue.class);
} else if (potionAttrib instanceof PotionOfToxicGas) {
GLog.i("You are imbued with vile toxic power!");
Buff.affect(hero, ToxicImbue.class);
} else if (potionAttrib instanceof PotionOfParalyticGas) {
GLog.i("You feel the power of the earth coursing through you!");
Buff.affect(hero, EarthImbue.class);
} else } else
potionAttrib.apply(hero); potionAttrib.apply(hero);
@ -182,61 +194,61 @@ public class Blandfruit extends Food {
if (potionAttrib instanceof PotionOfHealing){ if (potionAttrib instanceof PotionOfHealing){
name = "Healthfruit"; name = "Sunfruit";
potionGlow = new ItemSprite.Glowing( 0x2EE62E ); potionGlow = new ItemSprite.Glowing( 0x2EE62E );
info += "It looks delicious and hearty, ready to be eaten!"; info += "It looks delicious and hearty, ready to be eaten!";
} else if (potionAttrib instanceof PotionOfStrength){ } else if (potionAttrib instanceof PotionOfStrength){
name = "Powerfruit"; name = "Rotfruit";
potionGlow = new ItemSprite.Glowing( 0xCC0022 ); potionGlow = new ItemSprite.Glowing( 0xCC0022 );
info += "It looks delicious and powerful, ready to be eaten!"; info += "It looks delicious and powerful, ready to be eaten!";
} else if (potionAttrib instanceof PotionOfParalyticGas){ } else if (potionAttrib instanceof PotionOfParalyticGas){
name = "Paralyzefruit"; name = "Earthfruit";
potionGlow = new ItemSprite.Glowing( 0x67583D ); potionGlow = new ItemSprite.Glowing( 0x67583D );
info += "It looks firm and volatile, eating this might be unsafe."; info += "It looks delicious and firm, ready to be eaten!";
} else if (potionAttrib instanceof PotionOfInvisibility){ } else if (potionAttrib instanceof PotionOfInvisibility){
name = "Invisifruit"; name = "Blindfruit";
potionGlow = new ItemSprite.Glowing( 0xE5D273 ); potionGlow = new ItemSprite.Glowing( 0xE5D273 );
info += "It looks delicious and shiny, ready to be eaten!"; info += "It looks delicious and shiny, ready to be eaten!";
} else if (potionAttrib instanceof PotionOfLiquidFlame){ } else if (potionAttrib instanceof PotionOfLiquidFlame){
name = "Flamefruit"; name = "Firefruit";
potionGlow = new ItemSprite.Glowing( 0xFF7F00 ); potionGlow = new ItemSprite.Glowing( 0xFF7F00 );
info += "It looks spicy and volatile, eating this might be unsafe."; info += "It looks delicious and spicy, ready to be eaten!";
} else if (potionAttrib instanceof PotionOfFrost){ } else if (potionAttrib instanceof PotionOfFrost){
name = "Frostfruit"; name = "Icefruit";
potionGlow = new ItemSprite.Glowing( 0x66B3FF ); potionGlow = new ItemSprite.Glowing( 0x66B3FF );
info += "It looks delicious and refreshing, ready to be eaten!"; info += "It looks delicious and refreshing, ready to be eaten!";
} else if (potionAttrib instanceof PotionOfMindVision){ } else if (potionAttrib instanceof PotionOfMindVision){
name = "Visionfruit"; name = "Fadefruit";
potionGlow = new ItemSprite.Glowing( 0xB8E6CF ); potionGlow = new ItemSprite.Glowing( 0xB8E6CF );
info += "It looks delicious and shadowy, ready to be eaten!"; info += "It looks delicious and shadowy, ready to be eaten!";
} else if (potionAttrib instanceof PotionOfToxicGas){ } else if (potionAttrib instanceof PotionOfToxicGas){
name = "Toxicfruit"; name = "Sorrowfruit";
potionGlow = new ItemSprite.Glowing( 0xA15CE5 ); potionGlow = new ItemSprite.Glowing( 0xA15CE5 );
info += "It looks crisp and volatile, eating this might be unsafe."; info += "It looks delicious and crisp, ready to be eaten!";
} else if (potionAttrib instanceof PotionOfLevitation) { } else if (potionAttrib instanceof PotionOfLevitation) {
name = "Floatfruit"; name = "Stormfruit";
potionGlow = new ItemSprite.Glowing( 0x1C3A57 ); potionGlow = new ItemSprite.Glowing( 0x1C3A57 );
info += "It looks delicious and lightweight, ready to be eaten!"; info += "It looks delicious and lightweight, ready to be eaten!";
} else if (potionAttrib instanceof PotionOfPurity) { } else if (potionAttrib instanceof PotionOfPurity) {
name = "Purefruit"; name = "Dreamfruit";
potionGlow = new ItemSprite.Glowing( 0x8E2975 ); potionGlow = new ItemSprite.Glowing( 0x8E2975 );
info += "It looks delicious and clean, ready to be eaten!"; info += "It looks delicious and clean, ready to be eaten!";
@ -274,25 +286,25 @@ public class Blandfruit extends Food {
super.restoreFromBundle(bundle); super.restoreFromBundle(bundle);
name = bundle.getString(NAME); name = bundle.getString(NAME);
if (name.equals("Healthfruit")) if (name.equals("Sunfruit"))
cook(new Sungrass.Seed()); cook(new Sungrass.Seed());
else if (name.equals("Powerfruit")) else if (name.equals("Rotfruit"))
cook(new Wandmaker.Rotberry.Seed()); cook(new Wandmaker.Rotberry.Seed());
else if (name.equals("Paralyzefruit")) else if (name.equals("Earthfruit"))
cook(new Earthroot.Seed()); cook(new Earthroot.Seed());
else if (name.equals("Invisifruit")) else if (name.equals("Blindfruit"))
cook(new Blindweed.Seed()); cook(new Blindweed.Seed());
else if (name.equals("Flamefruit")) else if (name.equals("Firefruit"))
cook(new Firebloom.Seed()); cook(new Firebloom.Seed());
else if (name.equals("Frostfruit")) else if (name.equals("Icefruit"))
cook(new Icecap.Seed()); cook(new Icecap.Seed());
else if (name.equals("Visionfruit")) else if (name.equals("Fadefruit"))
cook(new Fadeleaf.Seed()); cook(new Fadeleaf.Seed());
else if (name.equals("Toxicfruit")) else if (name.equals("Sorrowfruit"))
cook(new Sorrowmoss.Seed()); cook(new Sorrowmoss.Seed());
else if (name.equals("Floatfruit")) else if (name.equals("Stormfruit"))
cook(new Stormvine.Seed()); cook(new Stormvine.Seed());
else if (name.equals("Purefruit")) else if (name.equals("Dreamfruit"))
cook(new Dreamfoil.Seed()); cook(new Dreamfoil.Seed());
} }