Search in sources :

Example 1 with Pasty

use of com.shatteredpixel.shatteredpixeldungeon.items.food.Pasty in project shattered-pixel-dungeon-gdx by 00-Evan.

the class SecretLarderRoom method paint.

@Override
public void paint(Level level) {
    Painter.fill(level, this, Terrain.WALL);
    Painter.fill(level, this, 1, Terrain.EMPTY_SP);
    Point c = center();
    Painter.fill(level, c.x - 1, c.y - 1, 3, 3, Terrain.WATER);
    Painter.set(level, c, Terrain.GRASS);
    level.plant(new BlandfruitBush.Seed(), level.pointToCell(c));
    int extraFood = (int) (Hunger.STARVING - Hunger.HUNGRY) * (1 + Dungeon.depth / 5);
    while (extraFood > 0) {
        Food food;
        if (extraFood >= Hunger.STARVING) {
            food = new Pasty();
            extraFood -= Hunger.STARVING;
        } else {
            food = new ChargrilledMeat();
            extraFood -= (Hunger.STARVING - Hunger.HUNGRY);
        }
        int foodPos;
        do {
            foodPos = level.pointToCell(random());
        } while (level.map[foodPos] != Terrain.EMPTY_SP || level.heaps.get(foodPos) != null);
        level.drop(food, foodPos);
    }
    entrance().set(Door.Type.HIDDEN);
}
Also used : Pasty(com.shatteredpixel.shatteredpixeldungeon.items.food.Pasty) ChargrilledMeat(com.shatteredpixel.shatteredpixeldungeon.items.food.ChargrilledMeat) BlandfruitBush(com.shatteredpixel.shatteredpixeldungeon.plants.BlandfruitBush) Point(com.watabou.utils.Point) Point(com.watabou.utils.Point) Food(com.shatteredpixel.shatteredpixeldungeon.items.food.Food)

Aggregations

ChargrilledMeat (com.shatteredpixel.shatteredpixeldungeon.items.food.ChargrilledMeat)1 Food (com.shatteredpixel.shatteredpixeldungeon.items.food.Food)1 Pasty (com.shatteredpixel.shatteredpixeldungeon.items.food.Pasty)1 BlandfruitBush (com.shatteredpixel.shatteredpixeldungeon.plants.BlandfruitBush)1 Point (com.watabou.utils.Point)1