diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java index be58d7768..30b10b339 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java @@ -51,9 +51,9 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.LastShopLevel; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.PrisonBossLevel; import com.shatteredpixel.shatteredpixeldungeon.levels.PrisonLevel; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room; import com.shatteredpixel.shatteredpixeldungeon.levels.SewerBossLevel; import com.shatteredpixel.shatteredpixeldungeon.levels.SewerLevel; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.StartScene; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java index 4d198ec44..103194689 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java @@ -27,6 +27,7 @@ import android.os.Bundle; import android.util.DisplayMetrics; import android.util.Log; import android.view.View; + import com.shatteredpixel.shatteredpixeldungeon.messages.Languages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; @@ -35,10 +36,10 @@ import com.watabou.noosa.Game; import com.watabou.noosa.RenderedText; import com.watabou.noosa.audio.Music; import com.watabou.noosa.audio.Sample; -import com.watabou.utils.GameMath; + +import java.util.Locale; import javax.microedition.khronos.opengles.GL10; -import java.util.Locale; public class ShatteredPixelDungeon extends Game { @@ -163,6 +164,17 @@ public class ShatteredPixelDungeon extends Game { com.watabou.utils.Bundle.addAlias( com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Repulsion.class, "com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Stench" ); + + //0.6.0 + com.watabou.utils.Bundle.addAlias( + com.shatteredpixel.shatteredpixeldungeon.levels.rooms.MassGraveRoom.Bones.class, + "com.shatteredpixel.shatteredpixeldungeon.levels.painters.MassGravePainter.Bones.class" ); + com.watabou.utils.Bundle.addAlias( + com.shatteredpixel.shatteredpixeldungeon.levels.rooms.RitualSiteRoom.RitualMarker.class, + "com.shatteredpixel.shatteredpixeldungeon.levels.painters.RitualSitePainter.RitualMarker.class" ); + com.watabou.utils.Bundle.addAlias( + com.shatteredpixel.shatteredpixeldungeon.levels.rooms.WeakFloorRoom.HiddenWell.class, + "com.shatteredpixel.shatteredpixeldungeon.levels.painters.WeakFloorPainter.HiddenWell.class" ); com.watabou.utils.Bundle.exceptionReporter = new com.watabou.utils.Bundle.BundleExceptionCallback() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java index daacc77e6..466e63490 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java @@ -32,8 +32,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.quest.DarkGold; import com.shatteredpixel.shatteredpixeldungeon.items.quest.Pickaxe; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room.Type; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room.Type; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.BlacksmithSprite; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java index d5344ec8f..314d9dcf4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java @@ -33,8 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.quest.CorpseDust; import com.shatteredpixel.shatteredpixeldungeon.items.quest.Embers; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.levels.PrisonLevel; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room; -import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.plants.Rotberry; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; 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 d422f68b2..f78f0eb5b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java @@ -33,7 +33,6 @@ 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 ae328e2ac..e46244067 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesLevel.java @@ -23,11 +23,9 @@ package com.shatteredpixel.shatteredpixeldungeon.levels; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTileSheet; -import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room.Type; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room.Type; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ConfusionTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ExplosiveTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.FireTrap; @@ -48,6 +46,8 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.traps.TeleportationTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.VenomTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.WarpingTrap; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTileSheet; +import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.watabou.noosa.Game; import com.watabou.noosa.Group; import com.watabou.noosa.particles.PixelParticle; 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 11034ddd3..a190a83dd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java @@ -31,7 +31,6 @@ 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 949d1c645..56124d9e9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityLevel.java @@ -23,10 +23,9 @@ package com.shatteredpixel.shatteredpixeldungeon.levels; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTileSheet; -import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Imp; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room.Type; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room.Type; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.BlazingTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.CursingTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.DisarmingTrap; @@ -46,6 +45,8 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.traps.VenomTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.WarpingTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.WeakeningTrap; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTileSheet; +import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.watabou.noosa.Group; import com.watabou.noosa.particles.Emitter; import com.watabou.noosa.particles.PixelParticle; 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 fd9818532..671e34a3e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java @@ -32,7 +32,6 @@ 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/LastLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java index 09d78b064..2904e8f70 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java @@ -24,7 +24,6 @@ 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 6c6048ec9..c58bc592d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastShopLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastShopLevel.java @@ -27,7 +27,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Imp; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room.Type; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room.Type; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.watabou.noosa.Group; import com.watabou.utils.Graph; 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 1288c0c5a..3d16c080d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -66,8 +66,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.MassGravePainter; -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; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -369,7 +368,7 @@ public abstract class Level implements Bundlable { CustomTiledVisual vis = (CustomTiledVisual)p; //for compatibilities with pre-0.5.0b saves //extends one of the bones visuals and discards the rest - if (vis instanceof MassGravePainter.Bones && vis.tileH == 0){ + if (vis instanceof MassGraveRoom.Bones && vis.tileH == 0){ int cell = vis.tileX + vis.tileY*width; if (map[cell] == Terrain.EMPTY_SP && DungeonTileSheet.wallStitcheable(map[cell - width]) && diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/Painter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Painter.java similarity index 93% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/Painter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Painter.java index 3399c53b4..b9c289904 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/Painter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Painter.java @@ -19,10 +19,9 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room; import com.watabou.utils.Point; import com.watabou.utils.Rect; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java index f3b210c34..35cf227de 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java @@ -33,7 +33,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Tengu; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.MazePainter; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.MazeRoom; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.SpearTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -306,7 +307,7 @@ public class PrisonBossLevel extends Level { maze.set(10, 1, 31, 29); maze.connected.put(null, new Room.Door(10, 2)); maze.connected.put(maze, new Room.Door(20, 29)); - MazePainter.paint(this, maze); + MazeRoom.paint(this, maze); buildFlagMaps(); cleanWalls(); GameScene.resetMap(); 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 a482a343b..ce23e9182 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonLevel.java @@ -23,11 +23,11 @@ package com.shatteredpixel.shatteredpixeldungeon.levels; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker; import com.shatteredpixel.shatteredpixeldungeon.effects.Halo; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room.Type; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room.Type; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.AlarmTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ChillingTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ConfusionTrap; @@ -44,6 +44,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.traps.SummoningTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.TeleportationTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ToxicTrap; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.watabou.noosa.Group; import com.watabou.noosa.particles.Emitter; import com.watabou.utils.PointF; 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 a5db80e08..972ba0f4c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java @@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Bones; import com.shatteredpixel.shatteredpixeldungeon.Challenges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Bestiary; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; @@ -34,9 +33,9 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfWealth; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room.Type; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.ShopPainter; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room.Type; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.ShopRoom; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ChillingTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ExplosiveTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.FireTrap; @@ -55,6 +54,7 @@ import java.util.List; public abstract class RegularLevel extends Level { + protected ArrayList rooms; protected Room roomEntrance; @@ -135,7 +135,7 @@ public abstract class RegularLevel extends Level { if (Dungeon.shopOnLevel()) { Room shop = null; for (Room r : roomEntrance.connected.keySet()) { - if (r.connected.size() == 1 && ((r.width()-1)*(r.height()-1) >= ShopPainter.spaceNeeded())) { + if (r.connected.size() == 1 && ((r.width()-1)*(r.height()-1) >= ShopRoom.spaceNeeded())) { shop = r; break; } @@ -795,7 +795,7 @@ public abstract class RegularLevel extends Level { } if (r.type == Type.ENTRANCE){ roomEntrance = r; - } else if (r.type == Type.EXIT || r.type == Type.BOSS_EXIT){ + } else if (r.type == Type.EXIT){ roomExit = r; } } 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 bd665a351..dd11ec011 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java @@ -29,7 +29,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Bestiary; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room.Type; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room.Type; 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/SewerLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerLevel.java index a07b85798..ced5a809f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerLevel.java @@ -23,10 +23,10 @@ package com.shatteredpixel.shatteredpixeldungeon.levels; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; import com.shatteredpixel.shatteredpixeldungeon.effects.Ripple; import com.shatteredpixel.shatteredpixeldungeon.items.DewVial; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.AlarmTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ChillingTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.FlockTrap; @@ -37,6 +37,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ToxicTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.WornTrap; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.watabou.noosa.Game; import com.watabou.noosa.Group; import com.watabou.noosa.particles.Emitter; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java index 22370d86c..41de55c4c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java @@ -32,7 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; import com.shatteredpixel.shatteredpixeldungeon.levels.RegularLevel; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/BossExitPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/BossExitPainter.java deleted file mode 100644 index 2f5fe2800..000000000 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/BossExitPainter.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2017 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; - -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room; -import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; - -public class BossExitPainter extends Painter { - - public static void paint( Level level, Room room ) { - - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.EMPTY ); - - for (Room.Door door : room.connected.values()) { - door.set( Room.Door.Type.REGULAR ); - } - - level.exit = room.top * level.width() + (room.left + room.right) / 2; - set( level, level.exit, Terrain.LOCKED_EXIT ); - } - -} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/AltarPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/AltarRoom.java similarity index 70% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/AltarPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/AltarRoom.java index e526bfd2f..dbbd9a39f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/AltarPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/AltarRoom.java @@ -19,39 +19,39 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.watabou.utils.Point; //import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.SacrificialFire; -public class AltarPainter extends Painter { +public class AltarRoom extends Room { public static void paint( Level level, Room room ) { - - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Dungeon.bossLevel( Dungeon.depth + 1 ) ? Terrain.HIGH_GRASS : Terrain.CHASM ); + + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Dungeon.bossLevel( Dungeon.depth + 1 ) ? Terrain.HIGH_GRASS : Terrain.CHASM ); Point c = room.center(); Room.Door door = room.entrance(); if (door.x == room.left || door.x == room.right) { - Point p = drawInside( level, room, door, Math.abs( door.x - c.x ) - 2, Terrain.EMPTY_SP ); + Point p = Painter.drawInside( level, room, door, Math.abs( door.x - c.x ) - 2, Terrain.EMPTY_SP ); for (; p.y != c.y; p.y += p.y < c.y ? +1 : -1) { - set( level, p, Terrain.EMPTY_SP ); + Painter.set( level, p, Terrain.EMPTY_SP ); } } else { - Point p = drawInside( level, room, door, Math.abs( door.y - c.y ) - 2, Terrain.EMPTY_SP ); + Point p = Painter.drawInside( level, room, door, Math.abs( door.y - c.y ) - 2, Terrain.EMPTY_SP ); for (; p.x != c.x; p.x += p.x < c.x ? +1 : -1) { - set( level, p, Terrain.EMPTY_SP ); + Painter.set( level, p, Terrain.EMPTY_SP ); } } - - fill( level, c.x - 1, c.y - 1, 3, 3, Terrain.EMBERS ); - set( level, c, Terrain.PEDESTAL ); + + Painter.fill( level, c.x - 1, c.y - 1, 3, 3, Terrain.EMBERS ); + Painter.set( level, c, Terrain.PEDESTAL ); //TODO: find some use for sacrificial fire... but not the vanilla one. scroll of wipe out is too strong. /*SacrificialFire fire = (SacrificialFire)level.blobs.get( SacrificialFire.class ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/ArmoryPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ArmoryRoom.java similarity index 89% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/ArmoryPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ArmoryRoom.java index 3844e3353..a86add208 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/ArmoryPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ArmoryRoom.java @@ -19,7 +19,7 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.items.Bomb; @@ -27,17 +27,17 @@ 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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.watabou.utils.Point; import com.watabou.utils.Random; -public class ArmoryPainter extends Painter { +public class ArmoryRoom extends Room { public static void paint( Level level, Room room ) { - - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.EMPTY ); + + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Terrain.EMPTY ); Room.Door entrance = room.entrance(); Point statue = null; @@ -51,7 +51,7 @@ public class ArmoryPainter extends Painter { statue = new Point( Random.Int( 2 ) == 0 ? room.left+1 : room.right-1, room.top+1 ); } if (statue != null) { - set( level, statue, Terrain.STATUE ); + Painter.set( level, statue, Terrain.STATUE ); } int n = Random.IntRange( 1, 2 ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/BlacksmithPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/BlacksmithRoom.java similarity index 83% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/BlacksmithPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/BlacksmithRoom.java index a7b2b1085..da095eee8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/BlacksmithPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/BlacksmithRoom.java @@ -19,24 +19,24 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.FireTrap; import com.watabou.utils.Point; import com.watabou.utils.Random; -public class BlacksmithPainter extends Painter { +public class BlacksmithRoom extends Room { public static void paint( Level level, Room room ) { - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.TRAP ); - fill( level, room, 2, Terrain.EMPTY_SP ); + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Terrain.TRAP ); + Painter.fill( level, room, 2, Terrain.EMPTY_SP ); for (int i=0; i < 2; i++) { int pos; @@ -52,7 +52,7 @@ public class BlacksmithPainter extends Painter { for (Room.Door door : room.connected.values()) { door.set( Room.Door.Type.UNLOCKED ); - drawInside( level, room, door, 1, Terrain.EMPTY ); + Painter.drawInside( level, room, door, 1, Terrain.EMPTY ); } Blacksmith npc = new Blacksmith(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/CryptPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/CryptRoom.java similarity index 67% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/CryptPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/CryptRoom.java index 76d1d834f..e86cd854a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/CryptPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/CryptRoom.java @@ -19,25 +19,25 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; -import com.shatteredpixel.shatteredpixeldungeon.items.Heap.Type; +import com.shatteredpixel.shatteredpixeldungeon.items.Heap; 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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.watabou.utils.Point; -public class CryptPainter extends Painter { +public class CryptRoom extends Room { public static void paint( Level level, Room room ) { - - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.EMPTY ); + + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Terrain.EMPTY ); Point c = room.center(); int cx = c.x; @@ -49,24 +49,24 @@ public class CryptPainter extends Painter { level.addItemToSpawn( new IronKey( Dungeon.depth ) ); if (entrance.x == room.left) { - set( level, new Point( room.right-1, room.top+1 ), Terrain.STATUE ); - set( level, new Point( room.right-1, room.bottom-1 ), Terrain.STATUE ); + Painter.set( level, new Point( room.right-1, room.top+1 ), Terrain.STATUE ); + Painter.set( level, new Point( room.right-1, room.bottom-1 ), Terrain.STATUE ); cx = room.right - 2; } else if (entrance.x == room.right) { - set( level, new Point( room.left+1, room.top+1 ), Terrain.STATUE ); - set( level, new Point( room.left+1, room.bottom-1 ), Terrain.STATUE ); + Painter.set( level, new Point( room.left+1, room.top+1 ), Terrain.STATUE ); + Painter.set( level, new Point( room.left+1, room.bottom-1 ), Terrain.STATUE ); cx = room.left + 2; } else if (entrance.y == room.top) { - set( level, new Point( room.left+1, room.bottom-1 ), Terrain.STATUE ); - set( level, new Point( room.right-1, room.bottom-1 ), Terrain.STATUE ); + Painter.set( level, new Point( room.left+1, room.bottom-1 ), Terrain.STATUE ); + Painter.set( level, new Point( room.right-1, room.bottom-1 ), Terrain.STATUE ); cy = room.bottom - 2; } else if (entrance.y == room.bottom) { - set( level, new Point( room.left+1, room.top+1 ), Terrain.STATUE ); - set( level, new Point( room.right-1, room.top+1 ), Terrain.STATUE ); + Painter.set( level, new Point( room.left+1, room.top+1 ), Terrain.STATUE ); + Painter.set( level, new Point( room.right-1, room.top+1 ), Terrain.STATUE ); cy = room.top + 2; } - level.drop( prize( level ), cx + cy * level.width() ).type = Type.TOMB; + level.drop( prize( level ), cx + cy * level.width() ).type = Heap.Type.TOMB; } private static Item prize( Level level ) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/EntrancePainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/EntranceRoom.java similarity index 78% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/EntrancePainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/EntranceRoom.java index 70f83d60e..f6e9d4cda 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/EntrancePainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/EntranceRoom.java @@ -19,18 +19,18 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; -public class EntrancePainter extends Painter { +public class EntranceRoom extends Room { public static void paint( Level level, Room room ) { - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.EMPTY ); + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Terrain.EMPTY ); for (Room.Door door : room.connected.values()) { door.set( Room.Door.Type.REGULAR ); @@ -39,7 +39,7 @@ public class EntrancePainter extends Painter { do { level.entrance = level.pointToCell(room.random(1)); } while (level.findMob(level.entrance) != null); - set( level, level.entrance, Terrain.ENTRANCE ); + Painter.set( level, level.entrance, Terrain.ENTRANCE ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/ExitPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ExitRoom.java similarity index 78% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/ExitPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ExitRoom.java index efb84e319..55ec6ca1f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/ExitPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ExitRoom.java @@ -19,25 +19,25 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; -public class ExitPainter extends Painter { +public class ExitRoom extends Room { public static void paint( Level level, Room room ) { - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.EMPTY ); + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Terrain.EMPTY ); for (Room.Door door : room.connected.values()) { door.set( Room.Door.Type.REGULAR ); } level.exit = level.pointToCell(room.random( 1 )); - set( level, level.exit, Terrain.EXIT ); + Painter.set( level, level.exit, Terrain.EXIT ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/GardenPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/GardenRoom.java similarity index 88% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/GardenPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/GardenRoom.java index 913d148db..0c2b51cd5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/GardenPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/GardenRoom.java @@ -19,25 +19,25 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; 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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.plants.BlandfruitBush; import com.shatteredpixel.shatteredpixeldungeon.plants.Sungrass; import com.watabou.utils.Random; -public class GardenPainter extends Painter { +public class GardenRoom extends Room { public static void paint( Level level, Room room ) { - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.HIGH_GRASS ); - fill( level, room, 2, Terrain.GRASS ); + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Terrain.HIGH_GRASS ); + Painter.fill( level, room, 2, Terrain.GRASS ); room.entrance().set( Room.Door.Type.REGULAR ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/LaboratoryPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/LaboratoryRoom.java similarity index 89% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/LaboratoryPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/LaboratoryRoom.java index 353f38a13..48f677db9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/LaboratoryPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/LaboratoryRoom.java @@ -19,7 +19,7 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Alchemy; @@ -28,17 +28,17 @@ 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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.watabou.utils.Point; import com.watabou.utils.Random; -public class LaboratoryPainter extends Painter { +public class LaboratoryRoom extends Room { public static void paint( Level level, Room room ) { - - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.EMPTY_SP ); + + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Terrain.EMPTY_SP ); Room.Door entrance = room.entrance(); @@ -52,7 +52,7 @@ public class LaboratoryPainter extends Painter { } else if (entrance.y == room.bottom) { pot = new Point( Random.Int( 2 ) == 0 ? room.left + 1 : room.right - 1, room.top+1 ); } - set( level, pot, Terrain.ALCHEMY ); + Painter.set( level, pot, Terrain.ALCHEMY ); Alchemy alchemy = new Alchemy(); alchemy.seed( level, pot.x + level.width() * pot.y, 1 ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/LibraryPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/LibraryRoom.java similarity index 84% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/LibraryPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/LibraryRoom.java index 261f06ea7..783216f37 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/LibraryPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/LibraryRoom.java @@ -19,7 +19,7 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; @@ -29,25 +29,25 @@ 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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.watabou.utils.Point; import com.watabou.utils.Random; -public class LibraryPainter extends Painter { +public class LibraryRoom extends Room { public static void paint( Level level, Room room ) { - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.EMPTY_SP ); + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Terrain.EMPTY_SP ); Room.Door entrance = room.entrance(); Point a = null; Point b = null; - - fill( level, room.left + 1, room.top+1, room.width() - 1, 1 , Terrain.BOOKSHELF ); + + Painter.fill( level, room.left + 1, room.top+1, room.width() - 1, 1 , Terrain.BOOKSHELF ); if (entrance.y == room.top){ - set( level, entrance.x, entrance.y + 1, Terrain.EMPTY_SP ); + Painter.set( level, entrance.x, entrance.y + 1, Terrain.EMPTY_SP ); } int n = Random.IntRange( 2, 3 ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/MagicWellPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MagicWellRoom.java similarity index 88% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/MagicWellPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MagicWellRoom.java index 9894c5f0a..1f4d6e459 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/MagicWellPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MagicWellRoom.java @@ -19,7 +19,7 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; @@ -28,23 +28,23 @@ 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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.watabou.utils.Point; import com.watabou.utils.Random; -public class MagicWellPainter extends Painter { +public class MagicWellRoom extends Room { private static final Class[] WATERS = {WaterOfAwareness.class, WaterOfHealth.class, WaterOfTransmutation.class}; public static void paint( Level level, Room room ) { - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.EMPTY ); + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Terrain.EMPTY ); Point c = room.center(); - set( level, c.x, c.y, Terrain.WELL ); + Painter.set( level, c.x, c.y, Terrain.WELL ); @SuppressWarnings("unchecked") Class waterClass = diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/MassGravePainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MassGraveRoom.java similarity index 93% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/MassGravePainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MassGraveRoom.java index 08e571ad7..687f2076d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/MassGravePainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MassGraveRoom.java @@ -19,7 +19,7 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Skeleton; @@ -30,7 +30,7 @@ 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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTiledVisual; @@ -39,7 +39,7 @@ import com.watabou.utils.Random; import java.util.ArrayList; -public class MassGravePainter extends Painter { +public class MassGraveRoom extends Room { public static void paint( Level level, Room room){ @@ -47,8 +47,8 @@ public class MassGravePainter extends Painter { entrance.set(Room.Door.Type.BARRICADE); level.addItemToSpawn(new PotionOfLiquidFlame()); - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY_SP); + Painter.fill(level, room, Terrain.WALL); + Painter.fill(level, room, 1, Terrain.EMPTY_SP); Bones b = new Bones(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/MazePainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MazeRoom.java similarity index 91% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/MazePainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MazeRoom.java index a8a4a554e..63b894b83 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/MazePainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/MazeRoom.java @@ -19,17 +19,17 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.watabou.utils.Random; -public class MazePainter extends Painter { +public class MazeRoom extends Room { public static void paint( Level level, Room room ) { - fill(level, room, 1, Terrain.EMPTY); + Painter.fill(level, room, 1, Terrain.EMPTY); //true = space, false = wall boolean[][] maze = new boolean[room.width() + 1][room.height() + 1]; @@ -82,11 +82,11 @@ public class MazePainter extends Painter { } - fill(level, room, 1, Terrain.EMPTY); + Painter.fill(level, room, 1, Terrain.EMPTY); for (int x = 0; x < maze.length; x++) for (int y = 0; y < maze[0].length; y++) { if (!maze[x][y]) { - fill(level, x + room.left, y + room.top, 1, 1, Terrain.WALL); + Painter.fill(level, x + room.left, y + room.top, 1, 1, Terrain.WALL); } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/PassagePainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PassageRoom.java similarity index 91% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/PassagePainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PassageRoom.java index 48004f064..8bd60608a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/PassagePainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PassageRoom.java @@ -19,16 +19,16 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.watabou.utils.Point; import java.util.ArrayList; import java.util.Collections; -public class PassagePainter extends Painter { +public class PassageRoom extends Room { private static int pasWidth; private static int pasHeight; @@ -63,11 +63,11 @@ public class PassagePainter extends Painter { int p = joints.get( start ); do { - set( level, p2xy( room, p ), floor ); + Painter.set( level, p2xy( room, p ), floor ); p = (p + 1) % perimeter; } while (p != joints.get( end )); - set( level, p2xy( room, p ), floor ); + Painter.set( level, p2xy( room, p ), floor ); for (Room.Door door : room.connected.values()) { door.set( Room.Door.Type.TUNNEL ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/PitPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PitRoom.java similarity index 86% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/PitPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PitRoom.java index 020401c7b..112d9facd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/PitPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PitRoom.java @@ -19,25 +19,25 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; -import com.shatteredpixel.shatteredpixeldungeon.items.Heap.Type; +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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.watabou.utils.Point; import com.watabou.utils.Random; -public class PitPainter extends Painter { +public class PitRoom extends Room { public static void paint( Level level, Room room ) { - - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.EMPTY ); + + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Terrain.EMPTY ); Room.Door entrance = room.entrance(); entrance.set( Room.Door.Type.LOCKED ); @@ -52,14 +52,14 @@ public class PitPainter extends Painter { } else if (entrance.y == room.bottom) { well = new Point( Random.Int( 2 ) == 0 ? room.left + 1 : room.right - 1, room.top+1 ); } - set( level, well, Terrain.EMPTY_WELL ); + Painter.set( level, well, Terrain.EMPTY_WELL ); int remains = level.pointToCell(room.random()); while (level.map[remains] == Terrain.EMPTY_WELL) { remains = level.pointToCell(room.random()); } - level.drop( new IronKey( Dungeon.depth ), remains ).type = Type.SKELETON; + level.drop( new IronKey( Dungeon.depth ), remains ).type = Heap.Type.SKELETON; int loot = Random.Int( 3 ); if (loot == 0) { level.drop( Generator.random( Generator.Category.RING ), remains ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/PoolPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PoolRoom.java similarity index 90% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/PoolPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PoolRoom.java index dc8486b49..31b936ded 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/PoolPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/PoolRoom.java @@ -19,7 +19,7 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Piranha; @@ -29,18 +29,18 @@ 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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.watabou.utils.Random; -public class PoolPainter extends Painter { +public class PoolRoom extends Room { private static final int NPIRANHAS = 3; public static void paint( Level level, Room room ) { - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.WATER ); + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Terrain.WATER ); Room.Door door = room.entrance(); door.set( Room.Door.Type.REGULAR ); @@ -72,7 +72,7 @@ public class PoolPainter extends Painter { int pos = x + y * level.width(); level.drop( prize( level ), pos ).type = Random.Int( 3 ) == 0 ? Heap.Type.CHEST : Heap.Type.HEAP; - set( level, pos, Terrain.PEDESTAL ); + Painter.set( level, pos, Terrain.PEDESTAL ); level.addItemToSpawn( new PotionOfInvisibility() ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RatKingPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RatKingRoom.java similarity index 89% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RatKingPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RatKingRoom.java index b4c9f6d68..21cb83dec 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RatKingPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RatKingRoom.java @@ -19,23 +19,23 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.RatKing; 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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.watabou.utils.Random; -public class RatKingPainter extends Painter { +public class RatKingRoom extends Room { public static void paint( Level level, Room room ) { - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.EMPTY_SP ); + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Terrain.EMPTY_SP ); Room.Door entrance = room.entrance(); entrance.set( Room.Door.Type.HIDDEN ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RitualSitePainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RitualSiteRoom.java similarity index 87% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RitualSitePainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RitualSiteRoom.java index 4f6195b41..f8531c06e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RitualSitePainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RitualSiteRoom.java @@ -19,18 +19,18 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTiledVisual; import com.watabou.utils.Point; -public class RitualSitePainter extends Painter { +public class RitualSiteRoom extends Room { public static void paint( Level level, Room room) { @@ -38,16 +38,16 @@ public class RitualSitePainter extends Painter { door.set( Room.Door.Type.REGULAR ); } - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.EMPTY); + Painter.fill(level, room, Terrain.WALL); + Painter.fill(level, room, 1, Terrain.EMPTY); RitualMarker vis = new RitualMarker(); Point c = room.center(); vis.pos(c.x - 1, c.y - 1); level.customTiles.add(vis); - - fill(level, c.x-1, c.y-1, 3, 3, Terrain.EMPTY_DECO); + + Painter.fill(level, c.x-1, c.y-1, 3, 3, Terrain.EMPTY_DECO); level.addItemToSpawn(new CeremonialCandle()); level.addItemToSpawn(new CeremonialCandle()); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Room.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/Room.java similarity index 62% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Room.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/Room.java index 187d86f8b..37c077af3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Room.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/Room.java @@ -19,38 +19,10 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; -import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.AltarPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.ArmoryPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.BlacksmithPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.BossExitPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.CryptPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.EntrancePainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.ExitPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.GardenPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.LaboratoryPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.LibraryPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.MagicWellPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.MassGravePainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.PassagePainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.PitPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.PoolPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.RatKingPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.RitualSitePainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.RotGardenPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.ShopPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.StandardPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.StatuePainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.StoragePainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.TrapsPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.TreasuryPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.TunnelPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.VaultPainter; -import com.shatteredpixel.shatteredpixeldungeon.levels.painters.WeakFloorPainter; +import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.watabou.utils.Bundlable; import com.watabou.utils.Bundle; import com.watabou.utils.Graph; @@ -72,41 +44,52 @@ public class Room extends Rect implements Graph.Node, Bundlable { public int distance; public int price = 1; + public Room(){ + super(); + } + + public Room(Rect other){ + super(other); + } + + public Room( int left, int top, int right, int bottom ) { + super( left, top, right, bottom ); + } + + //TODO convert these types into full subclasses of room public static enum Type { NULL( null ), - STANDARD ( StandardPainter.class ), - ENTRANCE ( EntrancePainter.class ), - EXIT ( ExitPainter.class ), - BOSS_EXIT ( BossExitPainter.class ), - TUNNEL ( TunnelPainter.class ), - PASSAGE ( PassagePainter.class ), - SHOP ( ShopPainter.class ), - BLACKSMITH ( BlacksmithPainter.class ), - TREASURY ( TreasuryPainter.class ), - ARMORY ( ArmoryPainter.class ), - LIBRARY ( LibraryPainter.class ), - LABORATORY ( LaboratoryPainter.class ), - VAULT ( VaultPainter.class ), - TRAPS ( TrapsPainter.class ), - STORAGE ( StoragePainter.class ), - MAGIC_WELL ( MagicWellPainter.class ), - GARDEN ( GardenPainter.class ), - CRYPT ( CryptPainter.class ), - STATUE ( StatuePainter.class ), - POOL ( PoolPainter.class ), - RAT_KING ( RatKingPainter.class ), - WEAK_FLOOR ( WeakFloorPainter.class ), - PIT ( PitPainter.class ), - ALTAR ( AltarPainter.class ), + STANDARD ( StandardRoom.class ), + ENTRANCE ( EntranceRoom.class ), + EXIT ( ExitRoom.class ), + TUNNEL ( MazeRoom.class ), + PASSAGE ( PassageRoom.class ), + SHOP ( ShopRoom.class ), + BLACKSMITH ( BlacksmithRoom.class ), + TREASURY ( TreasuryRoom.class ), + ARMORY ( ArmoryRoom.class ), + LIBRARY ( LibraryRoom.class ), + LABORATORY ( LaboratoryRoom.class ), + VAULT ( VaultRoom.class ), + TRAPS ( TrapsRoom.class ), + STORAGE ( StorageRoom.class ), + MAGIC_WELL ( MagicWellRoom.class ), + GARDEN ( GardenRoom.class ), + CRYPT ( CryptRoom.class ), + STATUE ( StatueRoom.class ), + POOL ( PoolRoom.class ), + RAT_KING ( RatKingRoom.class ), + WEAK_FLOOR ( WeakFloorRoom.class ), + PIT ( PitRoom.class ), //prison quests - MASS_GRAVE ( MassGravePainter.class ), - ROT_GARDEN ( RotGardenPainter.class ), - RITUAL_SITE ( RitualSitePainter.class ); + MASS_GRAVE ( MassGraveRoom.class ), + ROT_GARDEN ( RotGardenRoom.class ), + RITUAL_SITE ( RitualSiteRoom.class ); private Method paint; - Type( Class painter ) { + Type( Class painter ) { if (painter == null) paint = null; else diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RotGardenPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RotGardenRoom.java similarity index 89% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RotGardenPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RotGardenRoom.java index d4cb609e4..85b3c7cce 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RotGardenPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/RotGardenRoom.java @@ -19,7 +19,7 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; @@ -27,12 +27,12 @@ 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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; -public class RotGardenPainter extends Painter { +public class RotGardenRoom extends Room { public static void paint( Level level, Room room ) { @@ -40,8 +40,8 @@ public class RotGardenPainter extends Painter { entrance.set(Room.Door.Type.LOCKED); level.addItemToSpawn(new IronKey(Dungeon.depth)); - fill(level, room, Terrain.WALL); - fill(level, room, 1, Terrain.GRASS); + Painter.fill(level, room, Terrain.WALL); + Painter.fill(level, room, 1, Terrain.GRASS); int heartX = Random.IntRange(room.left+1, room.right-1); @@ -90,7 +90,7 @@ public class RotGardenPainter extends Painter { for(int i : PathFinder.NEIGHBOURS8) { if (level.map[pos + i] == Terrain.GRASS){ - set(level, pos + i, Terrain.HIGH_GRASS); + Painter.set(level, pos + i, Terrain.HIGH_GRASS); } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/ShopPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ShopRoom.java similarity index 98% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/ShopPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ShopRoom.java index c5630b75d..127840a3c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/ShopPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/ShopRoom.java @@ -19,7 +19,7 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings; @@ -68,7 +68,7 @@ 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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.plants.Plant; import com.watabou.utils.PathFinder; @@ -78,7 +78,7 @@ import com.watabou.utils.Random; import java.util.ArrayList; import java.util.Collections; -public class ShopPainter extends Painter { +public class ShopRoom extends Room { private static int pasWidth; private static int pasHeight; @@ -87,8 +87,8 @@ public class ShopPainter extends Painter { public static void paint( Level level, Room room ) { - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.EMPTY_SP ); + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Terrain.EMPTY_SP ); pasWidth = room.width() - 2; pasHeight = room.height() - 2; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/StandardPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StandardRoom.java similarity index 70% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/StandardPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StandardRoom.java index ef35d3172..be6290b60 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/StandardPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StandardRoom.java @@ -19,7 +19,7 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; @@ -27,17 +27,17 @@ 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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.FireTrap; import com.watabou.utils.Point; import com.watabou.utils.Random; -public class StandardPainter extends Painter { +public class StandardRoom extends Room { public static void paint( Level level, Room room ) { - fill( level, room, Terrain.WALL ); + Painter.fill( level, room, Terrain.WALL ); for (Room.Door door : room.connected.values()) { door.set( Room.Door.Type.REGULAR ); } @@ -92,7 +92,7 @@ public class StandardPainter extends Painter { } } - fill( level, room, 1, Terrain.EMPTY ); + Painter.fill( level, room, 1, Terrain.EMPTY ); } private static void paintBurned( Level level, Room room ) { @@ -125,7 +125,7 @@ public class StandardPainter extends Painter { } private static void paintGraveyard( Level level, Room room ) { - fill( level, room.left + 1, room.top + 1, room.width() - 1, room.height() - 1 , Terrain.GRASS ); + Painter.fill( level, room.left + 1, room.top + 1, room.width() - 1, room.height() - 1 , Terrain.GRASS ); int w = room.width() - 1; int h = room.height() - 1; @@ -143,37 +143,37 @@ public class StandardPainter extends Painter { } private static void paintStriped( Level level, Room room ) { - fill( level, room.left + 1, room.top + 1, room.width() - 1, room.height() - 1 , Terrain.EMPTY_SP ); + Painter.fill( level, room.left + 1, room.top + 1, room.width() - 1, room.height() - 1 , Terrain.EMPTY_SP ); if (room.width() > room.height()) { for (int i=room.left + 2; i < room.right; i += 2) { - fill( level, i, room.top + 1, 1, room.height() - 1, Terrain.HIGH_GRASS ); + Painter.fill( level, i, room.top + 1, 1, room.height() - 1, Terrain.HIGH_GRASS ); } } else { for (int i=room.top + 2; i < room.bottom; i += 2) { - fill( level, room.left + 1, i, room.width() - 1, 1, Terrain.HIGH_GRASS ); + Painter.fill( level, room.left + 1, i, room.width() - 1, 1, Terrain.HIGH_GRASS ); } } } //TODO: this is almost a special room type now, consider moving this into its own painter if/when you address room gen significantly. private static void paintStudy( Level level, Room room ) { - fill( level, room.left + 1, room.top + 1, room.width() - 1, room.height() - 1 , Terrain.BOOKSHELF ); - fill( level, room.left + 2, room.top + 2, room.width() - 3, room.height() - 3 , Terrain.EMPTY_SP ); + Painter.fill( level, room.left + 1, room.top + 1, room.width() - 1, room.height() - 1 , Terrain.BOOKSHELF ); + Painter.fill( level, room.left + 2, room.top + 2, room.width() - 3, room.height() - 3 , Terrain.EMPTY_SP ); for (Point door : room.connected.values()) { if (door.x == room.left) { - set( level, door.x + 1, door.y, Terrain.EMPTY ); + Painter.set( level, door.x + 1, door.y, Terrain.EMPTY ); } else if (door.x == room.right) { - set( level, door.x - 1, door.y, Terrain.EMPTY ); + Painter.set( level, door.x - 1, door.y, Terrain.EMPTY ); } else if (door.y == room.top) { - set( level, door.x, door.y + 1, Terrain.EMPTY ); + Painter.set( level, door.x, door.y + 1, Terrain.EMPTY ); } else if (door.y == room.bottom) { - set( level, door.x , door.y - 1, Terrain.EMPTY ); + Painter.set( level, door.x , door.y - 1, Terrain.EMPTY ); } } Point center = room.center(); - set( level, center, Terrain.PEDESTAL ); + Painter.set( level, center, Terrain.PEDESTAL ); if (Random.Int(2) != 0){ Item prize = level.findPrizeItem(); if (prize != null) { @@ -189,7 +189,7 @@ public class StandardPainter extends Painter { private static void paintBridge( Level level, Room room ) { - fill( level, room.left + 1, room.top + 1, room.width() - 1, room.height() - 1 , + Painter.fill( level, room.left + 1, room.top + 1, room.width() - 1, room.height() - 1 , !Dungeon.bossLevel() && !Dungeon.bossLevel( Dungeon.depth + 1 ) && Random.Int( 3 ) == 0 ? Terrain.CHASM : Terrain.WATER ); @@ -209,9 +209,9 @@ public class StandardPainter extends Painter { int s = room.width() / 2; - drawInside( level, room, door1, s, Terrain.EMPTY_SP ); - drawInside( level, room, door2, s, Terrain.EMPTY_SP ); - fill( level, room.center().x, Math.min( door1.y, door2.y ), 1, Math.abs( door1.y - door2.y ) + 1, Terrain.EMPTY_SP ); + Painter.drawInside( level, room, door1, s, Terrain.EMPTY_SP ); + Painter.drawInside( level, room, door2, s, Terrain.EMPTY_SP ); + Painter.fill( level, room.center().x, Math.min( door1.y, door2.y ), 1, Math.abs( door1.y - door2.y ) + 1, Terrain.EMPTY_SP ); } else if ((door1.y == room.top && door2.y == room.bottom) || @@ -219,44 +219,44 @@ public class StandardPainter extends Painter { int s = room.height() / 2; - drawInside( level, room, door1, s, Terrain.EMPTY_SP ); - drawInside( level, room, door2, s, Terrain.EMPTY_SP ); - fill( level, Math.min( door1.x, door2.x ), room.center().y, Math.abs( door1.x - door2.x ) + 1, 1, Terrain.EMPTY_SP ); + Painter.drawInside( level, room, door1, s, Terrain.EMPTY_SP ); + Painter.drawInside( level, room, door2, s, Terrain.EMPTY_SP ); + Painter.fill( level, Math.min( door1.x, door2.x ), room.center().y, Math.abs( door1.x - door2.x ) + 1, 1, Terrain.EMPTY_SP ); } else if (door1.x == door2.x) { - fill( level, door1.x == room.left ? room.left + 1 : room.right - 1, Math.min( door1.y, door2.y ), 1, Math.abs( door1.y - door2.y ) + 1, Terrain.EMPTY_SP ); + Painter.fill( level, door1.x == room.left ? room.left + 1 : room.right - 1, Math.min( door1.y, door2.y ), 1, Math.abs( door1.y - door2.y ) + 1, Terrain.EMPTY_SP ); } else if (door1.y == door2.y) { - fill( level, Math.min( door1.x, door2.x ), door1.y == room.top ? room.top + 1 : room.bottom - 1, Math.abs( door1.x - door2.x ) + 1, 1, Terrain.EMPTY_SP ); + Painter.fill( level, Math.min( door1.x, door2.x ), door1.y == room.top ? room.top + 1 : room.bottom - 1, Math.abs( door1.x - door2.x ) + 1, 1, Terrain.EMPTY_SP ); } else if (door1.y == room.top || door1.y == room.bottom) { - drawInside( level, room, door1, Math.abs( door1.y - door2.y ), Terrain.EMPTY_SP ); - drawInside( level, room, door2, Math.abs( door1.x - door2.x ), Terrain.EMPTY_SP ); + Painter.drawInside( level, room, door1, Math.abs( door1.y - door2.y ), Terrain.EMPTY_SP ); + Painter.drawInside( level, room, door2, Math.abs( door1.x - door2.x ), Terrain.EMPTY_SP ); } else if (door1.x == room.left || door1.x == room.right) { - drawInside( level, room, door1, Math.abs( door1.x - door2.x ), Terrain.EMPTY_SP ); - drawInside( level, room, door2, Math.abs( door1.y - door2.y ), Terrain.EMPTY_SP ); + Painter.drawInside( level, room, door1, Math.abs( door1.x - door2.x ), Terrain.EMPTY_SP ); + Painter.drawInside( level, room, door2, Math.abs( door1.y - door2.y ), Terrain.EMPTY_SP ); } } private static void paintFissure( Level level, Room room ) { - fill( level, room.left + 1, room.top + 1, room.width() - 1, room.height() - 1 ,Terrain.EMPTY ); + Painter.fill( level, room.left + 1, room.top + 1, room.width() - 1, room.height() - 1 ,Terrain.EMPTY ); for (int i=room.top + 2; i < room.bottom - 1; i++) { for (int j=room.left + 2; j < room.right - 1; j++) { int v = Math.min( i - room.top, room.bottom - i ); int h = Math.min( j - room.left, room.right - j ); if (Math.min( v, h ) > 2 || Random.Int( 2 ) == 0) { - set( level, j, i, Terrain.CHASM ); + Painter.set( level, j, i, Terrain.CHASM ); } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/StatuePainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StatueRoom.java similarity index 73% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/StatuePainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StatueRoom.java index 22479c8ab..9570a7355 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/StatuePainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StatueRoom.java @@ -19,22 +19,22 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; 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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.watabou.utils.Point; -public class StatuePainter extends Painter { +public class StatueRoom extends Room { public static void paint( Level level, Room room ) { - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.EMPTY ); + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Terrain.EMPTY ); Point c = room.center(); int cx = c.x; @@ -47,22 +47,22 @@ public class StatuePainter extends Painter { if (door.x == room.left) { - fill( level, room.right - 1, room.top + 1, 1, room.height() - 1 , Terrain.STATUE ); + Painter.fill( level, room.right - 1, room.top + 1, 1, room.height() - 1 , Terrain.STATUE ); cx = room.right - 2; } else if (door.x == room.right) { - fill( level, room.left + 1, room.top + 1, 1, room.height() - 1 , Terrain.STATUE ); + Painter.fill( level, room.left + 1, room.top + 1, 1, room.height() - 1 , Terrain.STATUE ); cx = room.left + 2; } else if (door.y == room.top) { - fill( level, room.left + 1, room.bottom - 1, room.width() - 1, 1 , Terrain.STATUE ); + Painter.fill( level, room.left + 1, room.bottom - 1, room.width() - 1, 1 , Terrain.STATUE ); cy = room.bottom - 2; } else if (door.y == room.bottom) { - fill( level, room.left + 1, room.top + 1, room.width() - 1, 1 , Terrain.STATUE ); + Painter.fill( level, room.left + 1, room.top + 1, room.width() - 1, 1 , Terrain.STATUE ); cy = room.top + 2; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/StoragePainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StorageRoom.java similarity index 89% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/StoragePainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StorageRoom.java index 55639a2af..dca285a9c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/StoragePainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/StorageRoom.java @@ -19,25 +19,25 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; 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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.watabou.utils.Random; -public class StoragePainter extends Painter { +public class StorageRoom extends Room { public static void paint( Level level, Room room ) { final int floor = Terrain.EMPTY_SP; - fill( level, room, Terrain.WALL ); - fill( level, room, 1, floor ); + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, floor ); boolean honeyPot = Random.Int( 2 ) == 0; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/TrapsPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TrapsRoom.java similarity index 88% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/TrapsPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TrapsRoom.java index 54288920b..d1d9078b1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/TrapsPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TrapsRoom.java @@ -19,7 +19,7 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; @@ -29,7 +29,7 @@ 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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.BlazingTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ConfusionTrap; @@ -48,11 +48,11 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.traps.WarpingTrap; import com.watabou.utils.Point; import com.watabou.utils.Random; -public class TrapsPainter extends Painter { +public class TrapsRoom extends Room { public static void paint( Level level, Room room ) { - fill( level, room, Terrain.WALL ); + Painter.fill( level, room, Terrain.WALL ); Class trapClass; switch (Random.Int(5)){ @@ -68,9 +68,9 @@ public class TrapsPainter extends Painter { } if (trapClass == null){ - fill(level, room, 1, Terrain.CHASM); + Painter.fill(level, room, 1, Terrain.CHASM); } else { - fill(level, room, 1, Terrain.TRAP); + Painter.fill(level, room, 1, Terrain.TRAP); } Room.Door door = room.entrance(); @@ -83,19 +83,19 @@ public class TrapsPainter extends Painter { if (door.x == room.left) { x = room.right - 1; y = room.top + room.height() / 2; - fill( level, x, room.top + 1, 1, room.height() - 1 , lastRow ); + Painter.fill( level, x, room.top + 1, 1, room.height() - 1 , lastRow ); } else if (door.x == room.right) { x = room.left + 1; y = room.top + room.height() / 2; - fill( level, x, room.top + 1, 1, room.height() - 1 , lastRow ); + Painter.fill( level, x, room.top + 1, 1, room.height() - 1 , lastRow ); } else if (door.y == room.top) { x = room.left + room.width() / 2; y = room.bottom - 1; - fill( level, room.left + 1, y, room.width() - 1, 1 , lastRow ); + Painter.fill( level, room.left + 1, y, room.width() - 1, 1 , lastRow ); } else if (door.y == room.bottom) { x = room.left + room.width() / 2; y = room.top + 1; - fill( level, room.left + 1, y, room.width() - 1, 1 , lastRow ); + Painter.fill( level, room.left + 1, y, room.width() - 1, 1 , lastRow ); } for(Point p : room.getPoints()) { @@ -112,11 +112,11 @@ public class TrapsPainter extends Painter { int pos = x + y * level.width(); if (Random.Int( 3 ) == 0) { if (lastRow == Terrain.CHASM) { - set( level, pos, Terrain.EMPTY ); + Painter.set( level, pos, Terrain.EMPTY ); } level.drop( prize( level ), pos ).type = Heap.Type.CHEST; } else { - set( level, pos, Terrain.PEDESTAL ); + Painter.set( level, pos, Terrain.PEDESTAL ); level.drop( prize( level ), pos ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/TreasuryPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TreasuryRoom.java similarity index 86% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/TreasuryPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TreasuryRoom.java index 7def6a1d1..e5a639d8d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/TreasuryPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TreasuryRoom.java @@ -19,25 +19,25 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; 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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.watabou.utils.Random; -public class TreasuryPainter extends Painter { +public class TreasuryRoom extends Room { public static void paint( Level level, Room room ) { - - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.EMPTY ); - set( level, room.center(), Terrain.STATUE ); + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Terrain.EMPTY ); + + Painter.set( level, room.center(), Terrain.STATUE ); Heap.Type heapType = Random.Int( 2 ) == 0 ? Heap.Type.CHEST : Heap.Type.HEAP; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/TunnelPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TunnelRoom.java similarity index 83% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/TunnelPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TunnelRoom.java index 6540b8d14..ad8408126 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/TunnelPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/TunnelRoom.java @@ -19,14 +19,14 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; -import com.shatteredpixel.shatteredpixeldungeon.levels.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.watabou.utils.Point; import com.watabou.utils.Random; -public class TunnelPainter extends Painter { +public class TunnelRoom extends Room { public static void paint( Level level, Room room ) { @@ -47,14 +47,14 @@ public class TunnelPainter extends Painter { from = room.left + 1; for (int i=door.y; i != c.y; i += step) { - set( level, from, i, floor ); + Painter.set( level, from, i, floor ); } } else if (door.x == room.right) { to = room.right - 1; for (int i=door.y; i != c.y; i += step) { - set( level, to, i, floor ); + Painter.set( level, to, i, floor ); } } else { @@ -66,13 +66,13 @@ public class TunnelPainter extends Painter { } for (int i=door.y+step; i != c.y; i += step) { - set( level, door.x, i, floor ); + Painter.set( level, door.x, i, floor ); } } } for (int i=from; i <= to; i++) { - set( level, i, c.y, floor ); + Painter.set( level, i, c.y, floor ); } } else { @@ -88,14 +88,14 @@ public class TunnelPainter extends Painter { from = room.top + 1; for (int i=door.x; i != c.x; i += step) { - set( level, i, from, floor ); + Painter.set( level, i, from, floor ); } } else if (door.y == room.bottom) { to = room.bottom - 1; for (int i=door.x; i != c.x; i += step) { - set( level, i, to, floor ); + Painter.set( level, i, to, floor ); } } else { @@ -107,13 +107,13 @@ public class TunnelPainter extends Painter { } for (int i=door.x+step; i != c.x; i += step) { - set( level, i, door.y, floor ); + Painter.set( level, i, door.y, floor ); } } } for (int i=from; i <= to; i++) { - set( level, c.x, i, floor ); + Painter.set( level, c.x, i, floor ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/VaultPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/VaultRoom.java similarity index 79% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/VaultPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/VaultRoom.java index 83ad93bfe..841cea726 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/VaultPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/VaultRoom.java @@ -19,27 +19,27 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +package com.shatteredpixel.shatteredpixeldungeon.levels.rooms; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; -import com.shatteredpixel.shatteredpixeldungeon.items.Heap.Type; +import com.shatteredpixel.shatteredpixeldungeon.items.Heap; 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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; -public class VaultPainter extends Painter { +public class VaultRoom extends Room { public static void paint( Level level, Room room ) { - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.EMPTY_SP ); - fill( level, room, 2, Terrain.EMPTY ); + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Terrain.EMPTY_SP ); + Painter.fill( level, room, 2, Terrain.EMPTY ); int cx = (room.left + room.right) / 2; int cy = (room.top + room.bottom) / 2; @@ -48,7 +48,7 @@ public class VaultPainter extends Painter { switch (Random.Int( 3 )) { case 0: - level.drop( prize( level ), c ).type = Type.LOCKED_CHEST; + level.drop( prize( level ), c ).type = Heap.Type.LOCKED_CHEST; level.addItemToSpawn( new GoldenKey( Dungeon.depth ) ); break; @@ -58,14 +58,14 @@ public class VaultPainter extends Painter { i1 = prize( level ); i2 = prize( level ); } while (i1.getClass() == i2.getClass()); - level.drop( i1, c ).type = Type.CRYSTAL_CHEST; - level.drop( i2, c + PathFinder.NEIGHBOURS8[Random.Int( 8 )]).type = Type.CRYSTAL_CHEST; + level.drop( i1, c ).type = Heap.Type.CRYSTAL_CHEST; + level.drop( i2, c + PathFinder.NEIGHBOURS8[Random.Int( 8 )]).type = Heap.Type.CRYSTAL_CHEST; level.addItemToSpawn( new GoldenKey( Dungeon.depth ) ); break; case 2: level.drop( prize( level ), c ); - set( level, c, Terrain.PEDESTAL ); + Painter.set( level, c, Terrain.PEDESTAL ); break; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/WeakFloorPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/WeakFloorRoom.java similarity index 77% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/WeakFloorPainter.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/WeakFloorRoom.java index dd33672be..867c21876 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/WeakFloorPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/WeakFloorRoom.java @@ -19,43 +19,43 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +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.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTiledVisual; import com.watabou.utils.Point; import com.watabou.utils.Random; -public class WeakFloorPainter extends Painter { +public class WeakFloorRoom extends Room { public static void paint( Level level, Room room ) { - fill( level, room, Terrain.WALL ); - fill( level, room, 1, Terrain.CHASM ); + Painter.fill( level, room, Terrain.WALL ); + Painter.fill( level, room, 1, Terrain.CHASM ); Room.Door door = room.entrance(); door.set( Room.Door.Type.REGULAR ); if (door.x == room.left) { for (int i=room.top + 1; i < room.bottom; i++) { - drawInside( level, room, new Point( room.left, i ), Random.IntRange( 1, room.width() - 2 ), Terrain.EMPTY_SP ); + Painter.drawInside( level, room, new Point( room.left, i ), Random.IntRange( 1, room.width() - 2 ), Terrain.EMPTY_SP ); } } else if (door.x == room.right) { for (int i=room.top + 1; i < room.bottom; i++) { - drawInside( level, room, new Point( room.right, i ), Random.IntRange( 1, room.width() - 2 ), Terrain.EMPTY_SP ); + Painter.drawInside( level, room, new Point( room.right, i ), Random.IntRange( 1, room.width() - 2 ), Terrain.EMPTY_SP ); } } else if (door.y == room.top) { for (int i=room.left + 1; i < room.right; i++) { - drawInside( level, room, new Point( i, room.top ), Random.IntRange( 1, room.height() - 2 ), Terrain.EMPTY_SP ); + Painter.drawInside( level, room, new Point( i, room.top ), Random.IntRange( 1, room.height() - 2 ), Terrain.EMPTY_SP ); } } else if (door.y == room.bottom) { for (int i=room.left + 1; i < room.right; i++) { - drawInside( level, room, new Point( i, room.bottom ), Random.IntRange( 1, room.height() - 2 ), Terrain.EMPTY_SP ); + Painter.drawInside( level, room, new Point( i, room.bottom ), Random.IntRange( 1, room.height() - 2 ), Terrain.EMPTY_SP ); } } @@ -69,7 +69,7 @@ public class WeakFloorPainter extends Painter { } else if (door.y == room.bottom) { well = new Point( Random.Int( 2 ) == 0 ? room.left + 1 : room.right - 1, room.top+2 ); } - set(level, well, Terrain.CHASM); + Painter.set(level, well, Terrain.CHASM); CustomTiledVisual vis = new HiddenWell(); vis.pos(well.x, well.y); level.customTiles.add(vis); diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/levels/levels.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/levels/levels.properties index 04f0c0f45..0f454f746 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/levels/levels.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/levels/levels.properties @@ -38,15 +38,15 @@ levels.features.sign.burn=As you try to read the sign it bursts into greenish fl -###painters -levels.painters.massgravepainter$bones.name=Mass grave -levels.painters.massgravepainter$bones.desc=bones litter the floor, what happened here? +###rooms +levels.rooms.massgraveroom$bones.name=Mass grave +levels.rooms.massgraveroom$bones.desc=bones litter the floor, what happened here? -levels.painters.ritualsitepainter$ritualmarker.name=Ritual marker -levels.painters.ritualsitepainter$ritualmarker.desc=A painted marker for some dark ritual. Candles are usually placed on the four corners. +levels.rooms.ritualsiteroom$ritualmarker.name=Ritual marker +levels.rooms.ritualsiteroom$ritualmarker.desc=A painted marker for some dark ritual. Candles are usually placed on the four corners. -levels.painters.weakfloorpainter$hiddenwell.name=Distant well -levels.painters.weakfloorpainter$hiddenwell.desc=You can just make out a well in the depths below, perhaps there is something down there? +levels.rooms.weakfloorroom$hiddenwell.name=Distant well +levels.rooms.weakfloorroom$hiddenwell.desc=You can just make out a well in the depths below, perhaps there is something down there? ###traps