Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_ch5_LW20W_handoff_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    skip = false;
4
    var ind = min(textind, array_length(proceedActions) - 1);
5
    
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 (global.darkzone == 1) global.typer = 89; } if (_speaker == "king" || _speaker == "kin") { global.fc = 20; global.typer = 33; if (global.chapter == 1) { if (global.plot < 235) global.typer = 36; ...
("noelle");
6
    global.fc = 3;
7
    global.typer = 63;
8
    proceedActions[ind]();
9
    textind++;
10
    
scr_anyface_next
scr_anyface_next

function
scr_anyface_next(arg0, arg1)
{ global.msgno++;
scr_anyface(arg0, global.msgno, arg1);
}
("no_name", 0);
11
    if (skip)
12
        
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 (global.darkzone == 1) global.typer = 89; } if (_speaker == "king" || _speaker == "kin") { global.fc = 20; global.typer = 33; if (global.chapter == 1) { if (global.plot < 235) global.typer = 36; ...
("no_name");
13
    var opt1 = str_stop;
14
    var opt2 = str_proceed;
15
    if (textind >= 7)
16
        opt1 = opt2;
17
    
scr_readychoicer
scr_readychoicer

function
scr_readychoicer(arg0 = "", arg1 = "", arg2 = "", arg3 = "", arg4 = -1, arg5 = -1)
{ global.msc = -99; global.choice = -1; global.choicemsg = [arg0, arg1, arg2, arg3]; var count = 2; if (arg2 != "") count++; if (arg3 != "") count++; var chooseString = "\\C" + string(count); if (arg4 == -1 && instance_exists(obj_cutscene_master)) arg4 = true; if (arg5) { if (arg4)
c_msgset(0, chooseString);
else msgset(0, chooseString); } else if (arg4) {
c_msgnext(chooseString);
} else { msgnext(chooseString); } }
(opt1, opt2, undefined, undefined, false, skip);
18
    with (d_make())
19
    {
20
        var _skippable = false;
21
        if (!_skippable)
22
        {
23
            skippable = 0;
24
            preventcskip = true;
25
        }
26
    }
27
    con = 1.01;
28
}
29
if (con == 1.01 && global.choice != -1)
30
{
31
    var s1vol = 1 - (wprog(19, 34) * 0.3);
32
    if (textind > 34)
33
        s1vol = 0.7 - (wprog(34, 37) * 0.7);
34
    if (s1vol > 0)
35
        snd_play(snd_ominous, s1vol);
36
    var s2vol = wprog(19, 34);
37
    if (textind > 34)
38
        s2vol = (1 - wprog(34, 58)) * 0.8;
39
    if (s2vol > 0)
40
        snd_play(snd_ominous_hell, s2vol);
41
    var s3vol = clamp(wprog(34, 54), 0, 1);
42
    var pitch = lerp(1, 1.6, wprog(54, 74));
43
    if (s3vol > 0)
44
        snd_play(snd_ominous_hell_super, s3vol, pitch);
45
    if (global.choice == 0 && textind < 7)
46
    {
47
        k_d(3);
48
        timer = 0;
49
        con = 1.02;
50
    }
51
    else
52
    {
53
        k_d(3);
54
        con = 2;
55
        timer = 0;
56
    }
57
    if (textind >= endind)
58
    {
59
        con = 95;
60
        k_d();
61
    }
62
}
63
if (con == 1.02)
64
{
65
    timer++;
66
    if (timer == 2)
67
    {
68
        var ind = min(global.flag[1742], array_length(stopActions) - 1);
69
        stopActions[ind]();
70
        global.flag[1742]++;
71
        
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 (global.darkzone == 1) global.typer = 89; } if (_speaker == "king" || _speaker == "kin") { global.fc = 20; global.typer = 33; if (global.chapter == 1) { if (global.plot < 235) global.typer = 36; ...
("noelle");
72
        global.fc = 3;
73
        global.typer = 63;
74
        with (d_make())
75
        {
76
            var _skippable = false;
77
            if (!_skippable)
78
            {
79
                skippable = 0;
80
                preventcskip = true;
81
            }
82
        }
83
        con = 2;
84
        timer = 0;
85
    }
86
}
87
if (con == 2 && !d_ex())
88
{
89
    timer++;
90
    if (timer == 2)
91
    {
92
        timer = 0;
93
        con = 2.1;
94
    }
95
}
96
if (con == 2.1)
97
{
98
    timer++;
99
    if (timer == 1)
100
    {
101
        moveamount = max(2, round(lerp(51, 20, wprog(0, 54))));
102
        if (textind > 28)
103
            moveamount = round(lerp(15, 4, wprog(28, 54)));
104
        if (textind > drownindex)
105
            moveamount = round(moveamount / 2);
106
        movespd = lerp(1.5, 2, clamp(textind / 20, 0, 1));
107
        startX = actor.x;
108
        endX = actor.x + moveamount;
109
        movetime = round(moveamount * movespd);
110
    }
111
    actor.x = round(lerp(startX, endX, timer / movetime));
112
    with (actor)
113
        camera_setxy(round(x - camxoff));
114
    for (var i = 0; i < sinkSprCount; i++)
115
    {
116
        if (actor.x >= sinkSpr[i].x)
117
        {
118
            if (actor.sprite_index != sinkSpr[i].sprite_index)
119
                actor.sprite_index = sinkSpr[i].sprite_index;
120
            break;
121
        }
122
    }
123
    var mem = actor.image_index;
124
    actor.image_index += 0.125 / movespd;
125
    var playsnd = false;
126
    if (textind < 13 && round(mem / 2) != round(actor.image_index / 2))
127
        playsnd = true;
128
    if (actor.x < 420)
129
        playsnd = false;
130
    if (noellewatersound == 0)
131
    {
132
        playsnd = false;
133
        if (actor.x >= 400)
134
        {
135
            noellewatersound = 1;
136
            playsnd = true;
137
        }
138
    }
139
    if (kriswatersound == 0)
140
    {
141
        if (actor.x == 419)
142
        {
143
            playsnd = true;
144
            kriswatersound = 1;
145
        }
146
    }
147
    if (playsnd)
148
    {
149
        var s1vol = 1 - (wprog(19, 34) * 0.3);
150
        if (textind > 34)
151
            s1vol = 0.7 - (wprog(34, 37) * 0.7);
152
        if (s1vol > 0)
153
            snd_play(snd_wading, s1vol);
154
        var s2vol = wprog(19, 34);
155
        if (textind > 34)
156
            s2vol = (1 - wprog(34, 54)) * 0.8;
157
        if (s2vol > 0)
158
            snd_play(snd_wading_type2, s2vol);
159
        var s3vol = wprog(34, 54);
160
        if (s3vol > 0)
161
            snd_play(snd_wading_type3_deep, s3vol);
162
    }
163
    if (textind >= 13)
164
    {
165
        if (timer == 1)
166
        {
167
            var s2vol = 1 - wprog(13, 54);
168
            if (s2vol > 0)
169
                snd_play(snd_wading_type2, s2vol);
170
            var s3vol = wprog(34, 54);
171
            if (s3vol > 0)
172
                snd_play(snd_wading_type3_deep, s3vol);
173
        }
174
    }
175
    if (timer >= movetime)
176
    {
177
        actor.image_index = 0;
178
        actor.x = endX;
179
        timer = 0;
180
        con = 3;
181
    }
182
}
183
if (con == 3)
184
{
185
    timer++;
186
    if (timer == 1)
187
        pauseTime = lerp(30, -1, wprog(0, 12));
188
    if (timer >= pauseTime)
189
    {
190
        timer = 0;
191
        con = 0;
192
        if (musicstart == false)
193
        {
194
            _bgm_track[0] = snd_init("ch5_inversion_lake_chant.ogg");
195
            _bgm_track[1] = mus_loop_ext(_bgm_track[0], 1, 1);
196
            mus_volume(_bgm_track[1], 0, 0);
197
            snd_pitch(_bgm_track[1], 0.35);
198
            _bgm_pitch = 0.35;
199
            _bgm_volume = 0;
200
            musicstart = true;
201
        }
202
    }
203
}
204
if (con == 95)
205
{
206
    timer = 0;
207
    con = 96;
208
}
209
if (con == 96)
210
{
211
    timer++;
212
    if (timer >= 300)
213
    {
214
        snd_free_all();
215
        makeEnd();
216
        timer = 0;
217
        con = 1000;
218
    }
219
}
220
if (con == 99)
221
{
222
    if (failed == 1)
223
    {
224
        failed = 2;
225
        failtimer = 0;
226
        timer = 0;
227
    }
228
    timer++;
229
    if (timer == 1)
230
    {
231
        with (obj_ch5_LW20W_blur)
232
            instance_destroy();
233
        with (obj_ch5_LW20W_blur2)
234
            instance_destroy();
235
        with (obj_choicer_neo)
236
            instance_destroy();
237
        with (obj_writer)
238
            
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ var _doom = instance_create_depth(0, 0, 0, obj_doom); with (_doom) { alarm[0] target = arg0; } return _doom; }
(id, 1);
239
        k_d();
240
        
scr_flag_set
scr_flag_set

function
scr_flag_set(arg0, arg1)
{ global.flag[arg0] = arg1; } function scr_flag_set_ext(arg0, arg1, arg2, arg3 = 1) { if (arg1 < 0)
scr_flag_set(arg0, arg2);
else global.flag[arg0] = scr_set_bitmask_value(global.flag[arg0], arg1, arg2, arg3); }
(1743, 1);
241
        
scr_flag_set
scr_flag_set

function
scr_flag_set(arg0, arg1)
{ global.flag[arg0] = arg1; } function scr_flag_set_ext(arg0, arg1, arg2, arg3 = 1) { if (arg1 < 0)
scr_flag_set(arg0, arg2);
else global.flag[arg0] = scr_set_bitmask_value(global.flag[arg0], arg1, arg2, arg3); }
(916, 1);
242
        
scr_litemremove
scr_litemremove

function
scr_litemremove(arg0)
{ for (i = 0; i < 8; i += 1) { if (global.litem[i] == arg0) script_execute(scr_litemshift, i, 0); } }
(20);
243
    }
244
    with (failwhite)
245
    {
246
        visible = 1;
247
        image_alpha = 1;
248
        var cam = scr_getcam();
249
        x = cam.x - 20;
250
        y = cam.y - 20;
251
        depth = 5;
252
        image_blend = merge_color(c_white, c_black, clamp(lerp_inout_cubic(0, 1, other.timer / 60), 0, 1));
253
    }
254
    if (timer == 90)
255
    {
256
        
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 (global.darkzone == 1) global.typer = 89; } if (_speaker == "king" || _speaker == "kin") { global.fc = 20; global.typer = 33; if (global.chapter == 1) { if (global.plot < 235) global.typer = 36; ...
("noelle");
257
        global.fc = 0;
258
        global.fe = 0;
259
        msgsetloc(0, 
* I was wrong.Wait for input
"* I was wrong./", "obj_ch5_LW20W_handoff_slash_Step_0_gml_253_0"
);
260
        msgnextloc(
* The dream never happened.Wait for input
"* The dream never happened./", "obj_ch5_LW20W_handoff_slash_Step_0_gml_254_0"
);
261
        msgnextloc(
* Kris hadn't changed.Wait for input
"* Kris hadn't changed./", "obj_ch5_LW20W_handoff_slash_Step_0_gml_255_0"
);
262
        msgnextloc(
* I hadn't changed.Wait for input
"* I hadn't changed./", "obj_ch5_LW20W_handoff_slash_Step_0_gml_256_0"
);
263
        msgnextloc(
* I had simply&Delay 22amp;gotten carried away.Wait for inputClose Message
"* I had simply^2&gotten carried away./%", "obj_ch5_LW20W_handoff_slash_Step_0_gml_257_0"
);
264
        global.typer = 63;
265
        var d = instance_create(camerax() + 40, cameray() + 170, obj_writer);
266
        with (d)
267
        {
268
            depth = -40;
269
            skippable = 0;
270
            preventcskip = true;
271
        }
272
        con = 70;
273
        timer = 0;
274
        snd_free_all();
275
    }
276
}
277
if (con == 70 && !i_ex(obj_writer))
278
{
279
    global.interact = 0;
280
    global.facing = 0;
281
    global.plot = 189;
282
    room_restart();
283
    con = -1;
284
}