v3.1.0: expanded standard rooms in the sewers
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2025 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.standard;
|
||||
|
||||
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.Room;
|
||||
|
||||
public class RegionDecoPatchRoom extends PatchRoom {
|
||||
|
||||
@Override
|
||||
public int minHeight() {
|
||||
return Math.max(5, super.minHeight());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int minWidth() {
|
||||
return Math.max(5, super.minWidth());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float fill() {
|
||||
//fill scales from ~30% at 4x4, to ~50% at 10x10
|
||||
int scale = Math.min(width()*height(), 10*10);
|
||||
return 0.30f + scale/512f;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int clustering() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean ensurePath() {
|
||||
return connected.size() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean cleanEdges() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Level level) {
|
||||
Painter.fill( level, this, Terrain.WALL );
|
||||
Painter.fill( level, this, 1 , Terrain.EMPTY );
|
||||
for (Room.Door door : connected.values()) {
|
||||
door.set( Room.Door.Type.REGULAR );
|
||||
}
|
||||
|
||||
setupPatch(level);
|
||||
fillPatch(level, Terrain.REGION_DECO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,6 +24,8 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.Point;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class RingRoom extends StandardRoom {
|
||||
|
||||
@@ -48,11 +50,42 @@ public class RingRoom extends StandardRoom {
|
||||
Painter.fill( level, this, 1 , Terrain.EMPTY );
|
||||
|
||||
int minDim = Math.min(width(), height());
|
||||
int passageWidth = (int)Math.floor(0.25f*(minDim+1));
|
||||
int passageWidth = (int)Math.floor(0.2f*(minDim+3));
|
||||
Painter.fill(level, this, passageWidth+1, Terrain.WALL);
|
||||
|
||||
if (minDim >= 10){
|
||||
Painter.fill(level, this, passageWidth+2, centerDecoTiles());
|
||||
Point center = center();
|
||||
int xDir = 0, yDir = 0;
|
||||
if (Random.Int(2) == 0) {
|
||||
xDir = Random.Int(2) == 0 ? 1 : -1;
|
||||
} else {
|
||||
yDir = Random.Int(2) == 0 ? 1 : -1;
|
||||
}
|
||||
|
||||
Painter.set(level, center, Terrain.EMPTY_SP);
|
||||
placeCenterDetail(level, level.pointToCell(center));
|
||||
|
||||
center.x += xDir;
|
||||
center.y += yDir;
|
||||
while (level.map[level.pointToCell(center)] != Terrain.WALL){
|
||||
Painter.set(level, center, Terrain.EMPTY_SP);
|
||||
center.x += xDir;
|
||||
center.y += yDir;
|
||||
}
|
||||
Painter.set(level, center, Terrain.DOOR);
|
||||
}
|
||||
|
||||
for (Door door : connected.values()) {
|
||||
door.set( Door.Type.REGULAR );
|
||||
}
|
||||
}
|
||||
|
||||
protected int centerDecoTiles(){
|
||||
return Terrain.REGION_DECO_SP;
|
||||
}
|
||||
|
||||
protected void placeCenterDetail(Level level, int pos){
|
||||
level.drop(level.findPrizeItem(), pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class SewerPipeRoom extends StandardRoom {
|
||||
|
||||
@Override
|
||||
public float[] sizeCatProbs() {
|
||||
return new float[]{4, 2, 1};
|
||||
return new float[]{3, 2, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -169,11 +169,17 @@ public abstract class StandardBridgeRoom extends StandardRoom {
|
||||
}
|
||||
|
||||
Painter.fill(level, spaceRect, spaceTile());
|
||||
Painter.fill(level, bridgeRect, Terrain.EMPTY_SP);
|
||||
Painter.fill(level, bridgeRect, bridgeTile());
|
||||
|
||||
}
|
||||
|
||||
protected abstract int maxBridgeWidth( int roomDimension );
|
||||
|
||||
protected abstract int spaceTile();
|
||||
|
||||
//defaults to special terrain
|
||||
protected int bridgeTile(){
|
||||
return Terrain.EMPTY_SP;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public abstract class StandardRoom extends Room {
|
||||
rooms.add(RingRoom.class);
|
||||
rooms.add(WaterBridgeRoom.class);
|
||||
rooms.add(CircleBasinRoom.class);
|
||||
rooms.add(EmptyRoom.class); //TODO
|
||||
rooms.add(RegionDecoPatchRoom.class);
|
||||
|
||||
rooms.add(SegmentedRoom.class);
|
||||
rooms.add(PillarsRoom.class);
|
||||
@@ -169,10 +169,10 @@ public abstract class StandardRoom extends Room {
|
||||
|
||||
private static float[][] chances = new float[27][];
|
||||
static {
|
||||
chances[1] = new float[]{0,5,0, 10,10,10,5,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0,1,0,1,0,1,1,0,0};
|
||||
chances[2] = new float[]{0,5,0, 10,10,10,5,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1};
|
||||
chances[1] = new float[]{0,5,0, 15,5,5,5,5, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0,1,0,1,0,1,1,0,0};
|
||||
chances[2] = new float[]{0,5,0, 15,5,5,5,5, 0,0,0,0,0, 0,0,0,0,0, 0,0,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[5] = new float[]{0,5,0, 10,10,10,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0};
|
||||
chances[5] = new float[]{0,5,0, 15,5,5,0,5, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
chances[6] = new float[]{0,5,0, 0,0,0,0,0, 10,10,10,5,0, 0,0,0,0,0, 0,0,0,0,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];
|
||||
|
||||
@@ -135,7 +135,7 @@ public class EntranceRoom extends StandardRoom {
|
||||
|
||||
rooms.add(WaterBridgeEntranceRoom.class);
|
||||
rooms.add(CircleBasinEntranceRoom.class);
|
||||
rooms.add(EntranceRoom.class); //TODO
|
||||
rooms.add(RingEntranceRoom.class);
|
||||
|
||||
rooms.add(ChasmBridgeEntranceRoom.class);
|
||||
rooms.add(PillarsEntranceRoom.class);
|
||||
@@ -156,12 +156,10 @@ public class EntranceRoom extends StandardRoom {
|
||||
|
||||
private static float[][] chances = new float[27][];
|
||||
static {
|
||||
//first 2 floors only use empty room.
|
||||
// First floor is to give a simple start room
|
||||
// 2nd floor for tutorialization
|
||||
chances[1] = new float[]{1,0,0, 0,0,0, 0,0,0, 0,0,0, 0,0,0, 0,0,0};
|
||||
//first 2 floors only use simpler entrance rooms
|
||||
chances[1] = new float[]{1,1,0, 1,0,0, 0,0,0, 0,0,0, 0,0,0, 0,0,0};
|
||||
chances[2] = chances[1];
|
||||
chances[3] = new float[]{0,3,0, 6,1,0, 0,0,0, 0,0,0, 0,0,0, 0,0,0};
|
||||
chances[3] = new float[]{0,4,0, 4,1,1, 0,0,0, 0,0,0, 0,0,0, 0,0,0};
|
||||
chances[5] = chances[4] = chances[3];
|
||||
|
||||
chances[6] = new float[]{0,2,0, 0,0,0, 4,4,0, 0,0,0, 0,0,0, 0,0,0};
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2025 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.standard.entrance;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.features.LevelTransition;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.RingRoom;
|
||||
|
||||
public class RingEntranceRoom extends RingRoom {
|
||||
|
||||
@Override
|
||||
public float[] sizeCatProbs() {
|
||||
return new float[]{0, 1, 0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEntrance() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected int centerDecoTiles(){
|
||||
return Terrain.EMPTY_SP;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void placeCenterDetail(Level level, int pos) {
|
||||
Painter.set(level, pos, Terrain.ENTRANCE_SP);
|
||||
level.transitions.add(new LevelTransition(level, pos, LevelTransition.Type.REGULAR_ENTRANCE));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -78,7 +78,7 @@ public class ExitRoom extends StandardRoom {
|
||||
|
||||
rooms.add(WaterBridgeExitRoom.class);
|
||||
rooms.add(CircleBasinExitRoom.class);
|
||||
rooms.add(ExitRoom.class); //todo
|
||||
rooms.add(RingExitRoom.class);
|
||||
|
||||
rooms.add(ChasmBridgeExitRoom.class);
|
||||
rooms.add(PillarsExitRoom.class);
|
||||
@@ -99,8 +99,10 @@ public class ExitRoom extends StandardRoom {
|
||||
|
||||
private static float[][] chances = new float[27][];
|
||||
static {
|
||||
chances[1] = new float[]{0,3,0, 6,1,0, 0,0,0, 0,0,0, 0,0,0, 0,0,0};
|
||||
chances[5] = chances[4] = chances[3] = chances[2] = chances[1];
|
||||
//floor 1 only uses simpler exit rooms
|
||||
chances[1] = new float[]{1,1,0, 1,0,0, 0,0,0, 0,0,0, 0,0,0, 0,0,0};
|
||||
chances[2] = new float[]{0,4,0, 4,1,1, 0,0,0, 0,0,0, 0,0,0, 0,0,0};
|
||||
chances[5] = chances[4] = chances[3] = chances[2];
|
||||
|
||||
chances[6] = new float[]{0,2,0, 0,0,0, 4,4,0, 0,0,0, 0,0,0, 0,0,0};
|
||||
chances[10] = chances[9] = chances[8] = chances[7] = chances[6];
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2025 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.standard.exit;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.features.LevelTransition;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.RingRoom;
|
||||
|
||||
public class RingExitRoom extends RingRoom {
|
||||
|
||||
@Override
|
||||
public float[] sizeCatProbs() {
|
||||
return new float[]{0, 1, 0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isExit() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected int centerDecoTiles(){
|
||||
return Terrain.EMPTY_SP;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void placeCenterDetail(Level level, int pos) {
|
||||
Painter.set(level, pos, Terrain.EXIT);
|
||||
level.transitions.add(new LevelTransition(level, pos, LevelTransition.Type.REGULAR_EXIT));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user