Deltarune (Chapter 5) script viewer

← back to main script listing

gml_GlobalScript_scr_floweryvoiceclip

(view raw script w/o annotations or w/e)
1
function 
scr_floweryvoiceclip
scr_floweryvoiceclip

function
scr_floweryvoiceclip(arg0)
{ if (!variable_global_exists("flowery_txtsnd")) scr_floweryvoiceclip_init(); var flowerysnd = 534; var text_char = arg0; for (var i = 0; i < array_length(global.flowery_txtsnd); i++) { if (text_char != global.flowery_txtsnd[i][0]) continue; if (text_char == "h") { var chance = random(1); flowerysnd = (chance >= 0.5) ? 208 : 665; if (global.lang == "ja") flowerysnd = 193; break; } else { flowerysnd =
scr_84_get_sound(audio_get_name(global.flowery_txtsnd[i][1]));
if (global.lang == "ja") { if (room == room_dw_fcastle_cafe) { if (flowerysnd == 238) flowerysnd = 373; } else if (room == room_dw_garden_enemyrush) { if (i_ex(obj_dw_garden_enemyrush) && obj_dw_garden_enemyrush.cutscene == 8 && i_ex(obj_cutscene_master)) { if (flowerysnd == 642) flowerysnd = 190; } } else if (room == room_dw_fcastle_top_intro) { if (i_ex(obj_ch5_DW22) && i_ex(obj_cutscene_master)) { if (flowerysnd == 611) flowerysnd = 242; else if (flowerysnd == 698) flowerysnd = 670; } } } break; } } return flowerysnd; } function scr_floweryvoiceclip_init() { if (!variable_global_exists("flowery_txtsnd")) global.flowery_txtsnd = []; var _assets = [131, 111, 106, 110, 5, 244, 228, 187, 117, 757, 226, 717, 633, 205, 154, 44, 72, 750, 210, 54, 15, 250, 673, 77, 95, 49, 616, 183, 144, 197, 74, 678, 436, 702, 574, 53, 89, 204, 216, 704, 125, 151, 212, 208, 140, 627, 3, 622, 741, 739, 147, 142, 79, 743, 14, 696, 185, 653, 159, 628, 29]; var alphabet_upper = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]; var alphabet_lower = []; for (var i = 0; i < array_length(alphabet_upper); i++) alphabet_lower[array_length(alphabet_lower)] = string_lower(alphabet_upper[i]); var alphabet = alphabet_upper; for (var i = 0; i < array_length(alphabet_lower); i++) alphabet[array_length(alphabet)] = alphabet_lower[i]; var alphabet_index = 0; for (var i = 0; i < array_length(_assets); i++) { var text_char = string(i); if (i > 9) { text_char = alphabet[alphabet_index]; alphabet_index += 1; } var sound_asset = _assets[i]; global.flowery_txtsnd[i][0] = text_char; global.flowery_txtsnd[i][1] = sound_asset; } } function scr_set_floweryvoicemode(arg0) { if (global.typer != 88 && global.typer != 96 && global.typer != 86) exit; if (string_pos("\\V", arg0) != 0) { global.voiceclipmode = 0; if (global.flag[1391] == 1) global.voiceclipmode = 2; if (string_pos("\\v1", arg0) != 0) global.voiceclipmode = 1; } else if (string_pos("\\v1", arg0) != 0) { global.voiceclipmode = 1; } else { global.voiceclipmode = 2; } } ...
(arg0)
2
{
3
    if (!variable_global_exists("flowery_txtsnd"))
4
        scr_floweryvoiceclip_init();
5
    var flowerysnd = 534;
6
    var text_char = arg0;
7
    for (var i = 0; i < array_length(global.flowery_txtsnd); i++)
8
    {
9
        if (text_char != global.flowery_txtsnd[i][0])
10
            continue;
11
        if (text_char == "h")
12
        {
13
            var chance = random(1);
14
            flowerysnd = (chance >= 0.5) ? 208 : 665;
15
            if (global.lang == "ja")
16
                flowerysnd = 193;
17
            break;
18
        }
19
        else
20
        {
21
            flowerysnd = 
scr_84_get_sound
scr_84_get_sound

function
scr_84_get_sound(arg0)
{ return ds_map_find_value(global.chemg_sound_map, arg0); }
(audio_get_name(global.flowery_txtsnd[i][1]));
22
            if (global.lang == "ja")
23
            {
24
                if (room == room_dw_fcastle_cafe)
25
                {
26
                    if (flowerysnd == 238)
27
                        flowerysnd = 373;
28
                }
29
                else if (room == room_dw_garden_enemyrush)
30
                {
31
                    if (i_ex(obj_dw_garden_enemyrush) && obj_dw_garden_enemyrush.cutscene == 8 && i_ex(obj_cutscene_master))
32
                    {
33
                        if (flowerysnd == 642)
34
                            flowerysnd = 190;
35
                    }
36
                }
37
                else if (room == room_dw_fcastle_top_intro)
38
                {
39
                    if (i_ex(obj_ch5_DW22) && i_ex(obj_cutscene_master))
40
                    {
41
                        if (flowerysnd == 611)
42
                            flowerysnd = 242;
43
                        else if (flowerysnd == 698)
44
                            flowerysnd = 670;
45
                    }
46
                }
47
            }
48
            break;
49
        }
50
    }
51
    return flowerysnd;
52
}
53
54
function scr_floweryvoiceclip_init()
55
{
56
    if (!variable_global_exists("flowery_txtsnd"))
57
        global.flowery_txtsnd = [];
58
    var _assets = [131, 111, 106, 110, 5, 244, 228, 187, 117, 757, 226, 717, 633, 205, 154, 44, 72, 750, 210, 54, 15, 250, 673, 77, 95, 49, 616, 183, 144, 197, 74, 678, 436, 702, 574, 53, 89, 204, 216, 704, 125, 151, 212, 208, 140, 627, 3, 622, 741, 739, 147, 142, 79, 743, 14, 696, 185, 653, 159, 628, 29];
59
    var alphabet_upper = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
60
    var alphabet_lower = [];
61
    for (var i = 0; i < array_length(alphabet_upper); i++)
62
        alphabet_lower[array_length(alphabet_lower)] = string_lower(alphabet_upper[i]);
63
    var alphabet = alphabet_upper;
64
    for (var i = 0; i < array_length(alphabet_lower); i++)
65
        alphabet[array_length(alphabet)] = alphabet_lower[i];
66
    var alphabet_index = 0;
67
    for (var i = 0; i < array_length(_assets); i++)
68
    {
69
        var text_char = string(i);
70
        if (i > 9)
71
        {
72
            text_char = alphabet[alphabet_index];
73
            alphabet_index += 1;
74
        }
75
        var sound_asset = _assets[i];
76
        global.flowery_txtsnd[i][0] = text_char;
77
        global.flowery_txtsnd[i][1] = sound_asset;
78
    }
79
}
80
81
function scr_set_floweryvoicemode(arg0)
82
{
83
    if (global.typer != 88 && global.typer != 96 && global.typer != 86)
84
        exit;
85
    if (string_pos("\\V", arg0) != 0)
86
    {
87
        global.voiceclipmode = 0;
88
        if (global.flag[1391] == 1)
89
            global.voiceclipmode = 2;
90
        if (string_pos("\\v1", arg0) != 0)
91
            global.voiceclipmode = 1;
92
    }
93
    else if (string_pos("\\v1", arg0) != 0)
94
    {
95
        global.voiceclipmode = 1;
96
    }
97
    else
98
    {
99
        global.voiceclipmode = 2;
100
    }
101
}