v0.6.0: externalized most painting behaviour into painter classes
This commit is contained in:
parent
4515e5ab79
commit
80f3be650b
|
@ -33,6 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ToxicTrap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
|
|
|
@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.levels;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.StandardRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.TunnelRoom;
|
||||
|
@ -74,12 +75,24 @@ public class CavesLevel extends RegularLevel {
|
|||
return Assets.WATER_CAVES;
|
||||
}
|
||||
|
||||
protected boolean[] water() {
|
||||
return Patch.generate( width, height, feeling == Feeling.WATER ? 0.85f : 0.30f, 6, true );
|
||||
@Override
|
||||
protected float waterFill() {
|
||||
return feeling == Feeling.WATER ? 0.85f : 0.30f;
|
||||
}
|
||||
|
||||
protected boolean[] grass() {
|
||||
return Patch.generate( width, height, feeling == Feeling.GRASS ? 0.65f : 0.15f, 3, true );
|
||||
@Override
|
||||
protected int waterSmoothing() {
|
||||
return 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float grassFill() {
|
||||
return feeling == Feeling.GRASS ? 0.65f : 0.15f;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int grassSmoothing() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTileSheet;
|
||||
|
|
|
@ -68,12 +68,24 @@ public class CityLevel extends RegularLevel {
|
|||
return Assets.WATER_CITY;
|
||||
}
|
||||
|
||||
protected boolean[] water() {
|
||||
return Patch.generate( width, height, feeling == Feeling.WATER ? 0.90f : 0.30f, 4, true );
|
||||
@Override
|
||||
protected float waterFill() {
|
||||
return feeling == Feeling.WATER ? 0.90f : 0.30f;
|
||||
}
|
||||
|
||||
protected boolean[] grass() {
|
||||
return Patch.generate( width, height, feeling == Feeling.GRASS ? 0.80f : 0.20f, 3, true );
|
||||
@Override
|
||||
protected int waterSmoothing() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float grassFill() {
|
||||
return feeling == Feeling.GRASS ? 0.80f : 0.20f;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int grassSmoothing() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.watabou.noosa.Group;
|
||||
|
|
|
@ -83,12 +83,24 @@ public class HallsLevel extends RegularLevel {
|
|||
return Assets.WATER_HALLS;
|
||||
}
|
||||
|
||||
protected boolean[] water() {
|
||||
return Patch.generate( width, height, feeling == Feeling.WATER ? 0.70f : 0.15f, 6, true );
|
||||
@Override
|
||||
protected float waterFill() {
|
||||
return feeling == Feeling.WATER ? 0.70f : 0.15f;
|
||||
}
|
||||
|
||||
protected boolean[] grass() {
|
||||
return Patch.generate( width, height, feeling == Feeling.GRASS ? 0.65f : 0.10f, 3, true );
|
||||
@Override
|
||||
protected int waterSmoothing() {
|
||||
return 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float grassFill() {
|
||||
return feeling == Feeling.GRASS ? 0.65f : 0.10f;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int grassSmoothing() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.levels;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Amulet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.watabou.noosa.Group;
|
||||
import com.watabou.utils.Bundle;
|
||||
|
|
|
@ -139,15 +139,25 @@ public class LastShopLevel extends RegularLevel {
|
|||
return super.tileDesc( tile );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean[] water() {
|
||||
return Patch.generate( width, height, 0.10f, 4, true );
|
||||
protected float waterFill() {
|
||||
return 0.10f;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean[] grass() {
|
||||
return Patch.generate( width, height, 0.10f, 3, true );
|
||||
protected int waterSmoothing() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float grassFill() {
|
||||
return 0.10f;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int grassSmoothing() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
protected int nTraps() {
|
||||
|
|
|
@ -67,6 +67,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Door;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.features.HighGrass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.MassGraveRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.ShadowCaster;
|
||||
|
|
|
@ -65,12 +65,24 @@ public class PrisonLevel extends RegularLevel {
|
|||
return Assets.WATER_PRISON;
|
||||
}
|
||||
|
||||
protected boolean[] water() {
|
||||
return Patch.generate( width, height, feeling == Feeling.WATER ? 0.90f : 0.30f, 4, true );
|
||||
@Override
|
||||
protected float waterFill() {
|
||||
return feeling == Feeling.WATER ? 0.90f : 0.30f;
|
||||
}
|
||||
|
||||
protected boolean[] grass() {
|
||||
return Patch.generate( width, height, feeling == Feeling.GRASS ? 0.80f : 0.20f, 3, true );
|
||||
@Override
|
||||
protected int waterSmoothing() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float grassFill() {
|
||||
return feeling == Feeling.GRASS ? 0.80f : 0.20f;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int grassSmoothing() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -34,23 +34,20 @@ import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfWealth;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.builders.Builder;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.builders.LegacyBuilder;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.RegularPainter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.EntranceRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.ExitRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.PassageRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.PitRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.StandardRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.TunnelRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.WeakFloorRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ChillingTrap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ExplosiveTrap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.FireTrap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.WornTrap;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.PathFinder;
|
||||
import com.watabou.utils.Random;
|
||||
import com.watabou.utils.Rect;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
@ -81,15 +78,10 @@ public abstract class RegularLevel extends Level {
|
|||
roomEntrance = ((LegacyBuilder)builder).roomEntrance;
|
||||
roomExit = ((LegacyBuilder)builder).roomExit;
|
||||
|
||||
if (!paint()){
|
||||
if (!painter().paint(this, rooms)){
|
||||
return false;
|
||||
}
|
||||
|
||||
paintWater();
|
||||
paintGrass();
|
||||
|
||||
placeTraps();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -97,6 +89,14 @@ public abstract class RegularLevel extends Level {
|
|||
return new LegacyBuilder(LegacyBuilder.Type.REGULAR,
|
||||
width, height, minRoomSize, maxRoomSize);
|
||||
}
|
||||
|
||||
protected Painter painter(){
|
||||
RegularPainter p = new RegularPainter();
|
||||
p.setGrass(grassFill(), grassSmoothing());
|
||||
p.setWater(waterFill(), waterSmoothing());
|
||||
p.setTraps(nTraps(), trapClasses(), trapChances());
|
||||
return p;
|
||||
}
|
||||
|
||||
protected void placeSign(){
|
||||
while (true) {
|
||||
|
@ -108,85 +108,20 @@ public abstract class RegularLevel extends Level {
|
|||
}
|
||||
}
|
||||
|
||||
protected void paintWater() {
|
||||
boolean[] lake = water();
|
||||
for (int i=0; i < length(); i++) {
|
||||
if (map[i] == Terrain.EMPTY && lake[i]) {
|
||||
map[i] = Terrain.WATER;
|
||||
}
|
||||
}
|
||||
protected float waterFill(){
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected void paintGrass() {
|
||||
boolean[] grass = grass();
|
||||
|
||||
if (feeling == Feeling.GRASS) {
|
||||
|
||||
for (Room room : rooms) {
|
||||
if (!(room instanceof TunnelRoom || room instanceof PassageRoom)) {
|
||||
grass[(room.left + 1) + (room.top + 1) * width()] = true;
|
||||
grass[(room.right - 1) + (room.top + 1) * width()] = true;
|
||||
grass[(room.left + 1) + (room.bottom - 1) * width()] = true;
|
||||
grass[(room.right - 1) + (room.bottom - 1) * width()] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=width()+1; i < length()-width()-1; i++) {
|
||||
if (map[i] == Terrain.EMPTY && grass[i]) {
|
||||
int count = 1;
|
||||
for (int n : PathFinder.NEIGHBOURS8) {
|
||||
if (grass[i + n]) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
map[i] = (Random.Float() < count / 12f) ? Terrain.HIGH_GRASS : Terrain.GRASS;
|
||||
}
|
||||
}
|
||||
protected int waterSmoothing(){
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected abstract boolean[] water();
|
||||
protected abstract boolean[] grass();
|
||||
protected float grassFill(){
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected void placeTraps() {
|
||||
|
||||
int nTraps = nTraps();
|
||||
float[] trapChances = trapChances();
|
||||
Class<?>[] trapClasses = trapClasses();
|
||||
|
||||
ArrayList<Integer> validCells = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < length(); i ++) {
|
||||
if (map[i] == Terrain.EMPTY){
|
||||
|
||||
if(Dungeon.depth == 1){
|
||||
//extra check to prevent annoying inactive traps in hallways on floor 1
|
||||
Room r = room(i);
|
||||
if (r instanceof StandardRoom){
|
||||
validCells.add(i);
|
||||
}
|
||||
} else
|
||||
validCells.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
//no more than one trap every 5 valid tiles.
|
||||
nTraps = Math.min(nTraps, validCells.size()/5);
|
||||
|
||||
for (int i = 0; i < nTraps; i++) {
|
||||
|
||||
Integer trapPos = Random.element(validCells);
|
||||
validCells.remove(trapPos); //removes the integer object, not at the index
|
||||
|
||||
try {
|
||||
Trap trap = ((Trap)trapClasses[Random.chances( trapChances )].newInstance()).hide();
|
||||
setTrap( trap, trapPos );
|
||||
//some traps will not be hidden
|
||||
map[trapPos] = trap.visible ? Terrain.TRAP : Terrain.SECRET_TRAP;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
protected int grassSmoothing(){
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected int nTraps() {
|
||||
|
@ -204,140 +139,6 @@ public abstract class RegularLevel extends Level {
|
|||
protected int minRoomSize = 8;
|
||||
protected int maxRoomSize = 10;
|
||||
|
||||
protected boolean paint() {
|
||||
|
||||
for (Room r : rooms) {
|
||||
placeDoors( r );
|
||||
r.paint( this );
|
||||
}
|
||||
|
||||
for (Room r : rooms) {
|
||||
paintDoors( r );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void placeDoors( Room r ) {
|
||||
for (Room n : r.connected.keySet()) {
|
||||
Room.Door door = r.connected.get( n );
|
||||
if (door == null) {
|
||||
|
||||
Rect i = r.intersect( n );
|
||||
if (i.width() == 0) {
|
||||
door = new Room.Door(
|
||||
i.left,
|
||||
Random.Int( i.top + 1, i.bottom ) );
|
||||
} else {
|
||||
door = new Room.Door(
|
||||
Random.Int( i.left + 1, i.right ),
|
||||
i.top);
|
||||
}
|
||||
|
||||
r.connected.put( n, door );
|
||||
n.connected.put( r, door );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void paintDoors( Room r ) {
|
||||
for (Room n : r.connected.keySet()) {
|
||||
|
||||
if (joinRooms( r, n )) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Room.Door d = r.connected.get( n );
|
||||
int door = d.x + d.y * width();
|
||||
|
||||
switch (d.type) {
|
||||
case EMPTY:
|
||||
map[door] = Terrain.EMPTY;
|
||||
break;
|
||||
case TUNNEL:
|
||||
map[door] = tunnelTile();
|
||||
break;
|
||||
case REGULAR:
|
||||
if (Dungeon.depth <= 1) {
|
||||
map[door] = Terrain.DOOR;
|
||||
} else {
|
||||
boolean secret = (Dungeon.depth < 6 ? Random.Int( 12 - Dungeon.depth ) : Random.Int( 6 )) == 0;
|
||||
map[door] = secret ? Terrain.SECRET_DOOR : Terrain.DOOR;
|
||||
if (secret) {
|
||||
secretDoors++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case UNLOCKED:
|
||||
map[door] = Terrain.DOOR;
|
||||
break;
|
||||
case HIDDEN:
|
||||
map[door] = Terrain.SECRET_DOOR;
|
||||
secretDoors++;
|
||||
break;
|
||||
case BARRICADE:
|
||||
map[door] = Terrain.BARRICADE;
|
||||
break;
|
||||
case LOCKED:
|
||||
map[door] = Terrain.LOCKED_DOOR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean joinRooms( Room r, Room n ) {
|
||||
|
||||
if (!(r instanceof StandardRoom && n instanceof StandardRoom)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Rect w = r.intersect( n );
|
||||
if (w.left == w.right) {
|
||||
|
||||
if (w.bottom - w.top < 3) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (w.height() == Math.max( r.height(), n.height() )) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (r.width() + n.width() > maxRoomSize) {
|
||||
return false;
|
||||
}
|
||||
|
||||
w.top += 1;
|
||||
w.bottom -= 0;
|
||||
|
||||
w.right++;
|
||||
|
||||
Painter.fill( this, w.left, w.top, 1, w.height(), Terrain.EMPTY );
|
||||
|
||||
} else {
|
||||
|
||||
if (w.right - w.left < 3) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (w.width() == Math.max( r.width(), n.width() )) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (r.height() + n.height() > maxRoomSize) {
|
||||
return false;
|
||||
}
|
||||
|
||||
w.left += 1;
|
||||
w.right -= 0;
|
||||
|
||||
w.bottom++;
|
||||
|
||||
Painter.fill( this, w.left, w.top, w.width(), 1, Terrain.EMPTY );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int nMobs() {
|
||||
switch(Dungeon.depth) {
|
||||
|
@ -554,8 +355,7 @@ public abstract class RegularLevel extends Level {
|
|||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
super.restoreFromBundle( bundle );
|
||||
|
||||
//TODO implement legacytype support here
|
||||
|
||||
rooms = new ArrayList<>( (Collection<Room>) ((Collection<?>) bundle.getCollection( "rooms" )) );
|
||||
for (Room r : rooms) {
|
||||
if (r instanceof WeakFloorRoom || r.legacyType.equals("WEAK_FLOOR")) {
|
||||
|
|
|
@ -86,13 +86,25 @@ public class SewerBossLevel extends RegularLevel {
|
|||
return new LegacyBuilder(LegacyBuilder.Type.SEWER_BOSS,
|
||||
width, height, minRoomSize, maxRoomSize);
|
||||
}
|
||||
|
||||
protected boolean[] water() {
|
||||
return Patch.generate( width, height, 0.5f, 5, true );
|
||||
|
||||
@Override
|
||||
protected float waterFill(){
|
||||
return 0.50f;
|
||||
}
|
||||
|
||||
protected boolean[] grass() {
|
||||
return Patch.generate( width, height, 0.20f, 4, true );
|
||||
@Override
|
||||
protected int waterSmoothing(){
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float grassFill() {
|
||||
return 0.20f;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int grassSmoothing() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
protected int nTraps() {
|
||||
|
|
|
@ -63,12 +63,24 @@ public class SewerLevel extends RegularLevel {
|
|||
return Assets.WATER_SEWERS;
|
||||
}
|
||||
|
||||
protected boolean[] water() {
|
||||
return Patch.generate( width, height, feeling == Feeling.WATER ? 0.85f : 0.30f, 5, true );
|
||||
@Override
|
||||
protected float waterFill() {
|
||||
return feeling == Feeling.WATER ? 0.85f : 0.30f;
|
||||
}
|
||||
|
||||
protected boolean[] grass() {
|
||||
return Patch.generate( width, height, feeling == Feeling.GRASS ? 0.80f : 0.20f, 4, true );
|
||||
@Override
|
||||
protected int waterSmoothing() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float grassFill() {
|
||||
return feeling == Feeling.GRASS ? 0.80f : 0.20f;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int grassSmoothing() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,7 +6,8 @@ import java.util.ArrayList;
|
|||
|
||||
public abstract class Builder {
|
||||
|
||||
//If builders require additional parameters, they should request them in their constructor
|
||||
//If builders require additional parameters, they should
|
||||
// request them in their constructor or other methods
|
||||
|
||||
//builders take a list of rooms and returns them as a connected map
|
||||
//returns null on failure
|
||||
|
|
|
@ -19,15 +19,25 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.levels;
|
||||
package com.shatteredpixel.shatteredpixeldungeon.levels.painters;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||
import com.watabou.utils.Point;
|
||||
import com.watabou.utils.Rect;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Painter {
|
||||
public abstract class Painter {
|
||||
|
||||
//If painters require additional parameters, they should
|
||||
// request them in their constructor or other methods
|
||||
|
||||
//Painters take a level and its collection of rooms, and paint all the specific tile values
|
||||
public abstract boolean paint(Level level, ArrayList<Room> rooms);
|
||||
|
||||
// Static methods
|
||||
|
||||
public static void set( Level level, int cell, int value ) {
|
||||
level.map[cell] = value;
|
|
@ -0,0 +1,243 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.levels.painters;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Patch;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.StandardRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
|
||||
import com.watabou.utils.PathFinder;
|
||||
import com.watabou.utils.Random;
|
||||
import com.watabou.utils.Rect;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class RegularPainter extends Painter {
|
||||
|
||||
private float waterFill = 0f;
|
||||
private int waterSmoothness;
|
||||
|
||||
private float grassFill = 0f;
|
||||
private int grassSmoothness;
|
||||
|
||||
private int nTraps = 0;
|
||||
private Class<? extends Trap>[] trapClasses;
|
||||
private float[] trapChances;
|
||||
|
||||
public void setWater(float fill, int smoothness){
|
||||
waterFill = fill;
|
||||
waterSmoothness = smoothness;
|
||||
}
|
||||
|
||||
public void setGrass(float fill, int smoothness){
|
||||
grassFill = fill;
|
||||
grassSmoothness = smoothness;
|
||||
}
|
||||
|
||||
public void setTraps(int num, Class<?>[] classes, float[] chances){
|
||||
nTraps = num;
|
||||
trapClasses = (Class<? extends Trap>[]) classes;
|
||||
trapChances = chances;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean paint(Level level, ArrayList<Room> rooms) {
|
||||
for (Room r : rooms) {
|
||||
placeDoors( r );
|
||||
r.paint( level );
|
||||
}
|
||||
|
||||
for (Room r : rooms) {
|
||||
paintDoors( level, r );
|
||||
}
|
||||
|
||||
if (waterFill > 0f) {
|
||||
paintWater( level );
|
||||
}
|
||||
|
||||
if (grassFill > 0f){
|
||||
paintGrass( level );
|
||||
}
|
||||
|
||||
if (nTraps > 0){
|
||||
paintTraps( level );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void placeDoors( Room r ) {
|
||||
for (Room n : r.connected.keySet()) {
|
||||
Room.Door door = r.connected.get( n );
|
||||
if (door == null) {
|
||||
|
||||
Rect i = r.intersect( n );
|
||||
if (i.width() == 0) {
|
||||
door = new Room.Door(
|
||||
i.left,
|
||||
Random.Int( i.top + 1, i.bottom ) );
|
||||
} else {
|
||||
door = new Room.Door(
|
||||
Random.Int( i.left + 1, i.right ),
|
||||
i.top);
|
||||
}
|
||||
|
||||
r.connected.put( n, door );
|
||||
n.connected.put( r, door );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void paintDoors( Level l, Room r ) {
|
||||
for (Room n : r.connected.keySet()) {
|
||||
|
||||
if (joinRooms( l, r, n )) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Room.Door d = r.connected.get( n );
|
||||
int door = d.x + d.y * l.width();
|
||||
|
||||
switch (d.type) {
|
||||
case EMPTY:
|
||||
l.map[door] = Terrain.EMPTY;
|
||||
break;
|
||||
case TUNNEL:
|
||||
l.map[door] = l.tunnelTile();
|
||||
break;
|
||||
case REGULAR:
|
||||
if (Dungeon.depth <= 1) {
|
||||
l.map[door] = Terrain.DOOR;
|
||||
} else {
|
||||
boolean secret = (Dungeon.depth < 6 ? Random.Int( 12 - Dungeon.depth ) : Random.Int( 6 )) == 0;
|
||||
l.map[door] = secret ? Terrain.SECRET_DOOR : Terrain.DOOR;
|
||||
}
|
||||
break;
|
||||
case UNLOCKED:
|
||||
l.map[door] = Terrain.DOOR;
|
||||
break;
|
||||
case HIDDEN:
|
||||
l.map[door] = Terrain.SECRET_DOOR;
|
||||
break;
|
||||
case BARRICADE:
|
||||
l.map[door] = Terrain.BARRICADE;
|
||||
break;
|
||||
case LOCKED:
|
||||
l.map[door] = Terrain.LOCKED_DOOR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean joinRooms( Level l, Room r, Room n ) {
|
||||
|
||||
if (!(r instanceof StandardRoom && n instanceof StandardRoom)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Rect w = r.intersect( n );
|
||||
if (w.left == w.right) {
|
||||
|
||||
if (w.bottom - w.top < 3) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (w.height()+1 == Math.max( r.height(), n.height() )) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (r.width() + n.width() > 10) {
|
||||
return false;
|
||||
}
|
||||
|
||||
w.top += 1;
|
||||
w.bottom -= 0;
|
||||
|
||||
w.right++;
|
||||
|
||||
Painter.fill( l, w.left, w.top, 1, w.height(), Terrain.EMPTY );
|
||||
|
||||
} else {
|
||||
|
||||
if (w.right - w.left < 3) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (w.width()+1 == Math.max( r.width(), n.width() )) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (r.height() + n.height() > 10) {
|
||||
return false;
|
||||
}
|
||||
|
||||
w.left += 1;
|
||||
w.right -= 0;
|
||||
|
||||
w.bottom++;
|
||||
|
||||
Painter.fill( l, w.left, w.top, w.width(), 1, Terrain.EMPTY );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void paintWater( Level l ){
|
||||
boolean[] lake =
|
||||
Patch.generate( l.width(), l.height(), waterFill, waterSmoothness, true );
|
||||
for (int i=0; i < l.length(); i++) {
|
||||
if (l.map[i] == Terrain.EMPTY && lake[i]) {
|
||||
l.map[i] = Terrain.WATER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void paintGrass( Level l ) {
|
||||
boolean[] grass =
|
||||
Patch.generate( l.width(), l.height(), grassFill, grassSmoothness, true );
|
||||
|
||||
//adds some chaos to grass distribution, note that this does decrease the fill rate slightly
|
||||
//TODO: analyize statistical changes on fill rate
|
||||
for (int i=l.width()+1; i < l.length()-l.width()-1; i++) {
|
||||
if (l.map[i] == Terrain.EMPTY && grass[i]) {
|
||||
int count = 1;
|
||||
for (int n : PathFinder.NEIGHBOURS8) {
|
||||
if (grass[i + n]) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
l.map[i] = (Random.Float() < count / 12f) ? Terrain.HIGH_GRASS : Terrain.GRASS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void paintTraps( Level l ) {
|
||||
ArrayList<Integer> validCells = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < l.length(); i ++) {
|
||||
if (l.map[i] == Terrain.EMPTY){
|
||||
validCells.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
//no more than one trap every 5 valid tiles.
|
||||
nTraps = Math.min(nTraps, validCells.size()/5);
|
||||
|
||||
for (int i = 0; i < nTraps; i++) {
|
||||
|
||||
Integer trapPos = Random.element(validCells);
|
||||
validCells.remove(trapPos); //removes the integer object, not at the index
|
||||
|
||||
try {
|
||||
Trap trap = trapClasses[Random.chances( trapChances )].newInstance().hide();
|
||||
l.setTrap( trap, trapPos );
|
||||
//some traps will not be hidden
|
||||
l.map[trapPos] = trap.visible ? Terrain.TRAP : Terrain.SECRET_TRAP;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -23,8 +23,8 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.rooms;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.Point;
|
||||
|
||||
//import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.SacrificialFire;
|
||||
|
|
|
@ -27,8 +27,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.Point;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.rooms;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.FireTrap;
|
||||
import com.watabou.utils.Point;
|
||||
import com.watabou.utils.Random;
|
||||
|
|
|
@ -28,8 +28,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.Point;
|
||||
|
||||
public class CryptRoom extends Room {
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
|
||||
public class EntranceRoom extends Room {
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
|
||||
public class ExitRoom extends Room {
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Foliage;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.BlandfruitBush;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Sungrass;
|
||||
import com.watabou.utils.Random;
|
||||
|
|
|
@ -28,8 +28,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.Point;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.Point;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.WaterOfHealth;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.WaterOfTransmutation;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.WellWater;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.Point;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.CorpseDust;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTiledVisual;
|
||||
import com.watabou.noosa.Image;
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class MazeRoom extends Room {
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.Point;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -27,8 +27,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.Point;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfInvisibility;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class PoolRoom extends Room {
|
||||
|
|
|
@ -26,8 +26,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class RatKingRoom extends Room {
|
||||
|
|
|
@ -24,8 +24,8 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.rooms;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.CeremonialCandle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTiledVisual;
|
||||
import com.watabou.utils.Point;
|
||||
|
|
|
@ -27,8 +27,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.RotHeart;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.RotLasher;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.PathFinder;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
|
|
|
@ -68,8 +68,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Shuriken;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Tamahawk;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.LastShopLevel;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
|
||||
import com.watabou.utils.PathFinder;
|
||||
import com.watabou.utils.Point;
|
||||
|
|
|
@ -27,8 +27,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.FireTrap;
|
||||
import com.watabou.utils.Point;
|
||||
import com.watabou.utils.Random;
|
||||
|
|
|
@ -25,8 +25,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Statue;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.Point;
|
||||
|
||||
public class StatueRoom extends Room {
|
||||
|
|
|
@ -26,8 +26,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Honeypot;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class StorageRoom extends Room {
|
||||
|
|
|
@ -29,8 +29,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLevitation;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.BlazingTrap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ConfusionTrap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.DisintegrationTrap;
|
||||
|
|
|
@ -26,8 +26,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class TreasuryRoom extends Room {
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.Point;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.GoldenKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.PathFinder;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.rooms;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTiledVisual;
|
||||
import com.watabou.utils.Point;
|
||||
|
|
Loading…
Reference in New Issue
Block a user