Undertale script viewer

← back to main script listing

gml_Object_obj_base_writer_Alarm_0

(view raw script w/o annotations or w/e)
1
if (stringpos >= string_length(originalstring))
2
    exit;
3
var advance = 1;
4
if (global.typer == 111)
5
    advance += 1;
6
if (txtsound == 56)
7
    advance += 2;
8
else if (txtsound == 65)
9
    advance += 1;
10
var dosound = 0;
11
var delay = textspeed;
12
while (stringpos < string_length(originalstring) && advance > 0)
13
{
14
    stringpos++;
15
    var ch = string_char_at(originalstring, stringpos);
16
    if (ch == "^")
17
    {
18
        stringpos++;
19
        ch = string_char_at(originalstring, stringpos);
20
        if (ch != "0")
21
        {
22
            var n = real(ch);
23
            delay = n * 10;
24
            advance = 1;
25
        }
26
    }
27
    else if (ch == "\")
28
    {
29
        stringpos++;
30
        ch = string_char_at(originalstring, stringpos);
31
        if (ch == "S")
32
        {
33
            stringpos++;
34
            var sfxtype = string_char_at(originalstring, stringpos);
35
            if (sfxtype == "+")
36
            {
37
                sound_enable = 1;
38
            }
39
            else if (sfxtype == "-")
40
            {
41
                sound_enable = 0;
42
            }
43
            else
44
            {
45
                var sfx = -4;
46
                if (sfxtype == "p")
47
                    sfx = 105;
48
                if (sfx != -4)
49
                    snd_play(sfx);
50
            }
51
        }
52
        else if (ch == "z")
53
        {
54
            stringpos++;
55
            advance--;
56
            if (sound_enable)
57
                dosound = 1;
58
        }
59
        else if (ch == "E" || ch == "F" || ch == "M" || ch == "T" || ch == "*")
60
        {
61
            stringpos++;
62
        }
63
    }
64
    else if (ch != "/" && ch != "%" && ch != "&")
65
    {
66
        advance--;
67
        if (sound_enable)
68
            dosound = 1;
69
    }
70
}
71
alarm[0] = delay;
gml_Object_obj_base_writer_Alarm_0.gml

if (stringpos >= string_length(originalstring)) exit; var advance = 1; if (global.typer == 111) advance += 1; if (txtsound == 56) advance += 2; else if (txtsound == 65) advance += 1; var dosound = 0; var delay = textspeed; while (stringpos < string_length(originalstring) && advance > 0) { stringpos++; var ch = string_char_at(originalstring, stringpos); if (ch == "^") { stringpos++; ch = string_char_at(originalstring, stringpos); if (ch != "0") { var n = real(ch); delay = n * 10; advance = 1; } } else if (ch == "\") { stringpos++; ch = string_char_at(originalstring, stringpos); if (ch == "S") { stringpos++; var sfxtype = string_char_at(originalstring, stringpos); if (sfxtype == "+") { sound_enable = 1; } else if (sfxtype == "-") { sound_enable = 0; } else { var sfx = -4; if (sfxtype == "p") sfx = 105; if (sfx != -4) snd_play(sfx); } } else if (ch == "z") { stringpos++; advance--; if (sound_enable) dosound = 1; } else if (ch == "E" || ch == "F" || ch == "M" || ch == "T" || ch == "*") { stringpos++; } } else if (ch != "/" && ch != "%" && ch != "&") { advance--; if (sound_enable) dosound = 1; } } alarm[0] = delay; if (dosound) { if (txtsound == 56) { snd_stop(snd_mtt1); snd_stop(snd_mtt2); snd_stop(snd_mtt3); snd_stop(snd_mtt4); snd_stop(snd_mtt5); snd_stop(snd_mtt6); snd_stop(snd_mtt7); snd_stop(snd_mtt8); snd_stop(snd_mtt9); var rnsound = floor(random(9)); switch (rnsound) { case 0: snd_play(snd_mtt1); break; case 1: snd_play(snd_mtt2); break; case 2: snd_play(snd_mtt3); break; case 3: snd_play(snd_mtt4); break; case 4: snd_play(snd_mtt5); ...
72
if (dosound)
73
{
74
    if (txtsound == 56)
75
    {
76
        snd_stop(snd_mtt1);
77
        snd_stop(snd_mtt2);
78
        snd_stop(snd_mtt3);
79
        snd_stop(snd_mtt4);
80
        snd_stop(snd_mtt5);
81
        snd_stop(snd_mtt6);
82
        snd_stop(snd_mtt7);
83
        snd_stop(snd_mtt8);
84
        snd_stop(snd_mtt9);
85
        var rnsound = floor(random(9));
86
        switch (rnsound)
87
        {
88
            case 0:
89
                snd_play(snd_mtt1);
90
                break;
91
            case 1:
92
                snd_play(snd_mtt2);
93
                break;
94
            case 2:
95
                snd_play(snd_mtt3);
96
                break;
97
            case 3:
98
                snd_play(snd_mtt4);
99
                break;
100
            case 4:
101
                snd_play(snd_mtt5);
102
                break;
103
            case 5:
104
                snd_play(snd_mtt6);
105
                break;
106
            case 6:
107
                snd_play(snd_mtt7);
108
                break;
109
            case 7:
110
                snd_play(snd_mtt8);
111
                break;
112
            case 8:
113
                snd_play(snd_mtt9);
114
                break;
115
        }
116
    }
117
    else if (txtsound == 71)
118
    {
119
        snd_stop(snd_wngdng1);
120
        snd_stop(snd_wngdng2);
121
        snd_stop(snd_wngdng3);
122
        snd_stop(snd_wngdng4);
123
        snd_stop(snd_wngdng5);
124
        snd_stop(snd_wngdng6);
125
        snd_stop(snd_wngdng7);
126
        var rnsound = floor(random(7));
127
        switch (rnsound)
128
        {
129
            case 0:
130
                snd_play(snd_wngdng1);
131
                break;
132
            case 1:
133
                snd_play(snd_wngdng2);
134
                break;
135
            case 2:
136
                snd_play(snd_wngdng3);
137
                break;
138
            case 3:
139
                snd_play(snd_wngdng4);
140
                break;
141
            case 4:
142
                snd_play(snd_wngdng5);
143
                break;
144
            case 5:
145
                snd_play(snd_wngdng6);
146
                break;
147
            case 6:
148
                snd_play(snd_wngdng7);
149
                break;
150
        }
151
    }
152
    else if (txtsound == 65)
153
    {
154
        snd_stop(snd_tem);
155
        snd_stop(snd_tem2);
156
        snd_stop(snd_tem3);
157
        snd_stop(snd_tem4);
158
        snd_stop(snd_tem5);
159
        snd_stop(snd_tem6);
160
        var rnsound = floor(random(6));
161
        switch (rnsound)
162
        {
163
            case 0:
164
                snd_play(snd_tem);
165
                break;
166
            case 1:
167
                snd_play(snd_tem2);
168
                break;
169
            case 2:
170
                snd_play(snd_tem3);
171
                break;
172
            case 3:
173
                snd_play(snd_tem4);
174
                break;
175
            case 4:
176
                snd_play(snd_tem5);
177
                break;
178
            case 5:
179
                snd_play(snd_tem6);
180
                break;
181
        }
182
    }
183
    else
184
    {
185
        var ch = string_char_at(originalstring, stringpos);
186
        if (ch != " " && ch != " ")
187
        {
188
            snd_stop(txtsound);
189
            snd_play(txtsound);
190
        }
191
    }
192
}