Spelunky is © 2008, 2009 Derek Yu and Mossmouth, LLC, and is used under the [Spelunky User License v1.1b](https://spelunky.ai/LICENSE.txt). spelunky.ai is an unofficial fan project, not affiliated with or endorsed by Mossmouth. The game and its assets may not be sold.

Music by George Buzinkai and Jonathan Perry; sound effects made in SFXR. From Spelunky Classic 1.1, © 2008, 2009 Derek Yu and Mossmouth, LLC.

# The Lady Xoc room in the way

From the spelunky.ai wiki: <https://spelunky.ai/wiki/lady-xoc-room-in-the-way>. Verified against the spelunky.ai port [v0.1.12](https://github.com/851-labs/spelunky/releases/tag/v0.1.12) on 28 October 2026.

The Lady Xoc room in the way is a quirk of Spelunky Classic in which the City of Gold's statue room can seal the way to the exit.

| Quirk     |                                                                                                                                                                                                                                  |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Status    | GML + Oracle                                                                                                                                                                                                                     |
| Where     | [`scripts/scrLevelGen.gml:136`](https://spelunky.ai/wiki/source/scripts/scrLevelGen#L136)                                                                                                                                        |
| Pinned by | `fidelity/replays/city-of-gold-seed-9-to-olmec.txt`                                                                                                                                                                              |
| Row       | [docs/quirks.md §1, Bugs and leftovers in the 1.1 source](https://github.com/851-labs/spelunky/blob/main/docs/quirks.md#1-bugs-and-leftovers-in-the-11-source): “The City of Gold's Lady Xoc room can seal the way to the exit.” |

The [City of Gold](https://spelunky.ai/wiki/city-of-gold) lays out its rooms as the [Temple](https://spelunky.ai/wiki/temple) does, on a path from the entrance to
the exit, and then writes the Lady Xoc statue's room over one room of the third row, at random. It doesn't look
at what the path needed there, and the statue's room has a solid floor, so when it takes the room the path
drops through, nothing leads down to the exit until the player breaks the floor open. On a sacrifice pit's
level it can take the pit's third room, and seal the pit's lava off from its shaft.

## What happens

The City of Gold here is a [sacrifice pit](https://spelunky.ai/wiki/sacrifice-pit) too, and the statue took the third room of the pit's
shaft. The player lifts the pit's golden idol, the floor under it gives way, and he falls a room down onto the
statue, stunned, and loses a heart, not three rooms down into the pit's lava[^1].

**Clip: The Lady Xoc statue in a sacrifice pit.** The City of Gold's Lady Xoc statue took the third room of a sacrifice pit's shaft. The player lifts the pit's golden idol, the floor under it gives way, and he falls a room down onto the statue, not three rooms down into the pit's lava. ([video](https://spelunky.ai/wiki/media/clips/quirks/xoc-statue-in-sacrifice-pit/clip.mp4))

On another City, the statue took the room the path drops through to the exit's row, so the run bombs through
the floor beside it. The player drops through the hole, picks up an emerald and takes the exit[^2].

**Clip: From the City of Gold to Olmec's Lair.** The player drops through a hole bombed beside the statue, picks up an emerald and takes the City of Gold's exit. After the screen between levels, level 16, Olmec's Lair, loads. ([video](https://spelunky.ai/wiki/media/clips/city-of-gold/to-olmec/clip.mp4))

## Why

`scrLevelGen` lays the path first, a room at a time from the top row to the bottom, marking each room it drops
out of as a drop room. Then, in the City, one line overwrites a room of the third row:

```gml scripts/scrLevelGen.gml:136
if (global.cityOfGold) global.roomPath[rand(0,3), 2] = 6;
```

[`scripts/scrLevelGen.gml:136`](https://spelunky.ai/wiki/source/scripts/scrLevelGen#L136), from `spelunky.gmk`, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC ([Spelunky User License v1.1b](https://spelunky.ai/LICENSE.txt)).

`rand(0,3)` is any of the row's four rooms, whatever the path made it. Room type 6 is the statue's, open at the
top and sides with a solid bottom row:

```gml scripts/scrRoomGen4.gml:189-192
else if (roomPath == 6) // Lady Xoc
{
    strTemp = "000000000000X0000000000000000000000000000000000000000000000000000000001111111111";
}
```

[`scripts/scrRoomGen4.gml:189-192`](https://spelunky.ai/wiki/source/scripts/scrRoomGen4#L189-L192), from `spelunky.gmk`, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC ([Spelunky User License v1.1b](https://spelunky.ai/LICENSE.txt)).

The `X` is the statue, 30 blocks five wide and six tall[^3], and
the last ten `1`s are the room's floor. If the path dropped through that room, the floor now stands between it
and the exit's row[^4].

A sacrifice pit is laid before the path: on 1 Temple level in 8, the City's too, `scrLevelGen` marks a whole
column as the pit, its top, two shaft rooms and its bottom, which the path never enters[^5]. The statue's line comes after, and one time in four picks the
pit's column, writing the statue's room over the pit's second shaft room. The shaft above then ends on the
statue's top, and the statue room's floor seals the pit's bottom, with its lava and its Big Ruby blocks,
under it[^6][^4].

## Reproducing it

Reach the City of Gold and look at where the statue is. When it stands in the room above the exit's row, on the
way down, the way to the exit has to be broken open beside or through it, with a [Bomb](https://spelunky.ai/wiki/bomb) or the
[Mattock](https://spelunky.ai/wiki/mattock); the statue's blocks, which break into gold, and six of them into gems, are as good a way down
as any[^7]. The replay, with seed 9, finds the statue on the drop
room above the exit's row: the run bombs the statue's top for its gems, then bombs a hole through the floor
beside it and drops to the exit[^8].

A City that's a sacrifice pit, with the statue in the pit's column, is 1 City in 32. The replay of the first
clip reaches one with seed 9, the statue in the pit's third room: lifting the idol takes away the four trap
blocks under it, and the player falls a room onto the statue, stunned, losing a heart, and never lower[^9].

## In the port

The spelunky.ai port reproduces it exactly: it's in docs/quirks.md's list of the 1.1 source's bugs[^4], and the oracle's fingerprints of the replays pin the rooms' layout, the statue's place and
the player's fall. No option turns it off.

## FAQ

### Why can't I get down to the City of Gold's exit?

The Lady Xoc statue's room may have taken the room the way down went through. Its bottom row is solid, so nothing leads down from it, and the floor has to be broken open, with a [Bomb](https://spelunky.ai/wiki/bomb) or the [Mattock](https://spelunky.ai/wiki/mattock).

### Why did I land on the statue when I lifted the sacrifice pit's idol?

The statue's room took the pit's third room. The pit's shaft then ends on the statue a room down, and the statue room's floor seals off the pit's bottom, with its lava, so the fall stuns the player and takes a heart instead of dropping him into the lava.

### How often does the statue take a sacrifice pit's room?

One time in four on a City of Gold that's a [sacrifice pit](https://spelunky.ai/wiki/sacrifice-pit), which is one City in 32.

## See also

- **Related:** [City of Gold](https://spelunky.ai/wiki/city-of-gold), [Sacrifice pit](https://spelunky.ai/wiki/sacrifice-pit)

## References

[^1]: Clip quirks/xoc-statue-in-sacrifice-pit

[^2]: Clip city-of-gold/to-olmec

[^3]: [`scripts/scrRoomGen4.gml:380-392`](https://spelunky.ai/wiki/source/scripts/scrRoomGen4#L380-L392)

[^4]: Quirk 1 (docs/quirks.md)

[^5]: [`scripts/scrLevelGen.gml:71-87`](https://spelunky.ai/wiki/source/scripts/scrLevelGen#L71-L87)

[^6]: [`scripts/scrRoomGen4.gml:193-204`](https://spelunky.ai/wiki/source/scripts/scrRoomGen4#L193-L204)

[^7]: [`objects/oXocBlock/destroy.gml:1-29`](https://spelunky.ai/wiki/source/objects/oXocBlock/destroy#L1-L29)

[^8]: Replay `fidelity/replays/city-of-gold-seed-9-to-olmec.txt`

[^9]: Replay `fidelity/replays/city-of-gold-seed-9-xoc-pit.txt`

### Source code

- [`scripts/scrLevelGen.gml`](https://spelunky.ai/wiki/source/scripts/scrLevelGen)
- [`scripts/scrRoomGen4.gml`](https://spelunky.ai/wiki/source/scripts/scrRoomGen4)
- [`objects/oXocBlock/destroy.gml`](https://spelunky.ai/wiki/source/objects/oXocBlock/destroy)
