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
@@ -23,6 +23,8 @@ import java.util.Collection;
import java.util.HashMap;
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.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
@@ -504,7 +506,8 @@ public abstract class Level implements Bundlable {
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;
do {
n = cell + NEIGHBOURS8[Random.Int( 8 )];
@@ -37,10 +37,11 @@ public class AlchemyPot {
private static final String TXT_OPTIONS =
"Do you want to cook a Blandfruit with a seed, or brew a Potion from seeds?";
private static Hero hero;
private static int pos;
public static Hero hero;
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 ) {
@@ -48,31 +49,30 @@ public class AlchemyPot {
AlchemyPot.pos = pos;
Iterator<Item> items = hero.belongings.iterator();
Item curItem = null;
cookingFruit = false;
foundFruit = false;
Heap heap = Dungeon.level.heaps.get( pos );
if (heap == null)
while (items.hasNext() && cookingFruit == false){
while (items.hasNext() && !foundFruit){
curItem = items.next();
if (curItem instanceof Blandfruit)
if (((Blandfruit) curItem).potionAttrib == null)
if (curItem instanceof Blandfruit && ((Blandfruit) curItem).potionAttrib == null){
GameScene.show(
new WndOptions( TXT_POT, TXT_OPTIONS, TXT_FRUIT, TXT_POTION ){
@Override
protected void onSelect( int index ) {
if (index == 0)
cookingFruit = true;
new WndOptions(TXT_POT, TXT_OPTIONS, TXT_FRUIT, TXT_POTION) {
@Override
protected void onSelect(int index) {
if (index == 0) {
curItem.cast( AlchemyPot.hero, AlchemyPot.pos );
} else
GameScene.selectItem(itemSelector, WndBag.Mode.SEED, TXT_SELECT_SEED);
}
}
}
);
);
foundFruit = true;
}
}
if (cookingFruit) {
curItem.cast( hero, pos );
} else {
if (!foundFruit)
GameScene.selectItem(itemSelector, WndBag.Mode.SEED, TXT_SELECT_SEED);
}
}
private static final WndBag.Listener itemSelector = new WndBag.Listener() {