objects/oEnemy/create.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.
oEnemy's create event, 45 lines of GML.
// ==== action 0: lib 1 id 604: action_inherited() ====// ==== action 1: lib 1 id 603: code ====hp = 1;type = "None";active = true;// is this used?shaking = 0shakeCounter = 0bloodless = false;bloodLeft = 4;flying = false;heavy = true;myGrav = 0.6;myGravNorm = 0.6;myGravWater = 0.2yVelLimit = 10;bounceFactor = 0.5;frictionFactor = 0.3;// added so enemies can be carried with same code as itemsheld = false;armed = false;trigger = false;safe = false;sticky = false;canPickUp = true;cost = 0;forSale = false;favor = 1;sacCount = 20;countsAsKill = true; // sometimes it's not the player's fault!burning = 0;swimming = false;stunTime = 200;LEFT = 0;RIGHT = 1;facing = 0;STUNNED = 98;DEAD = 99;bombID = 0;