v0.7.5: significantly improved room variety on floor 5

This commit is contained in:
Evan Debenham 2019-08-14 20:14:34 -04:00
parent bb9a1850d8
commit 0077e36c17
24 changed files with 470 additions and 97 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

View File

@ -122,6 +122,7 @@ public class Assets {
public static final String LOADING_HALLS = "loading_halls.png"; public static final String LOADING_HALLS = "loading_halls.png";
public static final String WEAK_FLOOR = "custom_tiles/weak_floor.png"; public static final String WEAK_FLOOR = "custom_tiles/weak_floor.png";
public static final String SEWER_BOSS = "custom_tiles/sewer_boss.png";
public static final String PRISON_QUEST = "custom_tiles/prison_quests.png"; public static final String PRISON_QUEST = "custom_tiles/prison_quests.png";
public static final String PRISON_EXIT = "custom_tiles/prison_exit.png"; public static final String PRISON_EXIT = "custom_tiles/prison_exit.png";

View File

@ -97,6 +97,11 @@ public class ShatteredPixelDungeon extends Game {
com.watabou.utils.Bundle.addAlias( com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Kinetic.class, com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Kinetic.class,
"com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Swift" ); "com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Swift" );
//v0.7.5
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.levels.rooms.sewerboss.SewerBossEntranceRoom.class,
"com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.SewerBossEntranceRoom" );
} }
@Override @Override

View File

