From a7d17836f0e9d85e1f8f107273ae6fc486c4fa61 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 1 May 2025 11:15:53 -0400 Subject: [PATCH] v3.1.0: adjusted prison standard rooms and overall standard room chances --- .../levels/painters/PrisonPainter.java | 28 ++++++++++++++++ .../levels/rooms/standard/CellBlockRoom.java | 6 +++- .../levels/rooms/standard/FissureRoom.java | 1 - .../levels/rooms/standard/StandardRoom.java | 32 ++++++++----------- 4 files changed, 47 insertions(+), 20 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/PrisonPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/PrisonPainter.java index 83a4800ed..083a55768 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/PrisonPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/PrisonPainter.java @@ -24,6 +24,9 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.painters; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.SpecialRoom; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.ChasmBridgeRoom; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.FissureRoom; import com.watabou.utils.Random; import java.util.ArrayList; @@ -59,6 +62,31 @@ public class PrisonPainter extends RegularPainter { } } } + + for (Room r : rooms){ + if (r instanceof SpecialRoom){ + continue; + } + int chance = 15; //1/15 by default, some rooms can be more common though + if (r instanceof FissureRoom){ + chance = 3; + } else if (r instanceof ChasmBridgeRoom){ + chance = 5; + } + + int cell; + for (int y = r.bottom-1; y > r.top; y--){ + cell = r.left+1 + level.width()*y; + for (int x = r.left+1; x < r.right; x++){ + if (level.map[cell] == Terrain.CHASM && level.map[cell-level.width()] == Terrain.CHASM){ + if (Random.Int(chance) == 0){ + level.map[cell] = Terrain.REGION_DECO_ALT; + } + } + cell++; + } + } + } for (int i=0; i < w; i++) { if (map[i] == Terrain.WALL && diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/CellBlockRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/CellBlockRoom.java index d946f8e4f..41affe100 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/CellBlockRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/CellBlockRoom.java @@ -73,7 +73,11 @@ public class CellBlockRoom extends StandardRoom { int left = internal.left + 1 + (x * (w + Wspacing)); int top = internal.top + 1 + (y * (h + Hspacing)); - Painter.fill(level, left, top, w, h, Terrain.EMPTY_SP); + if (Random.Int(w*h) == 0){ + Painter.fill(level, left, top, w, h, Terrain.REGION_DECO); + } else { + Painter.fill(level, left, top, w, h, Terrain.EMPTY_SP); + } if (topBottomDoors == null) { switch (Random.Int(4)){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/FissureRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/FissureRoom.java index 693052085..7391a3f0d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/FissureRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/FissureRoom.java @@ -76,7 +76,6 @@ public class FissureRoom extends StandardRoom { } } } - Painter.fill(level, this, 5, Terrain.REGION_DECO_ALT); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/StandardRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/StandardRoom.java index 069cdfec0..7cac206f1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/StandardRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/StandardRoom.java @@ -120,39 +120,35 @@ public abstract class StandardRoom extends Room { //FIXME this is a very messy way of handing variable standard rooms private static ArrayList> rooms = new ArrayList<>(); static { - rooms.add(EmptyRoom.class); - rooms.add(RegionDecoLineRoom.class); - rooms.add(StatueLineRoom.class); - rooms.add(SewerPipeRoom.class); + rooms.add(RegionDecoPatchRoom.class); rooms.add(RingRoom.class); rooms.add(WaterBridgeRoom.class); rooms.add(CircleBasinRoom.class); - rooms.add(RegionDecoPatchRoom.class); rooms.add(SegmentedRoom.class); + rooms.add(RegionDecoLineRoom.class); rooms.add(PillarsRoom.class); rooms.add(ChasmBridgeRoom.class); rooms.add(CellBlockRoom.class); - rooms.add(EmptyRoom.class); //TODO rooms.add(CaveRoom.class); + rooms.add(CustomDecoBridgeRoom.class); rooms.add(CavesFissureRoom.class); rooms.add(CirclePitRoom.class); rooms.add(CircleWallRoom.class); - rooms.add(CustomDecoBridgeRoom.class); rooms.add(HallwayRoom.class); - rooms.add(StatuesRoom.class); - rooms.add(LibraryRingRoom.class); - rooms.add(SegmentedLibraryRoom.class); rooms.add(LibraryHallRoom.class); + rooms.add(LibraryRingRoom.class); + rooms.add(StatuesRoom.class); + rooms.add(SegmentedLibraryRoom.class); rooms.add(RuinsRoom.class); + rooms.add(RegionDecoPatchRoom.class); rooms.add(ChasmRoom.class); rooms.add(SkullsRoom.class); rooms.add(RitualRoom.class); - rooms.add(RegionDecoPatchRoom.class); rooms.add(PlantsRoom.class); @@ -169,21 +165,21 @@ public abstract class StandardRoom extends Room { private static float[][] chances = new float[27][]; static { - chances[1] = new float[]{0,5,0, 15,5,5,5,5, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0,1,0,1,0,1,1,0,0}; - chances[2] = new float[]{0,5,0, 15,5,5,5,5, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1}; + chances[1] = new float[]{12,8,8,8,4, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0,1,0,1,0,1,1,0,0}; + chances[2] = new float[]{12,8,8,8,4, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1}; chances[4] = chances[3] = chances[2]; - chances[5] = new float[]{0,5,0, 15,5,5,0,5, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0}; + chances[5] = new float[]{12,8,8,8,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0}; - chances[6] = new float[]{0,5,0, 0,0,0,0,0, 10,10,10,5,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1}; + chances[6] = new float[]{0,0,0,0,0, 10,10,10,5,5, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1}; chances[10] = chances[9] = chances[8] = chances[7] = chances[6]; - chances[11] = new float[]{0,5,0, 0,0,0,0,0, 0,0,0,0,0, 15,5,5,5,5, 0,0,0,0,0, 0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1}; + chances[11] = new float[]{0,0,0,0,0, 0,0,0,0,0, 16,8,8,4,4, 0,0,0,0,0, 0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1}; chances[15] = chances[14] = chances[13] = chances[12] = chances[11]; - chances[16] = new float[]{0,0,5, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 10,5,5,5,10, 0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1}; + chances[16] = new float[]{0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 10,10,10,5,5, 0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1}; chances[20] = chances[19] = chances[18] = chances[17] = chances[16]; - chances[21] = new float[]{0,0,5, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 11,8,5,5,8, 1,1,1,1,1,1,1,1,1,1}; + chances[21] = new float[]{0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 10,10,10,5,5, 1,1,1,1,1,1,1,1,1,1}; chances[26] = chances[25] = chances[24] = chances[23] = chances[22] = chances[21]; }