scripts/scrShopkeeperAnger.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.
The script scrShopkeeperAnger, 24 lines of GML.
//// scrShopkeeperAnger(message)//// Make the nearest shopkeeper angry. RAWR! //shp = instance_nearest(x, y, oShopkeeper);if (shp){ if (not shp.dead and not shp.angered) { shp.status = 2; if (global.murderer) global.message = "YOU'LL PAY FOR YOUR CRIMES!"; else if (argument0 == 0) global.message = "COME BACK HERE, THIEF!"; else if (argument0 == 1) global.message = "DIE, YOU VANDAL!"; else if (argument0 == 2) global.message = "TERRORIST!"; else if (argument0 == 3) global.message = "HEY, ONLY I CAN DO THAT!"; else global.message = "NOW I'M REALLY STEAMED!"; global.message2 = ""; global.messageTimer = 80; if (global.thiefLevel > 0) global.thiefLevel += 3; else global.thiefLevel += 2; }}