0 {
  player_1.control_player();
  player_2.control_player();
  player_1.add_player_in_script( script, player_1_instance );
  player_2.add_player_in_script( script, player_2_instance );
  ray.add_player_in_script( script, ray_instance );

  god.do_action("flying-stork");
}

+1.3 player_1.do_action(move_right, 6.0);
+0.1 player_2.do_action(move_right, 6.2);

+0.4 gossip.speak("/Help!");

+1.8 {
  shared_camera.activate();
  shared_camera.remove_position_constraint_x();
  shared_camera.remove_position_constraint_y();
}

+0.2 player_2.do_action(jump, 0.1);

+1.0 {
  player_1.talk("/Hey!");
  player_2.talk("/Stop!");
}

+1.3 player_1.do_action(jump, 0.1);
+0.2 player_1.do_action(slap, 0.2);

+0.3 {
  /* Adjust the horizontal middle of god when changing the x-position here */
  ray_instance.set_center_of_mass( 5580, 836 );

  ray.do_action(injure, 0.5);
  god.do_action("disappearing-stork");
}

+0.1 {
  camera.focus_on(shared_camera);
  camera.activate();
  camera.add_item( god_2 );
  camera.add_item( ray_instance );

  god_2.do_action(appear);
}

+0.9 player_1.do_action(move_left, 0.1);
+0.1 player_2.do_action(move_left, 0.2);

+0.2 god_2.talk( "/You already!" );

+1 player_1.talk( "/Leave my son alone!" );
+2 {
  player_2.talk( "/Yeah! Leave him!" );
  rabbit.set_center_of_mass(5470, 646);
  rabbit.walk(1);
}

+1 {
  god_2.talk( "/You're not ready yet." );
  player_1_instance.save_current_position();
  player_2_instance.save_current_position();
}

+1.5 rabbit.walk(2);

+2 {
  god_2.start_model_action("create-ball");
  player_1.talk("/What the...?");
  player_2.talk("/What is this?");
}

+2.9 god_2.launch_ball(1.0, 0.4);

+0.2 rabbit.apply_jump();

+0.1 {
  boss.start_model_action("godify-1");
  boss.set_center_on( rabbit );
  rabbit.set_center_of_mass(0, 0);
  boss.add_position_constraint_y();

  boss.godify(1.5, 50);
  god_2.talk("/Damn! Take cover!");
}

+2.0 {
  boss.remove_position_constraint_y();
}

+0.5 {
  boss.start_model_action("godify-2");
  boss.godify(1, 100);
  boss.show_energy(10);
  player_1.talk("/What did you do?");
}

+1.0 {
  boss.start_model_action("godify-3");
  boss.godify(1, 150);
}

+1.0 {
  boss.start_model_action("godify-4");
  boss.godify(9, 400);
  god_2.talk("/Give him your carrots!");

  player_1_instance.add_corrupting_item
    (90, 0.5, "animation/forest/boss/corruption.canim");
  player_2_instance.add_corrupting_item
    (90, 0.5, "animation/forest/boss/corruption.canim");
  
  player_1_instance.disable_all_actions();
  player_2_instance.disable_all_actions();
  
  player_1_instance.authorize_action( "throw_stone" );
  player_2_instance.authorize_action( "throw_stone" );

  player_1.release_player();
  player_2.release_player();
}

+2.0 {
  god_2.do_action("disappear");
  god.do_action("kidnap");

  /* The horizontal middle of Ray */
  god.set_horizontal_middle(5580);
  ray.talk("/Help!");

  camera.add_item(boss);
  camera.add_item( god );
  camera.remove_item( god_2 );
  camera.remove_item( ray_instance );
}

+0.5 ray.do_action("disappear", 1);

+6.5 {
  camera.remove_item( god );

  player_1.control_player();
  player_2.control_player();

  player_1_instance.remove_corrupting_item();
  player_2_instance.remove_corrupting_item();

  player_1.do_action(roar, 0.5);
  player_2.do_action(roar, 0.4);

  boss.start_model_action("idle");
  boss.jump_to(5400);
}

+1 {
  player_1_instance.authorize_all_actions();
  player_2_instance.authorize_all_actions();
  player_1.release_player();
  player_2.release_player();
  script.end();
}
