diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java index f78f0eb5b..d422f68b2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesLevel.java index 53bf9abd1..db118b853 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesLevel.java @@ -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 diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java index a190a83dd..11034ddd3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityLevel.java index fe626aa38..6222b95ca 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityLevel.java @@ -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 diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java index 671e34a3e..fd9818532 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsLevel.java index 0eb55847d..4e98fb97b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsLevel.java @@ -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 diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java index 2904e8f70..09d78b064 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastShopLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastShopLevel.java index 8ae761914..16ae9074c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastShopLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastShopLevel.java @@ -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() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index 56378510c..f343c011c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonLevel.java index 4131725ef..2445c2eb4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonLevel.java @@ -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 diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java index 5994ac6da..a637c343b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java @@ -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 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) ((Collection) bundle.getCollection( "rooms" )) ); for (Room r : rooms) { if (r instanceof WeakFloorRoom || r.legacyType.equals("WEAK_FLOOR")) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java index a9c6804cb..175b9d03e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java @@ -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() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerLevel.java index ced5a809f..5e0c2c4a9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerLevel.java @@ -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 diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/builders/Builder.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/builders/Builder.java index 2e70e1fa2..13ad59fcc 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/builders/Builder.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/builders/Builder.java @@ -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 diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Painter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/Painter.java similarity index 83% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Painter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/Painter.java index 87e223b16..6d7e60633 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Painter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/Painter.java @@ -19,15 +19,25 @@ * along with this program. If not, see */ -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 rooms); + + // Static methods public static void set( Level level, int cell, int value ) { level.map[cell] = value; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RegularPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RegularPainter.java new file mode 100644 index 000000000..deb9b9cb0 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RegularPainter.java @@ -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[] 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[]) classes; + trapChances = chances; + } + + @Override + public boolean paint(Level level, ArrayList 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 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); + } + } + } + +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/AltarRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/AltarRoom.java index 15b649a75..a79d01223 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/AltarRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/AltarRoom.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ArmoryRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ArmoryRoom.java index 6c0203973..8dd06ec3d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ArmoryRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ArmoryRoom.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/BlacksmithRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/BlacksmithRoom.java index 0fe92f0b5..74e0d9d94 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/BlacksmithRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/BlacksmithRoom.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/CryptRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/CryptRoom.java index f0cc0a5b3..7e60161e6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/CryptRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/CryptRoom.java @@ -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 { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/EntranceRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/EntranceRoom.java index f03850020..94c5ced78 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/EntranceRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/EntranceRoom.java @@ -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 { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ExitRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ExitRoom.java index d705e0511..dfd83188c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ExitRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ExitRoom.java @@ -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 { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/GardenRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/GardenRoom.java index 7eef1e3a5..bc892326f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/GardenRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/GardenRoom.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/LaboratoryRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/LaboratoryRoom.java index a04017848..1cbcabebb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/LaboratoryRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/LaboratoryRoom.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/LibraryRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/LibraryRoom.java index 3d14c16f3..24435b09e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/LibraryRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/LibraryRoom.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MagicWellRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MagicWellRoom.java index 4f9754ccc..55c6a06ce 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MagicWellRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MagicWellRoom.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MassGraveRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MassGraveRoom.java index 58b9014e1..37447bb03 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MassGraveRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MassGraveRoom.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MazeRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MazeRoom.java index 043a993b4..24ee101e8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MazeRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MazeRoom.java @@ -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 { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PassageRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PassageRoom.java index 2095e4661..08e2a75e8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PassageRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PassageRoom.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PitRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PitRoom.java index c684cf724..66de9bfb3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PitRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PitRoom.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PoolRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PoolRoom.java index 86aa84301..b6e94babd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PoolRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PoolRoom.java @@ -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 { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RatKingRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RatKingRoom.java index e8483fafc..f355e9314 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RatKingRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RatKingRoom.java @@ -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 { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RitualSiteRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RitualSiteRoom.java index 8a289eafa..a492df284 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RitualSiteRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RitualSiteRoom.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RotGardenRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RotGardenRoom.java index f45597e41..e0f1b0953 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RotGardenRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RotGardenRoom.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ShopRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ShopRoom.java index 4947566b6..51fa2e3c3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ShopRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ShopRoom.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StandardRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StandardRoom.java index c626a55f7..c8abd6855 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StandardRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StandardRoom.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StatueRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StatueRoom.java index b6344a8ad..205964d67 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StatueRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StatueRoom.java @@ -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 { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StorageRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StorageRoom.java index f64cd6852..88e961190 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StorageRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StorageRoom.java @@ -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 { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TrapsRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TrapsRoom.java index 0ef93df7e..7bfaa6758 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TrapsRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TrapsRoom.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TreasuryRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TreasuryRoom.java index 97761a522..2b82d7d85 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TreasuryRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TreasuryRoom.java @@ -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 { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TunnelRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TunnelRoom.java index efa038cf3..ddab8b902 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TunnelRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TunnelRoom.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/VaultRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/VaultRoom.java index ddfedadf0..4d8d9e6eb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/VaultRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/VaultRoom.java @@ -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; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/WeakFloorRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/WeakFloorRoom.java index 2045a3079..2ae3e1699 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/WeakFloorRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/WeakFloorRoom.java @@ -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;