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);
}
Aggregations