sErisBody1
0
-1
0
0
<undefined>
<undefined>
1
603
7
0
0
-1
2
self
0
0
1
init = 0;
flashing = 0;
boosting = 0;
spr_normal = sErisBody1;
spr_frozen = sErisBody1F;
spr_open = sErisBody1D;
shaking = 0;
tail = 0;
canbeX = 1;
//hp = 10;
hp = global.mod_serrisHbody;
//damage = 50;
damage = global.mod_serrisDamage;
// ice check
if ((global.item[11] == 0) && (!tail))
{
state = 2;
} else {
state = 0;
}
statetime = 0;
inrange = 0;
1
603
7
0
0
-1
2
self
0
0
1
/// Health drops
// If Fusion, run regular pickup spawn routines.
if(oControl.mod_fusion) {
timer = 0;
rotspeed = 0;
myspeed = 0;
offset = 0;
moveratio = 0;
movesteps = 0;
spawn_rnd_pickup(100);
} else { // Otherwise, run Monster pickup spawn routines.
monster_spawn_powerups(x, y, irandom(4), irandom(3));
}
1
603
7
0
0
-1
2
self
0
0
1
/// Death routine
make_explosion3(x, y);
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);
}
}
sfx_play(sndMissileExpl);
instance_destroy();
1
603
7
0
0
-1
2
self
0
0
1
/// Boost calls
// Check for speedboost...
if (oErisHead.boosting) {
// Afterimages
if ((oErisHead.fxtimer == 2) || (oErisHead.fxtimer == 5)) {
var aft = instance_create(x, y, oFXTrail);
aft.sprite_index = sprite_index;
aft.depth = (depth + 5);
aft.fadespeed = 0.08;
aft.image_angle = image_angle;
aft.image_xscale = image_xscale;
aft.image_yscale = image_yscale;
aft.additive = 1;
}
repeat (irandom(2)) { // May need to come back and optimize for Android, bubbles hurt system performance
// Bubbles!
bubble = instance_create(x+irandom_range(-5,5), y+irandom_range(-5,5), oLBubble);
if (instance_exists(bubble)) { // Seems a bit redundant, I know, but safety third kiddos.
bubble.direction = point_direction(x, y, xprevious, yprevious) + irandom_range(-35, 35);
bubble.alarm[0] = 10 + irandom_range(0, 20);
bubble.speed = 2;
bubble.eris = 1;
}
}
}
1
603
7
0
0
-1
2
self
0
0
1
/// MOVEMENT
// If not tail...
if ((!tail) && (state != 100)) {
// Grab following segment
var nextSeg = oErisHead.segment[order-1];
// Init code to space segments, probably will scrap
if (init == 0) {
nextSeg.x = x + lengthdir_x(sprite_width-2, image_angle-180);
nextSeg.y = y + lengthdir_y(sprite_width-2, image_angle-180);
init = 1;
}
// Point following segment at self
nextSeg.image_angle = point_direction(nextSeg.x, nextSeg.y, x, y);
// Move previous segment towards self
nextSeg.x = lerp(nextSeg.x, x + lengthdir_x(nextSeg.sprite_width-(76/clamp(oErisHead.speed, 1, 16)), image_angle-180), clamp((oErisHead.speed-1)*0.065, 0, 1));
nextSeg.y = lerp(nextSeg.y, y + lengthdir_y(nextSeg.sprite_width-(76/clamp(oErisHead.speed, 1, 16)), image_angle-180), clamp((oErisHead.speed-1)*0.065, 0, 1));
}
// If first neck segment, snap to head
if ((order == 14) && (state != 100)) {
image_angle = point_direction(x, y, oErisHead.x, oErisHead.y);
}
/// GRAB PARENT VARS
if (state != 100) {
boosting = oErisHead.boosting;
}
/// STATE MACHINE
inrange = (x > 32) && (x < 608) && (y > 48) && (y < 448);
if (!tail) {
if (state == 0) { // Awaiting freeze
sprite_index = spr_normal;
} else if (state == 1) { // Frozen
sprite_index = spr_frozen;
if (statetime >= 600) { // Melt, but ready to refreeze quickly
state = 0;
statetime = 0;
hp = 2;
}
} else if (state == 2) { // Vulnerable
sprite_index = spr_open;
}
}
if (state == 100) { // Death
if (statetime < 30) {
speed *= 0.85;
} else if (vspeed > -0.2) vspeed -= 0.01;
}
if ((state == 1 ) || (state == 100)) {
statetime += 1;
}
// Shaking
if (shaking > 0) {
xoff = random_range(-4, 4);
yoff = random_range(-4, 4);
shaking -= 1;
} else {
xoff = 0;
yoff = 0;
}
// Flashing
if (flashing > 0) {
flashing -= 1;
}
//if (oErisHead.boostphase == 1 || oErisHead.boostphase == 3 || oErisHead.boostphase == 5) {
if (boosting) {
if (flashing <= 1) {
flashing = 10;
}
}
1
603
7
0
0
-1
2
self
0
0
1
/// Effects on missile, explosion does actual damage
if ((inrange) && (!oErisHead.boosting) && (!flashing) && (!tail)) {
with (other) {
event_user(0); // Run explosion
}
} else if (!tail) {
with (other) {
event_user(1); // Bounce
}
}
1
603
7
0
0
-1
2
self
0
0
1
/// Take Beam damage
if ((inrange) && (!flashing) && (!oErisHead.boosting) && (!tail)) { // Safety check
if ((state == 0) || (state == 1)) { // Shell up
if (other.ibeam) { // Freeze
if (!other.pbeam) { // Buff non-plasma damage
hp -= 4;
} else {
hp -= 2; // Nerf plasma damage
}
if (other.chargebeam) {
hp = 0; // Instantly freeze if other is charge beam
}
with (other) {
event_user(0); // Do thing to the beam
}
event_user(0); // Take damage, freeze self if necessary
} else with (other) {
event_user(1); // Bounce hits if not ice
}
if (!other.pbeam) {
with (other) {
instance_destroy(); // Destroy hits if not Plasma
}
}
} else if (state == 2) { // Second phase damage
with (other) { // Beam handling
event_user(0);
if (!pbeam) instance_destroy();
}
event_user(3); // Take damage
}
} else if (!tail) {
with (other) { // If flashing, boosting, OOB, or tail ignore hits
if (pbeam) {
event_user(1);
} else {
event_user(0);
instance_destroy();
}
}
}
1
603
7
0
0
-1
2
self
0
0
1
/// Take Missile damage
if ((inrange) && (!oErisHead.boosting) && (!tail)) { // Safety check
if (state == 1) { // If frozen, shatter
event_user(1);
} else if ((state == 2) && (!flashing) && (other.erisDmg == 1)) { // Else if open, take damage
if (other.smissile) { // Damage mod for Supers
event_user(4);
} else {
event_user(3);
}
with (other) { // Fix for double hits
erisDmg = 0;
}
}
}
1
603
7
0
0
-1
2
self
0
0
1
/// Take PB damage
if ((inrange) && (!oErisHead.boosting) && (!tail)) { // Safety check
if (state == 1) { // If frozen, shatter
event_user(1);
} else if ((state == 2) && (!flashing)) { // Else if open, take damage
event_user(2);
}
}
1
603
7
0
0
-1
2
self
0
0
1
/// Take Bomb damage
if ((inrange) && (!oErisHead.boosting) && (!tail)) { // Safety check
if (state == 1) { // If frozen, shatter
event_user(1);
} else if ((state == 2) && (!flashing)) { // Else if open, take damage
event_user(2);
}
}
1
603
7
0
0
-1
2
self
0
0
1
/// Damage Sarah
//if (inrange) { // Safety check?
if (state != 100) damage_player(damage, 7, -3, 0, 0);
//}
1
603
7
0
0
-1
2
self
0
0
1
/// Call from head to destroy routine
// Randomize drift
direction = image_angle + irandom_range(-20, 20);
speed = 4;
// Prepare to explode
alarm[1] = 200 + irandom(60);
// Destroy state
state = 100;
statetime = 0;
1
603
7
0
0
-1
2
self
0
0
1
/// Bubbles!
repeat (4 + floor(random(4))) {
var bubble = instance_create(x, y, oLBubble);
if (instance_exists(bubble)) {
bubble.hspeed = random_range(-1, 1);
bubble.vspeed = -random(0.4);
}
}
1
603
7
0
0
-1
2
self
0
0
1
/// Super Missile damage
if (state != 100) {
if (instance_exists(oErisHead)) {
with (oErisHead) {
hp -= 4;
stun = 3;
event_user(2);
}
}
event_user(5); // Bubbles!
shaking = 8;
}
1
603
7
0
0
-1
2
self
0
0
1
/// Missile/Beam damage
if (state != 100) {
if (instance_exists(oErisHead)) {
with (oErisHead) {
hp -= 2;
stun = 2;
event_user(2);
}
}
event_user(5); // Bubbles!
shaking = 8;
}
1
603
7
0
0
-1
2
self
0
0
1
/// Bomb/PB damage
if (state != 100) {
if (instance_exists(oErisHead)) {
with (oErisHead) {
hp -= 1;
stun = 1;
event_user(2);
}
}
event_user(5); // Bubbles!
shaking = 8;
}
1
603
7
0
0
-1
2
self
0
0
1
/// Ice shatter
if (state != 100) {
flashing = 10;
shaking = 8;
state = 2;
statetime = 0;
if (instance_exists(oErisHead)) {
with (oErisHead) {
stun = 2;
}
}
PlaySoundMono(sndIceShatter); // Sound
/// Particles
repeat (8) {
var deb = instance_create(x, y - 8, oIceShard);
}
repeat (8 + irandom(4)) {
var bubble = instance_create(x, y, oLBubble);
if (instance_exists(bubble)) {
bubble.hspeed = random_range(-2.5, 2.5);
bubble.vspeed = -random(0.4);
}
}
if (global.waterlevel != 0 && y + 8 > global.waterlevel + global.wateroffset) {
repeat (8 + irandom(4)) {
var bubble = instance_create(x, y, oLBubble);
if (instance_exists(bubble)) {
bubble.hspeed = random_range(-1.5, 1.5);
bubble.vspeed = -random(0.4);
}
}
}
}
1
603
7
0
0
-1
2
self
0
0
1
/// First phase damage
if (state != 100) {
flashing = 10;
if (hp <= 0) {
hp = 0;
state = 1;
statetime = 0;
sfx_stop(sndFreezeHit);
sfx_play(sndFreezeHit);
} else sfx_play(sndIceBeamHit);
}
1
603
7
0
0
-1
2
self
0
0
1
draw_self();
// Flashing, ice melt flash
if ((flashing > 0) || ((state == 1) && (statetime > 240))) {
draw_set_blend_mode(bm_add);
repeat (2) {
draw_sprite_ext(sprite_index, -1, x, y, image_xscale, image_yscale, image_angle, -1, flashing * 0.1);
}
draw_set_blend_mode(bm_normal);
}
// Speedboosting Draw
if (oErisHead.boosting) {
draw_set_blend_mode(bm_add);
if (oErisHead.fxtimer == 0 || oErisHead.fxtimer == 1) {
draw_sprite_ext(sprite_index, -1, x, y, image_xscale, image_yscale, image_angle, c_green, 1.1 + oErisHead.fxtimer * 0.2);
}
if (oErisHead.fxtimer == 2 || oErisHead.fxtimer == 3) {
repeat (2) {
draw_sprite_ext(sprite_index, -1, x, y, image_xscale, image_yscale, image_angle, c_yellow, 1);
draw_sprite_ext(sprite_index, -1, x, y, image_xscale, image_yscale, image_angle, c_white, 1);
}
}
if (oErisHead.fxtimer == 4 || oErisHead.fxtimer == 5) {
repeat (2) {
draw_sprite_ext(sprite_index, -1, x, y, image_xscale, image_yscale, image_angle, c_red, 1);
}
}
draw_set_blend_mode(bm_normal);
}
/* debug
draw_self();
draw_text(x, y+16, string(order));
0
0
0
0.5
0.100000001490116
0
0.100000001490116
0.100000001490116
0.200000002980232
-1
0