touhou-pride-jam-2021/thpj3/objects/obj_dialogue/Step_0.gml

87 lines
2.9 KiB
Plaintext
Raw Normal View History

2021-06-03 21:01:32 -07:00
if (dialogue_mode) {
if (text_advance_ready == TEXT_LOADING && !ds_queue_empty(name_test) && !ds_queue_empty(name_test) && !ds_queue_empty(active_test) && !ds_queue_empty(emote_test)) {
text_advance_ready = TEXT_TYPING;
2021-06-03 21:01:32 -07:00
actor_left = ds_queue_dequeue(name_test);
actor_left_emote = ds_queue_dequeue(emote_test);
2021-06-13 02:20:47 -07:00
switch ( actor_left_emote ) {
case 0:
actor_left_sprite = asset_get_index( "spr_" + string_lower(actor_left) + "_0_neutral" );
break;
case 1:
actor_left_sprite = asset_get_index( "spr_" + string_lower(actor_left) + "_1_happy" );
break;
case 2:
actor_left_sprite = asset_get_index( "spr_" + string_lower(actor_left) + "_2_sad" );
break;
case 3:
actor_left_sprite = asset_get_index( "spr_" + string_lower(actor_left) + "_3_confused" );
break;
case 4:
actor_left_sprite = asset_get_index( "spr_" + string_lower(actor_left) + "_4_angry" );
break;
case 5:
actor_left_sprite = asset_get_index( "spr_" + string_lower(actor_left) + "_5_sad" );
break;
default:
actor_left_sprite = -1;
break;
}
2021-06-03 21:01:32 -07:00
actor_right = "";
if (!ds_queue_empty(name_test) && !ds_queue_empty(emote_test)) {
2021-06-03 21:01:32 -07:00
actor_right = ds_queue_dequeue(name_test);
actor_right_emote = ds_queue_dequeue(emote_test);
2021-06-13 02:20:47 -07:00
switch ( actor_right_emote ) {
case 0:
actor_right_sprite = asset_get_index( "spr_" + string_lower(actor_right) + "_0_neutral" );
break;
case 1:
actor_right_sprite = asset_get_index( "spr_" + string_lower(actor_right) + "_1_happy" );
break;
case 2:
actor_right_sprite = asset_get_index( "spr_" + string_lower(actor_right) + "_2_sad" );
break;
case 3:
actor_right_sprite = asset_get_index( "spr_" + string_lower(actor_right) + "_3_confused" );
break;
case 4:
actor_right_sprite = asset_get_index( "spr_" + string_lower(actor_right) + "_4_angry" );
break;
case 5:
actor_right_sprite = asset_get_index( "spr_" + string_lower(actor_right) + "_5_sad" );
break;
default:
actor_right_sprite = -1;
break;
}
2021-06-03 21:01:32 -07:00
}
2021-06-13 02:20:47 -07:00
textload = ds_queue_dequeue(text_test);
texttarget = string_replace_all(textload, "#", "\n" );
2021-06-03 21:01:32 -07:00
textspew = "";
spewlength = 1;
last_active = ds_queue_dequeue(active_test);
}
if (text_advance_ready == TEXT_TYPING ) {
2021-06-03 21:01:32 -07:00
textspew += string_char_at(texttarget, spewlength);
audio_play_sound( snd_typewriter, 0, false );
2021-06-03 21:01:32 -07:00
spewlength++;
if (keyboard_check_pressed( ord("Z") ) ) {
textspew = texttarget;
keyboard_clear(ord("Z"));
}
if (textspew == texttarget) {
text_advance_ready = TEXT_READY;
2021-06-03 21:01:32 -07:00
}
}
if (text_advance_ready == TEXT_READY) {
2021-06-03 21:01:32 -07:00
if (keyboard_check_pressed( ord("Z") ) ) {
text_advance_ready = TEXT_LOADING;
if (ds_queue_empty(name_test) || ds_queue_empty(text_test) || ds_queue_empty(active_test) || ds_queue_empty(emote_test)) {
2021-06-03 21:01:32 -07:00
dialogue_mode = false;
}
}
}
}