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.

# Free wares from a hit Shopkeeper

From the spelunky.ai wiki: <https://spelunky.ai/wiki/hit-shopkeeper-free-wares>. Verified against the spelunky.ai port [v0.1.12](https://github.com/851-labs/spelunky/releases/tag/v0.1.12) on 28 October 2026.

Free wares from a hit Shopkeeper is a quirk of Spelunky Classic in which hitting a Shopkeeper frees his wares without marking the player a thief.

| Quirk     |                                                                                                                                                                                                                                            |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Status    | GML + Oracle                                                                                                                                                                                                                               |
| Where     | [`objects/oShopkeeper/step.gml:337-349`](https://spelunky.ai/wiki/source/objects/oShopkeeper/step#L337-L349)                                                                                                                               |
| Pinned by | `fidelity/replays/weapon-seed-39-pistol.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): “Hitting a Shopkeeper frees the wares without marking the player a thief.” |

Stealing from a shop, or bombing it, angers the [Shopkeeper](https://spelunky.ai/wiki/shopkeeper) through one script, which shouts and
marks the player a thief, so that a Shopkeeper waits at the next level's exit. Hitting him angers him too, but
none of the ways to hit him calls that script. And an angry Shopkeeper's first step gives every ware away, so a
player who hits him can carry the wares out free, with no theft. It may be by design.

## What happens

The player buys a [Pistol](https://spelunky.ai/wiki/pistol) and shoots the Shopkeeper beside him, who falls stunned and drops his shotgun.
He gets up angry, grabs the player and throws him against the floor, which costs a heart. The player then
collects the shop's bomb bag, free, and no shout calls him a thief[^1].

**Clip: Shopkeeper's throw.** The shopkeeper follows the player while he holds an unpaid pistol, and stands still once he pays. Shot with it, the shopkeeper falls stunned and drops his shotgun; he gets up angry, grabs the player and throws him against the floor, which costs a heart. ([video](https://spelunky.ai/wiki/media/clips/shopkeeper/throw/clip.mp4))

## Why

A crack of the [Whip](https://spelunky.ai/wiki/whip) (or a Machete's slash) sets the Shopkeeper's `status` to `ATTACK` at once, and so do
a thrown item's hit and a Piranha's bite; a bullet stuns him, and he gets up in `ATTACK`[^2][^3][^4][^5][^6]. None of them calls `scrShopkeeperAnger`, the script
that shouts and adds to the thief count[^7]. But the first step of
his attack frees every ware the game is running:

```gml objects/oShopkeeper/step.gml:337-349
else if (status == ATTACK)
{
    image_speed = 1;
    
    if (not angered)
    {
        with oItem
        {
            cost = 0;
            forSale = false;
        }
        angered = true;
    }
```

[`objects/oShopkeeper/step.gml:337-349`](https://spelunky.ai/wiki/source/objects/oShopkeeper/step#L337-L349), 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)).

A free ware isn't for sale, so carrying it out isn't a theft: the count stays at 0, so no Shopkeeper waits at the
next level's exit, and its shops greet the player as before[^8].

## Reproducing it

Hit a Shopkeeper, with the Whip, a thrown item or a shot, then take a ware. It happens in normal play. In the
replay of the clip, the player buys a Pistol and shoots the Shopkeeper (frame 1490). He gets up in his attack
(1545), which frees the bomb bag (1546), and the player collects it (1598): the thief count stays at 0 throughout[^9]. Whipping one does the same: his attack frees the
wares on the next step, with no shout and no thief[^10].

## 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[^8], and the oracle's fingerprint of the replay pins the free bag and the count. No option turns it
off.

## FAQ

### Does hitting a Shopkeeper make you a thief in Spelunky Classic?

No. A crack of the [Whip](https://spelunky.ai/wiki/whip), a thrown item or a shot turns the [Shopkeeper](https://spelunky.ai/wiki/shopkeeper) on the player, but it doesn't mark him a thief: there's no shout, and no Shopkeeper waits at the next level's exit.

### Are a Shopkeeper's wares free once he's angry?

Yes. The first step of his attack makes every ware free, however he was angered, so after a hit they can be carried out with no theft.

### Is it safe to take the wares after hitting the Shopkeeper?

Only as far as the theft goes. He still attacks, with his [Shotgun](https://spelunky.ai/wiki/shotgun) if he has it.

## See also

- **Related:** [Shopkeeper](https://spelunky.ai/wiki/shopkeeper), [Whip](https://spelunky.ai/wiki/whip), [Pistol](https://spelunky.ai/wiki/pistol)

## References

[^1]: Clip shopkeeper/throw

[^2]: [`objects/oShopkeeper/collision_oWhip.gml:1-19`](https://spelunky.ai/wiki/source/objects/oShopkeeper/collision_oWhip#L1-L19)

[^3]: [`objects/oItem/step.gml:289-299`](https://spelunky.ai/wiki/source/objects/oItem/step#L289-L299)

[^4]: [`objects/oPiranha/step.gml:107-118`](https://spelunky.ai/wiki/source/objects/oPiranha/step#L107-L118)

[^5]: [`objects/oBullet/collision_oEnemy.gml:14-25`](https://spelunky.ai/wiki/source/objects/oBullet/collision_oEnemy#L14-L25)

[^6]: [`objects/oShopkeeper/step.gml:465-470`](https://spelunky.ai/wiki/source/objects/oShopkeeper/step#L465-L470)

[^7]: [`scripts/scrShopkeeperAnger.gml:7-22`](https://spelunky.ai/wiki/source/scripts/scrShopkeeperAnger#L7-L22)

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

[^9]: Replay `fidelity/replays/weapon-seed-39-pistol.txt`

[^10]: Replay `fidelity/replays/shop-seed-11-whip.txt`

### Source code

- [`objects/oShopkeeper/collision_oWhip.gml`](https://spelunky.ai/wiki/source/objects/oShopkeeper/collision_oWhip)
- [`objects/oShopkeeper/step.gml`](https://spelunky.ai/wiki/source/objects/oShopkeeper/step)
- [`objects/oItem/step.gml`](https://spelunky.ai/wiki/source/objects/oItem/step)
- [`objects/oBullet/collision_oEnemy.gml`](https://spelunky.ai/wiki/source/objects/oBullet/collision_oEnemy)
- [`objects/oPiranha/step.gml`](https://spelunky.ai/wiki/source/objects/oPiranha/step)
- [`scripts/scrShopkeeperAnger.gml`](https://spelunky.ai/wiki/source/scripts/scrShopkeeperAnger)
