#SEQUENCE "stop";
# wait(.15);
# char_activate("player", 0);
  char_kill("hand_lvl_01");
  char_kill("hand_lvl_02");
  char_kill("hand_lvl_03");
 
  char_kill("arms_lvl_01");
  char_kill("arms_lvl_02");
  char_kill("arms_lvl_03");

  char_kill("steropes");

  indicator_kill( "seagull", 0.01);

  script_load("island/seagull");

  light_color("sun", .35, .35, .235);
# var func = nop;
  func = if(eq(avar("island_goal"), "island_09"), seq_jump, nop);
  func("boss");
# seq_jump(if(gvar("gfx_world_particles"), "particles", "spawn_01"));

#SEQUENCE "particles";
# var func = nop;
  func = if(geq(lvar("count"), 30), seq_jump, nop);
  func("spawn_01");
# particle_make( "mist_02", rand(0,150), rand(0,150), rand(9,24), rand(0.1,0.5), rand(-.1,.3), 0, 0 );
  particle_make( "mist_02", rand(0,150), rand(0,150), rand(9,24), rand(0.1,0.5), rand(-.1,.3), 0, 0 );
  particle_make( "mist_02", rand(0,150), rand(0,150), rand(9,24), rand(0.1,0.5), rand(-.1,.3), 0, 0 );
  particle_make( "mist_02", rand(0,150), rand(0,150), rand(9,24), rand(0.1,0.5), rand(-.1,.3), 0, 0 );
  particle_make( "mist_02", rand(0,150), rand(0,150), rand(9,24), rand(0.1,0.5), rand(-.1,.3), 0, 0 );
  particle_make( "mist_02", rand(0,150), rand(0,150), rand(9,24), rand(0.1,0.5), rand(-.1,.3), 0, 0 );
  particle_make( "mist_02", rand(0,150), rand(0,150), rand(9,24), rand(0.1,0.5), rand(-.1,.3), 0, 0 );
  particle_make( "mist_02", rand(0,150), rand(0,150), rand(9,24), rand(0.1,0.5), rand(-.1,.3), 0, 0 );
  particle_make( "mist_02", rand(0,150), rand(0,150), rand(9,24), rand(0.1,0.5), rand(-.1,.3), 0, 0 );
  particle_make( "mist_02", rand(0,150), rand(0,150), rand(9,24), rand(0.1,0.5), rand(-.1,.3), 0, 0 );
  lvar("count", add(lvar("count"), 10));
# wait( .0001 );

#SEQUENCE "boss";
# wait( .15 );
# char_kill(avar("eyeclops_goal"));
# char_make(add("bosses/", avar("eyeclops_goal")), rand(50, 100), rand(50, 100));
  script_kill("island/seagull");
  floating_text_make( "Objectives Updated:", 60, 400, 2, 0, 0, 1, 18, colorRGB(0.0, 1.0, 0.0), 5.0, .5, .5, 0 );
  floating_text_make( add("Kill ", avar("eyeclops_goal_name"),"."), 60, 425, 2, 0, 0, 1, 18, colorRGB(0.0, 1.0, 0.0), 5.0, .5, .5, 0 );
  light_color("sun", avar("eyeclops_red_color"), avar("eyeclops_green_color"), avar("eyeclops_blue_color"));
  avar("island_free", 0);
# seq_jump(if(gvar("gfx_world_particles"), "particles", "spawn_01"));

#SEQUENCE "spawn_01";
# char_make("monsters/hand_lvl_01", rand(500, 550), rand(500, 550), "hand_lvl_01", 1 );
  char_make("monsters/hand_lvl_02", rand(500, 550), rand(500, 550), "hand_lvl_02", 1 );
  char_make("monsters/hand_lvl_03", rand(500, 550), rand(500, 550), "hand_lvl_03", 1 );
  
  char_make("monsters/arms_lvl_01", rand(500, 550), rand(500, 550), "arms_lvl_01", 1 );
  char_make("monsters/arms_lvl_02", rand(500, 550), rand(500, 550), "arms_lvl_02", 1 );
  char_make("monsters/arms_lvl_03", rand(500, 550), rand(500, 550), "arms_lvl_03", 1 );

  char_make("bosses/steropes", rand(500, 550), rand(500, 550), "steropes", 1 );

  script_load("island/seagull_09");

# char_clone("hand_lvl_01", 87, 118);
  char_clone("hand_lvl_02", 69, 94);
  char_clone("hand_lvl_03", 48, 59);

# seq_jump("x_01");

#SEQUENCE "x_01";
# lvar("x", "x_01");
  lvar("y", "y_01");
# var func = nop;
  func = if(eq(lvar("calc"), 0), seq_jump, nop);
  func("calc_vars");
# char_clone("arms_lvl_01", lvar("x_01"), lvar("y_01"));
# char_clone("arms_lvl_01", add(-2, lvar("x_01")), add(2, lvar("y_01")));
# char_clone("arms_lvl_01", add(-1, lvar("x_01")), add(2, lvar("y_01")));
# char_clone("arms_lvl_01", add(-2, lvar("x_01")), add(1, lvar("y_01")));
# char_clone("arms_lvl_02", add(1, lvar("x_01")),  add(-1, lvar("y_01")));
# lvar("calc", 0);
# seq_jump("x_02");

