SpelunkyFan wiki

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

#
Mattock digging. The player picks up a mattock and walks into a wall two blocks thick. Each swing breaks one block of it, and he walks on through.

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].

MonsterHitWind-up
Most monsters2 hit points a step2 hit points a step from each[18]
Caveman, Hawkman, Vampire, Mantrap2, and stuns it; nothing while it's stunnedThe same[19] [20]
Yeti2, and stuns it; at most once every 10 stepsNothing: it knocks the Yeti back[21] [22]
Yeti King2, at most once every 10 steps, only level with its top 12 pixels2 a step from each[23]
Tomb Lord2, at most once every 10 steps, only level with its top 12 pixels2 a step from each[24]
Giant Spider1, at most once every 10 steps2 a step from each[25]
Magma ManNothing2 a step from each, off its life[26]
GhostNothingNothing[27]
Mattock wind-up and the floor. With his back to the yeti king, the player swings a mattock. The swing makes its wind-up behind him twice, and the two take 12 of the yeti king's 30 hit points in four steps. The hit in front breaks the block he stands on, and he drops into the hole.

Obtaining

#
SourceChance
General Store1 in 20 for each ware, its first roll[28]
Rare ShopEach of its wares is one of its eleven items or a Bomb Box[29]
The Dice House's prize1 in 8, once the rolls for a Jetpack, a Cape, a Shotgun, Climbing Gloves and a Teleporter fail[30]
A Crate1 in 100, once the rolls for a Jetpack, a Cape and a Shotgun fail[31]
Buried in a block1 in 19 of the items buried in blocks[32]
The bottom of a Snake PitAlways, 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:

Area1st level2nd level3rd level4th 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_find never 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

#
  1. objects/oMattockHit/other_animation_end.gml:1-59
  2. objects/oMattockHit/create.gml:5
  3. objects/oMattock/create.gml:6
  4. scripts/scrUseItem.gml:168-215
  5. objects/oPlayer1/step.gml:415-431
  6. objects/oPlayer1/step.gml:497-509
  7. objects/oMattockHit/other_animation_end.gml:1-36
  8. Clip mattock/dig
  9. objects/oMattockHit/other_animation_end.gml:7-11
  10. Quirk 1 (docs/quirks.md)
  11. Clip mattock/wind-up
  12. Replay fidelity/replays/weapon-mattock-wrong-block.txt
  13. objects/oMattockHit/other_animation_end.gml:38-56
  14. Replay fidelity/replays/item-seed-35-mattock-break.txt
  15. objects/oMattockHit/create.gml:3-6
  16. objects/oMattockPre/create.gml:3-4
  17. objects/oEnemy/collision_oWhip.gml:1-8
  18. objects/oEnemy/collision_oWhip.gml:1
  19. objects/oCaveman/collision_oWhip.gml:1-17
  20. objects/oManTrap/collision_oWhip.gml:1-20
  21. objects/oYeti/collision_oWhip.gml:1-21
  22. objects/oYeti/collision_oWhipPre.gml:22-30
  23. objects/oYetiKing/collision_oWhip.gml:1-10
  24. objects/oTombLord/collision_oWhip.gml:1-8
  25. objects/oGiantSpider/collision_oWhip.gml:1-7
  26. objects/oMagmaMan/collision_oWhip.gml:1-6
  27. objects/oGhost/collision_oWhip.gml:1
  28. scripts/scrShopItemsGen.gml:156-177
  29. scripts/scrShopItemsGen.gml:102-155
  30. scripts/scrGenerateItem.gml:47-54
  31. objects/oPlayer1/step.gml:617-620
  32. scripts/scrGenerateItem.gml:63-89
  33. scripts/scrRoomGen.gml:212-218
  34. scripts/scrRoomGen.gml:475-481
  35. scripts/scrShopItemsGen.gml:117-120
  36. scripts/scrShopItemsGen.gml:179-191
  37. scripts/scrLevelGen.gml:240
  38. scripts/scrRoomGen.gml:392-397
  39. objects/oShopkeeper/step.gml:173-200
  40. objects/oBrick/create.gml:7-16
  41. scripts/scrCreateTileObj.gml:399-404
  42. scripts/scrStealItem.gml:253-262
  43. Replay fidelity/replays/weapon-seed-35-mattock.txt
  44. objects/oShopkeeper/collision_oWhip.gml:1-19
  45. objects/oMattockHit/other_animation_end.gml:25-28
  46. objects/oMattockHit/other_animation_end.gml:2-13
  47. objects/oPlayer1/step.gml:432-446
  48. objects/oMattockHit/other_animation_end.gml:39
  49. objects/oMattockHit/other_animation_end.gml:15-20
  50. Quirk 5 (docs/quirks.md)
  51. objects/oEnemy/collision_oWhipPre.gml:1

Source code

  • objects/oMattock/create.gml
  • objects/oMattockHit/create.gml
  • objects/oMattockHit/other_animation_end.gml
  • objects/oMattockPre/create.gml
  • objects/oPlayer1/step.gml
  • scripts/scrUseItem.gml
  • scripts/scrShopItemsGen.gml
  • scripts/scrGenerateItem.gml
#