2023-06-03 01:02:35 -07:00
|
|
|
tutorial_fadeout--;
|
|
|
|
actor_A_anim_frame += TALK_ANIM_SPEED;
|
|
|
|
actor_B_anim_frame += TALK_ANIM_SPEED;
|
|
|
|
actor_C_anim_frame += TALK_ANIM_SPEED;
|
|
|
|
|
|
|
|
|
|
|
|
if (global.dialogue_mode) {
|
|
|
|
|
|
|
|
if ( keyboard_check_pressed(ord("C")) ) {
|
|
|
|
if (text_auto_mode == AUTO_ON) {
|
|
|
|
text_auto_mode = AUTO_OFF;
|
|
|
|
} else {
|
|
|
|
text_auto_mode = AUTO_ON;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (text_advance_ready == TEXT_LOADING //&& all ds_queues contain a value
|
|
|
|
&& !ds_queue_empty(bg_test)
|
|
|
|
&& !ds_queue_empty(mus_test)
|
|
|
|
&& !ds_queue_empty(sound_test)
|
|
|
|
&& !ds_queue_empty(display_test)
|
|
|
|
&& !ds_queue_empty(sprite_test)
|
|
|
|
&& !ds_queue_empty(pos_test)
|
|
|
|
&& !ds_queue_empty(speaker_test)
|
|
|
|
&& !ds_queue_empty(text_test)
|
|
|
|
) {
|
|
|
|
text_advance_ready = TEXT_TYPING;
|
|
|
|
|
2023-06-06 23:53:55 -07:00
|
|
|
//bg files
|
2023-06-03 01:02:35 -07:00
|
|
|
bg_id_last = bg_id;
|
|
|
|
bg_id = ds_queue_dequeue(bg_test);
|
|
|
|
switch ( bg_id ) {
|
|
|
|
case BG_NONE: {
|
|
|
|
bg_sprite = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case BG_TEST: {
|
|
|
|
bg_sprite = spr_bg_PLACEHOLDER;
|
|
|
|
break;
|
|
|
|
}
|
2023-06-14 21:53:10 -07:00
|
|
|
case BG_CHIREIDEN: {
|
|
|
|
bg_sprite = spr_bg_chireiden;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case BG_MORIYA_SHRINE: {
|
2023-06-14 21:53:10 -07:00
|
|
|
bg_sprite = spr_bg_moriya;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
2023-06-14 21:53:10 -07:00
|
|
|
case BG_THERAPY_OFFICE: {
|
|
|
|
bg_sprite = spr_bg_therapy;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2023-06-03 01:02:35 -07:00
|
|
|
default: {
|
|
|
|
bg_sprite = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-06 23:53:55 -07:00
|
|
|
//music files
|
2023-06-03 01:02:35 -07:00
|
|
|
mus_id_last = mus_id;
|
|
|
|
mus_id = ds_queue_dequeue(mus_test);
|
|
|
|
if ( mus_id_last != mus_id ) {
|
|
|
|
if ( audio_is_playing(mus_playing) ) {
|
|
|
|
audio_stop_sound(mus_playing);
|
|
|
|
}
|
|
|
|
switch ( mus_id ) {
|
|
|
|
case MUS_NONE: {
|
|
|
|
mus_playing = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case MUS_TEST: {
|
|
|
|
mus_playing = mus_PLACEHOLDER;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
mus_playing = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( audio_exists(mus_playing) ) {
|
|
|
|
audio_play_sound( mus_playing, 0, true );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-06 23:53:55 -07:00
|
|
|
|
|
|
|
//sound effects
|
2023-06-03 01:02:35 -07:00
|
|
|
sound_id = ds_queue_dequeue(sound_test);
|
|
|
|
switch ( sound_id ) {
|
|
|
|
case SOUND_NONE: {
|
|
|
|
sound_playing = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SOUND_TEST: {
|
|
|
|
sound_playing = snd_PLACEHOLDER;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
sound_playing = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( audio_exists(sound_playing) ) {
|
|
|
|
audio_play_sound( sound_playing, 1, false );
|
|
|
|
}
|
|
|
|
|
2023-06-06 23:53:55 -07:00
|
|
|
//display modes
|
2023-06-03 01:02:35 -07:00
|
|
|
display_mode = ds_queue_dequeue(display_test);
|
2023-06-08 23:55:41 -07:00
|
|
|
if ( display_mode == DISPLAY_NOTEXT && text_auto_mode == AUTO_OFF ) { //no text
|
2023-06-03 01:02:35 -07:00
|
|
|
text_auto_mode = AUTO_NEXT;
|
|
|
|
}
|
|
|
|
|
2023-06-06 23:53:55 -07:00
|
|
|
|
|
|
|
//portrait sprites
|
2023-06-03 01:02:35 -07:00
|
|
|
actor_A_pos = ds_queue_dequeue(pos_test);
|
|
|
|
actor_A_sprite_id_last = actor_A_sprite_id;
|
|
|
|
actor_A_sprite_id = ds_queue_dequeue(sprite_test);
|
|
|
|
if ( actor_A_sprite_id_last != actor_A_sprite_id ) {
|
|
|
|
actor_A_anim_frame = 0;
|
|
|
|
}
|
|
|
|
switch (actor_A_sprite_id) {
|
|
|
|
case TALK_NOSPRITE: {
|
|
|
|
actor_A_sprite = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_TEST: {
|
|
|
|
actor_A_sprite = spr_talk_PLACEHOLDER;
|
|
|
|
break;
|
|
|
|
}
|
2023-06-06 23:53:55 -07:00
|
|
|
case TALK_KOISHI: {
|
|
|
|
actor_A_sprite = spr_talk_koishi;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_SATORI: {
|
2023-06-14 21:53:10 -07:00
|
|
|
actor_A_sprite = spr_talk_satori;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
2023-06-14 21:53:10 -07:00
|
|
|
case TALK_SANAE: {
|
|
|
|
actor_A_sprite = spr_talk_sanae;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_RIN: {
|
2023-06-14 21:53:10 -07:00
|
|
|
actor_A_sprite = spr_talk_rin;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_UTSUHO: {
|
2023-06-14 21:53:10 -07:00
|
|
|
actor_A_sprite = spr_talk_utsuho;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_KANOKO: {
|
2023-06-14 21:53:10 -07:00
|
|
|
actor_A_sprite = spr_talk_kanoko;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_SUWAKO: {
|
2023-06-14 21:53:10 -07:00
|
|
|
actor_A_sprite = spr_talk_suwako;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2023-06-03 01:02:35 -07:00
|
|
|
default: {
|
|
|
|
actor_A_sprite = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
actor_B_pos = ds_queue_dequeue(pos_test);
|
|
|
|
actor_B_sprite_id_last = actor_B_sprite_id;
|
|
|
|
actor_B_sprite_id = ds_queue_dequeue(sprite_test);
|
|
|
|
if ( actor_B_sprite_id_last != actor_B_sprite_id) {
|
|
|
|
actor_B_anim_frame = 0;
|
|
|
|
}
|
|
|
|
switch (actor_B_sprite_id) {
|
|
|
|
case TALK_NOSPRITE: {
|
|
|
|
actor_B_sprite = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_TEST: {
|
|
|
|
actor_B_sprite = spr_talk_PLACEHOLDER;
|
|
|
|
break;
|
|
|
|
}
|
2023-06-06 23:53:55 -07:00
|
|
|
case TALK_KOISHI: {
|
|
|
|
actor_B_sprite = spr_talk_koishi;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_SATORI: {
|
2023-06-14 21:53:10 -07:00
|
|
|
actor_B_sprite = spr_talk_satori;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
2023-06-14 21:53:10 -07:00
|
|
|
case TALK_SANAE: {
|
|
|
|
actor_B_sprite = spr_talk_sanae;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_RIN: {
|
2023-06-14 21:53:10 -07:00
|
|
|
actor_B_sprite = spr_talk_rin;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_UTSUHO: {
|
2023-06-14 21:53:10 -07:00
|
|
|
actor_B_sprite = spr_talk_utsuho;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_KANOKO: {
|
2023-06-14 21:53:10 -07:00
|
|
|
actor_B_sprite = spr_talk_kanoko;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_SUWAKO: {
|
2023-06-14 21:53:10 -07:00
|
|
|
actor_B_sprite = spr_talk_suwako;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2023-06-03 01:02:35 -07:00
|
|
|
default: {
|
|
|
|
actor_B_sprite = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
actor_C_pos = ds_queue_dequeue(pos_test);
|
|
|
|
actor_C_sprite_id_last = actor_C_sprite_id;
|
|
|
|
actor_C_sprite_id = ds_queue_dequeue(sprite_test);
|
|
|
|
if ( actor_C_sprite_id_last != actor_C_sprite_id ) {
|
|
|
|
actor_C_anim_frame = 0;
|
|
|
|
}
|
|
|
|
switch (actor_C_sprite_id) {
|
|
|
|
case TALK_NOSPRITE: {
|
|
|
|
actor_C_sprite = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_TEST: {
|
|
|
|
actor_C_sprite = spr_talk_PLACEHOLDER;
|
|
|
|
break;
|
|
|
|
}
|
2023-06-06 23:53:55 -07:00
|
|
|
case TALK_KOISHI: {
|
|
|
|
actor_C_sprite = spr_talk_koishi;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_SATORI: {
|
2023-06-14 21:53:10 -07:00
|
|
|
actor_C_sprite = spr_talk_satori;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
2023-06-14 21:53:10 -07:00
|
|
|
case TALK_SANAE: {
|
|
|
|
actor_C_sprite = spr_talk_sanae;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_RIN: {
|
2023-06-14 21:53:10 -07:00
|
|
|
actor_C_sprite = spr_talk_rin;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_UTSUHO: {
|
2023-06-14 21:53:10 -07:00
|
|
|
actor_C_sprite = spr_talk_utsuho;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_KANOKO: {
|
2023-06-14 21:53:10 -07:00
|
|
|
actor_C_sprite = spr_talk_kanoko;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TALK_SUWAKO: {
|
2023-06-14 21:53:10 -07:00
|
|
|
actor_C_sprite = spr_talk_suwako;
|
2023-06-06 23:53:55 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2023-06-03 01:02:35 -07:00
|
|
|
default: {
|
|
|
|
actor_C_sprite = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-06 23:53:55 -07:00
|
|
|
//speaker name
|
2023-06-03 01:02:35 -07:00
|
|
|
speaker_name = ds_queue_dequeue(speaker_test);
|
|
|
|
|
2023-06-06 23:53:55 -07:00
|
|
|
//spoken text
|
2023-06-03 01:02:35 -07:00
|
|
|
textload = ds_queue_dequeue(text_test);
|
|
|
|
texttarget = string_replace_all(textload, "#", "\n" );
|
|
|
|
|
2023-06-08 23:55:41 -07:00
|
|
|
//add text to log
|
|
|
|
if (global.log_text[0] != 0 && global.log_names[0] != 0) {
|
|
|
|
for( var r = LOG_LIMIT - 1; r >= 0; r--) {
|
|
|
|
global.log_text[r+1] = global.log_text[r];
|
|
|
|
global.log_names[r+1] = global.log_names[r];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.log_text[0] = texttarget;
|
|
|
|
global.log_names[0] = speaker_name;
|
|
|
|
|
2023-06-03 01:02:35 -07:00
|
|
|
textspew = "";
|
2023-06-14 21:53:10 -07:00
|
|
|
textlines = [ "", "", "", "", "", "", "", "" ];
|
2023-06-03 01:02:35 -07:00
|
|
|
textlinecount = 1;
|
|
|
|
spewlength = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (text_advance_ready == TEXT_TYPING ) {
|
|
|
|
if ( display_mode == DISPLAY_NOTEXT ) {
|
|
|
|
text_advance_ready = TEXT_READY;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( display_mode == DISPLAY_NARRATOR ) {
|
|
|
|
for( var i = 1; i <= string_length(texttarget); i++ ) {
|
|
|
|
textlines[textlinecount] += string_char_at(texttarget, spewlength);
|
|
|
|
if (string_char_at(texttarget, spewlength) == "\n") {
|
|
|
|
textlinecount++;
|
|
|
|
}
|
|
|
|
spewlength++;
|
|
|
|
}
|
|
|
|
textlinefadein++;
|
2023-06-06 23:53:55 -07:00
|
|
|
if (keyboard_check_pressed(ord("Z")) || keyboard_check(vk_control) || text_loader_skip > 0) {
|
2023-06-03 01:02:35 -07:00
|
|
|
textlinefadein = 1000;
|
|
|
|
keyboard_clear(ord("Z"));
|
|
|
|
keyboard_clear(vk_control);
|
|
|
|
}
|
|
|
|
if ( textlinefadein >= 60 + (90 * textlinecount) ) {
|
|
|
|
text_advance_ready = TEXT_READY;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( display_mode == DISPLAY_ADV ) {
|
|
|
|
textspew += string_char_at(texttarget, spewlength);
|
|
|
|
audio_play_sound( snd_typewriter, 0, false );
|
|
|
|
spewlength++;
|
2023-06-06 23:53:55 -07:00
|
|
|
if (keyboard_check_pressed(ord("Z")) || keyboard_check(vk_control) || text_loader_skip > 0) {
|
2023-06-03 01:02:35 -07:00
|
|
|
textspew = texttarget;
|
|
|
|
keyboard_clear(ord("Z"));
|
|
|
|
keyboard_clear(vk_control);
|
|
|
|
}
|
|
|
|
if (textspew == texttarget) {
|
|
|
|
text_advance_ready = TEXT_READY;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (text_advance_ready == TEXT_READY) {
|
|
|
|
text_auto_timer--;
|
2023-06-06 23:53:55 -07:00
|
|
|
if ( keyboard_check_pressed(ord("Z")) || keyboard_check(vk_control) || text_loader_skip > 0 || (text_auto_timer <= 0 && (text_auto_mode == AUTO_NEXT || text_auto_mode == AUTO_ON)) ) {
|
2023-06-03 01:02:35 -07:00
|
|
|
if (text_auto_mode == AUTO_NEXT ) {
|
|
|
|
text_auto_mode = AUTO_OFF;
|
|
|
|
}
|
2023-06-06 23:53:55 -07:00
|
|
|
if (text_loader_skip > 0) {
|
|
|
|
text_loader_skip--;
|
|
|
|
} else {
|
|
|
|
global.loaded_file[? SAVE_LINENUM]++;
|
|
|
|
}
|
2023-06-03 01:02:35 -07:00
|
|
|
text_auto_timer = AUTO_SPEED;
|
|
|
|
textlinefadein = 0;
|
|
|
|
text_advance_ready = TEXT_LOADING;
|
|
|
|
if ( ds_queue_empty(bg_test)
|
|
|
|
&& ds_queue_empty(mus_test)
|
|
|
|
&& ds_queue_empty(sound_test)
|
|
|
|
&& ds_queue_empty(display_test)
|
|
|
|
&& ds_queue_empty(sprite_test)
|
|
|
|
&& ds_queue_empty(pos_test)
|
|
|
|
&& ds_queue_empty(speaker_test)
|
|
|
|
&& ds_queue_empty(text_test)
|
|
|
|
) {
|
|
|
|
global.dialogue_mode = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|