sCoreXArachnus
0
-1
-153
0
<undefined>
<undefined>
1
603
7
0
0
-1
2
self
0
0
1
/// Initialization.
image_speed = 0.16;
state = 0;
statetime = 0;
flashing = 0;
fxtimer = 0;
roomcenter_x = room_width/2;
roomcenter_y = room_height/2;
frequency_x = 0.1 + random_range(-0.05, 0.05);
amplitude_x = 0.5 + random_range(-0.1, 0.1);
timer_x = irandom(100);
frequency_y = 0.1 + random_range(-0.05, 0.05);
amplitude_y = 0.5 + random_range(-0.1, 0.1);
timer_y = irandom(100);
xx = 0;
yy = 0;
drawaura = 1;
roomoffsety = 0;
switch (room) {
case rm_a2a04:
sprite_index = sCoreXArachnus;
break;
case rm_a3a01:
sprite_index = sCoreXTorizo;
roomoffsety = -100;
break;
case rm_a5b03a:
sprite_index = sCoreXSerris;
break;
case rm_a8a11:
sprite_index = sCoreXGenesis;
break;
}
alarm[1] = 1;
glow = 0;
frequency_glow = 0.1;
amplitude_glow = 1;
timer_glow = 0;
screwattackpickupframe = irandom(4);
screwattackpickupangle = irandom(359);
screwattackpickupfx = 0;
1
603
7
0
0
-1
2
self
0
0
1
/// Destroy Torizo Core-X camera.
with (oTorizoCoreXCam) instance_destroy();
1
603
7
0
0
-1
2
self
0
0
1
/// Create shell.
shell = instance_create(x, y, oCoreXShell);
shell.lastBossX = lastBossX;
shell.lastBossY = lastBossY;
shell.sprite_index = lastBossSprite;
shell.image_index = lastBossFrame;
shell.lastBossAngle = lastBossAngle;
shell.lastBossFacing = lastBossFacing;
shell.lastYscale = lastYscale;
shell.depth = lastBossDepth;
1
603
7
0
0
-1
2
self
0
0
1
/// Loop idle sound effect.
if(state != 2 || state != 6) {
sfx_play(sndCoreXIdle);
alarm[0]=60;
}
1
603
7
0
0
-1
2
self
0
0
1
/// Move with shell.
if(instance_exists(oCoreXShell)) {
x = oCoreXShell.x;
y = oCoreXShell.y;
}
1
603
7
0
0
-1
2
self
0
0
1
/// Shrink during pickup.
if(state == 6) {
if(statetime == 0) {
image_xscale = 1;
image_xscale = 1;
sa_image_index = round(random(2));
sa_image_alpha = 1 + fxtimer * 0.1;
sa_image_blend = make_color_rgb(50 + random(200), 255, 50 + random(200));
}
with (oCharacter) {
speedmultiplier = 0;
speedmultiresettimer = 10000;
sfx_stop(sndCoreXIdle);
alarm[0]=-1;
Mute_Loops();
}
x = oCharacter.x + relativeX;
y = (oCharacter.y-oCharacter.sprite_height/2) + relativeY;
relativeX = lerp(relativeX, 0, 0.1);
relativeY = lerp(relativeY, 0, 0.1);
if(image_xscale > 0) {
image_xscale -= 0.0225;
image_yscale -= 0.0225;
}
if(image_xscale <= 0) {
if(room == rm_a2a04) {
with(instance_create(oCharacter.x-8, oCharacter.y-8, scr_itemsopen(oControl.mod_jumpball))) {
visible = false;
active = 1;
}
}
else {
Unmute_Loops();
}
with (oCharacter) speedmultiresettimer = 0;
global.enablecontrol = 1;
with(instance_find(oFXTrail, instance_number(oFXTrail) - 1)) {
if(sprite_index == sScrewSpark) {
visible = true;
sprite_index = sScrewAttack;
image_index = other.screwattackpickupframe;
image_alpha = 1;
image_angle = other.screwattackpickupangle;
image_blend = c_white;
image_xscale = 1;
image_yscale = 1;
}
}
instance_destroy();
}
}
1
603
7
0
0
-1
2
self
0
0
1
/// Core-X idle.
if(!instance_exists(oCoreXShell)) {
if(state == 0) {
if(statetime == 0) flashing = 10000;
move_towards_point(roomcenter_x, roomcenter_y+roomoffsety, 1);
if(point_distance(x, y, roomcenter_x, roomcenter_y+roomoffsety) <= 1) {
speed = 0;
state = 1;
statetime = 0;
}
x += xx;
y += yy;
}
if(state == 1) {
if(statetime == 0) {
alarm[0] = 30;
}
if(statetime == 30) {
flashing = 0;
}
x += xx;
y += yy;
}
statetime += 1;
timer_x++;
if(timer_x > 2 * pi/frequency_x) timer_x -= 2 * pi/frequency_x;
timer_y++;
if(timer_y > 2 * pi/frequency_y) timer_y -= 2 * pi/frequency_y;
xx = sin(timer_x*frequency_x)*amplitude_x;
yy = sin(timer_y*frequency_y)*amplitude_y;
}
if (fxtimer < 10) {
fxtimer += 1;
} else fxtimer = 0;
if (flashing > 0) {
flashing -= 1;
}
timer_glow++;
if(timer_glow > 2 * pi/frequency_glow) timer_glow -= 2 * pi/frequency_glow;
glow = sin(timer_glow*frequency_glow)*amplitude_glow;
1
603
7
0
0
-1
2
self
0
0
1
/// Pickup event.
if(state == 1 && flashing == 0 && state != 6) {
if (distance_to_point(oCharacter.x, oCharacter.y-oCharacter.sprite_height/2) < 0.1) {
global.playerhealth += 500;
if (global.playerhealth > global.maxhealth) global.playerhealth = global.maxhealth;
global.missiles += 75;
if (global.missiles > global.maxmissiles) global.missiles = global.maxmissiles;
global.smissiles += 10;
if (global.smissiles > global.maxsmissiles) global.smissiles = global.maxsmissiles;
global.pbombs += 2;
if (global.pbombs > global.maxpbombs) global.pbombs = global.maxpbombs;
PlaySoundMono(sndAbsorbX);
with(instance_create(oCharacter.x,oCharacter.y-oCharacter.sprite_height/2,oAbsorbX)) core = true;
state = 6;
statetime = 0;
relativeX = x - oCharacter.x;
relativeY = y - (oCharacter.y-oCharacter.sprite_height/2);
screwattackpickupfx = oCharacter.fxtimer;
}
}
1
603
7
0
0
-1
2
self
0
0
1
/// Freeze Sarah during X pickup.
if(state == 6) {
global.enablecontrol = 0;
with (oCharacter) {
fxtimer = other.screwattackpickupfx;
speedmultiplier = 0;
speedmultiresettimer = 10000;
kLeft = 0;
kRight = 0;
kUp = 0;
kDown = 0;
kJump = 0;
kJumpPressed = 0;
kRun = 0;
kAim = 0;
kFire = 0;
kMissile = 0;
charge = 0;
Mute_Loops();
}
with(oFXTrail) {
if(sprite_index == sScrewSpark) visible = false;
}
}
1
603
7
0
0
-1
2
self
0
0
1
/// Draw event.
if(state == 6) {
with(oCharacter) {
if (global.screwattack == 1 && state == JUMPING && vjump == 0 && walljumping == 0 && (inwater == 0 || global.currentsuit >= 2)) {
draw_set_blend_mode(bm_add);
draw_sprite_ext(sScrewAttack, other.screwattackpickupframe, x, y - 15, 1, 1, other.screwattackpickupangle, c_white, 1);
draw_set_blend_mode(bm_normal);
}
}
}
if(!instance_exists(oCoreXShell)) {
if (flashing) {
draw_sprite_ext(sprite_index, -1, x, y, image_xscale, image_yscale, 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, image_yscale, image_angle, -1, 1 - fxtimer * 0.1);
draw_set_blend_mode(bm_normal);
} else draw_self();
if(!instance_exists(oCoreXShell) && (state == 0 || state == 1)) {
draw_sprite_ext(sCoreXAura, image_index, x, y, 1, 1, 0, c_white, drawaura);
drawaura = !drawaura;
}
}
else if (shell.state != 0) draw_self();
0
0
0
0.5
0.100000001490116
0
0.100000001490116
0.100000001490116
0.200000002980232
-1
0