| 1 |
if (global.dialogue_open == false) |
| 2 |
{ |
| 3 |
if (instance_exists(obj_pl)) |
| 4 |
obj_pl.alarm[0] = 1; |
| 5 |
instance_destroy(); |
| 6 |
} |
| 7 |
var MSG_ADVANCE = false; |
| 8 |
var message_length = string_length(message[message_current]); |
| 9 |
if (message_reset == true) |
| 10 |
{ |
| 11 |
message_reset = false; |
| 12 |
message = 0; |
| 13 |
event_perform(ev_create, 0); |
| 14 |
exit; |
| 15 |
} |
| 16 |
if (chujin_tapes_effects) |
| 17 |
{ |
| 18 |
if (irandom(80) == 1) |
| 19 |
{ |
| 20 |
shaky_text = true; |
| 21 |
obj_mansion_chujin_tapes.static_flicker = true; |
| 22 |
obj_mansion_chujin_tapes.overlay_alpha += 0.2; |
| 23 |
alarm[0] = irandom_range(15, 45); |
| 24 |
} |
| 25 |
} |
| 26 |
if (keyboard_multicheck_pressed(1) && skippable == true) |
| 27 |
cutoff = message_length; |
| 28 |
if (cutoff < message_length) |
| 29 |
{ |
| 30 |
if (counter == 0) |
| 31 |
{ |
| 32 |
cutoff += 1; |
| 33 |
message_length = string_length(message[message_current]); |
| 34 |
if (cutoff < message_length && (cutoff % 1) == 0) |
| 35 |
{ |
| 36 |
switch (string_char_at(message[message_current], cutoff)) |
| 37 |
{ |
| 38 |
case " ": |
| 39 |
case ".": |
| 40 |
break; |
| 41 |
default: |
| 42 |
audio_stop_sound(sndfnt); |
| 43 |
audio_play_sound(sndfnt, 1, false); |
| 44 |
break; |
| 45 |
} |
| 46 |
} |
| 47 |
} |
| 48 |
} |
| 49 |
else if (keyboard_multicheck_pressed(0) && skippable == true) |
| 50 |
{ |
| 51 |
if (choice == false) |
| 52 |
MSG_ADVANCE = true; |
| 53 |
} |
| 54 |
if (cutoff > message_length) |
| 55 |
cutoff = message_length; |
| 56 |
if (message_timer > -1 && cutoff == message_length) |
| 57 |
{ |
| 58 |
if (mT == -1) |
| 59 |
mT = message_timer; |
| 60 |
if (mT > 0) |
| 61 |
{ |
| 62 |
mT -= 1; |
| 63 |
} |
| 64 |
else if (mT == 0) |
| 65 |
{ |
| 66 |
mT = -1; |
| 67 |
MSG_ADVANCE = true; |
| 68 |
} |
| 69 |
} |
| 70 |
script_execute(scr_text_counter_overworld); |
| 71 |
script_execute(scr_text_choices); |
| 72 |
if (MSG_ADVANCE) |
| 73 |
{ |
| 74 |
if ((message_current + 1) < array_length_1d(message)) |
| 75 |
{ |
| 76 |
message_current += 1; |
| 77 |
cutoff = 0; |
| 78 |
} |
| 79 |
else |
| 80 |
{ |
| 81 |
global.dialogue_open = false; |
| 82 |
} |
| 83 |
} |
| 84 |
if (instance_exists(obj_mansion_chujin_tapes)) |
| 85 |
{ |
| 86 |
if ((array_length(prt) - 1) >= message_current) |
| 87 |
{ |
| 88 |
if (prt[message_current] != 0 && !obj_mansion_chujin_tapes.scene_change) |
| 89 |
obj_mansion_chujin_tapes.sprite_index = prt[message_current]; |
| 90 |
} |
| 91 |
} |