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.

# Dice angering the next shop

From the spelunky.ai wiki: <https://spelunky.ai/wiki/dice-angers-next-shop>. Verified against the spelunky.ai port [v0.1.11](https://github.com/851-labs/spelunky/releases/tag/v0.1.11) on 28 October 2026.

Dice angering the next shop is a quirk of Spelunky Classic in which a die carried out of a shop's room angers the nearest Shopkeeper, whoever he is.

| Quirk     |                                                                                                                                                                                                                                                         |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Status    | GML + Oracle                                                                                                                                                                                                                                            |
| Where     | [`objects/oDice/step.gml:1-17`](https://spelunky.ai/wiki/source/objects/oDice/step#L1-L17)                                                                                                                                                              |
| Pinned by | `fidelity/replays/shop-seed-9-market-dice-carried-out.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): “A Dice House's die angers the nearest Shopkeeper wherever it's outside a shop's room.” |

A [Dice House](https://spelunky.ai/wiki/dice-house)'s die mustn't leave the shop: carried out, it angers a [Shopkeeper](https://spelunky.ai/wiki/shopkeeper). But
the die's check is only whether it's in a shop's room, any shop's, and the Shopkeeper it angers is the nearest one,
any shop's. On an ordinary level the two are the Dice House's. In the [Black Market](https://spelunky.ai/wiki/black-market), whose shops
stand side by side, a die can pass through the next shop unnoticed and anger that shop's Shopkeeper when it leaves.

## What happens

In the Black Market, the Dice House's die is carried left through the [Clothing Shop](https://spelunky.ai/wiki/clothing-shop), a shop's
room, so no one minds. Carried on out of it, the die angers the nearest Shopkeeper: the Clothing Shop's runs out
after the player, while the Dice House's stays where he is[^1].

**Clip: A die carried into the next shop.** In the Black Market, the Dice House's die is carried left through the Clothing Shop, a shop's room, so no one minds. Carried on out of it, the die angers the nearest Shopkeeper: the Clothing Shop's runs out after the player, while the Dice House's stays where he is. ([video](https://spelunky.ai/wiki/media/clips/quirks/market-die-angers-next-shop/clip.mp4))

## Why

On every step a die is near the screen on a level, its step checks whether it's in a shop:

```gml objects/oDice/step.gml:10-17
    // stealing makes shopkeeper angry
    if (isLevel())
    {
        if (not isInShop(x, y))
        {
            scrShopkeeperAnger(0);
        }
    }
```

[`objects/oDice/step.gml:10-17`](https://spelunky.ai/wiki/source/objects/oDice/step#L10-L17), 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)).

`isInShop` is true in any room of the level that's a shop's or a Dice House's, not only the die's own[^2]. And the anger falls on the nearest Shopkeeper to the die, whoever's he
is:

```gml scripts/scrShopkeeperAnger.gml:7-12
shp = instance_nearest(x, y, oShopkeeper);
if (shp)
{
    if (not shp.dead and not shp.angered)
    {
        shp.status = 2;
```

[`scripts/scrShopkeeperAnger.gml:7-12`](https://spelunky.ai/wiki/source/scripts/scrShopkeeperAnger#L7-L12), 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)).

On an ordinary level there's one shop, so the two are the Dice House's room and Shopkeeper, unless the die is
nearer the Shopkeeper who waits by the exit for a thief or a murderer. The Black Market's Dice House opens on its
left into an item shop, and that one onto the way down[^3]. A die
carried into the item shop is still in a shop's room, and carried on out of it, it's nearest that shop's
Shopkeeper[^4].

## Reproducing it

In any Black Market, pick up the Dice House's die and walk left through the shop beside it and out of it: the
market's rooms are always laid out the same way[^5]. The replay, with seed 9, does it in the market on level 6: the player picks up a die in Tarn's Dice House
and carries it left through Wang's Clothing Shop, where nothing happens. Out in the next room, "COME BACK HERE,
THIEF!": the Clothing Shop's Shopkeeper runs out after him and knocks him down, and the Dice House's is never
angered[^6].

## 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 fingerprint of the replay pins which Shopkeeper is angered. No option turns it
off.

## FAQ

### Can you carry a Dice House's die into another shop?

Yes. The die angers a Shopkeeper only outside a shop's room, and any shop's room counts, so in the [Black Market](https://spelunky.ai/wiki/black-market) a die carried into the next shop angers no one.

### Which Shopkeeper does a stolen die anger?

The nearest one to the die, whichever shop is his. On an ordinary level that's the Dice House's own, but in the Black Market it can be another shop's, while the Dice House's stays calm.

### Does carrying a die out make you a thief?

Yes. It angers the Shopkeeper as a theft does, with "COME BACK HERE, THIEF!", and raises the thief level the same way.

## See also

- **Related:** [Dice House](https://spelunky.ai/wiki/dice-house), [Black Market](https://spelunky.ai/wiki/black-market), [Shopkeeper](https://spelunky.ai/wiki/shopkeeper), [Clothing Shop](https://spelunky.ai/wiki/clothing-shop)

## References

[^1]: Clip quirks/market-die-angers-next-shop

[^2]: [`scripts/isInShop.gml:7-13`](https://spelunky.ai/wiki/source/scripts/isInShop#L7-L13)

[^3]: [`scripts/scrRoomGenMarket.gml:117-146`](https://spelunky.ai/wiki/source/scripts/scrRoomGenMarket#L117-L146)

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

[^5]: [`scripts/scrLevelGen.gml:44-69`](https://spelunky.ai/wiki/source/scripts/scrLevelGen#L44-L69)

[^6]: Replay `fidelity/replays/shop-seed-9-market-dice-carried-out.txt`

### Source code

- [`objects/oDice/step.gml`](https://spelunky.ai/wiki/source/objects/oDice/step)
- [`scripts/isInShop.gml`](https://spelunky.ai/wiki/source/scripts/isInShop)
- [`scripts/scrShopkeeperAnger.gml`](https://spelunky.ai/wiki/source/scripts/scrShopkeeperAnger)
- [`scripts/scrRoomGenMarket.gml`](https://spelunky.ai/wiki/source/scripts/scrRoomGenMarket)
