V0.1.1: updated sprites, added seed to generator, fixed (hopefully) all bugs

This commit is contained in:
Evan Debenham 2014-08-15 22:48:02 -04:00
parent 7403aa8359
commit fb115114f4
9 changed files with 43 additions and 43 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -184,8 +184,9 @@ public class Generator {
Sungrass.Seed.class, Sungrass.Seed.class,
Earthroot.Seed.class, Earthroot.Seed.class,
Fadeleaf.Seed.class, Fadeleaf.Seed.class,
Rotberry.Seed.class }; Rotberry.Seed.class,
Category.SEED.probs = new float[]{ 1, 1, 1, 1, 1, 1, 1, 0 }; BlandfruitBush.Seed.class};
Category.SEED.probs = new float[]{ 7, 7, 7, 7, 7, 7, 7, 0, 1 };
} }
public static void reset() { public static void reset() {

View File

@ -242,12 +242,13 @@ public class Heap implements Bundlable {
int count = 0; int count = 0;
if (items.get(0) instanceof Blandfruit && items.get(1) instanceof Seed) { if (items.size() == 2 && items.get(0) instanceof Seed && items.get(1) instanceof Blandfruit ) {
Sample.INSTANCE.play( Assets.SND_PUFF );
CellEmitter.center( pos ).burst( Speck.factory( Speck.EVOKE ), 3 ); CellEmitter.center( pos ).burst( Speck.factory( Speck.EVOKE ), 3 );
Blandfruit result = new Blandfruit(); Blandfruit result = new Blandfruit();
result.cook((Seed)items.get(1)); result.cook((Seed)items.get(0));
destroy(); destroy();
@ -266,7 +267,7 @@ public class Heap implements Bundlable {
} }
} }
} else if (count >= SEEDS_TO_POTION) { if (count >= SEEDS_TO_POTION) {
CellEmitter.get( pos ).burst( Speck.factory( Speck.WOOL ), 6 ); CellEmitter.get( pos ).burst( Speck.factory( Speck.WOOL ), 6 );
Sample.INSTANCE.play( Assets.SND_PUFF ); Sample.INSTANCE.play( Assets.SND_PUFF );

View File

@ -18,6 +18,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Bundle;
import com.watabou.utils.Random; import com.watabou.utils.Random;
/** /**
@ -232,22 +233,22 @@ public class Blandfruit extends Food {
super.restoreFromBundle(bundle); super.restoreFromBundle(bundle);
name = bundle.getString(NAME); name = bundle.getString(NAME);
if (name == "Healthfruit") if (name.equals("Healthfruit"))
cook(new Sungrass.Seed()); cook(new Sungrass.Seed());
else if (name == "Powerfruit") else if (name.equals("Powerfruit"))
//TODO: make sure this doesn't break anything //TODO: make sure this doesn't break anything
cook(new Wandmaker.Rotberry.Seed()); cook(new Wandmaker.Rotberry.Seed());
else if (name == "Paralyzefruit") else if (name.equals("Paralyzefruit"))
cook(new Earthroot.Seed()); cook(new Earthroot.Seed());
else if (name == "Invisifruit") else if (name.equals("Invisifruit"))
cook(new Blindweed.Seed()); cook(new Blindweed.Seed());
else if (name == "Flamefruit") else if (name.equals("Flamefruit"))
cook(new Firebloom.Seed()); cook(new Firebloom.Seed());
else if (name == "Frostfruit") else if (name.equals("Frostfruit"))
cook(new Icecap.Seed()); cook(new Icecap.Seed());
else if (name == "Visionfruit") else if (name.equals("Visionfruit"))
cook(new Fadeleaf.Seed()); cook(new Fadeleaf.Seed());
else if (name == "Toxicfruit") else if (name.equals("Toxicfruit"))
cook(new Sorrowmoss.Seed()); cook(new Sorrowmoss.Seed());
} }

View File

@ -23,6 +23,8 @@ import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
import com.shatteredpixel.shatteredpixeldungeon.plants.BlandfruitBush;
import com.watabou.noosa.Scene; import com.watabou.noosa.Scene;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
@ -504,7 +506,8 @@ public abstract class Level implements Bundlable {
public Heap drop( Item item, int cell ) { public Heap drop( Item item, int cell ) {
if ((map[cell] == Terrain.ALCHEMY) && !(item instanceof Plant.Seed)) { if ((map[cell] == Terrain.ALCHEMY) && (item instanceof BlandfruitBush.Seed || !(item instanceof Plant.Seed ||
(item instanceof Blandfruit && ((Blandfruit) item).potionAttrib == null && heaps.get(cell) == null)))) {
int n; int n;
do { do {
n = cell + NEIGHBOURS8[Random.Int( 8 )]; n = cell + NEIGHBOURS8[Random.Int( 8 )];

View File

@ -37,10 +37,11 @@ public class AlchemyPot {
private static final String TXT_OPTIONS = private static final String TXT_OPTIONS =
"Do you want to cook a Blandfruit with a seed, or brew a Potion from seeds?"; "Do you want to cook a Blandfruit with a seed, or brew a Potion from seeds?";
private static Hero hero; public static Hero hero;
private static int pos; public static int pos;
public static boolean cookingFruit; public static boolean foundFruit;
public static Item curItem = null;
public static void operate( Hero hero, int pos ) { public static void operate( Hero hero, int pos ) {
@ -48,32 +49,31 @@ public class AlchemyPot {
AlchemyPot.pos = pos; AlchemyPot.pos = pos;
Iterator<Item> items = hero.belongings.iterator(); Iterator<Item> items = hero.belongings.iterator();
Item curItem = null; foundFruit = false;
cookingFruit = false;
Heap heap = Dungeon.level.heaps.get( pos ); Heap heap = Dungeon.level.heaps.get( pos );
if (heap == null) if (heap == null)
while (items.hasNext() && cookingFruit == false){ while (items.hasNext() && !foundFruit){
curItem = items.next(); curItem = items.next();
if (curItem instanceof Blandfruit) if (curItem instanceof Blandfruit && ((Blandfruit) curItem).potionAttrib == null){
if (((Blandfruit) curItem).potionAttrib == null)
GameScene.show( GameScene.show(
new WndOptions( TXT_POT, TXT_OPTIONS, TXT_FRUIT, TXT_POTION ){ new WndOptions(TXT_POT, TXT_OPTIONS, TXT_FRUIT, TXT_POTION) {
@Override @Override
protected void onSelect( int index ) { protected void onSelect(int index) {
if (index == 0) if (index == 0) {
cookingFruit = true; curItem.cast( AlchemyPot.hero, AlchemyPot.pos );
} else
GameScene.selectItem(itemSelector, WndBag.Mode.SEED, TXT_SELECT_SEED);
} }
} }
); );
foundFruit = true;
}
} }
if (cookingFruit) { if (!foundFruit)
curItem.cast( hero, pos );
} else {
GameScene.selectItem(itemSelector, WndBag.Mode.SEED, TXT_SELECT_SEED); GameScene.selectItem(itemSelector, WndBag.Mode.SEED, TXT_SELECT_SEED);
} }
}
private static final WndBag.Listener itemSelector = new WndBag.Listener() { private static final WndBag.Listener itemSelector = new WndBag.Listener() {
@Override @Override

View File

@ -2,15 +2,8 @@ package com.shatteredpixel.shatteredpixeldungeon.plants;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfInvisibility;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.utils.Random;
/** /**
* Created by Evan on 13/08/2014. * Created by Evan on 13/08/2014.
@ -30,7 +23,7 @@ public class BlandfruitBush extends Plant {
public void activate( Char ch ) { public void activate( Char ch ) {
super.activate( ch ); super.activate( ch );
Dungeon.level.drop( new Seed(), pos ).sprite.drop(); Dungeon.level.drop( new Blandfruit(), pos ).sprite.drop();
} }
@Override @Override
@ -43,7 +36,7 @@ public class BlandfruitBush extends Plant {
plantName = "Blandfruit"; plantName = "Blandfruit";
name = "seed of " + plantName; name = "seed of " + plantName;
image = ItemSpriteSheet.SEED_BLINDWEED; image = ItemSpriteSheet.SEED_BLANDFRUIT;
plantClass = BlandfruitBush.class; plantClass = BlandfruitBush.class;
alchemyClass = null; alchemyClass = null;

View File

@ -129,6 +129,7 @@ public class ItemSpriteSheet {
public static final int SEED_EARTHROOT = 93; public static final int SEED_EARTHROOT = 93;
public static final int SEED_FADELEAF = 94; public static final int SEED_FADELEAF = 94;
public static final int SEED_ROTBERRY = 95; public static final int SEED_ROTBERRY = 95;
public static final int SEED_BLANDFRUIT = 118;
// Quest items // Quest items
public static final int ROSE = 100; public static final int ROSE = 100;