#SEQUENCE "x_02";
# lvar("x", "x_02");
  lvar("y", "y_02");
# var func = nop;
  func = if(eq(lvar("calc"), 0), seq_jump, nop);
  func("calc_vars");
# char_clone("arms_lvl_01", lvar("x_02"), lvar("y_02"));
# char_clone("arms_lvl_01", add(-2, lvar("x_02")), add(2, lvar("y_02")));
# char_clone("arms_lvl_01", add(-1, lvar("x_02")), add(2, lvar("y_02")));
# char_clone("arms_lvl_01", add(-2, lvar("x_02")), add(1, lvar("y_02")));
# char_clone("arms_lvl_02", add(1, lvar("x_02")),  add(-1, lvar("y_02")));
# lvar("calc", 0);
# seq_jump("x_03");

#SEQUENCE "x_03";
# lvar("x", "x_03");
  lvar("y", "y_03");
# var func = nop;
  func = if(eq(lvar("calc"), 0), seq_jump, nop);
  func("calc_vars");
# char_clone("arms_lvl_03", lvar("x_03"), lvar("y_03"));
# char_clone("arms_lvl_01", add(-2, lvar("x_03")), add(1, lvar("y_03")));
# char_clone("arms_lvl_02", add(1, lvar("x_03")),  add(-1, lvar("y_03")));
# lvar("calc", 0);
# seq_jump("x_04");

#SEQUENCE "x_04";
# lvar("x", "x_04");
  lvar("y", "y_04");
# var func = nop;
  func = if(eq(lvar("calc"), 0), seq_jump, nop);
  func("calc_vars");
# char_clone("arms_lvl_03", lvar("x_04"), lvar("y_04"));
# char_clone("arms_lvl_01", add(-2, lvar("x_04")), add(2, lvar("y_04")));
# char_clone("arms_lvl_01", add(-1, lvar("x_04")), add(2, lvar("y_04")));
# char_clone("arms_lvl_01", add(-2, lvar("x_04")), add(1, lvar("y_04")));
# char_clone("arms_lvl_01", add(2, lvar("x_04")), add(-1, lvar("y_04")));
# char_clone("arms_lvl_02", add(1, lvar("x_04")),  add(-1, lvar("y_04")));
# char_clone("arms_lvl_02", add(-1, lvar("x_04")),  add(1, lvar("y_04")));
# lvar("calc", 0);
# seq_jump("kill");

#SEQUENCE "calc_vars";
# lvar("temp_x", rand(20,130));
  lvar("temp_y", rand(20,130));
# var dx = sub( lvar("x_04"), lvar("temp_x") );
  var dy = sub( lvar("y_04"), lvar("temp_y") );
  var dist = add( mult(dx,dx), mult(dy,dy) );
  var func = nop;
  func = if( less( dist, 1600 ), seq_jump, nop );
  func( "calc_vars" );
# var dx = sub( lvar("x_01"), lvar("temp_x") );
  var dy = sub( lvar("y_01"), lvar("temp_y") );
  var dist = add( mult(dx,dx), mult(dy,dy) );
  var func = nop;
  func = if( less( dist, 1600 ), seq_jump, nop );
  func( "calc_vars" );
# var dx = sub( lvar("x_02"), lvar("temp_x") );
  var dy = sub( lvar("y_02"), lvar("temp_y") );
  var dist = add( mult(dx,dx), mult(dy,dy) );
  var func = nop;
  func = if( less( dist, 1600 ), seq_jump, nop );
  func( "calc_vars" );
# var dx = sub( lvar("x_03"), lvar("temp_x") );
  var dy = sub( lvar("y_03"), lvar("temp_y") );
  var dist = add( mult(dx,dx), mult(dy,dy) );
  var func = nop;
  func = if( less( dist, 1600 ), seq_jump, nop );
  func( "calc_vars" );
# seq_jump("set_vars");
# wait(.01);

#SEQUENCE "set_vars";
# lvar(lvar("x"), lvar("temp_x"));
  lvar(lvar("y"), lvar("temp_y"));
  lvar("calc", 1);
# seq_jump(lvar("x"));

#SEQUENCE "kill";
# wait(1);
# char_activate("player", 1);
  floating_text_make( "Cutthroat Cape", 10, 20, 2, 0, 0, 1, 24, colorRGB(1.0, 1.0, 1.0), 5.0, .5, .5, 0 );
  floating_text_make( "Island Northwest", 10, 50, 2, 0, 0, 1, 16, colorRGB(1.0, 1.0, 1.0), 5.0, .5, .5, 0 );
  screenFX_fade( "fade_black", .5, 0 );
  avar("loading", 0);
# kill_this();
# seq_jump("wait");

#SEQUENCE "wait";
# wait( 10000 );
