sMeboid 0 -1 -3 0 oEnemy <undefined> 1 603 7 0 0 -1 2 self 0 0 1 action_inherited(); myhealth = 60; damage = 35; hitsound = sndEHit1; deathsound = sndEDeath2; platyoffset = -4; frozenspr = sMeboidFrozen; target = 0; canattack = 1; flipx = 1; hitbeam = 0; hitmissile = 0; hitmissileexpl = 0; hitpbomb = 0; hitbomb = 0; hitscrewattack = 0; hitpseudoscrew = 0; state = 0; facing = 1; stuntime = 5; accelx = 0.05; accely = 0.02; maxspx = 2; maxspy = 1; targetx = x; targety = y; startx = x; starty = y; currtgt = 0; for (i = 0; i < 10; i += 1) { tgtx[i] = x; tgty[i] = y; } tgtx[1] = startx + 32; tgty[1] = starty + random_range(-18, 18); tgtx[2] = startx - 32; tgty[2] = starty + random_range(-18, 18); tgtx[3] = startx; tgty[3] = starty + 1; tgtx[4] = startx + 32; tgty[4] = starty + random_range(-18, 18); tgtx[5] = startx - 32; tgty[5] = starty + random_range(-18, 18); tgtx[6] = startx; tgty[6] = starty; CollisionTop = 0; CollisionRight = 0; CollisionLeft = 0; CollisionBottom = 0; shaking = 0; sprite_index = sMeboidSpawn; image_speed = 0.25; candamage = 0; //want to drain health, so we disable normal attacks 1 603 7 0 0 -1 2 self 0 0 1 enemy_active_check(30); enemy_target_check(120, 1); CollisionTop = collision_line(x - 8, y - 7, x + 8, y - 7, oSolid, true, true); if (CollisionTop == -4) CollisionTop = collision_line(x - 8, y - 7, x + 8, y - 7, oEnemySolid, true, true); CollisionRight = collision_line(x + 9, y + 6, x + 9, y - 6, oSolid, true, true); if (CollisionRight == -4) CollisionRight = collision_line(x + 9, y + 6, x + 9, y - 6, oEnemySolid, true, true); CollisionLeft = collision_line(x - 9, y - 6, x - 9, y + 6, oSolid, true, true); if (CollisionLeft == -4) CollisionLeft = collision_line(x - 9, y - 6, x - 9, y + 6, oEnemySolid, true, true); CollisionBottom = collision_line(x - 8, y + 7, x + 8, y + 7, oSolid, true, true); if (CollisionBottom == -4) CollisionBottom = collision_line(x - 8, y + 7, x + 8, y + 7, oEnemySolid, true, true); if (active == 1 && frozen == 0) { if (state == 0) { accelx = 0.02; accely = 0.02; maxspx = 0.6; maxspy = 0.5; if (point_distance(x, y, targetx, targety) < 10) { currtgt += 1; if (tgtx[currtgt] == startx && tgty[currtgt] == starty) currtgt = 0; targetx = tgtx[currtgt]; targety = tgty[currtgt]; } if (point_distance(x, y, oCharacter.x, oCharacter.y) < 64 && statetime > 120) { state = 1; statetime = 0; } } if (state == 1) { accelx = 0.1; accely = 0.05; maxspx = 1.5; maxspy = 1; targetx = oCharacter.x; targety = oCharacter.y - 8; if (statetime >= 300) { state = 0; statetime = 0; } } if (targetx > x) hspeed += accelx; if (targetx < x) hspeed -= accelx; if (targety > y) vspeed += accely; if (targety < y) vspeed -= accely; hspeed = min(hspeed, maxspx); hspeed = max(hspeed, -maxspx); vspeed = min(vspeed, maxspy); vspeed = max(vspeed, -maxspy); if (inwater) speed = 0.7; if (CollisionTop != 0) { if (instance_exists(CollisionTop)) { if (vspeed < 0 && CollisionTop.depth != 10) { vspeed *= -1; shaking = 1; } } } if (CollisionBottom != 0) { if (instance_exists(CollisionBottom)) { if (vspeed > 0 && CollisionBottom.depth != 10) { vspeed *= -1; shaking = 1; } } } if (CollisionLeft != 0) { if (instance_exists(CollisionLeft)) { if (hspeed < 0 && CollisionLeft.depth != 10) { hspeed *= -1; shaking = 1; } } } if (CollisionRight != 0) { if (instance_exists(CollisionRight)) { if (hspeed > 0 && CollisionRight.depth != 10) { hspeed *= -1; shaking = 1; } } } if (shaking > 0) { image_speed = 1; } else if (image_speed > 0.25) image_speed -= 0.05; } else speed = 0; // if (active == 1 && frozen == 0) else if (state == 100) enemy_death(); if (shaking > 0) shaking -= 1; //if (image_alpha < 1) image_alpha += 0.05; event_inherited(); 1 603 7 0 0 -1 2 self 0 0 1 event_inherited(); shaking = 30; direction = other.direction; speed = 2; 1 603 7 0 0 -1 2 self 0 0 1 if (other.ibeam) { with (other) event_user(0); frz = instance_create(x, y, oEnemyFrozen); frz.image_xscale = facing; frz.sprite_index = frozenspr; frz.image_index = image_index; frz.mask_index = frozenspr; frz.image_angle = image_angle; frz.xVel = hspeed; frz.yVel = vspeed; frz.depth = 10; frz.falling = freezefall; // X respawn variable pass-through. frz.xSprite = sprite_index; frz.xLastFrame = image_index; frz.xLastFacing = image_xscale; frz.xLastAngle = image_angle; frz.xLastDepth = depth; frz.xLastXPos = xstart; frz.xLastYPos = ystart; frz.xLastEnemy = object_index; frz.canbeX = canbeX; frz.timer = timer; frz.rotspeed = rotspeed; frz.myspeed = myspeed; frz.offset = offset; frz.moveratio = moveratio; frz.movesteps = movesteps; PlaySoundMono(sndFreezeHit); instance_destroy(); } else with (other) event_user(1); with (other) if (!pbeam) instance_destroy(); direction = other.direction; speed = 2; shaking = 30; 1 603 7 0 0 -1 2 self 0 0 1 shaking = 60; speed = 0; 1 603 7 0 0 -1 2 self 0 0 1 shaking = 10; direction = 90; speed = 2; 1 603 7 0 0 -1 2 self 0 0 1 with (other) plantdrain = 2; 1 603 7 0 0 -1 2 self 0 0 1 if (sprite_index == sMeboidSpawn) sprite_index = sMeboid; 0 0 0 0.5 0.100000001490116 0 0.100000001490116 0.100000001490116 0.200000002980232 -1 -1