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 Mattock's double wind-up

From the spelunky.ai wiki: <https://spelunky.ai/wiki/mattock-wind-up-twice>. Verified against the spelunky.ai port [v0.1.10](https://github.com/851-labs/spelunky/releases/tag/v0.1.10) on 28 October 2026.

The Mattock's double wind-up is a quirk of Spelunky Classic in which each Mattock swing makes its wind-up twice, hurting a monster behind the player twice over.

| Quirk     |                                                                                                                                                                                                                |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Status    | GML + Oracle                                                                                                                                                                                                   |
| Where     | [`objects/oPlayer1/step.gml:497-509`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L497-L509)                                                                                                         |
| Pinned by | `fidelity/replays/weapon-mattock-wind-up-twice.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 Mattock makes its wind-up twice a swing.” |

A swing of the [Whip](https://spelunky.ai/wiki/whip), the [Machete](https://spelunky.ai/wiki/machete) or the [Mattock](https://spelunky.ai/wiki/mattock) begins with a wind-up behind
the player, which hurts a monster there. The Mattock makes its wind-up twice, a step apart, so a monster behind
the player takes twice the Machete's wind-up damage from it.

## What happens

With his back to a [Yeti King](https://spelunky.ai/wiki/yeti-king), the player swings a Mattock. Its wind-up is made behind him twice,
and the two take 12 of the Yeti King's 30 hit points in four steps: 2, 4, 4 and 2. The hit in front breaks the
block under him, and he drops into the hole[^1].

**Clip: The Mattock makes its wind-up twice a swing.** With his back to a yeti king, the player swings a mattock: its wind-up is made behind him twice, and the two take 12 of the yeti king's 30 hit points in four steps, 2, 4, 4 and 2. The hit in front breaks the block under him, and he drops into the hole. ([video](https://spelunky.ai/wiki/media/1d3f433106e37ef1/clips/quirks/mattock-wind-up-twice/clip.mp4))

## Why

The player's step makes a swing's wind-up on its first two steps, once a swing: it checks that none exists
yet. The Mattock's branch is a copy of the Machete's that makes an `oMattockPre` but still checks for the
Machete's `oMachetePre`:

```gml objects/oPlayer1/step.gml:497-503
    else if (holdItem.type == "Mattock")
    {
        if ((sprite_index == sAttackLeft or sprite_index == sDamselAttackL or sprite_index == sTunnelAttackL) and facing == LEFT and image_index < 2 and instance_number(oMachetePre) == 0)
        {
            obj = instance_create(x+16, y, oMattockPre);
            obj.sprite_index = sMattockPreL;
        }
```

[`objects/oPlayer1/step.gml:497-503`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L497-L503), 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)).

An `oMattockPre` isn't an `oMachetePre` (both are kinds of the Whip's `oWhipPre`), so the check always passes,
and it makes one on each of the two steps. Each lasts 3 steps[^2]
and takes its 2[^3] on every step it touches a monster, with no
wait between[^4]. From a monster both touch throughout,
that's 2, 4, 4 and 2. The [Tunnel Man](https://spelunky.ai/wiki/tunnel-man)'s swing with empty hands checks for an `oMattockPre`, and
makes one[^5][^6].

## Reproducing it

Swing a Mattock with a monster close behind the player: every such swing in play hits it twice over. The
replay of the clip's staged scene, on a custom level, makes
the two wind-ups a step apart and takes a Yeti King's hit points to 28, 24, 20 and 18[^7].

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

## FAQ

### How much damage does the Mattock's wind-up do in Spelunky Classic?

12 hit points a swing to a monster behind the player that both of its wind-ups touch throughout: 2, 4, 4 and 2 over four steps, where the [Machete](https://spelunky.ai/wiki/machete)'s single wind-up takes 6.

### Why does the Mattock swing hit behind the player twice?

The [Mattock](https://spelunky.ai/wiki/mattock)'s code is a copy of the Machete's, and still checks for the Machete's wind-up before making its own. There never is one, so it makes a wind-up on each of the swing's first two steps.

### Does the Tunnel Man's swing do it too?

Not with empty hands: the [Tunnel Man](https://spelunky.ai/wiki/tunnel-man)'s own swing checks for a Mattock's wind-up, and makes one. A Mattock he carries makes two, as anyone's does.

## See also

- **Related:** [Mattock](https://spelunky.ai/wiki/mattock), [Machete](https://spelunky.ai/wiki/machete), [Tunnel Man](https://spelunky.ai/wiki/tunnel-man)

## References

[^1]: Clip quirks/mattock-wind-up-twice

[^2]: [`objects/oWhipPre/create.gml:3-5`](https://spelunky.ai/wiki/source/objects/oWhipPre/create#L3-L5)

[^3]: [`objects/oMattockPre/create.gml:3-4`](https://spelunky.ai/wiki/source/objects/oMattockPre/create#L3-L4)

[^4]: [`objects/oEnemy/collision_oWhipPre.gml:1-8`](https://spelunky.ai/wiki/source/objects/oEnemy/collision_oWhipPre#L1-L8)

[^5]: [`objects/oPlayer1/step.gml:511-523`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L511-L523)

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

[^7]: Replay `fidelity/replays/weapon-mattock-wind-up-twice.txt`

### Source code

- [`objects/oPlayer1/step.gml`](https://spelunky.ai/wiki/source/objects/oPlayer1/step)
- [`objects/oMattockPre/create.gml`](https://spelunky.ai/wiki/source/objects/oMattockPre/create)
- [`objects/oWhipPre/create.gml`](https://spelunky.ai/wiki/source/objects/oWhipPre/create)
- [`objects/oEnemy/collision_oWhipPre.gml`](https://spelunky.ai/wiki/source/objects/oEnemy/collision_oWhipPre)
