#SEQUENCE "start";
# lvar("island_old", avar("island_num"));
# seq_jump("island");

#SEQUENCE "island";
# avar("island_num", if(leq(rand(0,2), 1), rand(2, 4.99), rand(6, 9.99)));
  var func = nop;
  func = if(eq(str_to_num(num_to_str(avar("island_num"))), str_to_num(num_to_str(lvar("island_old")))), seq_jump, nop);
  func("island");
# avar("island_goal", 
    add("island_0", 
	    num_to_str(
		   avar("island_num")
		   )
		   )
		   );
  //var func = nop;
  //func = if(eq(avar("testing"), 0), avar, nop);
  //func("island_goal", "island_06");
  //func("island_num", 6);
  //avar("testing", 1);
  //message_box(avar("island_goal"));
  avar("eyeclops_dead", add(avar("eyeclops_dead"), 1));
# seq_jump("select_boss");

#SEQUENCE "select_boss";
# var func = nop;
  func = if(eq(avar("eyeclops_dead"), 4), seq_jump, nop);
  func("phemus_spawn");
# var func = nop;
  func = if(eq(avar("brontes"), 1), seq_jump, nop);
  func("brontes_dead");
# var func = nop;
  func = if(eq(avar("arges"), 1), seq_jump, nop);
  func("arges_dead");
# var func = nop;
  func = if(eq(avar("steropes"), 1), seq_jump, nop);
  func("steropes_dead");
# var boss_vec = {"brontes", "arges", "steropes"};
  var name_vec = {"Brontes the Thunderer", "Arges the Brightener", "Steropes the Flasher"};
  var red_vec = {0, 0.5, 0};
  var green_vec = {0.5, 0, 0};
  var blue_vec = {0, 0, 1.0};
  var r = rand(0,2.99);
  avar("eyeclops_goal", boss_vec[r]);
  avar("eyeclops_goal_name", name_vec[r]);
  avar("eyeclops_red_color", red_vec[r]);
  avar("eyeclops_green_color", green_vec[r]);
  avar("eyeclops_blue_color", blue_vec[r]);
  script_load(add("island/seagull_0", num_to_str(lvar("island_old"))));
# kill_this();
# seq_jump("wait");

#SEQUENCE "brontes_dead";
# var func = nop;
  func = if(eq(avar("arges"), 1), seq_jump, nop);
  func("brontes_arges_dead");
  func = if(eq(avar("steropes"), 1), seq_jump, nop);
  func("brontes_steropes_dead");
# var boss_vec = {"arges", "steropes"};
  var name_vec = {"Arges the Brightener", "Steropes the Flasher"};
  var red_vec = {0.5, 0};
  var green_vec = {0, 0};
  var blue_vec = {0, 1.0};
  var r = rand(0,1.99);
  avar("eyeclops_goal", boss_vec[r]);
  avar("eyeclops_goal_name", name_vec[r]);
  avar("eyeclops_red_color", red_vec[r]);
  avar("eyeclops_green_color", green_vec[r]);
  avar("eyeclops_blue_color", blue_vec[r]);
  script_load("island/seagull");
  script_load(add("island/seagull_0", num_to_str(lvar("island_old"))));
# kill_this();
# seq_jump("wait");

#SEQUENCE "arges_dead";
# var func = nop;
  func = if(eq(avar("steropes"), 1), seq_jump, nop);
  func("arges_steropes_dead");
# var boss_vec = {"brontes", "steropes"};
  var name_vec = {"Brontes the Thunderer", "Steropes the Flasher"};
  var red_vec = {0, 0};
  var green_vec = {0.5, 0};
  var blue_vec = {0, 1.0};
  var r = rand(0,1.99);
  avar("eyeclops_goal", boss_vec[r]);
  avar("eyeclops_goal_name", name_vec[r]);
  avar("eyeclops_red_color", red_vec[r]);
  avar("eyeclops_green_color", green_vec[r]);
  avar("eyeclops_blue_color", blue_vec[r]);
  script_load("island/seagull");
  script_load(add("island/seagull_0", num_to_str(lvar("island_old"))));
# kill_this();
# seq_jump("wait");

#SEQUENCE "steropes_dead";
# var boss_vec = {"brontes", "arges"};
  var name_vec = {"Brontes the Thunderer", "Arges the Brightener"};
  var red_vec = {0, 0.5};
  var green_vec = {0.5, 0};
  var blue_vec = {0, 0};
  var r = rand(0,1.99);
  avar("eyeclops_goal", boss_vec[r]);
  avar("eyeclops_goal_name", name_vec[r]);
  avar("eyeclops_red_color", red_vec[r]);
  avar("eyeclops_green_color", green_vec[r]);
  avar("eyeclops_blue_color", blue_vec[r]);
  script_load("island/seagull");
  script_load(add("island/seagull_0", num_to_str(lvar("island_old"))));
# kill_this();
# seq_jump("wait");

#SEQUENCE "brontes_steropes_dead";
# avar("eyeclops_goal", "arges");
  avar("eyeclops_goal_name", "Arges the Brightener");
  avar("eyeclops_red_color", 0.5);
  avar("eyeclops_green_color", 0);
  avar("eyeclops_blue_color", 0);
  script_load("island/seagull");
  script_load(add("island/seagull_0", num_to_str(lvar("island_old"))));
# kill_this();
# seq_jump("wait");

#SEQUENCE "brontes_arges_dead";
# avar("eyeclops_goal", "steropes");
  avar("eyeclops_goal_name", "Steropes the Flasher");
  avar("eyeclops_red_color", 0);
  avar("eyeclops_green_color", 0);
  avar("eyeclops_blue_color", 1.0);
  script_load("island/seagull");
  script_load(add("island/seagull_0", num_to_str(lvar("island_old"))));
# kill_this();
# seq_jump("wait");

#SEQUENCE "arges_steropes_dead";
# avar("eyeclops_goal", "brontes");
  avar("eyeclops_goal_name", "Brontes the Thunderer");
  avar("eyeclops_red_color", 0);
  avar("eyeclops_green_color", 0.5);
  avar("eyeclops_blue_color", 0);
  script_load("island/seagull");
  script_load(add("island/seagull_0", num_to_str(lvar("island_old"))));
# kill_this();
# seq_jump("wait");

#SEQUENCE "phemus_spawn";
# avar("eyeclops_goal", "phemus");
  avar("eyeclops_goal_name", "Phemus, King of the Eye-clopes");
  avar("eyeclops_red_color", 1.0);
  avar("eyeclops_green_color", 0);
  avar("eyeclops_blue_color", 1.0);
  script_load("island/seagull");
  avar("island_goal", "island_05");
  script_load(add("island/seagull_0", num_to_str(lvar("island_old"))));
# kill_this();
# seq_jump("wait");

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