@ -30,8 +30,8 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.builders.Builder;
import com.shatteredpixel.shatteredpixeldungeon.levels.builders.LoopBuilder; import com.shatteredpixel.shatteredpixeldungeon.levels.builders.LoopBuilder;
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.secret.RatKingRoom; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.secret.RatKingRoom;
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.EmptyRoom; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.sewerboss.GooBossRoom;
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.SewerBossEntranceRoom; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.sewerboss.SewerBossEntranceRoom;
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.StandardRoom; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.StandardRoom;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.watabou.utils.Bundle; import com.watabou.utils.Bundle;
@ -55,17 +55,18 @@ public class SewerBossLevel extends SewerLevel {
int standards = standardRooms(); int standards = standardRooms();
for (int i = 0; i < standards; i++) { for (int i = 0; i < standards; i++) {
initRooms.add(new EmptyRoom()); initRooms.add(StandardRoom.createRoom());
} }
initRooms.add(GooBossRoom.randomGooRoom());
initRooms.add(new RatKingRoom()); initRooms.add(new RatKingRoom());
return initRooms; return initRooms;
} }
@Override @Override
protected int standardRooms() { protected int standardRooms() {
//2 to 4, average 3 //2 to 3, average 2.5
return 2+Random.chances(new float[]{1, 1, 1}); return 2+Random.chances(new float[]{1, 1});
} }
protected Builder builder(){ protected Builder builder(){
@ -100,13 +101,6 @@ public class SewerBossLevel extends SewerLevel {
@Override @Override
protected void createMobs() { protected void createMobs() {
Goo boss = new Goo();
Room room;
do {
room = randomRoom(StandardRoom.class);
} while (room == roomEntrance);
boss.pos = pointToCell(room.random());
mobs.add( boss );
} }
public Actor respawner() { public Actor respawner() {

View File

@ -156,8 +156,10 @@ public abstract class Room extends Rect implements Graph.Node, Bundlable {
public static final int RIGHT = 3; public static final int RIGHT = 3;
public static final int BOTTOM = 4; public static final int BOTTOM = 4;
//TODO make abstract public int minConnections(int direction){
public int minConnections(int direction){ return -1; } if (direction == ALL) return 1;
else return 0;
}
public int curConnections(int direction){ public int curConnections(int direction){
if (direction == ALL) { if (direction == ALL) {
@ -181,8 +183,10 @@ public abstract class Room extends Rect implements Graph.Node, Bundlable {
else return maxConnections(direction) - curConnections(direction); else return maxConnections(direction) - curConnections(direction);
} }
//TODO make abstract public int maxConnections(int direction){
public int maxConnections(int direction){ return -1; } if (direction == ALL) return 16;
else return 4;
}
//only considers point-specific limits, not direction limits //only considers point-specific limits, not direction limits
public boolean canConnect(Point p){ public boolean canConnect(Point p){
@ -257,8 +261,7 @@ public abstract class Room extends Rect implements Graph.Node, Bundlable {
// **** Painter Logic **** // **** Painter Logic ****
//TODO make abstract public abstract void paint(Level level);
public void paint(Level level){}
//whether or not a painter can make its own modifications to a specific point //whether or not a painter can make its own modifications to a specific point
public boolean canPlaceWater(Point p){ public boolean canPlaceWater(Point p){

View File

@ -45,12 +45,6 @@ public abstract class ConnectionRoom extends Room {
else return 0; else return 0;
} }
@Override
public int maxConnections(int direction) {
if (direction == ALL) return 16;
else return 4;
}
@Override @Override
public boolean canPlaceTrap(Point p) { public boolean canPlaceTrap(Point p) {
//traps cannot appear in connection rooms on floor 1 //traps cannot appear in connection rooms on floor 1
@ -74,7 +68,7 @@ public abstract class ConnectionRoom extends Room {
static { static {
chances[1] = new float[]{20, 1, 0, 2, 2, 1}; chances[1] = new float[]{20, 1, 0, 2, 2, 1};
chances[4] = chances[3] = chances[2] = chances[1]; chances[4] = chances[3] = chances[2] = chances[1];
chances[5] = new float[]{18, 0, 0, 0, 7, 0}; chances[5] = new float[]{20, 0, 0, 0, 0, 0};
chances[6] = new float[]{0, 0, 22, 3, 0, 0}; chances[6] = new float[]{0, 0, 22, 3, 0, 0};
chances[10] = chances[9] = chances[8] = chances[7] = chances[6]; chances[10] = chances[9] = chances[8] = chances[7] = chances[6];

View File

@ -30,8 +30,6 @@ public class MazeConnectionRoom extends ConnectionRoom {
@Override @Override
public void paint(Level level) { public void paint(Level level) {
super.paint(level);
Painter.fill(level, this, 1, Terrain.EMPTY); Painter.fill(level, this, 1, Terrain.EMPTY);
//true = space, false = wall //true = space, false = wall

View File

@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.connection;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
import com.watabou.utils.Point; import com.watabou.utils.Point;
import java.util.ArrayList; import java.util.ArrayList;
@ -34,14 +35,25 @@ public class PerimeterRoom extends ConnectionRoom {
int floor = level.tunnelTile(); int floor = level.tunnelTile();
fillPerimiterPaths(level, this, floor);
for (Door door : connected.values()) {
door.set( Door.Type.TUNNEL );
}
}
public static void fillPerimiterPaths( Level l, Room r, int floor ){
corners = null;
ArrayList<Point> pointsToFill = new ArrayList<>(); ArrayList<Point> pointsToFill = new ArrayList<>();
for (Point door : connected.values()) { for (Point door : r.connected.values()) {
Point p = new Point(door); Point p = new Point(door);
if (p.y == top){ if (p.y == r.top){
p.y++; p.y++;
} else if (p.y == bottom) { } else if (p.y == r.bottom) {
p.y--; p.y--;
} else if (p.x == left){ } else if (p.x == r.left){
p.x++; p.x++;
} else { } else {
p.x--; p.x--;
@ -58,7 +70,7 @@ public class PerimeterRoom extends ConnectionRoom {
shortestDistance = Integer.MAX_VALUE; shortestDistance = Integer.MAX_VALUE;
for (Point f : pointsFilled){ for (Point f : pointsFilled){
for (Point t : pointsToFill){ for (Point t : pointsToFill){
int dist = distanceBetweenPoints(f, t); int dist = distanceBetweenPoints(r, f, t);
if (dist < shortestDistance){ if (dist < shortestDistance){
from = f; from = f;
to = t; to = t;
@ -66,46 +78,45 @@ public class PerimeterRoom extends ConnectionRoom {
} }
} }
} }
fillBetweenPoints(level, from, to, floor); fillBetweenPoints(l, r, from, to, floor);
pointsFilled.add(to); pointsFilled.add(to);
pointsToFill.remove(to); pointsToFill.remove(to);
} }
for (Door door : connected.values()) {
door.set( Door.Type.TUNNEL );
}
} }
private int spaceBetween(int a, int b){ private static int spaceBetween(int a, int b){
return Math.abs(a - b)-1; return Math.abs(a - b)-1;
} }
//gets the path distance between two points //gets the path distance between two points
private int distanceBetweenPoints(Point a, Point b){ private static int distanceBetweenPoints(Room r, Point a, Point b){
//on the same side //on the same side
if (a.y == b.y || a.x == b.x){ if (((a.x == r.left || a.x == r.right) && a.y == b.y)
|| ((a.y == r.top || a.y == r.bottom) && a.x == b.x)){
return Math.max(spaceBetween(a.x, b.x), spaceBetween(a.y, b.y)); return Math.max(spaceBetween(a.x, b.x), spaceBetween(a.y, b.y));
} }
//otherwise... //otherwise...
//subtract 1 at the end to account for overlap //subtract 1 at the end to account for overlap
return return
Math.min(spaceBetween(left, a.x) + spaceBetween(left, b.x), Math.min(spaceBetween(r.left, a.x) + spaceBetween(r.left, b.x),
spaceBetween(right, a.x) + spaceBetween(right, b.x)) spaceBetween(r.right, a.x) + spaceBetween(r.right, b.x))
+ +
Math.min(spaceBetween(top, a.y) + spaceBetween(top, b.y), Math.min(spaceBetween(r.top, a.y) + spaceBetween(r.top, b.y),
spaceBetween(bottom, a.y) + spaceBetween(bottom, b.y)) spaceBetween(r.bottom, a.y) + spaceBetween(r.bottom, b.y))
- -
1; 1;
} }
private Point[] corners; private static Point[] corners;
//picks the smallest path to fill between two points //picks the smallest path to fill between two points
private void fillBetweenPoints(Level level, Point from, Point to, int floor){ private static void fillBetweenPoints(Level level, Room r, Point from, Point to, int floor){
//doors are along the same side //doors are along the same side
if (from.y == to.y || from.x == to.x){ if (((from.x == r.left || from.x == r.right) && from.y == to.y)
|| ((from.y == r.top || from.y == r.bottom) && from.x == to.x)){
Painter.fill(level, Painter.fill(level,
Math.min(from.x, to.x), Math.min(from.x, to.x),
Math.min(from.y, to.y), Math.min(from.y, to.y),
@ -118,10 +129,10 @@ public class PerimeterRoom extends ConnectionRoom {
//set up corners //set up corners
if (corners == null){ if (corners == null){
corners = new Point[4]; corners = new Point[4];
corners[0] = new Point(left+1, top+1); corners[0] = new Point(r.left+1, r.top+1);
corners[1] = new Point(right-1, top+1); corners[1] = new Point(r.right-1, r.top+1);
corners[2] = new Point(right-1, bottom-1); corners[2] = new Point(r.right-1, r.bottom-1);
corners[3] = new Point(left+1, bottom-1); corners[3] = new Point(r.left+1, r.bottom-1);
} }
//doors on adjacent sides //doors on adjacent sides
@ -135,26 +146,26 @@ public class PerimeterRoom extends ConnectionRoom {
//doors on opposite sides //doors on opposite sides
Point side; Point side;
if (from.y == top+1 || from.y == bottom-1){ if (from.y == r.top+1 || from.y == r.bottom-1){
//connect along the left, or right side //connect along the left, or right side
if (spaceBetween(left, from.x) + spaceBetween(left, to.x) <= if (spaceBetween(r.left, from.x) + spaceBetween(r.left, to.x) <=
spaceBetween(right, from.x) + spaceBetween(right, to.x)){ spaceBetween(r.right, from.x) + spaceBetween(r.right, to.x)){
side = new Point(left+1, top + height()/2); side = new Point(r.left+1, r.top + r.height()/2);
} else { } else {
side = new Point(right-1, top + height()/2); side = new Point(r.right-1, r.top + r.height()/2);
} }
} else { } else {
//connect along the top, or bottom side //connect along the top, or bottom side
if (spaceBetween(top, from.y) + spaceBetween(top, to.y) <= if (spaceBetween(r.top, from.y) + spaceBetween(r.top, to.y) <=
spaceBetween(bottom, from.y) + spaceBetween(bottom, to.y)){ spaceBetween(r.bottom, from.y) + spaceBetween(r.bottom, to.y)){
side = new Point(left + width()/2, top+1); side = new Point(r.left + r.width()/2, r.top+1);
} else { } else {
side = new Point(left + width()/2, bottom-1); side = new Point(r.left + r.width()/2, r.bottom-1);
} }
} }
//treat this as two connections with adjacent sides //treat this as two connections with adjacent sides
fillBetweenPoints(level, from, side, floor); fillBetweenPoints(level, r, from, side, floor);
fillBetweenPoints(level, side, to, floor); fillBetweenPoints(level, r, side, to, floor);
} }
} }

View File

@ -29,7 +29,7 @@ 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.levels.rooms.Room; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.SewerBossEntranceRoom; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.sewerboss.SewerBossEntranceRoom;
import com.watabou.utils.Random; import com.watabou.utils.Random;
public class RatKingRoom extends SecretRoom { public class RatKingRoom extends SecretRoom {

View File

@ -31,8 +31,6 @@ public class SecretArtilleryRoom extends SecretRoom {
@Override @Override
public void paint(Level level) { public void paint(Level level) {
super.paint(level);
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);

View File

@ -57,8 +57,6 @@ public class SecretChestChasmRoom extends SecretRoom {
@Override @Override
public void paint(Level level) { public void paint(Level level) {
super.paint(level);
Painter.fill(level, this, Terrain.WALL); Painter.fill(level, this, Terrain.WALL);
Painter.fill(level, this, 1, Terrain.CHASM); Painter.fill(level, this, 1, Terrain.CHASM);

View File

@ -39,8 +39,6 @@ public class SecretHoardRoom extends SecretRoom {
@Override @Override
public void paint(Level level) { public void paint(Level level) {
super.paint(level);
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);

View File

@ -58,8 +58,6 @@ public class SecretMazeRoom extends SecretRoom {
@Override @Override
public void paint(Level level) { public void paint(Level level) {
super.paint(level);
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);

View File

@ -45,8 +45,6 @@ public class SecretSummoningRoom extends SecretRoom {
@Override @Override
public void paint(Level level) { public void paint(Level level) {
super.paint(level);
Painter.fill(level, this, Terrain.WALL); Painter.fill(level, this, Terrain.WALL);
Painter.fill(level, this, 1, Terrain.SECRET_TRAP); Painter.fill(level, this, 1, Terrain.SECRET_TRAP);

View File

@ -0,0 +1,78 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2019 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.sewerboss;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Goo;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
import com.watabou.utils.Point;
public class DiamondGooRoom extends GooBossRoom {
@Override
public void paint(Level level) {
Painter.fill( level, this, Terrain.WALL );
int diamondWidth = 2 + width()%2;
for (int i = 1; i < height(); i++){
Painter.fill( level, left + (width() - diamondWidth)/2, top+i, diamondWidth, height()-2*i, Terrain.EMPTY);
diamondWidth += 2;
if (diamondWidth >= width()) break;
}
for (Door door : connected.values()) {
door.set( Door.Type.REGULAR );
Point dir;
if (door.x == left){
dir = new Point(1, 0);
} else if (door.y == top){
dir = new Point(0, 1);
} else if (door.x == right){
dir = new Point(-1, 0);
} else {
dir = new Point(0, -1);
}
Point curr = new Point(door);
do {
Painter.set(level, curr, Terrain.EMPTY_SP);
curr.x += dir.x;
curr.y += dir.y;
} while (level.map[level.pointToCell(curr)] != Terrain.EMPTY);
}
Painter.fill( level, left + width()/2 - 1, top + height()/2 - 2, 2 + width()%2, 4 + height()%2, Terrain.WATER);
Painter.fill( level, left + width()/2 - 2, top + height()/2 - 1, 4 + width()%2, 2 + height()%2, Terrain.WATER);
setupGooNest(level);
Goo boss = new Goo();
boss.pos = level.pointToCell(center());
level.mobs.add( boss );
}
@Override
public boolean canPlaceWater(Point p) {
return false;
}
}

View File

@ -0,0 +1,120 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2019 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.sewerboss;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.StandardRoom;
import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTilemap;
import com.watabou.noosa.Image;
import com.watabou.noosa.Tilemap;
import com.watabou.utils.Point;
import com.watabou.utils.Random;
public abstract class GooBossRoom extends StandardRoom {
@Override
public float[] sizeCatProbs() {
return new float[]{0, 1, 0};
}
public static GooBossRoom randomGooRoom(){
switch (Random.Int(4)){
case 0: default:
return new DiamondGooRoom();
case 1:
return new WalledGooRoom();
case 2:
return new ThinPillarsGooRoom();
case 3:
return new ThickPillarsGooRoom();
}
}
protected void setupGooNest( Level level ){
GooNest nest = new GooNest();
nest.setRect(left + width()/2 - 2, top + height()/2 - 2, 4 + width()%2, 4 + height()%2);
level.customTiles.add(nest);
}
//TODO no texturing on this atm
public static class GooNest extends CustomTilemap {
{
texture = Assets.SEWER_BOSS;
}
@Override
public Tilemap create() {
Tilemap v = super.create();
int[] data = new int[tileW*tileH];
for (int x = 0; x < tileW; x++){
for (int y = 0; y < tileH; y++){
//corners
if ((x == 0 || x == tileW-1) && (y == 0 || y == tileH-1)){
data[x + tileW*y] = -1;
//adjacent to corners
} else if ((x == 1 && y == 0) || (x == 0 && y == 1)){
data[x + tileW*y] = 0;
} else if ((x == tileW-2 && y == 0) || (x == tileW-1 && y == 1)){
data[x + tileW*y] = 1;
} else if ((x == 1 && y == tileH-1) || (x == 0 && y == tileH-2)){
data[x + tileW*y] = 2;
} else if ((x == tileW-2 && y == tileH-1) || (x == tileW-1 && y == tileH-2)) {
data[x + tileW*y] = 3;
//sides
} else if (x == 0){
data[x + tileW*y] = 4;
} else if (y == 0){
data[x + tileW*y] = 5;
} else if (x == tileW-1){
data[x + tileW*y] = 6;
} else if (y == tileH-1){
data[x + tileW*y] = 7;
//inside
} else {
data[x + tileW*y] = 8;
}
}
}
v.map( data, tileW );
return v;
}
@Override
public Image image(int tileX, int tileY) {
return null;
}
}
}

View File

@ -19,12 +19,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/> * along with this program. If not, see <http://www.gnu.org/licenses/>
*/ */
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard; package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.sewerboss;
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.levels.rooms.Room; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.EntranceRoom;
import com.watabou.utils.Point; import com.watabou.utils.Point;
public class SewerBossEntranceRoom extends EntranceRoom { public class SewerBossEntranceRoom extends EntranceRoom {

View File

@ -0,0 +1,58 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2019 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.sewerboss;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Goo;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.connection.PerimeterRoom;
public class ThickPillarsGooRoom extends GooBossRoom {
@Override
public void paint(Level level) {
Painter.fill( level, this, Terrain.WALL );
Painter.fill( level, this, 1 , Terrain.WATER );
int pillarW = (width()-8)/2;
int pillarH = (height()-8)/2;
Painter.fill(level, left+2, top+2, pillarW+1, pillarH+1, Terrain.WALL);
Painter.fill(level, left+2, bottom-2-pillarH, pillarW+1, pillarH+1, Terrain.WALL);
Painter.fill(level, right-2-pillarW, top+2, pillarW+1, pillarH+1, Terrain.WALL);
Painter.fill(level, right-2-pillarW, bottom-2-pillarH, pillarW+1, pillarH+1, Terrain.WALL);
PerimeterRoom.fillPerimiterPaths(level, this, Terrain.EMPTY_SP);
for (Door door : connected.values()) {
door.set(Door.Type.REGULAR);
}
setupGooNest(level);
Goo boss = new Goo();
boss.pos = level.pointToCell(center());
level.mobs.add( boss );
}
}

View File

@ -0,0 +1,71 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2019 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.sewerboss;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Goo;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.connection.PerimeterRoom;
public class ThinPillarsGooRoom extends GooBossRoom {
@Override
public void paint(Level level) {
Painter.fill( level, this, Terrain.WALL );
Painter.fill( level, this, 1 , Terrain.WATER );
int pillarW = (width() == 14 ? 4: 2) + width()%2;
int pillarH = (height() == 14 ? 4: 2) + height()%2;
if (height() < 12){
Painter.fill(level, left + (width()-pillarW)/2, top+2, pillarW, 1, Terrain.WALL);
Painter.fill(level, left + (width()-pillarW)/2, bottom-2, pillarW, 1, Terrain.WALL);
} else {
Painter.fill(level, left + (width()-pillarW)/2, top+3, pillarW, 1, Terrain.WALL);
Painter.fill(level, left + (width()-pillarW)/2, bottom-3, pillarW, 1, Terrain.WALL);
}
if (width() < 12){
Painter.fill(level, left + 2, top + (height() - pillarH)/2, 1, pillarH, Terrain.WALL);
Painter.fill(level, right - 2, top + (height() - pillarH)/2, 1, pillarH, Terrain.WALL);
} else {
Painter.fill(level, left + 3, top + (height() - pillarH)/2, 1, pillarH, Terrain.WALL);
Painter.fill(level, right - 3, top + (height() - pillarH)/2, 1, pillarH, Terrain.WALL);
}
PerimeterRoom.fillPerimiterPaths(level, this, Terrain.EMPTY_SP);
for (Door door : connected.values()) {
door.set(Door.Type.REGULAR);
}
setupGooNest(level);
Goo boss = new Goo();
boss.pos = level.pointToCell(center());
level.mobs.add( boss );
}
}

View File

@ -0,0 +1,71 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2019 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.sewerboss;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Goo;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
import com.watabou.utils.Point;
public class WalledGooRoom extends GooBossRoom {
@Override
public void paint(Level level) {
Painter.fill( level, this, Terrain.WALL );
Painter.fill( level, this, 1 , Terrain.EMPTY_SP );
Painter.fill( level, this, 2 , Terrain.EMPTY );
int pillarW = (width()-2)/3;
int pillarH = (height()-2)/3;
Painter.fill(level, left+2, top+2, pillarW, 1, Terrain.WALL);
Painter.fill(level, left+2, top+2, 1, pillarH, Terrain.WALL);
Painter.fill(level, left+2, bottom-2, pillarW, 1, Terrain.WALL);
Painter.fill(level, left+2, bottom-1-pillarH, 1, pillarH, Terrain.WALL);
Painter.fill(level, right-1-pillarW, top+2, pillarW, 1, Terrain.WALL);
Painter.fill(level, right-2, top+2, 1, pillarH, Terrain.WALL);
Painter.fill(level, right-1-pillarW, bottom-2, pillarW, 1, Terrain.WALL);
Painter.fill(level, right-2, bottom-1-pillarH, 1, pillarH, Terrain.WALL);
for (Door door : connected.values()) {
door.set(Door.Type.REGULAR);
}
Painter.fill( level, left + width()/2 - 1, top + height()/2 - 2, 2 + width()%2, 4 + height()%2, Terrain.WATER);
Painter.fill( level, left + width()/2 - 2, top + height()/2 - 1, 4 + width()%2, 2 + height()%2, Terrain.WATER);
setupGooNest(level);
Goo boss = new Goo();
boss.pos = level.pointToCell(center());
level.mobs.add( boss );
}
@Override
public boolean canPlaceWater(Point p) {
return false;
}
}

View File

@ -30,7 +30,7 @@ import com.watabou.utils.Random;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
public class SpecialRoom extends Room { public abstract class SpecialRoom extends Room {
@Override @Override
public int minWidth() { return 5; } public int minWidth() { return 5; }
@ -42,12 +42,6 @@ public class SpecialRoom extends Room {
} }
public int maxHeight() { return 10; } public int maxHeight() { return 10; }
@Override
public int minConnections(int direction) {
if (direction == ALL) return 1;
else return 0;
}
@Override @Override
public int maxConnections(int direction) { public int maxConnections(int direction) {
return 1; return 1;

View File

@ -64,8 +64,6 @@ public class AquariumRoom extends StandardRoom {
for (Door door : connected.values()) { for (Door door : connected.values()) {
door.set( Door.Type.REGULAR ); door.set( Door.Type.REGULAR );
} }
super.paint(level);
} }
} }

View File

@ -94,8 +94,6 @@ public class PlantsRoom extends StandardRoom {
for (Door door : connected.values()) { for (Door door : connected.values()) {
door.set( Door.Type.REGULAR ); door.set( Door.Type.REGULAR );
} }
super.paint(level);
} }
private static Plant.Seed randomSeed(){ private static Plant.Seed randomSeed(){

View File

@ -98,18 +98,6 @@ public abstract class StandardRoom extends Room {
public int minHeight() { return sizeCat.minDim; } public int minHeight() { return sizeCat.minDim; }
public int maxHeight() { return sizeCat.maxDim; } public int maxHeight() { return sizeCat.maxDim; }
@Override
public int minConnections(int direction) {
if (direction == ALL) return 1;
else return 0;
}
@Override
public int maxConnections(int direction) {
if (direction == ALL) return 16;
else return 4;
}
//FIXME this is a very messy way of handing variable standard rooms //FIXME this is a very messy way of handing variable standard rooms
private static ArrayList<Class<?extends StandardRoom>> rooms = new ArrayList<>(); private static ArrayList<Class<?extends StandardRoom>> rooms = new ArrayList<>();
static { static {
@ -149,7 +137,7 @@ public abstract class StandardRoom extends Room {
chances[1] = new float[]{20, 15,5, 0,0, 0,0, 0,0, 0,0, 1,0,1,0,1,0,1,1,0,0}; chances[1] = new float[]{20, 15,5, 0,0, 0,0, 0,0, 0,0, 1,0,1,0,1,0,1,1,0,0};
chances[2] = new float[]{20, 15,5, 0,0, 0,0, 0,0, 0,0, 1,1,1,1,1,1,1,1,1,1}; chances[2] = new float[]{20, 15,5, 0,0, 0,0, 0,0, 0,0, 1,1,1,1,1,1,1,1,1,1};
chances[4] = chances[3] = chances[2]; chances[4] = chances[3] = chances[2];
chances[5] = new float[]{50, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0,0,0,0,0,0,0,0,0}; chances[5] = new float[]{20, 15,5, 0,0, 0,0, 0,0, 0,0, 0,0,0,0,0,0,0,0,0,0};
chances[6] = new float[]{20, 0,0, 15,5, 0,0, 0,0, 0,0, 1,1,1,1,1,1,1,1,1,1}; chances[6] = new float[]{20, 0,0, 15,5, 0,0, 0,0, 0,0, 1,1,1,1,1,1,1,1,1,1};
chances[10] = chances[9] = chances[8] = chances[7] = chances[6]; chances[10] = chances[9] = chances[8] = chances[7] = chances[6];