Mantrap
Verified against the spelunky.ai port v0.1.10 on .
The Mantrap is a carnivorous plant in Spelunky Classic's Jungle that creeps along the ground and swallows the player whole on contact, killing him outright.
Level generation plants Mantraps on the ground in the Jungle, where they creep about slowly. A Mantrap has no bite: whatever walks into it, the player included, it swallows whole, and the player dies on the spot whatever his hearts. Landing on one is no defence without Spike Shoes. With 3 hit points, it survives most single hits, which stun it, but one Machete cut kills it.
Behaviour
#A Mantrap sets off in a random direction as soon as it's made [5]. It turns around at walls and at the edges of ledges, and stands still where it has a wall or a drop on both sides [6]. Its code sets its speed to 1 pixel per step, but friction then cuts that to 0.3 every step, and the game moves it in whole pixels, so it covers 1 pixel every 3 steps (10 per second) [3] [7]. It has a 1 in 100 chance each step of stopping for 20–50 steps (0.67–1.67 seconds), and then sets off in a random direction again [8].
It never looks for the player: it eats what it walks into, or what walks into it.
Eating. When the player touches a Mantrap that isn't stunned or already eating, within 8 pixels of its middle across, the Mantrap swallows him: he vanishes, his hearts are set to −99, and he dies. Whatever he was holding is thrown out [9] [10]. The clip shows the player dropping onto a Mantrap from a ledge and being eaten. It eats the same way a Caveman (alive, stunned or dead), the Damsel (even out of the player's hands) or a Shopkeeper that touches it; a Shopkeeper's Shotgun flies out as he's swallowed [11] [12] [13].
When its eating animation ends, it falls asleep, spitting out the odd bone, and when its sleeping animation ends it lies stunned for 400 steps (13.33 seconds), twice as long as a hit stuns it, before it wakes and walks again [14] [15].
Like most monsters, it only acts while it's on screen or just off it [16].
Damage
#A Mantrap kills the player outright, with no knockback and no invincibility to save him: it sets his hearts to −99 [17]. Its touch event replaces the one most monsters share, so it never takes a single heart. It can't eat him while it's stunned or already eating, nor while he's invincible after a hit [18].
Landing on a Mantrap is only a stomp with Spike Shoes, or while it's eating something else; otherwise it counts as touching it, and it eats the player, as in the clip [19] [20].
Defeating
#Most hits stun a Mantrap as well as hurting it: it's knocked back and lies on the ground for 200 steps (6.67 seconds), counted down while it's on the ground or carried, and then gets up if it has hit points left [21]. A stunned Mantrap can't eat, and the Whip, a stomp and thrown items can't hurt it again until it's up. The clip shows the Whip stunning a Mantrap, which gets up about seven seconds later and walks off.
| Way | Damage | |
|---|---|---|
| Whip | 1 hit point, and stuns it; nothing while it's stunned | [22] |
| Machete | 4, twice the Machete's 2, which kills it; nothing while it's stunned | [23] |
| Stomp, only with Spike Shoes or while it's eating | 1, plus 1 for every 16 steps of falling, three times that with Spike Shoes, and stuns it | [24] |
| A thrown item moving faster than 2 pixels per step, such as a Rock | 1, and stuns it; nothing while it's stunned | [25] |
| A stunned monster thrown into it | 1, and stuns it | [26] |
| A Shotgun or Pistol bullet | 4 hit points | [27] |
| A Bomb's explosion | 30 hit points | [28] |
| A Spear Trap's spears | 2, and stuns it | [29] |
| Falling onto Spikes | Kills it | [30] |
| Standing in Lava | Kills it | [31] |
A Mantrap that ends up inside solid ground is pushed up out of it rather than killed [32].
When its hit points run out, a Mantrap bursts into leaves and is gone, leaving no body [33]. If it had swallowed a living Shopkeeper, he bursts back out, without his Shotgun, when it dies, or the next time it gets up from being stunned, which destroys it [34] [35]. Mantraps killed count toward the player's kills, and the screen between levels draws a Mantrap icon for each [36] [37]. One that Spikes, Lava or a Spear Trap killed doesn't count [38] [39] [40].
A stunned Mantrap can be carried and thrown like a stunned Caveman, and one left lying still on Kali's altar for 20 steps is sacrificed to her, adding 2 to her favour, unless her favour is already −8 or less [41]. As it leaves no body, a dead one can't be.
Locations
#Level generation makes Mantraps only in the Jungle, on top of blocks with open space above them, outside the starting room and shops: each such block has a 1 in 60 chance, but not under water or on a graveyard level [42]. In the Black Market, blocks at a height that's a multiple of 128 pixels (every eighth row) get none, which the code's comment says is to keep Mantraps from growing near the shopkeepers there [43].
Custom levels can have them, as the level editor's tile M
[44].
Tips
#- A Mantrap can't be stomped without Spike Shoes: landing on one is touching it.
- It moves 1 pixel every 3 steps, so it's easy to outwalk, and it never turns toward the player.
- One Machete cut kills it, as does a bullet or a Bomb; with the Whip, it takes three hits, each after it gets back up.
- A stunned Mantrap can't eat anything, so it's safe to carry until it wakes.
- After eating, it sleeps and then lies stunned for over 13 seconds.
Trivia
#-
The code most monsters share names it in its first line, in a comment noting that the Mantrap replaces its touch code with its own:
// jumped on - oCaveman, oManTrap replaces this script with its ownobjects/oEnemy/collision_oCharacter.gml:1, fromspelunky.gmk, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC (Spelunky User License v1.1b). -
Its eating animation has a version for each character the player can be: the Spelunker, the Damsel and the Tunnel Man [45].
-
Its code names an attack state, but nothing ever puts a Mantrap in it [46].
FAQ
#- How much damage does a Mantrap do in Spelunky Classic?
All of it. A Mantrap that touches the player swallows him and sets his hearts to −99, so he dies however many hearts he had. It can't while it's stunned or already eating.
- Can you stomp a Mantrap in Spelunky Classic?
Only with Spike Shoes, or while it's busy eating something else. Otherwise landing on a Mantrap counts as touching it, and it eats the player.
- How do you kill a Mantrap in Spelunky Classic?
From a distance, or with a Machete. It has 3 hit points: one Machete cut does twice its damage and kills it, as does one bullet or a Bomb; a Whip hit or a thrown item takes 1 and stuns it, and can't hurt it again until it gets up.
- What does a Mantrap eat in Spelunky Classic?
The player, a Caveman, the Damsel or a Shopkeeper, whichever touches it while it isn't stunned or eating. A Shopkeeper it ate alive comes back out when it dies or wakes up.
- Where do Mantraps grow in Spelunky Classic?
On the ground in the Jungle, where level generation puts one on a block with a 1 in 60 chance, though not under water or on a graveyard level.
See also
#References
#objects/oManTrap/create.gml:10objects/oManTrap/collision_oCharacter.gml:20-47objects/oManTrap/step.gml:144-149objects/oManTrap/step.gml:44-86objects/oManTrap/step.gml:44-52objects/oManTrap/step.gml:53-78scripts/moveTo.gml:20-31objects/oManTrap/step.gml:80-85objects/oManTrap/collision_oCharacter.gml:1-4objects/oManTrap/collision_oCharacter.gml:20-62objects/oManTrap/collision_oCaveman.gml:1-10objects/oManTrap/collision_oDamsel.gml:1-18objects/oManTrap/collision_oShopkeeper.gml:1-24objects/oManTrap/other_animation_end.gml:1-11objects/oManTrap/step.gml:158-170objects/oManTrap/step.gml:3-4objects/oManTrap/collision_oCharacter.gml:41-46objects/oManTrap/collision_oCharacter.gml:20-22objects/oManTrap/collision_oCharacter.gml:5- Clip mantrap/eat
objects/oManTrap/step.gml:87-137objects/oManTrap/collision_oWhip.gml:1-20objects/oManTrap/collision_oWhip.gml:3-6objects/oManTrap/collision_oCharacter.gml:5-19objects/oItem/step.gml:270-288objects/oEnemy/step.gml:169-199objects/oBullet/collision_oEnemy.gml:16objects/oExplosion/collision_oEnemy.gml:14objects/oEnemy/step.gml:76-97objects/oEnemy/step.gml:108-124objects/oEnemy/step.gml:65-74objects/oManTrap/step.gml:151objects/oManTrap/step.gml:20-40objects/oManTrap/step.gml:30-38objects/oManTrap/step.gml:111-120objects/oManTrap/step.gml:22-27objects/oTransition/alarm_0.gml:191-196objects/oEnemy/step.gml:68objects/oEnemy/step.gml:87objects/oEnemy/step.gml:120objects/oEnemy/step.gml:130-167scripts/scrEntityGen.gml:276-289scripts/scrEntityGen.gml:287-289scripts/scrCreateTileObj.gml:189-192objects/oManTrap/collision_oCharacter.gml:28-39objects/oManTrap/create.gml:14-21objects/oEnemy/step.gml:63-74
Source code
objects/oManTrap/create.gmlobjects/oManTrap/step.gmlobjects/oManTrap/collision_oCharacter.gmlobjects/oManTrap/collision_oWhip.gmlobjects/oManTrap/collision_oCaveman.gmlobjects/oManTrap/collision_oDamsel.gmlobjects/oManTrap/collision_oShopkeeper.gmlobjects/oManTrap/other_animation_end.gmlobjects/oEnemy/step.gmlscripts/scrEntityGen.gml