SpelunkyFan wiki

objects/oSacAltarLeft/destroy.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.

oSacAltarLeft's destroy event, 67 lines of GML.

if (not cleanDeath and not global.cleanSolids){    rubble = instance_create(x+8+rand(0,8)-rand(0,8), y+8+rand(0,8)-rand(0,8), oRubble);    rubble.sprite_index = sRubbleTan;    rubble = instance_create(x+8+rand(0,8)-rand(0,8), y+8+rand(0,8)-rand(0,8), oRubbleSmall);    rubble.sprite_index = sRubbleTanSmall;    rubble = instance_create(x+8+rand(0,8)-rand(0,8), y+8+rand(0,8)-rand(0,8), oRubbleSmall);    rubble.sprite_index = sRubbleTanSmall;}if (defile){    global.message = "YOU DARE DEFILE MY ALTAR?";    global.message2 = "I WILL PUNISH YOU!";    global.messageTimer = 200;    scrShake(10);    global.favor -= 16;        if (global.kaliPunish == 0)    {        with oKaliHead        {            alarm[0] = 1;        }    }    else if (global.kaliPunish == 1)    {        instance_create(oPlayer1.x, oPlayer1.y, oBall);        obj = instance_create(oPlayer1.x, oPlayer1.y, oChain);        obj.linkVal = 1;        obj = instance_create(oPlayer1.x, oPlayer1.y, oChain);        obj.linkVal = 2;        obj = instance_create(oPlayer1.x, oPlayer1.y, oChain);        obj.linkVal = 3;        obj = instance_create(oPlayer1.x, oPlayer1.y, oChain);        obj.linkVal = 4;    }    else    {        if (global.darkLevel and global.ghostExists)        {            with oKaliHead            {                alarm[0] = 1;            }        }        else        {            global.darkLevel = true;            if (not global.ghostExists)            {                if (oPlayer1.x > room_width / 2) instance_create(view_xview[0]+view_wview[0]+8, view_yview[0]+floor(view_hview[0] / 2), oGhost);                else instance_create(view_xview[0]-32,  view_yview[0]+floor(view_hview[0] / 2), oGhost);                global.ghostExists = true;            }        }    }    global.kaliPunish += 1;    with oSacAltarLeft    {        defile = false;        instance_destroy();    }}