Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_DEVICE_FAILURE_Step_0

(view raw script w/o annotations or w/e)
1
if (EVENT == 1)
2
{
3
    snd_free_all();
4
    if (global.chapter == 1)
5
    {
6
        global.currentsong[0] = snd_init("AUDIO_DRONE.ogg");
7
        global.currentsong[1] = mus_loop(global.currentsong[0]);
8
        global.typer = 667;
9
        global.fc = 0;
10
        global.msg[0] = stringsetloc(
Face 0 IT APPEARS YOU
HAVE REACHED
Delay 66
AN END.Wait for inputClose Message
"\\M0 IT APPEARS YOU& HAVE REACHED^6& & AN END./%", "DEVICE_FAILURE_slash_Step_0_gml_10_0"
);
11
        EVENT = 2;
12
        W = instance_create(70, 80, obj_writer);
13
        if (global.tempflag[3] >= 1)
14
        {
15
            with (obj_writer)
16
                instance_destroy();
17
        }
18
    }
19
    else if (text_timer > 0)
20
    {
21
        text_timer--;
22
    }
23
    else
24
    {
25
        EVENT = 3;
26
        alarm[4]
 = 30;
gml_Object_DEVICE_FAILURE_Alarm_4.gml

EVENT += 1;
27
        global.currentsong[0] = snd_init("AUDIO_DEFEAT.ogg");
28
        global.currentsong[1] = mus_loop(global.currentsong[0]);
29
        var voice = choose(0, 1);
30
        if (!
scr_havechar
scr_havechar

function
scr_havechar(arg0)
{ var checker = arg0; if (checker == "susie" || checker == "su" || checker == "s") checker = 2; if (checker == "ralsei" || checker == "ra" || checker == "r") checker = 3; if (checker == "noelle" || checker == "no" || checker == "n") checker = 4; _rreturn = 0; if (global.char[0] == checker) _rreturn = 1; if (global.char[1] == checker) _rreturn = 1; if (global.char[2] == checker) _rreturn = 1; return _rreturn; }
(2))
31
            voice = 1;
32
        else if (!
scr_havechar
scr_havechar

function
scr_havechar(arg0)
{ var checker = arg0; if (checker == "susie" || checker == "su" || checker == "s") checker = 2; if (checker == "ralsei" || checker == "ra" || checker == "r") checker = 3; if (checker == "noelle" || checker == "no" || checker == "n") checker = 4; _rreturn = 0; if (global.char[0] == checker) _rreturn = 1; if (global.char[1] == checker) _rreturn = 1; if (global.char[2] == checker) _rreturn = 1; return _rreturn; }
(3))
33
            voice = 0;
34
        if (
scr_havechar
scr_havechar

function
scr_havechar(arg0)
{ var checker = arg0; if (checker == "susie" || checker == "su" || checker == "s") checker = 2; if (checker == "ralsei" || checker == "ra" || checker == "r") checker = 3; if (checker == "noelle" || checker == "no" || checker == "n") checker = 4; _rreturn = 0; if (global.char[0] == checker) _rreturn = 1; if (global.char[1] == checker) _rreturn = 1; if (global.char[2] == checker) _rreturn = 1; return _rreturn; }
(2) ||
scr_havechar
scr_havechar

function
scr_havechar(arg0)
{ var checker = arg0; if (checker == "susie" || checker == "su" || checker == "s") checker = 2; if (checker == "ralsei" || checker == "ra" || checker == "r") checker = 3; if (checker == "noelle" || checker == "no" || checker == "n") checker = 4; _rreturn = 0; if (global.char[0] == checker) _rreturn = 1; if (global.char[1] == checker) _rreturn = 1; if (global.char[2] == checker) _rreturn = 1; return _rreturn; }
(3))
35
        {
36
            if (voice == 0)
37
            {
38
                
scr_speaker
scr_speaker

function
scr_speaker(arg0)
{ _speaker = arg0; global.typer = 5; if (global.darkzone == 1) global.typer = 6; if (global.fighting == 1) global.typer = 4; global.fc = 0; global.fe = 0; if (_speaker == "silent" && global.darkzone == 0) global.typer = 2; if (_speaker == "silent" && global.darkzone == 1) global.typer = 36; if (_speaker == "balloon" || _speaker == "enemy") global.typer = 50; if (_speaker == "sans") { global.typer = 14; global.fc = 6; } if (_speaker == "undyne" || _speaker == "und") { global.typer = 17; global.fc = 9; } if (_speaker == "temmie" || _speaker == "tem") global.typer = 21; if (_speaker == "jevil") global.typer = 35; if (_speaker == "catti") global.fc = 13; if (_speaker == "jockington" || _speaker == "joc") global.fc = 14; if (_speaker == "catty" || _speaker == "caddy") global.fc = 16; if (_speaker == "bratty" || _speaker == "bra") global.fc = 17; if (_speaker == "rouxls" || _speaker == "rou") global.fc = 18; if (_speaker == "burgerpants" || _speaker == "bur") global.fc = 19; if (_speaker == "spamton") { if (global.fighting == 0) global.typer = 66; else global.typer = 68; } if (_speaker == "sneo") global.typer = 67; if (_speaker == "susie" || _speaker == "sus") { global.fc = 1; global.typer = 10; if (global.darkzone == 1) { global.typer = 30; if (global.fighting == 1) global.typer = 47; } } if (_speaker == "ralsei" || _speaker == "ral") { global.fc = 2; global.typer = 31; if (global.fighting == 1) global.typer = 45; if (global.flag[30 ralsei_hat_state] == 1) global.typer = 6; } if (_speaker == "noelle" || _speaker == "noe") { global.fc = 3; if (global.darkzone == 0) global.typer = 12; else global.typer = 56; if (global.fighting == 1) global.typer = 59; } if (_speaker == "toriel" || _speaker == "tor") { global.fc = 4; global.typer = 7; } if (_speaker == "asgore" || _speaker == "asg") { global.fc = 10; global.typer = 18; } if (_speaker == "king" || _speaker == "kin") { global.fc = 20; global.typer = 33; if (global.chapter == 1) { if (global.plot < 235) global.typer = 36; } if (global.fighting == 1) ...
("no_name");
39
                msgsetloc(0, 
Come on,Delay 11
that all you got!?Wait for input
" Come on^1,& that all you got!?/", "DEVICE_FAILURE_slash_Step_0_gml_39_0"
);
40
                msgnextloc(
Kris,Delay 11
get up...!Wait for inputClose Message
" Kris^1,& get up...!/%", "DEVICE_FAILURE_slash_Step_0_gml_40_0"
);
41
                global.typer = 61;
42
                global.fc = 0;
43
            }
44
            else
45
            {
46
                
scr_speaker
scr_speaker

function
scr_speaker(arg0)
{ _speaker = arg0; global.typer = 5; if (global.darkzone == 1) global.typer = 6; if (global.fighting == 1) global.typer = 4; global.fc = 0; global.fe = 0; if (_speaker == "silent" && global.darkzone == 0) global.typer = 2; if (_speaker == "silent" && global.darkzone == 1) global.typer = 36; if (_speaker == "balloon" || _speaker == "enemy") global.typer = 50; if (_speaker == "sans") { global.typer = 14; global.fc = 6; } if (_speaker == "undyne" || _speaker == "und") { global.typer = 17; global.fc = 9; } if (_speaker == "temmie" || _speaker == "tem") global.typer = 21; if (_speaker == "jevil") global.typer = 35; if (_speaker == "catti") global.fc = 13; if (_speaker == "jockington" || _speaker == "joc") global.fc = 14; if (_speaker == "catty" || _speaker == "caddy") global.fc = 16; if (_speaker == "bratty" || _speaker == "bra") global.fc = 17; if (_speaker == "rouxls" || _speaker == "rou") global.fc = 18; if (_speaker == "burgerpants" || _speaker == "bur") global.fc = 19; if (_speaker == "spamton") { if (global.fighting == 0) global.typer = 66; else global.typer = 68; } if (_speaker == "sneo") global.typer = 67; if (_speaker == "susie" || _speaker == "sus") { global.fc = 1; global.typer = 10; if (global.darkzone == 1) { global.typer = 30; if (global.fighting == 1) global.typer = 47; } } if (_speaker == "ralsei" || _speaker == "ral") { global.fc = 2; global.typer = 31; if (global.fighting == 1) global.typer = 45; if (global.flag[30 ralsei_hat_state] == 1) global.typer = 6; } if (_speaker == "noelle" || _speaker == "noe") { global.fc = 3; if (global.darkzone == 0) global.typer = 12; else global.typer = 56; if (global.fighting == 1) global.typer = 59; } if (_speaker == "toriel" || _speaker == "tor") { global.fc = 4; global.typer = 7; } if (_speaker == "asgore" || _speaker == "asg") { global.fc = 10; global.typer = 18; } if (_speaker == "king" || _speaker == "kin") { global.fc = 20; global.typer = 33; if (global.chapter == 1) { if (global.plot < 235) global.typer = 36; } if (global.fighting == 1) ...
("no_name");
47
                msgsetloc(0, 
This is not
your fate...!Wait for input
" This is not& your fate...!/", "DEVICE_FAILURE_slash_Step_0_gml_47_0"
);
48
                msgnextloc(
Please,Delay 11
don't give up!Wait for inputClose Message
" Please^1,& don't give up!/%", "DEVICE_FAILURE_slash_Step_0_gml_48_0"
);
49
                global.typer = 60;
50
                global.fc = 0;
51
            }
52
            var xx = 50;
53
            if (global.lang == "ja")
54
                xx = 44;
55
            W = instance_create(50, 150, obj_writer);
56
        }
57
    }
58
}
59
if (EVENT == 0)
60
    EVENT = 1;
61
if (EVENT == 2 && !instance_exists(obj_writer))
62
{
63
    EVENT = 3;
64
    alarm[4]
 = 30;
gml_Object_DEVICE_FAILURE_Alarm_4.gml

EVENT += 1;
65
    global.msg[0] = stringsetloc(
Face 0 WILL YOU TRY AGAIN?
"\\M0 WILL YOU TRY AGAIN?", "DEVICE_FAILURE_slash_Step_0_gml_28_0"
);
66
    if (global.tempflag[3] >= 1)
67
        global.msg[0] = stringsetloc(
Face 0 WILL YOU PERSIST?
"\\M0 WILL YOU PERSIST?", "DEVICE_FAILURE_slash_Step_0_gml_32_0"
);
68
    if (global.tempflag[3] >= 1)
69
        alarm[4]
 = 15;
gml_Object_DEVICE_FAILURE_Alarm_4.gml

EVENT += 1;
70
    W = instance_create(langopt(40, 84), 80, obj_writer);
71
}
72
if (EVENT == 4 && !instance_exists(obj_writer))
73
{
74
    if (global.chapter == 1)
75
    {
76
        choice = instance_create(100, 120, DEVICE_CHOICE);
77
        EVENT = 5;
78
    }
79
    else if (!instance_exists(obj_writer))
80
    {
81
        choice = instance_create(100, 120, DEVICE_CHOICE);
82
        if (global.chapter > 1)
83
        {
84
            with (choice)
85
            {
86
                NAME[0][0] = stringsetloc(
CONTINUE
"CONTINUE", "DEVICE_FAILURE_slash_Step_0_gml_103_0_b"
);
87
                NAME[1][0] = stringsetloc(
GIVE UP
"GIVE UP", "DEVICE_FAILURE_slash_Step_0_gml_104_0"
);
88
                NAMEX[0][0] = 80;
89
                NAMEX[1][0] = 190;
90
                NAMEY[0][0] = 180;
91
                NAMEY[1][0] = 180;
92
                XMAX = 1;
93
                CURX = -1;
94
                IDEALX = 190;
95
                IDEALY = 180;
96
            }
97
        }
98
        EVENT = 5;
99
    }
100
}
101
if (EVENT == 5)
102
{
103
    if (global.choice == 0)
104
    {
105
        with (obj_writer)
106
            instance_destroy();
107
        EVENT = 6;
108
    }
109
    if (global.choice == 1)
110
    {
111
        with (obj_writer)
112
            instance_destroy();
113
        EVENT = 26;
114
    }
115
}
116
if (EVENT == 6)
117
{
118
    snd_free_all();
119
    EVENT = 7;
120
    alarm[4]
 = 30;
gml_Object_DEVICE_FAILURE_Alarm_4.gml

EVENT += 1;
121
    if (global.chapter == 1)
122
    {
123
        global.flag[6 disable_text_skip] = 1;
124
        global.msg[0] = stringsetloc(
THEN, THE FUTURE
IS IN YOUR HANDS.
" THEN, THE FUTURE& IS IN YOUR HANDS.", "DEVICE_FAILURE_slash_Step_0_gml_68_0"
);
125
        W = instance_create(50, 80, obj_writer);
126
        if (global.tempflag[3] >= 1)
127
        {
128
            with (obj_writer)
129
                instance_destroy();
130
            alarm[4]
 = 1;
gml_Object_DEVICE_FAILURE_Alarm_4.gml

EVENT += 1;
131
        }
132
    }
133
}
134
if (EVENT == 8)
135
{
136
    WHITEFADE = 1;
137
    FADEUP = 0.01;
138
    EVENT = 9;
139
    alarm[4]
 = 120;
gml_Object_DEVICE_FAILURE_Alarm_4.gml

EVENT += 1;
140
    if (global.tempflag[3] >= 1)
141
    {
142
        FADEUP = 0.03;
143
        alarm[4]
 = 45;
gml_Object_DEVICE_FAILURE_Alarm_4.gml

EVENT += 1;
144
    }
145
    else
146
    {
147
        snd_play(snd_dtrans_lw);
148
    }
149
    global.tempflag[3] += 1;
150
}
151
if (EVENT == 10)
152
{
153
    
scr_windowcaption
scr_windowcaption

function
scr_windowcaption(arg0)
{ if (global.tempflag[10] != 1 && global.chapter == 1) window_set_caption(arg0); else window_set_caption("DELTARUNE Chapter " + string(global.chapter)); }
(stringsetloc(
THE DARK
"THE DARK", "DEVICE_FAILURE_slash_Step_0_gml_172_0"
));
154
    
scr_tempload
scr_tempload

function
scr_tempload()
{ filechoicebk3 = global.filechoice; global.filechoice = 9;
scr_load();
global.filechoice = filechoicebk3; }
();
155
    EVENT = 11;
156
}
157
if (EVENT == 26)
158
{
159
    snd_free_all();
160
    if (global.chapter > 1)
161
    {
162
        if (i_ex(obj_gameoverbg))
163
            instance_destroy(obj_gameoverbg);
164
    }
165
    global.typer = 667;
166
    global.msg[0] = stringsetloc(
Face 0 THEN THE WORLD Delay 55
WAS COVERED Delay 55
IN DARKNESS.Wait for inputClose Message
"\\M0 THEN THE WORLD^5 & WAS COVERED^5 & IN DARKNESS./%", "DEVICE_FAILURE_slash_Step_0_gml_103_0"
);
167
    EVENT = 27;
168
    W = instance_create(60, 80, obj_writer);
169
}
170
if (EVENT == 27 && !instance_exists(obj_writer))
171
{
172
    global.currentsong[0] = snd_init("AUDIO_DARKNESS.ogg");
173
    global.currentsong[1] = mus_play(global.currentsong[0]);
174
    EVENT = 28;
175
    DARK_WAIT = 0;
176
}
177
if (EVENT == 28)
178
{
179
    DARK_WAIT += 1;
180
    if (DARK_WAIT >= 2040)
181
        ossafe_game_end();
182
    if (!snd_is_playing(global.currentsong[1]))
183
        ossafe_game_end();
184
    if (global.is_console)
185
    {
186
        if (DARK_WAIT >= 90 && !restart)
187
        {
188
            for (var i = 0; i < array_length_1d(gamepad_controls); i++)
189
            {
190
                if (gamepad_button_check_pressed(obj_gamecontroller.gamepad_id, gamepad_controls[i]))
191
                {
192
                    if (gamepad_controls[i] == global.button0 || gamepad_controls[i] == global.button1 || gamepad_controls[i] == global.button2 || gamepad_controls[i] == gp_shoulderlb)
193
                    {
194
                        mus_volume(global.currentsong[1], 0, 80);
195
                        restart = true;
196
                        break;
197
                    }
198
                }
199
            }
200
        }
201
        if (restart)
202
        {
203
            restart_timer++;
204
            if (restart_timer >= 100)
205
                ossafe_game_end();
206
        }
207
    }
208
}
209
if (EVENT >= 0 && EVENT <= 4)
210
{
211
    if (button2_h())
212
    {
213
        with (obj_writer)
214
        {
215
            if (pos < (length - 3))
216
                pos += 2;
217
            if (specfade <= 0.9)
218
                specfade -= 0.1;
219
            if (rate <= 1)
220
                rate = 1;
221
        }
222
    }
223
}