V0.1.1: updated sprites, added seed to generator, fixed (hopefully) all bugs
This commit is contained in:
parent
7403aa8359
commit
fb115114f4
BIN
assets/items.png
BIN
assets/items.png
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 |
|
@ -184,8 +184,9 @@ public class Generator {
|
|||
Sungrass.Seed.class,
|
||||
Earthroot.Seed.class,
|
||||
Fadeleaf.Seed.class,
|
||||
Rotberry.Seed.class };
|
||||
Category.SEED.probs = new float[]{ 1, 1, 1, 1, 1, 1, 1, 0 };
|
||||
Rotberry.Seed.class,
|
||||
BlandfruitBush.Seed.class};
|
||||
Category.SEED.probs = new float[]{ 7, 7, 7, 7, 7, 7, 7, 0, 1 };
|
||||
}
|
||||
|
||||
public static void reset() {
|
||||
|
|
|
@ -242,12 +242,13 @@ public class Heap implements Bundlable {
|
|||
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 );
|
||||
|
||||
Blandfruit result = new Blandfruit();
|
||||
result.cook((Seed)items.get(1));
|
||||
result.cook((Seed)items.get(0));
|
||||
|
||||
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 );
|
||||
Sample.INSTANCE.play( Assets.SND_PUFF );
|
||||
|
|
|
@ -18,6 +18,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
/**
|
||||
|
@ -232,22 +233,22 @@ public class Blandfruit extends Food {
|
|||
super.restoreFromBundle(bundle);
|
||||
name = bundle.getString(NAME);
|
||||
|
||||
if (name == "Healthfruit")
|
||||
if (name.equals("Healthfruit"))
|
||||
cook(new Sungrass.Seed());
|
||||
else if (name == "Powerfruit")
|
||||
else if (name.equals("Powerfruit"))
|
||||
//TODO: make sure this doesn't break anything
|
||||
cook(new Wandmaker.Rotberry.Seed());
|
||||
else if (name == "Paralyzefruit")
|
||||
else if (name.equals("Paralyzefruit"))
|
||||
cook(new Earthroot.Seed());
|
||||
else if (name == "Invisifruit")
|
||||
else if (name.equals("Invisifruit"))
|
||||
cook(new Blindweed.Seed());
|
||||
else if (name == "Flamefruit")
|
||||
else if (name.equals("Flamefruit"))
|
||||
cook(new Firebloom.Seed());
|
||||
else if (name == "Frostfruit")
|
||||
else if (name.equals("Frostfruit"))
|
||||
cook(new Icecap.Seed());
|
||||
else if (name == "Visionfruit")
|
||||
else if (name.equals("Visionfruit"))
|
||||
cook(new Fadeleaf.Seed());
|
||||
else if (name == "Toxicfruit")
|
||||
else if (name.equals("Toxicfruit"))
|
||||
cook(new Sorrowmoss.Seed());
|
||||
|
||||
}
|
||||
|
|
|
@ -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,32 +49,31 @@ 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;
|
||||
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() {
|
||||
@Override
|
||||
|
|
|
@ -2,15 +2,8 @@ package com.shatteredpixel.shatteredpixeldungeon.plants;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
|
||||
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.items.food.Blandfruit;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
/**
|
||||
* Created by Evan on 13/08/2014.
|
||||
|
@ -30,7 +23,7 @@ public class BlandfruitBush extends Plant {
|
|||
public void activate( Char ch ) {
|
||||
super.activate( ch );
|
||||
|
||||
Dungeon.level.drop( new Seed(), pos ).sprite.drop();
|
||||
Dungeon.level.drop( new Blandfruit(), pos ).sprite.drop();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -43,7 +36,7 @@ public class BlandfruitBush extends Plant {
|
|||
plantName = "Blandfruit";
|
||||
|
||||
name = "seed of " + plantName;
|
||||
image = ItemSpriteSheet.SEED_BLINDWEED;
|
||||
image = ItemSpriteSheet.SEED_BLANDFRUIT;
|
||||
|
||||
plantClass = BlandfruitBush.class;
|
||||
alchemyClass = null;
|
||||
|
|
|
@ -129,6 +129,7 @@ public class ItemSpriteSheet {
|
|||
public static final int SEED_EARTHROOT = 93;
|
||||
public static final int SEED_FADELEAF = 94;
|
||||
public static final int SEED_ROTBERRY = 95;
|
||||
public static final int SEED_BLANDFRUIT = 118;
|
||||
|
||||
// Quest items
|
||||
public static final int ROSE = 100;
|
||||
|
|
Loading…
Reference in New Issue
Block a user