#SEQUENCE "select_boss";
# char_kill("patches");
  explosion_make( 37, 46, 3, .10, 0, 0, 0, "", "dust_01");
  sound_play("pop_1.wav", 37, 46, 1);
# wait ( 1 );
# avar("waiting", 0);
  avar("boss_dead", add(avar("boss_dead"), 1));
# var func = nop;
  func = if(eq(avar("boss_dead"), 4), seq_jump, nop);
  func("patches");
# var func = nop;
  func = if(eq(avar("phemus"), 1), seq_jump, nop);
  func("phemus_dead");
# var func = nop;
  func = if(eq(avar("kenki"), 1), seq_jump, nop);
  func("kenki_dead");
# var func = nop;
  func = if(eq(avar("whipstone"), 1), seq_jump, nop);
  func("whipstone_dead");
# var boss_vec = {"phemus", "kenki", "whipstone"};
  var r = rand(0,2.99);
  avar("total_spawn", 1);
  char_clone(add(boss_vec[r], "_b"), 36, 16);
# kill_this();
# seq_jump("wait");

#SEQUENCE "phemus_dead";
# var func = nop;
  func = if(eq(avar("kenki"), 1), seq_jump, nop);
  func("phemus_kenki_dead");
  func = if(eq(avar("whipstone"), 1), seq_jump, nop);
  func("phemus_whipstone_dead");
# var boss_vec = {"kenki", "whipstone"};
  var r = rand(0,1.99);
  avar("total_spawn", 1);
  char_clone(add(boss_vec[r], "_b"), 36, 16);
# kill_this();
# seq_jump("wait");

#SEQUENCE "kenki_dead";
# var func = nop;
  func = if(eq(avar("whipstone"), 1), seq_jump, nop);
  func("kenki_whipstone_dead");
# var boss_vec = {"phemus", "whipstone"};
  var r = rand(0,1.99);
  avar("total_spawn", 1);
  char_clone(add(boss_vec[r], "_b"), 36, 16);
# kill_this();
# seq_jump("wait");

#SEQUENCE "whipstone_dead";
# var boss_vec = {"phemus", "kenki"};
  var r = rand(0,1.99);
  avar("total_spawn", 1);
  char_clone(add(boss_vec[r], "_b"), 36, 16);
# kill_this();
# seq_jump("wait");

#SEQUENCE "phemus_whipstone_dead";
# char_clone("kenki_b", 36, 16);
  avar("total_spawn", 1);
# kill_this();
# seq_jump("wait");

#SEQUENCE "phemus_kenki_dead";
# char_clone("whipstone_b", 36, 16);
  avar("total_spawn", 1);
# kill_this();
# seq_jump("wait");

#SEQUENCE "kenki_whipstone_dead";
# char_clone("phemus_b", 36, 16);
  avar("total_spawn", 1);
# kill_this();
# seq_jump("wait");

#SEQUENCE "patches";
# wait ( 1 );
# obs_kill("wall");
  sound_play("ambient/lightout.wav", 34, 1, 1);
# kill_this();
# seq_jump("wait");

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