v0.6.2: adjustments to two more secret rooms
This commit is contained in:
+7
-4
@@ -39,19 +39,22 @@ public class SecretHoneypotRoom extends SecretRoom {
|
|||||||
Painter.fill( level, this, Terrain.WALL );
|
Painter.fill( level, this, Terrain.WALL );
|
||||||
Painter.fill(level, this, 1, Terrain.EMPTY );
|
Painter.fill(level, this, 1, Terrain.EMPTY );
|
||||||
|
|
||||||
Point center = center();
|
Point brokenPotPos = center();
|
||||||
|
|
||||||
|
brokenPotPos.x = (brokenPotPos.x + entrance().x) / 2;
|
||||||
|
brokenPotPos.y = (brokenPotPos.y + entrance().y) / 2;
|
||||||
|
|
||||||
Honeypot.ShatteredPot pot = new Honeypot.ShatteredPot();
|
Honeypot.ShatteredPot pot = new Honeypot.ShatteredPot();
|
||||||
level.drop(pot, level.pointToCell(center));
|
level.drop(pot, level.pointToCell(brokenPotPos));
|
||||||
|
|
||||||
Bee bee = new Bee();
|
Bee bee = new Bee();
|
||||||
bee.spawn( Dungeon.depth );
|
bee.spawn( Dungeon.depth );
|
||||||
bee.HP = bee.HT;
|
bee.HP = bee.HT;
|
||||||
bee.pos = level.pointToCell(center);
|
bee.pos = level.pointToCell(brokenPotPos);
|
||||||
level.mobs.add( bee );
|
level.mobs.add( bee );
|
||||||
|
|
||||||
pot.setBee(bee);
|
pot.setBee(bee);
|
||||||
bee.setPotInfo(level.pointToCell(center), null);
|
bee.setPotInfo(level.pointToCell(brokenPotPos), null);
|
||||||
|
|
||||||
placeItem(new Honeypot(), level);
|
placeItem(new Honeypot(), level);
|
||||||
|
|
||||||
|
|||||||
+26
-37
@@ -21,36 +21,27 @@
|
|||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.secret;
|
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.secret;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.ChargrilledMeat;
|
import com.shatteredpixel.shatteredpixeldungeon.items.food.ChargrilledMeat;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
|
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.Pasty;
|
import com.shatteredpixel.shatteredpixeldungeon.items.food.Pasty;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.SmallRation;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.plants.BlandfruitBush;
|
||||||
import com.watabou.utils.Point;
|
import com.watabou.utils.Point;
|
||||||
import com.watabou.utils.Random;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class SecretLarderRoom extends SecretRoom {
|
public class SecretLarderRoom extends SecretRoom {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canConnect(Point p) {
|
public int minHeight() {
|
||||||
//refuses connections from the top
|
return 6;
|
||||||
return super.canConnect(p) && p.y > top+1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int maxWidth() {
|
public int minWidth() {
|
||||||
return 8;
|
return 6;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int maxHeight() {
|
|
||||||
return 8;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -58,31 +49,29 @@ public class SecretLarderRoom extends SecretRoom {
|
|||||||
Painter.fill(level, this, Terrain.WALL);
|
Painter.fill(level, this, Terrain.WALL);
|
||||||
Painter.fill(level, this, 1, Terrain.EMPTY_SP);
|
Painter.fill(level, this, 1, Terrain.EMPTY_SP);
|
||||||
|
|
||||||
int nFood = width()-2;
|
Point c = center();
|
||||||
ArrayList<Item> foodItems = new ArrayList<>();
|
|
||||||
|
|
||||||
//generates 900 food value, spread out over 3-6 pieces of food
|
Painter.fill(level, c.x-1, c.y-1, 3, 3, Terrain.WATER);
|
||||||
if (nFood <= 4){
|
Painter.set(level, c, Terrain.GRASS);
|
||||||
foodItems.add(Random.Int(2) == 0 ? new Blandfruit() : new Pasty());
|
|
||||||
nFood--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nFood == 3 || nFood == 5){
|
level.plant(new BlandfruitBush.Seed(), level.pointToCell(c));
|
||||||
foodItems.add(new Food());
|
|
||||||
nFood--;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (nFood > 0){
|
int extraFood = (int)(Hunger.STARVING - Hunger.HUNGRY) * (1 + Dungeon.depth / 5);
|
||||||
foodItems.add(Random.Int(2) == 0 ? new ChargrilledMeat() : new SmallRation());
|
|
||||||
nFood--;
|
|
||||||
}
|
|
||||||
|
|
||||||
Random.shuffle(foodItems);
|
while (extraFood > 0){
|
||||||
|
Food food;
|
||||||
int topLeft = level.pointToCell(new Point(left+1, top+1));
|
if (extraFood >= Hunger.STARVING){
|
||||||
for(int i = 0; i < foodItems.size(); i++){
|
food = new Pasty();
|
||||||
level.drop( foodItems.get(i), topLeft+i );
|
extraFood -= Hunger.STARVING;
|
||||||
Painter.set(level, topLeft+i, Terrain.PEDESTAL);
|
} 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);
|
entrance().set(Door.Type.HIDDEN);
|
||||||
|
|||||||
Reference in New Issue
Block a user