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
#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
#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:
| Source | Hearts | Also | |
|---|---|---|---|
| Most monsters' touch, such as a Snake's | 1 | Knocked back, invincible for 30 steps | [1] |
| A Giant Spider's or a Tomb Lord's touch | 2 | As above | [31] [32] |
| The Yeti King's touch | 2, on a real level only | As above | [33] |
| A Magma Man's touch, or a blob of its magma | 2 | Stunned for 20 steps, set alight | [5] [34] |
| A Tomb Lord's fly | 2 | Stunned for 20 steps | [35] |
| A Yeti, Hawkman or Shopkeeper throwing him | 1, when he hits a wall or the floor | Stunned until he comes to rest | [3] |
| A Ghost or a Mantrap | All: he dies | [36] [37] | |
| A bullet, such as an angry Shopkeeper's from his Shotgun | 4 | Stunned for 20 steps | [38] |
| An Arrow moving faster than 3 pixels per step across | 2 | Stunned for 20 steps | [39] |
| A Rock moving faster than 4 pixels per step across | 2 | Stunned for 20 steps | [40] |
| A UFO's laser | 3 | Stunned for 20 steps | [41] |
| The Alien Boss's psychic wave | 1 | Stunned for 40 steps | [42] |
| An explosion, such as a Bomb's | 10, each step he's in it | Stunned for 100 steps, set alight | [43] |
| A Spear Trap's spears | 4, each step they strike him | Thrown up and away | [44] |
| A Smash Trap | 10, each step he touches it | Thrown | [45] |
| A Ceiling Trap coming down | 10, each step | [46] | |
| Falling onto Spikes | 99 | [47] | |
| Lava | 99, each step he's in it | [48] | |
| Being crushed (his middle inside a block) | 99 | [49] | |
| Falling out of the bottom of the level | 99 | [50] | |
| Landing after more than 16, 32 or 48 steps of falling | 1, 2 or 10 | Stunned 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
#objects/oEnemy/collision_oCharacter.gml:14-25objects/oYeti/collision_oCharacter.gml:42-67objects/oPlayer1/step.gml:1815-1842objects/oPlayer1/step.gml:257objects/oMagmaMan/collision_oCharacter.gml:1-18objects/oGhost/collision_oCharacter.gml:1-16objects/oManTrap/collision_oCharacter.gml:20-47objects/oPlayer1/step.gml:1929-1937objects/oPlayer1/step.gml:1513-1710objects/oBullet/collision_oCharacter.gml:1-6objects/oFly/collision_oCharacter.gml:1-6- Quirk 1 (docs/quirks.md)
objects/oPlayer1/step.gml:1885-1886objects/oPlayer1/step.gml:871-872- Clip damage/invincible
scripts/characterStepEvent.gml:71-88objects/oPlayer1/step.gml:1714-1736objects/oPlayer1/step.gml:1738-1753scripts/characterStepEvent.gml:266-276scripts/characterStepEvent.gml:731-736objects/oPlayer1/step.gml:243-250objects/oPlayer1/step.gml:1793-1797objects/oYeti/collision_oCharacter.gml:65-67objects/oPlayer1/step.gml:254-257objects/oPlayer1/step.gml:268-289objects/oPlayer1/step.gml:268objects/oPlayer1/step.gml:15-18objects/oPlayer1/step.gml:252objects/oEnemy/collision_oCharacter.gml:11- Clip damage/long-drop
objects/oGiantSpider/collision_oCharacter.gml:28-31objects/oTombLord/collision_oCharacter.gml:30-33objects/oYetiKing/collision_oCharacter.gml:27-30objects/oMagma/collision_oCharacter.gml:1-15objects/oFly/collision_oCharacter.gml:1-16objects/oGhost/collision_oCharacter.gml:16objects/oManTrap/collision_oCharacter.gml:44objects/oBullet/collision_oCharacter.gml:1-17objects/oPlayer1/step.gml:1513-1535objects/oPlayer1/step.gml:1538-1563objects/oPlayer1/step.gml:1567-1591objects/oPlayer1/step.gml:1594-1611objects/oPlayer1/step.gml:1614-1627objects/oPlayer1/step.gml:1629-1647objects/oPlayer1/step.gml:1649-1668objects/oPlayer1/step.gml:1670-1679objects/oPlayer1/step.gml:1693-1703objects/oPlayer1/step.gml:196-212objects/oPlayer1/step.gml:1493-1511objects/oPlayer1/step.gml:221-239- Replay
fidelity/replays/action-bomb-death-mines-seed-1.txt - Replay
fidelity/replays/enemy-vampire-seed-163-death.txt - Replay
fidelity/replays/enemy-yeti-king-custom-level-touch.txt
Source code
objects/oEnemy/collision_oCharacter.gmlobjects/oPlayer1/step.gmlscripts/characterStepEvent.gmlobjects/oYeti/collision_oCharacter.gmlobjects/oBullet/collision_oCharacter.gmlobjects/oFly/collision_oCharacter.gmlobjects/oMagmaMan/collision_oCharacter.gml