<undefined> 0 -1 -1000000000 -1 <undefined> <undefined> 1 603 7 0 0 -1 2 self 0 0 1 ///Initialize for(var i = 6; i >= 0; i--) { state[i] = 0; } progress[0] = 0; cutscene = false; inikey = ""; 1 603 7 0 0 -1 2 self 0 0 1 ///Update characters' current dialog switch(state[0]) { case S_BRADINSIDE: if(instance_exists(Brad)) { dialog_import("BradInside", Brad); } break; case S_STARTEDSOLVING: if(instance_exists(Brad)) { dialog_import("StartedSolvingBrad", Brad); } break; case S_FINISHEDSOLVING: if(instance_exists(Brad)) { dialog_import("FinishedSolvingBrad", Brad); } break; } if(instance_exists(Spirit0)) { dialog_import("Spirit0." + string(state[1]), Spirit0); } if(instance_exists(Spirit1)) { dialog_import("Spirit1." + string(state[2]), Spirit1); } if(instance_exists(Spirit2)) { dialog_import("Spirit2." + string(state[3]), Spirit2); } if(instance_exists(Spirit3)) { dialog_import("Spirit3." + string(state[4]), Spirit3); } if(instance_exists(Spirit4)) { dialog_import("Spirit4." + string(state[5]), Spirit4); } if(instance_exists(Spirit5)) { dialog_import("Spirit5." + string(state[6]), Spirit5); } 1 603 7 0 0 -1 2 self 0 0 1 ///Do story events switch(state[0]) { case S_BEGIN: switch(progress[0]) { case 0: if(room == rHome) { if(Controller.shake == 0) { dialog_import("Wakeup"); dialog_from_array(0, 1); progress[0] = 1; cutscene = false; } else cutscene = true; } break; case 1: if(instance_exists(Player)) { if(room == rOutside && Player.vdist == 0) { dialog_import("Intro"); dialog_from_array(0); cutscene = true; progress[0] = 2; } } break; case 2: if(instance_exists(Brad)) { if(Brad.x == Player.x - 32) { dialog_from_array(1, 3); progress[0]++; } } break; case 4: if(Brad.hdist == 0 && Brad.vdist == 0) { Brad.vdist = -32; Player.facing = LEFT; progress[0] = 5; } break; case 5: if(Brad.vdist == 0) { with(Brad) instance_destroy(); dialog_from_array(9); progress[0] = 0; state[0] = S_BRADINSIDE; cutscene = false; } break; } break; case S_BRADINSIDE: if( StoryController.state[1] == 3 || StoryController.state[2] == 4 || StoryController.state[3] == 4 || StoryController.state[4] == 3 || StoryController.state[5] == 3 || StoryController.state[6] == 4 ) { state[0] = S_STARTEDSOLVING; } break; case S_STARTEDSOLVING: if( StoryController.state[1] == 3 && StoryController.state[2] == 4 && StoryController.state[3] == 4 && StoryController.state[4] == 3 && StoryController.state[5] == 3 && StoryController.state[6] == 4 ) { dialog_import("StartedSolving"); dialog_from_array(0); state[0] = S_FINISHEDSOLVING; } break; case S_FINISHEDSOLVING: dialog_import("FinishedSolving"); switch(progress[0]) { case 1: if(Player.hdist == 0) { Brad.vdist = 7 * 32; progress[0] = 2; } break; case 2: if(Brad.vdist == 0) { Brad.hdist = 4 * 32; progress[0] = 3; } break; case 3: if(Brad.hdist == 0) { Brad.vdist = 5 * 32; progress[0] = 4; } break; case 4: if(Brad.vdist == 0) { with(Brad) instance_destroy(); dialog_from_array(0); progress[0] = 5; cutscene = false; } break; case 5: if(room == rOutside) { cutscene = true; progress[0] = 6; } break; case 6: if(instance_exists(Player)) { if(Player.vdist == 0) { dialog_from_array(1); progress[0] = 7; } } break; case 9: if(instance_exists(Brad)) { if(Brad.x < 0 && Brad.hdist == 0) { with(instance_create(0, 0, TransitionController)) { rm = rEnd; door = noone; } } } break; } break; } switch(state[1]) { case 1: if(inv_has("Stuffed Cat") != -1) { state[1] = 2; } break; case 3: if(room == rOutside) { if(tile_get_left(tile_layer_find(1000000, 256, 256)) != 192) { tile_set_region(tile_layer_find(1000000, 256, 256), 192, 128, 64, 64); dialog_import("SpiritTree.alive", instance_position(256, 256, SpiritTree)); } } break; } switch(state[2]) { case 1: if(inv_has("Key 1") != -1 && inv_has("Key 2") != -1 && inv_has("Key 3") != -1 && inv_has("Key 4") != -1) { state[2] = 2; } break; case 3: if(instance_exists(Spirit1)) { if(Spirit1.vdist == 0) { with(Spirit1) dialog_from_array(0); inv_subtract(inv_has("Key 1"), 1); inv_subtract(inv_has("Key 2"), 1); inv_subtract(inv_has("Key 3"), 1); inv_subtract(inv_has("Key 4"), 1); state[2] = 4; cutscene = false; } } break; case 4: if(room == rOutside) { if(tile_get_left(tile_layer_find(1000000, 224, 384)) != 192) { tile_set_region(tile_layer_find(1000000, 224, 384), 192, 128, 64, 64); dialog_import("SpiritTree.alive", instance_position(224, 384, SpiritTree)); } } break; } switch(state[3]) { case 1: if(inv_has("Ladder") != -1) { state[3] = 2; } break; case 3: if(cutscene) { if(Player.x == 512) { Player.facing = DOWN; inv_subtract(inv_has("Ladder"), 1); instance_create(512, 512, Bridge); with(Spirit2) dialog_from_array(0); state[3] = 4; cutscene = false; } } break; case 4: if(room == rOutside) { if(tile_get_left(tile_layer_find(1000000, 352, 512)) != 192) { tile_set_region(tile_layer_find(1000000, 352, 512), 192, 128, 64, 64); dialog_import("SpiritTree.alive", instance_position(352, 512, SpiritTree)); } } else if(room == rWater) { if(!instance_exists(Bridge)) { instance_create(512, 512, Bridge); } } break; } switch(state[4]) { case 1: if(inv_has("Fish") != -1) { state[4] = 2; } break; case 3: if(room == rOutside) { if(tile_get_left(tile_layer_find(1000000, 544, 480)) != 192) { tile_set_region(tile_layer_find(1000000, 544, 480), 192, 128, 64, 64); dialog_import("SpiritTree.alive", instance_position(544, 480, SpiritTree)); } } break; } switch(state[5]) { case 1: if(inv_has("Flower") != -1) { state[5] = 2; } break; case 3: if(room == rOutside) { if(tile_get_left(tile_layer_find(1000000, 672, 416)) != 192) { tile_set_region(tile_layer_find(1000000, 672, 416), 192, 128, 64, 64); dialog_import("SpiritTree.alive", instance_position(672, 416, SpiritTree)); } } break; } switch(state[6]) { case 1: if(inv_has("Stick") != -1) { state[6] = 2; } break; case 3: with(Spirit5) dialog_from_array(0, 1); state[6] = 4; break; case 4: if(room == rOutside) { if(tile_get_left(tile_layer_find(1000000, 640, 288)) != 192) { tile_set_region(tile_layer_find(1000000, 640, 288), 192, 128, 64, 64); dialog_import("SpiritTree.alive", instance_position(640, 288, SpiritTree)); } } break; } 0 0 0 0.5 0.100000001490116 0 0.100000001490116 0.100000001490116 0.200000002980232 -1 0