Mattock
Verified against the spelunky.ai port v0.1.10 on .
The Mattock is a digging tool and weapon in Spelunky Classic that breaks a block with each swing and can break itself; shops sell it from $8,000.
Held in the player's hands, it's swung like the Whip, but only on the ground: its hit in front of him breaks a block of rock, and hurts monsters for 2 hit points a step, as does its wind-up behind him. Every block it breaks may break it. General Stores, Rare Shops and the Dice House sell it, and Crates, buried blocks and the bottom of every Snake Pit give it away.
Usage
#The Mattock is picked up like any item, crouching over it and pressing the attack key. While it's held, the attack key swings it, only while the player stands on the ground, and he can't jump for 20 steps after; crouching, the key puts it down in front of him instead [4]. It isn't thrown. A swing makes a wind-up behind the player and a hit 16 pixels in front of him, once the swing's animation is past its fifth frame [5] [6].
Digging
#When the hit's animation ends, it breaks the block at its middle, or if there's none, the one 9 pixels lower: the block in front of the player's feet. A block that can't be destroyed, such as the level's border, stops it. It also makes every treasure in the level active again, so treasure the block held up falls, and breaks every Spike with nothing under it [7]. The clip shows a wall two blocks thick dug through with two swings [8].
Which block breaks is chosen with the hit's whole shape, not only the point the code tests, and of the blocks that shape touches it takes the first one made [9] [10]. Facing right, the shape reaches 8 pixels back toward the player, so when he stands over the left half of a block, it can be the block he stands on: in the second clip, a swing to the right breaks the floor under him, and he drops into the hole [11]. Facing left, it reaches 3 pixels past the point, so over the first 3 pixels of a block it can be the block beyond the one in front of him, which stays [12].
Each block it breaks has a 1 in 20 chance of breaking the Mattock: its head flies off, its handle is gone from the player's hands, and the sound of it breaking plays; otherwise the sound is a crunch [13] [14]. The head is an item of its own, which can be picked up and thrown.
Damage
#The hit and the wind-up each take 2 hit points on every step they touch a monster on the code most monsters share [15] [16] [17]. The hit punctures, as the Machete's slash does, but the code that treats the Machete apart tests for its name, which the Mattock hasn't got: to a Caveman, a Hawkman or a Vampire the Mattock is a harder Whip, nothing while it's stunned.
The wind-up is made twice in a swing. The code that makes it checks that no Machete's wind-up exists rather than a Mattock's, so on the swing's first two steps it makes one each time [6] [10]. Each lasts 3 steps, and where they overlap a monster behind the player takes 4 a step: the clip's Yeti King loses 12 of its 30 hit points to one swing, 2, 4, 4 and 2 [11].
| Monster | Hit | Wind-up | |
|---|---|---|---|
| Most monsters | 2 hit points a step | 2 hit points a step from each | [18] |
| Caveman, Hawkman, Vampire, Mantrap | 2, and stuns it; nothing while it's stunned | The same | [19] [20] |
| Yeti | 2, and stuns it; at most once every 10 steps | Nothing: it knocks the Yeti back | [21] [22] |
| Yeti King | 2, at most once every 10 steps, only level with its top 12 pixels | 2 a step from each | [23] |
| Tomb Lord | 2, at most once every 10 steps, only level with its top 12 pixels | 2 a step from each | [24] |
| Giant Spider | 1, at most once every 10 steps | 2 a step from each | [25] |
| Magma Man | Nothing | 2 a step from each, off its life | [26] |
| Ghost | Nothing | Nothing | [27] |
Obtaining
#| Source | Chance | |
|---|---|---|
| General Store | 1 in 20 for each ware, its first roll | [28] |
| Rare Shop | Each of its wares is one of its eleven items or a Bomb Box | [29] |
| The Dice House's prize | 1 in 8, once the rolls for a Jetpack, a Cape, a Shotgun, Climbing Gloves and a Teleporter fail | [30] |
| A Crate | 1 in 100, once the rolls for a Jetpack, a Cape and a Shotgun fail | [31] |
| Buried in a block | 1 in 19 of the items buried in blocks | [32] |
| The bottom of a Snake Pit | Always, inside a brick | [33] [34] |
A shop stocks one only if the level hasn't got one already [35], and it adds 10% of the base price for each level past the second [36]. Shops are made from level 2 on [37], and level 16, Olmec's Lair, has none:
| Area | 1st level | 2nd level | 3rd level | 4th level |
|---|---|---|---|---|
| The Mines | — | $8,000 | $8,800 | $9,600 |
| The Jungle | $10,400 | $11,200 | $12,000 | $12,800 |
| The Ice Caves | $13,600 | $14,400 | $15,200 | $16,000 |
| The Temple | $16,800 | $17,600 | $18,400 | — |
The Dice House puts its prize up from the same set of rare items, and a roll of seven gives it
away [38] [39]. Every
block of rock away from the level's edges that isn't gold and holds no gem has a 1 in 1200 chance of hiding
an item, one of nineteen at random [40] [32]. A Snake Pit's bottom room puts a free Mattock inside a
brick, which a bomb or the Mattock itself digs out. In custom levels, it's the level
editor's tile ( [41].
Paying for one, or carrying one out of a shop without paying, which angers the Shopkeeper, shows "YOU GOT A MATTOCK!" and "IT SEEMS A BIT RUSTY.", and it stays in the player's hands [42] [10]. Digging a shop's floor angers the Shopkeeper too [43].
Interactions
#- Shopkeepers. The hit and the wind-up don't hurt one, but make him attack [44].
- Treasure. Every block it breaks makes every treasure in the level active again, so gold and gems left in the air where blocks were drop [45].
- The level's edge. The border's blocks can't be broken, and a swing at one does nothing and can't break the Mattock [46].
Tips
#- With the player's back to it, one swing took 12 of the Yeti King's hit points in the clip, where the Whip's wind-up takes 3: the Mattock's double wind-up is its strongest attack on the Yeti King, the Tomb Lord and the Magma Man.
- Facing right, a swing can break the floor under the player when he stands over the left half of a block, so digging sideways over a drop is risky.
Trivia
#- The Tunnel Man, one of the characters, swings a Mattock's hit with empty hands, and his never breaks [47] [48].
- The blocks it breaks leave their decorations behind, as GameMaker 8.0's
tile_layer_findnever finds the tiles the game looks for [49] [50].
FAQ
#- What does the Mattock do in Spelunky Classic?
Swung on the ground, it breaks the block in front of the player, or the one below that, and hits monsters for 2 hit points a step. Each block it breaks has a 1 in 20 chance of breaking the Mattock too.
- How many blocks can the Mattock dig in Spelunky Classic?
No set number. Each block it breaks rolls a 1 in 20 chance of breaking it, so on average it lasts 20 blocks, but it can break on the first.
- Where do you find the Mattock in Spelunky Classic?
In General Stores, Rare Shops and as the Dice House's prize. Free ones come out of Crates (a 1 in 100 roll, once the rolls before it fail), out of blocks that hide them, and from the bottom of every Snake Pit, buried in a brick.
- How much does the Mattock cost in Spelunky Classic?
$8,000 on level 2, the first with shops, and 10% of that more on each level after it, up to $18,400 on level 15.
See also
#References
#objects/oMattockHit/other_animation_end.gml:1-59objects/oMattockHit/create.gml:5objects/oMattock/create.gml:6scripts/scrUseItem.gml:168-215objects/oPlayer1/step.gml:415-431objects/oPlayer1/step.gml:497-509objects/oMattockHit/other_animation_end.gml:1-36- Clip mattock/dig
objects/oMattockHit/other_animation_end.gml:7-11- Quirk 1 (docs/quirks.md)
- Clip mattock/wind-up
- Replay
fidelity/replays/weapon-mattock-wrong-block.txt objects/oMattockHit/other_animation_end.gml:38-56- Replay
fidelity/replays/item-seed-35-mattock-break.txt objects/oMattockHit/create.gml:3-6objects/oMattockPre/create.gml:3-4objects/oEnemy/collision_oWhip.gml:1-8objects/oEnemy/collision_oWhip.gml:1objects/oCaveman/collision_oWhip.gml:1-17objects/oManTrap/collision_oWhip.gml:1-20objects/oYeti/collision_oWhip.gml:1-21objects/oYeti/collision_oWhipPre.gml:22-30objects/oYetiKing/collision_oWhip.gml:1-10objects/oTombLord/collision_oWhip.gml:1-8objects/oGiantSpider/collision_oWhip.gml:1-7objects/oMagmaMan/collision_oWhip.gml:1-6objects/oGhost/collision_oWhip.gml:1scripts/scrShopItemsGen.gml:156-177scripts/scrShopItemsGen.gml:102-155scripts/scrGenerateItem.gml:47-54objects/oPlayer1/step.gml:617-620scripts/scrGenerateItem.gml:63-89scripts/scrRoomGen.gml:212-218scripts/scrRoomGen.gml:475-481scripts/scrShopItemsGen.gml:117-120scripts/scrShopItemsGen.gml:179-191scripts/scrLevelGen.gml:240scripts/scrRoomGen.gml:392-397objects/oShopkeeper/step.gml:173-200objects/oBrick/create.gml:7-16scripts/scrCreateTileObj.gml:399-404scripts/scrStealItem.gml:253-262- Replay
fidelity/replays/weapon-seed-35-mattock.txt objects/oShopkeeper/collision_oWhip.gml:1-19objects/oMattockHit/other_animation_end.gml:25-28objects/oMattockHit/other_animation_end.gml:2-13objects/oPlayer1/step.gml:432-446objects/oMattockHit/other_animation_end.gml:39objects/oMattockHit/other_animation_end.gml:15-20- Quirk 5 (docs/quirks.md)
objects/oEnemy/collision_oWhipPre.gml:1
Source code
objects/oMattock/create.gmlobjects/oMattockHit/create.gmlobjects/oMattockHit/other_animation_end.gmlobjects/oMattockPre/create.gmlobjects/oPlayer1/step.gmlscripts/scrUseItem.gmlscripts/scrShopItemsGen.gmlscripts/scrGenerateItem.gml