sElderSeptogg 0 -1 90 0 oMovingSolid <undefined> 1 603 7 0 0 -1 2 other 0 0 1 /// Initialize. // Modifiable variables. max_down_speed = 1; // The max speed it will fall when Sarah is standing on top. max_up_speed = 2; // The max speed it will rise back to its original position. // Internal variables. material = 2; viscidTop = 1; makeActive(); image_index = choose(1, 2, 3); frequency = 0.1; amplitude = 2; timer = irandom(100); parent = irandom(3); grounded = 0; lift = 0; yy = sin(timer*frequency)*amplitude; alarm[1] = 1; 1 603 7 0 0 -1 2 self 0 0 1 /// Set Septogg sprite based on area. switch (real(string_char_at(room_get_name(room), 5))) { case 1: flying_sprite = sElderSeptogg_tlRock1AN; carrying_sprite = sElderSeptogg_tlRock1AN_Carry; material = 1; break; case 2: flying_sprite = sElderSeptogg_tlRock2NB; carrying_sprite = sElderSeptogg_tlRock2NB_Carry; material = 1; break; case 3: var room_let = string(string_char_at(room_get_name(room), 6)) if(room_let == "b") { flying_sprite = sElderSeptogg_tlArea3Breed; carrying_sprite = sElderSeptogg_tlArea3Breed_Carry; material = 5; } else { flying_sprite = sElderSeptogg_tlRock3A; carrying_sprite = sElderSeptogg_tlRock3A_Carry; material = 1; } break; case 4: var room_let = string(string_char_at(room_get_name(room), 6)) if(room_let == "b") { flying_sprite = sElderSeptogg_tlRock4B; carrying_sprite = sElderSeptogg_tlRock4B_Carry; material = 1; } else { flying_sprite = sElderSeptogg_tlRock4A; carrying_sprite = sElderSeptogg_tlRock4A_Carry; material = 1; } break; case 5: flying_sprite = sElderSeptogg_tlRock5A; carrying_sprite = sElderSeptogg_tlRock5A_Carry; material = 1; break; case 6: flying_sprite = sElderSeptogg_tlRock6A; carrying_sprite = sElderSeptogg_tlRock6A_Carry; material = 1; break; default: var room_num = real(string(string_char_at(room_get_name(room), 7) + string_char_at(room_get_name(room), 8))) if(room_num >= 16 and room_num <= 23) { flying_sprite = sElderSeptogg_tlGreenCrystals; carrying_sprite = sElderSeptogg_tlGreenCrystals_Carry; material = 1; } else if((room_num >= 24 and room_num <= 28) or room_num == 11) { flying_sprite = sElderSeptogg_tlRock3A; carrying_sprite = sElderSeptogg_tlRock3A_Carry; material = 1; } else if(room_num >= 5 and room_num <= 15) { flying_sprite = sElderSeptogg_tlRock1AN; carrying_sprite = sElderSeptogg_tlRock1AN_Carry; material = 1; } else if(room_num >= 29) { flying_sprite = sElderSeptogg_tlRock4A; carrying_sprite = sElderSeptogg_tlRock4A_Carry; material = 1; } else { switch (global.timeofday) { case 1: flying_sprite = sElderSeptoggTwilight; carrying_sprite = sElderSeptoggTwilight_Carry; break; case 2: flying_sprite = sElderSeptoggNight; carrying_sprite = sElderSeptoggNight_Carry; break; default: flying_sprite = sElderSeptogg; carrying_sprite = sElderSeptogg_Carry; } material = 2; } } sprite_index = flying_sprite; 1 603 7 0 0 -1 2 self 0 0 1 /// Create baby Septoggs if parent. if(/*(room == rm_a0h01 && global.timeofday != 2) ||*/ room == rm_a0h05) exit; repeat(parent) { var inst = instance_create(x, y, oBabySeptogg); with (inst) { parent = other.id; event_user(0); } } 1 603 7 0 0 -1 2 self 0 0 1 /// Push down from force of jump. if(oCharacter.state == oCharacter.JUMPING) yVel = 6; 1 603 7 0 0 -1 2 self 0 0 1 /// Septogg physics. timer++; if(timer > 2 * pi/frequency) timer -= 2 * pi/frequency; if(y<oCharacter.y-1) { x = -500; depth = 90 } else { x = xstart; depth = -90 } if(place_meeting(x, y - 1, oCharacter) and (oCharacter.state != oCharacter.JUMPING)) { if(!place_meeting(x, y + 1, oSolid)) { if(lift<=0) { yVel += 0.1; if(yVel>max_down_speed) yVel=max_down_speed; image_speed = 0.55; grounded = 0; } else{ yVel -= 0.1; if(yVel<-max_down_speed) yVel=-max_down_speed; image_speed = 0.55; grounded = 0; if(y<=ystart-lift) yVel = 0; } } else { yVel = 0; image_speed = 0.2; grounded = 1; } timer = 0; sprite_index = carrying_sprite; } else { if (y>ystart) { yVel = -min(abs(y - ystart)/15, max_up_speed); timer = 0; grounded = 0; } if (y<ystart) { yVel = min(abs(y - ystart)/15, max_up_speed); timer = 0; grounded = 0; } if(abs(y-ystart)<=1) y = ystart; if(y<-20) y=-20; sprite_index = flying_sprite; image_speed = 0.33; } 1 603 7 0 0 -1 2 self 0 0 1 /// Weapon fizzle. var collider = collision_rectangle(xstart-8, y, xstart+8, y+24, oBeam, false, false); if(instance_exists(collider)) { with(collider) { event_user(1); if (!pbeam) instance_destroy(); } } collider = collision_rectangle(xstart-8, y, xstart+8, y+24, oMissile, false, true); if(instance_exists(collider)) { with(collider) { event_user(1); } } 1 603 7 0 0 -1 2 self 0 0 1 /// Destory the dust animation when jumping onto a Septogg. if(instance_exists(oFXAnimSpark)) { if(oFXAnimSpark.sprite_index == sSmoke1) { with(oFXAnimSpark) { instance_destroy(); } } } if(oCharacter.state != oCharacter.JUMPING) alarm[0] = 2; 1 603 7 0 0 -1 2 self 0 0 1 /// Disable moving platform physics. global.movingobj = 0; 1 603 7 0 0 -1 2 self 0 0 1 /// Activate moving platform physics. global.movingobj = 1; 1 603 7 0 0 -1 2 self 0 0 1 /// Draw the Septogg. yy = sin(timer*frequency)*amplitude; if(lift>0) draw_sprite_ext(sElderSeptoggBackWings, image_index, xstart, y + yy + 4, 1, 1, 0, c_gray, 1); draw_sprite(sprite_index, image_index, xstart, y + yy); // Debug /* draw_set_alpha(1); draw_text(xstart, y + yy, string(x) + ", " + string(y)); 0 0 0 0.5 0.100000001490116 0 0.100000001490116 0.100000001490116 0.200000002980232 -1 0