sCoreXShell 0 -1 -155 0 <undefined> <undefined> 1 603 7 0 0 -1 2 self 0 0 1 /// Initialization. acceleration = 0.08; maxspeed = 3.25; drag = 0.025; forcemissile = 4; forcesupermissile = 5; // health PER STAGE myhealth[0] = 1; // blue myhealth[1] = 1; // yellow myhealth[2] = 1; // red damage = 40; missiledamage = 1; superdamage = 2; gravity = 0; gravity_direction = 270; state = 0; statetime = 0; canbehit = 1; flashing = 0; fxtimer = 0; invulnerability = 180; sparkcount = 2; image_index = 0; image_speed = 0; sprite_index = sCoreXShell; canSpawnX = true; canbeX = 1; if(room == rm_a2a04) { // Arachnus damage = global.mod_coreArachnusDamage; myhealth[0] = global.mod_coreArachnusHealthBlue; myhealth[1] = global.mod_coreArachnusHealthYellow; myhealth[2] = global.mod_coreArachnusHealthRed; } if(room == rm_a3a01) { // Torizo damage = global.mod_coreTorizoDamage; myhealth[0] = global.mod_coreTorizoHealthBlue; myhealth[1] = global.mod_coreTorizoHealthYellow; myhealth[2] = global.mod_coreTorizoHealthRed; } if(room == rm_a8a11) { // Genesis damage = global.mod_coreGenesisDamage; myhealth[0] = global.mod_coreGenesisHealthBlue; myhealth[1] = global.mod_coreGenesisHealthYellow; myhealth[2] = global.mod_coreGenesisHealthRed; } if(room == rm_a5b03a) { //Eris damage = global.mod_coreErisDamage; myhealth[0] = global.mod_coreErisHealthBlue; myhealth[1] = global.mod_coreErisHealthYellow; myhealth[2] = global.mod_coreErisHealthRed; } 1 603 7 0 0 -1 2 self 0 0 1 /// Morph sttings. sizeX = 1; sizeY = 1; xtype = sCoreXShell; 1 603 7 0 0 -1 2 self 0 0 1 /// Change X depth after spawning. if(instance_exists(inst)) inst.depth = -200; 1 603 7 0 0 -1 2 self 0 0 1 /// Reenable X spawning. canSpawnX = true; 1 603 7 0 0 -1 2 self 0 0 1 /// Spawn X parasite. if(canSpawnX && state != 0) { inst = spawn_rnd_pickup_at(x, y, 100); if(instance_exists(inst)) { inst.state = 2; inst.statetime = 0; inst.depth = -151; canSpawnX = false; alarm[2] = 75; alarm[3] = 60; } } 1 603 7 0 0 -1 2 self 0 0 1 /// Create electric sparks. if(myhealth[2] > 0) { if(sparkcount > 0) { instance_create(x, y, oElectricSparkCoreXShort); sparkcount--; alarm[0] = 30 + random(30); sfx_play(sndCoreXPhaseShort); } else { instance_create(x, y, oElectricSparkCoreX); sparkcount = irandom_range(3, 5); alarm[0] = 60 + random(15); } } 1 603 7 0 0 -1 2 self 0 0 1 /// Core-X movement. if (state == 0) { if(statetime == 0) sfx_play(sndXMorph1); if(statetime < 40) { sizeX = sizeX + 0.18; sizeY = sizeY + 0.12; } if(statetime >= 40 && statetime < 80) { sizeX = sizeX - 0.18; sizeY = sizeY - 0.12; if(statetime == 40) { sprite_index = xtype; depth = -155; spawn_rnd_pickup_at(x + lengthdir_x(20, 90 + random_range(-20, 20)), y + lengthdir_y(20, 90 + random_range(-20, 20)), 100); spawn_rnd_pickup_at(x + lengthdir_x(20, 18 + random_range(-20, 20)), y + lengthdir_y(20, 18 + random_range(-20, 20)), 100); spawn_rnd_pickup_at(x + lengthdir_x(20, 306 + random_range(-20, 20)), y + lengthdir_y(20, 306 + random_range(-20, 20)), 100); spawn_rnd_pickup_at(x + lengthdir_x(20, 234 + random_range(-20, 20)), y + lengthdir_y(20, 234 + random_range(-20, 20)), 100); spawn_rnd_pickup_at(x + lengthdir_x(20, 162 + random_range(-20, 20)), y + lengthdir_y(20, 162 + random_range(-20, 20)), 100); if (global.waterlevel != 0) { repeat (20) { bubble = instance_create(x, y, oLBubble); if (instance_exists(bubble)) { bubble.hspeed = random_range(-2.5, 2.5); bubble.vspeed = -random(0.4); } } } } } if(statetime == 80) { state = 1; statetime = 0; alarm[0] = 15; } image_index = 0; } if(state == 1) { if (x > oCharacter.x) hspeed -= acceleration; else hspeed += acceleration; if (y > oCharacter.y-24) vspeed -= acceleration; else vspeed += acceleration; if(hspeed > maxspeed) hspeed -= acceleration; if(vspeed > maxspeed) vspeed -= acceleration; if(hspeed < -maxspeed) hspeed += acceleration; if(vspeed < -maxspeed) vspeed += acceleration; friction = drag; if(myhealth[2] <= 0) { state = 100; statetime = 0; } if (global.waterlevel != 0) { if (fxtimer == 0) { bubble = instance_create(x, y, oLBubble); if (instance_exists(bubble)) { bubble.alarm[0] = 60 + random(120); bubble.direction = random(360); bubble.speed = 0.5; } } } } if(state == 100) { if(statetime == 0) { hspeed = 0; vspeed = 0; visible = false; sfx_play(sndCoreXBreak); if(instance_exists(oElectricSparkCoreX)) { sfx_stop(sndCoreXPhase); with (oElectricSparkCoreX) instance_destroy(); } event_user(0); event_user(1); instance_destroy(); } } statetime += 1; if (fxtimer < 5) { fxtimer += 1; } else fxtimer = 0; if (flashing > 0) { canbehit = 0; flashing -= 1; } else canbehit = 1; if(sizeX < 1) sizeX = 1; if(sizeY < 1) sizeY = 1; 1 603 7 0 0 -1 2 self 0 0 1 /// Damage Core-X. var force = 0; if (!canbehit || state == 0) { with (other) event_user(1); } else { with (other) event_user(0); if (other.smissile == 0) { myhealth[image_index] -= missiledamage; force = forcemissile; flashing = invulnerability; } else { myhealth[image_index] -= min(myhealth[image_index], superdamage); force = forcesupermissile; flashing = invulnerability*superdamage/2; } if(myhealth[image_index] <= 0) image_index++; if(place_meeting(x, y, oCharacter)) force = -force; hspeed = lengthdir_x(-force, point_direction(x, y, other.x, other.y)); vspeed = lengthdir_y(-force, point_direction(x, y, other.x, other.y)); fxtimer = 0; canbehit = 0; if(myhealth[2] > 0) sfx_play(sndCoreXHit); if (global.waterlevel != 0) { repeat (8 + floor(random(4))) { bubble = instance_create(x, y, oLBubble); if (instance_exists(bubble)) { bubble.hspeed = random_range(-2.5, 2.5); bubble.vspeed = -random(0.4); } } } canSpawnX = true; alarm[1] = 30; } 1 603 7 0 0 -1 2 self 0 0 1 /// Fizzle beam. with (other) { event_user(1); if (!pbeam) instance_destroy(); } if (alarm[1] == -1) alarm[1] = 30; 1 603 7 0 0 -1 2 self 0 0 1 /// Damage player. if (myhealth[2] > 0) { if (other.invincible == 0) damage_player(damage, 5, -3, 0, 0); } 1 603 7 0 0 -1 2 self 0 0 1 /// End the boss fight. if(room == rm_a2a04) { with (oDoor) event_user(3); mus_fadeout(musArachnus); oMusicV2.bossbgm = sndJump; mus_current_fadein(); } if(room == rm_a8a11) { with (oDoor) event_user(3); mus_fadeout(musGenesis); oMusicV2.bossbgm = sndJump; mus_current_fadein(); with (oA8RedLightFX) fadeout = 1; } if(room == rm_a3a01) { with (oCoreX) alarm[4] = 90; with (oTorizoSpikes) event_user(0); with (oDoor) event_user(3); mus_fadeout(musTorizoB); oMusicV2.bossbgm = sndJump; mus_current_fadein(); } if(room == rm_a5b03a) { with (oDoorA5) event_user(3); mus_fadeout(musEris); oMusicV2.bossbgm = sndJump; mus_current_fadein(); } 1 603 7 0 0 -1 2 self 0 0 1 /// Create debris when destryoed. deb = instance_create(x-15, y-14, oDebris); deb.image_angle = 0; deb.sprite_index = sCoreXShellFrag; deb.image_index = 0; deb.direction = 135; deb.speed = 1 + random_range(-0.1, 0.1); deb.gravity = 0.5 + random_range(-0.1, 0.1); deb.depth = -155; deb.playsound = 0; deb.rotspeed = 4; deb.canbounce = 0; deb.alarm[0] = 30; deb.alarm[1] = -1; deb = instance_create(x+15, y-14, oDebris); deb.image_angle = 0; deb.sprite_index = sCoreXShellFrag; deb.image_index = 1; deb.direction = 45; deb.speed = 1 + random_range(-0.1, 0.1); deb.gravity = 0.5 + random_range(-0.1, 0.1); deb.depth = -155; deb.playsound = 0; deb.rotspeed = -4; deb.canbounce = 0; deb.alarm[0] = 30; deb.alarm[1] = -1; deb = instance_create(x+15, y+14, oDebris); deb.image_angle = 0; deb.sprite_index = sCoreXShellFrag; deb.image_index = 2; deb.direction = 0; deb.speed = 0.5 + random_range(-0.1, 0.1); deb.gravity = 0.5 + random_range(-0.1, 0.1); deb.depth = -155; deb.playsound = 0; deb.rotspeed = 2; deb.canbounce = 0; deb.alarm[0] = 30; deb.alarm[1] = -1; deb = instance_create(x-15, y+14, oDebris); deb.image_angle = 0; deb.sprite_index = sCoreXShellFrag; deb.image_index = 3; deb.direction = 180; deb.speed = 0.5 + random_range(-0.1, 0.1); deb.gravity = 0.5 + random_range(-0.1, 0.1); deb.depth = -155; deb.playsound = 0; deb.rotspeed = 2; deb.canbounce = 0; deb.alarm[0] = 30; deb.alarm[1] = -1; bld = instance_create(x+4, y+4, oFXAnimSpark); bld.sprite_index = sCoreXBlood; bld.image_speed = 0.35 + random_range(-0.075, 0.075); bld.image_alpha = 0.8; bld.image_angle = 45 + irandom_range(-15, 15); bld.image_xscale = 1; bld.image_yscale = 1; bld = instance_create(x+4, y+4, oFXAnimSpark); bld.sprite_index = sCoreXBlood; bld.image_speed = 0.35 + random_range(-0.075, 0.075); bld.image_alpha = 0.8; bld.image_angle = 135 + irandom_range(-15, 15); bld.image_xscale = 1; bld.image_yscale = 1; bld = instance_create(x+4, y+4, oFXAnimSpark); bld.sprite_index = sCoreXBlood; bld.image_speed = 0.35 + random_range(-0.075, 0.075); bld.image_alpha = 0.8; bld.image_angle = 315 + irandom_range(-15, 15); bld.image_xscale = 1; bld.image_yscale = 1.25; bld = instance_create(x+4, y+4, oFXAnimSpark); bld.sprite_index = sCoreXBlood; bld.image_speed = 0.35 + random_range(-0.075, 0.075); bld.image_alpha = 0.8; bld.image_angle = 225 + irandom_range(-15, 15); bld.image_xscale = 1; bld.image_yscale = 1; if (global.waterlevel != 0) { repeat (20) { bubble = instance_create(x, y, oLBubble); if (instance_exists(bubble)) { bubble.hspeed = random_range(-2.5, 2.5); bubble.vspeed = -random(0.4); } } } 1 603 7 0 0 -1 2 self 0 0 1 /// Draw event. if(state = 0) { with(oCoreX) draw_sprite_pixelated(sprite_index, image_index, x, y, 1, 1, image_angle, c_white, 1, other.sizeX, other.sizeY, 64); if(sprite_index == xtype) draw_sprite_pixelated(sprite_index, image_index, x, y, image_xscale, 1, image_angle, c_white, 1, sizeX, sizeY, 64); else { if(sprite_index == sErisHead) draw_sprite_pixelated(sErisJaw, 0, lastBossX, lastBossY, 1, lastYscale, lastBossAngle, c_white, 1, sizeX, sizeY, 64); draw_sprite_pixelated(sprite_index, image_index, lastBossX, lastBossY, lastBossFacing, lastYscale, lastBossAngle, c_white, 1, sizeX, sizeY, 128); } } else { if (flashing) { draw_sprite_ext(sprite_index, -1, x, y, image_xscale, 1, image_angle, make_color_rgb(80, 80, 80), 1); draw_set_blend_mode(bm_add); repeat (3) draw_sprite_ext(sprite_index, -1, x, y, image_xscale, 1, image_angle, -1, 1 - fxtimer * 0.25); draw_set_blend_mode(bm_normal); } else draw_self(); } 0 0 0 0.5 0.100000001490116 0 0.100000001490116 0.100000001490116 0.200000002980232 -1 0