Unarmed lit bombs
Verified against the spelunky.ai port v0.1.10 on .
Unarmed lit bombs are a quirk of Spelunky Classic in which a lit bomb the player didn't throw, as a Chest's trap, can be carried out of a level as a free bomb.
A lit Bomb the player throws is armed, which the game checks in two places: a Bomb going through an exit in his hands is let go and left behind, and one near a shop angers its Shopkeeper. Bombs lit by other things look and burn the same but aren't armed, so neither check acts on them.
What happens
#The player opens a Chest, and out pops a lit bomb. He picks it up and takes the exit with it: instead of being left behind, it goes back into his bag, and his bombs go from 4 to 5 [1].
Why
#One time in 12, opening a Chest lets out a trap: a Bomb with the lit sprite and a 40-step fuse, but armed,
which every item starts without, is never set [2]. At a level's exit, the player's
step lets go of an armed Bomb and puts any other back in his bombs
[3]:
else if (holdItem.type == "Bomb")
{
if (holdItem.armed)
{
holdItem.held = false;
}
else
{
global.bombs += 1;
with holdItem { instance_destroy(); }
}objects/oPlayer1/step.gml:821-831, from spelunky.gmk, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC (Spelunky User License v1.1b).That's what puts an unlit Bomb carried out back in the bag, and the trap bomb, lit but unarmed, goes back in too. Olmec's exit does the same [4]. A Bomb near a shop angers its Shopkeeper only if it's armed [5].
Only the player's throw, a Monkey and the Sun Room arm a bomb; an explosion setting one off, a Magma Man's touch and the mothership's barrier light it unarmed. The player being stunned or killed arms whatever he drops [6]. Of the unarmed ones, only the Chest's burns long enough to carry out: the others go off in 4 to 12 steps [7].
Reproducing it
#Open Chests until one lets out a bomb, pick it up at once and walk through the exit within its 40 steps. The replay of the clip's staged scene pins it: the trap bomb, unarmed, picked up lit and taken through the exit, puts the bombs from 4 to 5, with no explosion [8].
In the port
#The spelunky.ai port reproduces it exactly: it's in docs/quirks.md's list of the 1.1 source's bugs [7], and the oracle's fingerprint of the replay pins the bomb count. The Shopkeeper's side is read in the code and not yet in a replay. No option turns it off.
FAQ
#- Can you keep a Chest's trap bomb in Spelunky Classic?
Yes. Picked up while it's lit and carried out of the level's exit, a Chest's trap bomb goes back into the player's bombs instead of being left behind, so it's a free bomb.
- Does a Chest's lit bomb anger a Shopkeeper?
No. A bomb only angers a Shopkeeper when it's armed, and a Chest's trap bomb never is unless the player is stunned or dies holding it.
- Why is a lit bomb not armed?
The code that lights a bomb for a Chest, an explosion, a Magma Man or the mothership's barrier changes its sprite and starts its fuse, but doesn't set it armed, as the player's throw does.
See also
#References
#- Clip quirks/chest-trap-bomb-taken-out
objects/oPlayer1/step.gml:568-577objects/oPlayer1/step.gml:821-831objects/oPlayer1/step.gml:691-702objects/oBomb/step.gml:6objects/oPlayer1/step.gml:1714-1720- Quirk 1 (docs/quirks.md)
- Replay
fidelity/replays/item-chest-trap-bomb-unarmed.txt
Source code
objects/oPlayer1/step.gmlobjects/oBomb/step.gml