Adjust rooms in Medusa levels to account for player monster statues

There is code in fixup_special for stocking Medusa's lair with statues
of players from the leaderboard. It makes two assumptions: that there
will always be at least one room defined on Medusa's level, and that
the statues should be placed in the first room defined. In the process
of removing prefilled, some of these rooms suddenly became non-rooms,
and this caused problems. This commit ensures that the regions for
turning into rooms to hold the statues are present and come first.

In the process of writing this commit, I discovered a bug: the statue
stocking code for medusa in fixup_special naively chooses the spot at
which to place its final statue by selecting independent x and y
coordinates with somex and somey. This is responsible for a statue
occasionally being embedded in a wall or in iron bars on medusa-2 and
medusa-4: the rooms defined to receive statues are irregular, and some
of the possible coordinates happen to be walls, bars, and water.

The proper fix here is to add lua functionality so that the level
designer can specify that they want a leaderboard corpse or statue, and
remove the medusa special case from fixup_special, but that's rather
out of scope for what I'm doing here.
This commit is contained in:
copperwater
2020-05-21 13:23:41 -04:00
committed by Pasi Kallinen
parent f8ff58ed7e
commit 5d73b2be08
5 changed files with 14 additions and 3 deletions

View File

@@ -40,6 +40,10 @@ place:set(10,08);
place:set(10,12);
--
des.region(selection.area(00,00,74,19),"lit")
-- fixup_special hack: The first "room" region in Medusa levels gets filled with
-- some leaderboard statues, so this needs to be a room; setting irregular=1
-- will force this
des.region({ region={13,03, 18,13}, lit=1, type="ordinary", irregular=1 })
--
des.teleport_region({ region = {64,01,74,17}, dir="down" });
des.teleport_region({ region = {02,02,18,13}, dir="up" });