SpelunkyFan wiki

Two General Stores

Verified against the spelunky.ai port v0.1.10 on .

Two General Stores is a quirk of Spelunky Classic in which one Black Market in five has a second General Store in place of the shop it was about to make.

The Black Market has five item shops, one of each kind: a General Store, a Bomb Shop, a Weapon Shop, a Rare Shop and a Clothing Shop, with the Ankh's shop beside them. The loop that gives each its kind checks whether it has gone round once after every try, the one that succeeds included, so the fifth shop can find the last kind and be made a General Store all the same.

What happens

#

The fifth shop, with only the Rare Shop's kind left, finds it and is made a General Store all the same, so the market has two and no Rare Shop. The player walks into Duke's Supply Shop, then down into Lemmy's [1].

A Black Market with two General Stores. The Black Market's fifth item shop, with only the Rare Shop's kind left, finds it and is made a General Store all the same, so the market has two and no Rare Shop. The player walks into Duke's Supply Shop, then down into Lemmy's.

Why

#

For each item shop, the market's room script picks a first kind at random, m, and tries it and each kind after it in turn, General, Bomb, Weapon, Rare and Clothing, then round again, taking the first the market hasn't made. If it comes back to m, it gives up with a General Store [2]:

        n += 1;
        if (n > 5) n = 1;
        if (n == m)
        {
            shopType = "General";
            break;
        }
scripts/scrRoomGenMarket.gml:133-139, from spelunky.gmk, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC (Spelunky User License v1.1b).

The test runs after every try, once n has moved on, including the try that just found a kind. For the fifth shop, with one kind left, a first pick just after that kind finds it on the fifth try, the last before n is back at m: the script marks the kind as made, then overwrites the shop's kind with General. That's one first pick in five, and it shows unless the kind left was the General Store's own [3].

Reproducing it

#

It depends on the level's seed: visit Black Markets until one has two General Stores. The replay pins one: seed 9's market, where the fifth shop finds the Rare Shop's kind and is made a General Store, and the player is greeted in Duke's Supply Shop and in Lemmy's, with no Rare Shop on the level [4]. Other routes into the same seed's market have all five kinds [5].

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 [3], and the oracle's fingerprint of the replay pins the shops. No option turns it off.

FAQ

#
Why does the Black Market have two General Stores in Spelunky Classic?

The script that picks each shop's kind gives up one try too early. One market in five, its fifth shop finds the last kind left and is made a General Store anyway, so the market has two and none of the kind left.

Which shop is missing when the Black Market has two General Stores?

The kind the fifth shop found: a Rare Shop, a Bomb Shop, a Weapon Shop or a Clothing Shop, whichever the first four didn't make.

How often does the Black Market have two General Stores?

One market in five lets the fifth shop's last kind go, and it shows unless that kind was the General Store, so a little less often than that.

See also

#

References

#
  1. Clip quirks/market-two-general-stores
  2. scripts/scrRoomGenMarket.gml:117-141
  3. Quirk 1 (docs/quirks.md)
  4. Replay fidelity/replays/shop-seed-9-market-two-general-stores.txt
  5. Replay fidelity/replays/jungle-seed-9-market.txt

Source code

  • scripts/scrRoomGenMarket.gml
#