objects/oGhost/collision_oCharacter.gml
From spelunky.gmk, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC, shown whole under the Spelunky User License v1.1b. Extracted by spelunky.ai's tools, an unofficial fan project, one file per script or event; the // ==== lines are the extractor's, naming each action of the event. Some scripts are others' work that Derek Yu credits in the source's readme.txt: Martin Piecyk's platform engine, ChevyRay's view scaling scripts and tsg1zzn's Super Sound System.
oGhost's collision oCharacter event, 34 lines of GML.
if (other.invincible == 0){ if (true) { if (isRealLevel()) global.enemyDeaths[23] += 1; repeat(3) { instance_create(other.x, other.y, oBone); } skull = instance_create(other.x, other.y-2, oSkull); skull.yVel = -rand(1,3); skull.xVel = rand(0,3)-rand(0,3); other.visible = false; other.invincible = 9999; other.bounced = true; global.plife = -99; playSound(global.sndDie); global.drawHUD = false; if (other.holdItem) { other.holdItem.held = false; if (facing == LEFT) other.holdItem.xVel = -2; else other.holdItem.xVel = 2; other.holdItem.yVel = -4; other.holdItem = 0; } status = IDLE; image_speed = 0.2; sprite_index = sGhostDisappear; playSound(global.sndGhost); }}