v3.1.0: added some cages to Tengu's arena and rubble to Yog's arena

This commit is contained in:
Evan Debenham
2025-05-28 17:06:35 -04:00
parent ca4c3f7a7d
commit 3c7aaee108
3 changed files with 35 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -132,10 +132,13 @@ public class HallsBossLevel extends Level {
} }
int exitCell = width/2 + ((ROOM_TOP+1) * width);
int bossPos = exitCell + width*3;
boolean[] patch = Patch.generate(width, height, 0.20f, 0, true); boolean[] patch = Patch.generate(width, height, 0.20f, 0, true);
for (int i = 0; i < length(); i++) { for (int i = 0; i < length(); i++) {
if (map[i] == Terrain.EMPTY && patch[i]) { if (map[i] == Terrain.EMPTY && patch[i]) {
map[i] = Terrain.STATUE; map[i] = distance(i, bossPos)+Random.Int(5) >= 10 ? Terrain.REGION_DECO : Terrain.STATUE;
} }
} }
@@ -145,7 +148,7 @@ public class HallsBossLevel extends Level {
patch = Patch.generate(width, height, 0.30f, 3, true); patch = Patch.generate(width, height, 0.30f, 3, true);
for (int i = 0; i < length(); i++) { for (int i = 0; i < length(); i++) {
if ((map[i] == Terrain.EMPTY || map[i] == Terrain.STATUE) && patch[i]) { if ((map[i] == Terrain.EMPTY || map[i] == Terrain.STATUE || map[i] == Terrain.REGION_DECO) && patch[i]) {
map[i] = Terrain.WATER; map[i] = Terrain.WATER;
} }
} }
@@ -164,7 +167,6 @@ public class HallsBossLevel extends Level {
Painter.fill(this, ROOM_LEFT+3, ROOM_TOP+2, 3, 4, Terrain.EMPTY ); Painter.fill(this, ROOM_LEFT+3, ROOM_TOP+2, 3, 4, Terrain.EMPTY );
int exitCell = width/2 + ((ROOM_TOP+1) * width);
LevelTransition exit = new LevelTransition(this, exitCell, LevelTransition.Type.REGULAR_EXIT); LevelTransition exit = new LevelTransition(this, exitCell, LevelTransition.Type.REGULAR_EXIT);
exit.top--; exit.top--;
exit.left--; exit.left--;

View File

@@ -210,6 +210,8 @@ public class PrisonBossLevel extends Level {
Painter.set(this, p, Terrain.WALL_DECO); Painter.set(this, p, Terrain.WALL_DECO);
} }
addCagesToCells();
//we set up the exit for consistently with other levels, even though it's in the walls //we set up the exit for consistently with other levels, even though it's in the walls
LevelTransition exit = new LevelTransition(this, pointToCell(levelExit), LevelTransition.Type.REGULAR_EXIT); LevelTransition exit = new LevelTransition(this, pointToCell(levelExit), LevelTransition.Type.REGULAR_EXIT);
exit.right+=2; exit.right+=2;
@@ -233,6 +235,8 @@ public class PrisonBossLevel extends Level {
Painter.set(this, startHallway.left+1, startHallway.top, Terrain.EMPTY); Painter.set(this, startHallway.left+1, startHallway.top, Terrain.EMPTY);
Painter.set(this, startHallway.left+1, startHallway.top+1, Terrain.DOOR); Painter.set(this, startHallway.left+1, startHallway.top+1, Terrain.DOOR);
addCagesToCells();
} }
private static final Rect arena = new Rect(3, 1, 18, 16); private static final Rect arena = new Rect(3, 1, 18, 16);
@@ -320,6 +324,8 @@ public class PrisonBossLevel extends Level {
exit.bottom += 3; exit.bottom += 3;
transitions.add(exit); transitions.add(exit);
} }
addCagesToCells();
} }
//keep track of removed items as the level is changed. Dump them back into the level at the end. //keep track of removed items as the level is changed. Dump them back into the level at the end.
@@ -380,6 +386,25 @@ public class PrisonBossLevel extends Level {
GameScene.resetMap(); GameScene.resetMap();
Dungeon.observe(); Dungeon.observe();
} }
//randomly places up to 5 cages on tiles that are aside walls (but not torches or doors!)
public void addCagesToCells(){
Random.pushGenerator(Dungeon.seedCurDepth());
for (int i = 0; i < 5; i++){
int cell = randomPrisonCellPos();
boolean valid = false;
for (int j : PathFinder.NEIGHBOURS4){
if (map[cell+j] == Terrain.WALL){
valid = true;
}
}
if (valid){
Painter.set(this, cell, Terrain.REGION_DECO);
}
}
Random.popGenerator();
}
@Override @Override
public Group addVisuals() { public Group addVisuals() {
@@ -592,7 +617,11 @@ public class PrisonBossLevel extends Level {
} }
Random.popGenerator(); Random.popGenerator();
drop(new IronKey(10), randomPrisonCellPos()); int pos;
do {
pos = randomPrisonCellPos();
} while (solid[pos]);
drop(new IronKey(10), pos);
} }
@Override @Override