SpelunkyFan wiki

Damage and stun

Verified against the spelunky.ai port v0.1.10 on .

Damage in Spelunky Classic is what takes the player's hearts: a monster's touch, a trap, an explosion or a long drop, many of which also stun him.

Each thing that hurts the player takes its own number of hearts, from 1 for most monsters to 99 for lava. Many also stun him for a time, during which he can't move, and a monster's touch knocks him back and makes him invincible to monsters for a second. A fall hurts too, if it's long enough.

How it works

#

Monsters' touches

#

Most monsters' touch is the code they share, their parent object's (oEnemy's). When the player touches one without Stomping it, and isn't invincible, he's knocked away from it at 6 pixels per step, blinks, and is invincible for 30 steps; then, if he has a heart left, he loses one [1]. Monsters with a touch of their own take their own amount, usually the same way (Numbers). A few do something else:

  • A Yeti, a Hawkman or an angry Shopkeeper grabs the player and throws him over its head, stunned, unless there's a block above it; the first wall or floor he hits takes a heart [2] [3]. A long fall cancels that heart, as the landing costs one anyway [4].
  • A Magma Man burns him: he's stunned and set alight as well [5].
  • A Ghost kills him outright, as does a Mantrap, which eats him [6] [7].

Invincibility

#
Invincible after a bite. The player walks into a snake and loses a heart, then blinks: while he blinks he walks through a second snake unharmed. Back among them, a snake bites him again, and the next bite comes exactly a second later, when the blinking stops.

While the player is invincible he blinks for as long, the two counts going down one a step [8]. Only monsters' touches check it. The checks in his own step for arrows, thrown rocks, lasers, explosions, traps, spikes, lava and falls don't, and neither do a bullet's or a Tomb Lord's fly's, so they hurt him while he blinks [9] [10] [11]. Nor do those checks space their hits out: an explosion, a Spear Trap or a Smash Trap he stays in hits him on every step [12]. Besides a monster's touch, the Ankh's revival makes him invincible, for 60 steps, and so does going through a level's exit, for the rest of the level [13] [14].

The clip shows it. A Snake bites the player, and while he blinks he walks through a second Snake without losing a heart. Back among them, he's bitten again, and once more exactly 30 steps later, as his blinking stops [15].

Stun

#

While the player is stunned, every key is ignored [16]. He lets go of what he holds, which is thrown up out of his hands and, if it's a Bow, fires [17]; a whip swing stops and an open Parachute tears away [18]. In the air his speed across isn't slowed, and he bounces off walls at half his speed and off ceilings at most of it [19] [20].

Most stuns set a count of steps, which only goes down while he lies still, in the stunned pose: the stun ends when it reaches 0 [21] [22]. So a stun that sends him flying lasts its steps after he stops, and a throw by a Yeti, a Hawkman or a Shopkeeper, which sets no count, lasts until he comes to rest [23].

Long drops

#
Long drop. The player walks off a ledge and falls about twenty blocks. He lands on his 35th step of falling, loses two of his four hearts and lies stunned for two seconds before he can move again.

The player's step counts the steps he's been falling, unless he's climbing [24]. Landing after more than 16 is a long drop: he's stunned for 60 steps more, bounces up, and loses 1 heart, 2 after more than 32 steps and 10 after more than 48 [25]. Landing on a Spring Trap isn't one [26], and an open Parachute or Cape keeps the count at 0 [27] [28], as does a stomp, which ends the fall in a bounce [29].

The clip shows a drop of about twenty blocks. The player lands on his 35th step of falling, loses two of his four hearts and lies stunned for 2 seconds [30].

Numbers

#

What each thing does to the player, from the code most monsters share to the checks in his own step:

SourceHeartsAlso
Most monsters' touch, such as a Snake's1Knocked back, invincible for 30 steps[1]
A Giant Spider's or a Tomb Lord's touch2As above[31] [32]
The Yeti King's touch2, on a real level onlyAs above[33]
A Magma Man's touch, or a blob of its magma2Stunned for 20 steps, set alight[5] [34]
A Tomb Lord's fly2Stunned for 20 steps[35]
A Yeti, Hawkman or Shopkeeper throwing him1, when he hits a wall or the floorStunned until he comes to rest[3]
A Ghost or a MantrapAll: he dies[36] [37]
A bullet, such as an angry Shopkeeper's from his Shotgun4Stunned for 20 steps[38]
An Arrow moving faster than 3 pixels per step across2Stunned for 20 steps[39]
A Rock moving faster than 4 pixels per step across2Stunned for 20 steps[40]
A UFO's laser3Stunned for 20 steps[41]
The Alien Boss's psychic wave1Stunned for 40 steps[42]
An explosion, such as a Bomb's10, each step he's in itStunned for 100 steps, set alight[43]
A Spear Trap's spears4, each step they strike himThrown up and away[44]
A Smash Trap10, each step he touches itThrown[45]
A Ceiling Trap coming down10, each step[46]
Falling onto Spikes99[47]
Lava99, each step he's in it[48]
Being crushed (his middle inside a block)99[49]
Falling out of the bottom of the level99[50]
Landing after more than 16, 32 or 48 steps of falling1, 2 or 10Stunned for 60 more steps[25]

Examples

#
  • A Snake's bite takes 1 heart, and touching it again within the second after does nothing [15].
  • A Bomb at the player's feet takes all 4 of a new game's hearts, and hits him again on each step he's in the explosion [51].
  • A long drop of 35 steps takes 2 hearts and stuns him for 2 seconds [30].

Quirks

#
  • The deaths table counts some hits that don't kill. The end-of-game statistics' explosion row counts every step of an explosion the player survives, and not the one that kills him; the Spear, Smash and Ceiling Trap rows count every hit [12] [51].
  • Some monsters' kills aren't counted at all. A Bat, a Zombie and a Dead Fish never set the name the touch tallies by, and the Megamouth's is spelled another way; a Vampire's own touch has no tally, and nor does a blob of magma's, a copy of the Magma Man's [12] [52].
  • The Yeti King's touch costs nothing in a custom level, though it knocks the player back and its kill is tallied all the same [12] [53].
  • A Smash Trap throws the player toward it, and a lit one on a dark level never takes the 10 hearts: the player's check doesn't see it [12].
  • The arrow check takes the nearest arrow, touching him or not, so a spent arrow lying beside him can spare him a fast one [12].

FAQ

#
How long are you invincible after getting hit in Spelunky Classic?

1 second (30 steps) after a monster's touch. It only protects against monsters' touches: arrows, explosions, traps and falls hurt the player while he blinks.

How far can you fall without taking damage in Spelunky Classic?

For 16 steps, about half a second. Landing after a longer fall stuns the player and takes 1 heart, 2 after more than 32 steps and 10 after more than 48, unless he lands on a Spring Trap.

How long does a stun last in Spelunky Classic?

It depends on what stunned the player: 20 steps for an arrow or a thrown Rock, 60 steps for a long drop, 100 steps for an explosion. The count only starts once he's lying still, so a stun that sends him flying lasts longer.

What does being stunned do in Spelunky Classic?

The player can't move or act: every key is ignored. He drops what he's holding, which flies up out of his hands, and bounces off the walls he's thrown into.

See also

#

References

#
  1. objects/oEnemy/collision_oCharacter.gml:14-25
  2. objects/oYeti/collision_oCharacter.gml:42-67
  3. objects/oPlayer1/step.gml:1815-1842
  4. objects/oPlayer1/step.gml:257
  5. objects/oMagmaMan/collision_oCharacter.gml:1-18
  6. objects/oGhost/collision_oCharacter.gml:1-16
  7. objects/oManTrap/collision_oCharacter.gml:20-47
  8. objects/oPlayer1/step.gml:1929-1937
  9. objects/oPlayer1/step.gml:1513-1710
  10. objects/oBullet/collision_oCharacter.gml:1-6
  11. objects/oFly/collision_oCharacter.gml:1-6
  12. Quirk 1 (docs/quirks.md)
  13. objects/oPlayer1/step.gml:1885-1886
  14. objects/oPlayer1/step.gml:871-872
  15. Clip damage/invincible
  16. scripts/characterStepEvent.gml:71-88
  17. objects/oPlayer1/step.gml:1714-1736
  18. objects/oPlayer1/step.gml:1738-1753
  19. scripts/characterStepEvent.gml:266-276
  20. scripts/characterStepEvent.gml:731-736
  21. objects/oPlayer1/step.gml:243-250
  22. objects/oPlayer1/step.gml:1793-1797
  23. objects/oYeti/collision_oCharacter.gml:65-67
  24. objects/oPlayer1/step.gml:254-257
  25. objects/oPlayer1/step.gml:268-289
  26. objects/oPlayer1/step.gml:268
  27. objects/oPlayer1/step.gml:15-18
  28. objects/oPlayer1/step.gml:252
  29. objects/oEnemy/collision_oCharacter.gml:11
  30. Clip damage/long-drop
  31. objects/oGiantSpider/collision_oCharacter.gml:28-31
  32. objects/oTombLord/collision_oCharacter.gml:30-33
  33. objects/oYetiKing/collision_oCharacter.gml:27-30
  34. objects/oMagma/collision_oCharacter.gml:1-15
  35. objects/oFly/collision_oCharacter.gml:1-16
  36. objects/oGhost/collision_oCharacter.gml:16
  37. objects/oManTrap/collision_oCharacter.gml:44
  38. objects/oBullet/collision_oCharacter.gml:1-17
  39. objects/oPlayer1/step.gml:1513-1535
  40. objects/oPlayer1/step.gml:1538-1563
  41. objects/oPlayer1/step.gml:1567-1591
  42. objects/oPlayer1/step.gml:1594-1611
  43. objects/oPlayer1/step.gml:1614-1627
  44. objects/oPlayer1/step.gml:1629-1647
  45. objects/oPlayer1/step.gml:1649-1668
  46. objects/oPlayer1/step.gml:1670-1679
  47. objects/oPlayer1/step.gml:1693-1703
  48. objects/oPlayer1/step.gml:196-212
  49. objects/oPlayer1/step.gml:1493-1511
  50. objects/oPlayer1/step.gml:221-239
  51. Replay fidelity/replays/action-bomb-death-mines-seed-1.txt
  52. Replay fidelity/replays/enemy-vampire-seed-163-death.txt
  53. Replay fidelity/replays/enemy-yeti-king-custom-level-touch.txt

Source code

  • objects/oEnemy/collision_oCharacter.gml
  • objects/oPlayer1/step.gml
  • scripts/characterStepEvent.gml
  • objects/oYeti/collision_oCharacter.gml
  • objects/oBullet/collision_oCharacter.gml
  • objects/oFly/collision_oCharacter.gml
  • objects/oMagmaMan/collision_oCharacter.gml
#