Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_puzzlecloset_manager_Step_0

(view raw script w/o annotations or w/e)
1
if (caterinit == 0)
2
{
3
    with (obj_caterpillarchara)
4
    {
5
        x = obj_mainchara.x - halign;
6
        y = obj_mainchara.y;
7
        for (_iaia = target; _iaia > -1; _iaia -= 1)
8
        {
9
            remx[_iaia] = x;
10
            remy[_iaia] = y;
11
            facing[_iaia] = global.facing;
12
        }
13
    }
14
    caterinit = 1;
15
    if (global.flag[1228 entered_coldplace] > 0)
16
    {
17
        if (room == room_dw_puzzlecloset_2)
18
        {
19
            with (obj_doorAny)
20
            {
21
                doorDelay = -1;
22
                doorFadeMusicTime = 14;
23
                debug_print("done");
24
            }
25
        }
26
    }
27
}
28
with (obj_board_controller)
29
    drawcrt = false;
30
if (wrapchar == true)
31
{
32
    with (obj_mainchara_board)
33
    {
34
        if (x < 732)
35
            x += 604;
36
        if (x > 1348)
37
            x -= 604;
38
        if (y < 164)
39
            y += 292;
40
        if (y > 444)
41
            y -= 292;
42
    }
43
}
44
if (room == room_dw_puzzlecloset_2)
45
{
46
    if (keycon == 0)
47
    {
48
        with (obj_board_trigger)
49
        {
50
            if (place_meeting(x, y, obj_b3bs_chasekey))
51
                other.keycon = 1;
52
        }
53
    }
54
    if (keycon == 1)
55
    {
56
        with (doorsolid)
57
        {
58
            
scr_board_marker
scr_board_marker

function
scr_board_marker()
{ var _thismarker = instance_create(argument0, argument1, obj_board_marker); _thismarker.sprite_index = argument2; _thismarker.image_xscale = 2; _thismarker.image_yscale = 2; if (argument_count >= 4) _thismarker.image_speed = argument3; if (argument_count >= 5) { if (argument4 != -1) _thismarker.depth = argument4; } if (argument_count >= 6) _thismarker.image_xscale = argument5; if (argument_count >= 6) _thismarker.image_yscale = argument5; if (argument_count >= 7) _thismarker.animateonce = argument6; return _thismarker; }
(x, y, spr_board_stairs, 0, 999999);
59
            instance_create(x, y, obj_board_smokepuff);
60
            instance_destroy();
61
            snd_play(snd_board_door_close);
62
        }
63
        with (obj_b3bs_chasekey)
64
            instance_destroy();
65
        keycon = 2;
66
    }
67
}
68
if (room == room_dw_puzzlecloset_3)
69
{
70
    with (obj_mainchara_board)
71
        freeroam = false;
72
    with (obj_board_parent)
73
        active = true;
74
}
75
if (nextloc == 0)
76
{
77
    with (obj_dw_puzzlecloset_warp)
78
    {
79
        if (con == 2)
80
        {
81
            other.nextloc = 1;
82
            timer = 0;
83
            con = 3;
84
        }
85
    }
86
}
87
if (nextloc == 1)
88
{
89
    with (obj_b3bs_console)
90
    {
91
        playx = 3088;
92
        playy = 688;
93
    }
94
    wrapchar = 0;
95
    nextloc++;
96
    var xloc = 3008;
97
    var yloc = 608;
98
    var yspace = 128;
99
    var camwid = 160;
100
    var camhei = 128;
101
    camera_set_view_pos(view_camera[1], xloc + (vwid * 0), yloc + (yspace * 0));
102
    camera_set_view_pos(view_camera[2], xloc + (vwid * 1), yloc + (yspace * 0));
103
    camera_set_view_pos(view_camera[3], xloc + (vwid * 2), yloc + (yspace * 0));
104
    camera_set_view_pos(view_camera[4], xloc + (vwid * 0), yloc + (yspace * 1));
105
    camera_set_view_pos(view_camera[5], xloc + (vwid * 1), yloc + (yspace * 1));
106
    camera_set_view_pos(view_camera[6], xloc + (vwid * 2), yloc + (yspace * 1));
107
    with (obj_mainchara_board)
108
        setxy(3040, 640);
109
}
110
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
111
{
112
    if (keyboard_check_pressed(ord("P")))
113
    {
114
        shuffle = !shuffle;
115
        debug_print("P: shuffle=" + string(shuffle));
116
    }
117
}
118
if (room == room_dw_puzzlecloset_3)
119
{
120
    if (pc3fuzzinit == 0)
121
    {
122
        if (global.flag[1245 num_parent_photos] >= 8)
123
        {
124
            with (obj_board_playercamera)
125
            {
126
                snd_stop(snd_camera_flash);
127
                snd_play_x(snd_noise, 0.8, 1);
128
                snd_play_x(snd_noise, 0.5, 1.4);
129
                snd_play_x(snd_noise, 0.5, 0.6);
130
                instance_destroy();
131
                with (
scr_marker_ext
scr_marker_ext

function
scr_marker_ext(arg0, arg1, arg2, arg3 = 1, arg4 = 1, arg5 = 0, arg6 = 0, arg7 = 16777215, arg8 = depth, arg9 = false, arg10 = -1, arg11 = 1)
{ var thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { depth = arg8; sprite_index = arg2; image_speed = arg5; image_xscale = arg3; image_yscale = arg4; image_index = arg6; image_blend = arg7; image_alpha = arg11; if (arg9)
scr_depth();
} if (arg10 > 0)
scr_doom(thismarker, arg10);
return thismarker; }
(524, 32, spr_pxwhite, 384, 256, 0, 0, c_white, 999998))
132
                {
133
                    var timedie = 60;
134
                    
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("image_alpha", 1.1, 0, timedie, 2, "in");
135
                    
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(id, timedie + 1);
136
                }
137
            }
138
            with (obj_board_parent)
139
                instance_destroy();
140
            with (obj_b3bs_console)
141
            {
142
                endplay = 3;
143
                cantuse = true;
144
                
scr_marker_ext
scr_marker_ext

function
scr_marker_ext(arg0, arg1, arg2, arg3 = 1, arg4 = 1, arg5 = 0, arg6 = 0, arg7 = 16777215, arg8 = depth, arg9 = false, arg10 = -1, arg11 = 1)
{ var thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { depth = arg8; sprite_index = arg2; image_speed = arg5; image_xscale = arg3; image_yscale = arg4; image_index = arg6; image_blend = arg7; image_alpha = arg11; if (arg9)
scr_depth();
} if (arg10 > 0)
scr_doom(thismarker, arg10);
return thismarker; }
(x, y, sprite_index, 2, 2, undefined, undefined, undefined, 1000100);
145
                y = -800;
146
            }
147
            fuzzsnd = snd_loop(snd_tv_static);
148
            pc3fuzzinit = 1;
149
            pc3check = instance_create(690, 342, obj_trigger_interact);
150
            with (pc3check)
151
                
scr_size
scr_size

function
scr_size(arg0 = image_xscale, arg1 = image_yscale, arg2 = id)
{ with (arg2) { image_xscale = arg0; image_yscale = arg1; } }
(3.5, 1);
152
            instance_create(524, 32, obj_dw_ch3_pc3fuzz);
153
        }
154
    }
155
    if (pc3fuzzinit)
156
    {
157
        if (audio_exists(fuzzsnd))
158
        {
159
            var x1 = obj_b3bs_console.x + 32;
160
            var x2 = obj_mainchara.x;
161
            var maxdist = 200;
162
            var amt2 = clamp((maxdist - abs(x1 - x2)) / maxdist, 0, 0.35);
163
            if (global.flag[1231 parent_lock_3_done] == 1)
164
                amt2 = 0;
165
            snd_volume(fuzzsnd, amt2, 0);
166
        }
167
        with (pc3check)
168
        {
169
            if (myinteract == 3 && global.flag[1231 parent_lock_3_done] == 0)
170
            {
171
                global.interact = 1;
172
                
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 == "tenna") { global.typer = 80; if (global.fighting == 1) global.typer = 81; } 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; ...
("no_name");
173
                msgsetloc(0, 
* The console is unresponsive.Wait for inputClose Message
"* The console is unresponsive./%", "obj_puzzlecloset_manager_slash_Step_0_gml_172_0"
);
174
                myinteract = 4;
175
                d_make();
176
            }
177
            if (myinteract == 4 && !d_ex())
178
            {
179
                myinteract = 0;
180
                global.interact = 0;
181
            }
182
        }
183
    }
184
    if (global.flag[1233 parent_lock_3_used] == 0)
185
    {
186
        with (obj_doorAny)
187
        {
188
            if (x > 640)
189
            {
190
                if (touched)
191
                    global.flag[1233 parent_lock_3_used] = 1;
192
            }
193
        }
194
    }
195
}
196
if (endcon == 1)
197
{
198
    if (obj_b3bs_console.swordinteract == 1)
199
    {
200
        endcon = 2;
201
        global.interact = 1;
202
        global.msc = 1411;
203
        
scr_text
scr_text

function
scr_text(arg0)
{ switch (arg0) { case 0: break; case 10: global.choicemsg[0] = stringsetloc(
#Yes
"#Yes", "scr_text_slash_scr_text_gml_8_0"
);
global.choicemsg[1] = stringsetloc(
#No
"#No", "scr_text_slash_scr_text_gml_9_0"
);
global.choicemsg[2] = stringsetloc(
" ", "scr_text_slash_scr_text_gml_12_0_b"
);
global.choicemsg[3] = stringsetloc(
" ", "scr_text_slash_scr_text_gml_13_0_b"
);
global.msg[0] = stringsetloc(
* You really didn't want to throw it away.Wait for input
"* You really didn't want to throw it away./", "scr_text_slash_scr_text_gml_12_0"
);
global.msg[1] = stringsetloc(
* Throw it away anyway?Wait for input
"* Throw it away anyway?/", "scr_text_slash_scr_text_gml_13_0"
);
global.msg[2] = stringsetloc(
Choice type 2
"\\C2 ", "scr_text_slash_scr_text_gml_14_0"
);
if (global.chapter >= 2) msgsetloc(0,
* You took it from your pocket.Delay 11
* You have a very,Delay 11 very,Delay 11 bad feeling about throwing it away.Wait for input
"* You took it from your pocket^1.&* You have a \\cYvery^1, very^1, bad feeling\\c0 about throwing it away./", "scr_text_slash_scr_text_gml_19_0"
);
break; case 11: if (global.choice == 0) { global.flag[466 junkball_dropped] = 1; snd_play(snd_bageldefeat); global.msg[0] = stringsetloc(
* Hand shaking,Delay 11 you dropped the ball of junk on the ground.Wait for input
"* Hand shaking^1, you dropped the ball of junk on the ground./", "scr_text_slash_scr_text_gml_20_0"
);
global.msg[1] = stringsetloc(
* It broke into pieces.Wait for input
"* It broke into pieces./", "scr_text_slash_scr_text_gml_21_0"
);
global.msg[2] = stringsetloc(
* You felt bitter.Wait for inputClose Message
"* You felt bitter./%", "scr_text_slash_scr_text_gml_22_0"
);
script_execute(scr_litemshift, global.menucoord[1], 0); for (var i = 0; i < 12; i += 1) global.item[i] = 0; for (var i = 0; i < 48; i += 1) { global.armor[i] = 0; global.weapon[i] = 0; } } else { global.msg[0] = stringsetloc(
* You felt a feeling of relief.Wait for inputClose Message
"* You felt a feeling of relief./%", "scr_text_slash_scr_text_gml_34_0"
);
} break; case 100: global.msg[0] = stringsetloc(
* Hey, Kris!Delay 11 What's up?Delay 11
* Didja lose your pencil again?Wait for input
"* Hey, Kris^1! What's up^1?&* Didja lose your pencil again?/", "scr_text_slash_scr_text_gml_39_0"
);
global.msg[1] = stringsetloc(
Face 4* Here,Delay 11 you want the candy-cane one or the one with lights on it?Wait for input
"\\E4* Here^1, you want the candy-cane one or the one with lights on it?/", "scr_text_slash_scr_text_gml_40_0"
);
global.msg[2] = stringsetloc(
Face 1* Huh?Delay 11
* You want to be partners?Wait for input
"\\E1* Huh^1?&* You want to be partners?/", "scr_text_slash_scr_text_gml_41_0"
);
global.msg[3] = stringsetloc(
Face 4* Ummm...Delay 11 Sorry...Delay 11
* Berdly already asked me...Wait for input
"\\E4* Ummm..^1. Sorry..^1.&* Berdly already asked me.../", "scr_text_slash_scr_text_gml_42_0"
);
global.msg[4] = stringsetloc(
Face 0* But I could ask Ms. Alphys if we could make a group of 3!Wait for input
"\\E0* But I could ask Ms. Alphys if we could make a group of 3!/", "scr_text_slash_scr_text_gml_43_0"
);
global.msg[5] = stringsetloc(
Face 4* I'll ask if you're sure!

Not yet Yes. Ask.Choice type 1
"\\E4* I'll ask if you're sure!& &Not yet Yes. Ask.\\C1 ", "scr_text_slash_scr_text_gml_44_0"
);
global.msg[6] = stringsetloc(
" ", "scr_text_slash_scr_text_gml_47_0"
);
break; case 101: if (global.choice == 1) { global.msg[0] = stringsetloc(
Face 0* OK,Delay 11 I'll ask!Wait for input
"\\E0* OK^1, I'll ask!/", "scr_text_slash_scr_text_gml_51_0"
);
global.msg[1] = stringsetloc(
* Miss Alphys!Delay 11
* Umm,Delay 11 is it OK if we have a group of 3?Wait for inputClose Message
"* Miss Alphys^1!&* Umm^1, is it OK if we have a group of 3?/%", "scr_text_slash_scr_text_gml_52_0"
);
with (obj_classscene) con = 20; } if (global.choice == 0) global.msg[0] = stringsetloc(
Face 4* Yeah,Delay 11 I'm sure there's someone else you can ask!Wait for inputClose Message
"\\E4* Yeah^1, I'm sure there's someone else you can ask!/%", "scr_text_slash_scr_text_gml_57_0"
);
break; case 102: global.msg[0] = stringsetloc(
Face 0* Do you wanna be partners?
Not yet YesChoice type 1
"\\E0* Do you wanna be partners?&Not yet Yes\\C1 ", "scr_text_slash_scr_text_gml_62_0"
);
global.msg[1] = stringsetloc(
" ", "scr_text_slash_scr_text_gml_65_0"
);
break; case 103: if (global.choice == 1) { global.msg[0] = stringsetloc(
Face 0* OK,Delay 11 I'll ask!Wait for input
"\\E0* OK^1, I'll ask!/", "scr_text_slash_scr_text_gml_69_0"
);
global.msg[1] = stringsetloc(
* Miss Alphys!Delay 11
* Umm,Delay 11 is it OK if we have a group of 3?Wait for inputClose Message
"* Miss Alphys^1!&* Umm^1, is it OK if we have a group of 3?/%", "scr_text_slash_scr_text_gml_70_0"
);
with (obj_classscene) con = 20; } if (global.choice == 0) global.msg[0] = stringsetloc(
Face 4* Umm,Delay 11 OK.Delay 11
* You just keep doing your thing,Delay 11 Kris.Wait for inputClose Message
"\\E4* Umm^1, OK^1.&* You just keep doing your thing^1, Kris./%", "scr_text_slash_scr_text_gml_75_0"
);
break; case 104: global.msg[0] = stringsetloc(
Face 0* Alright.Delay 11
* Let's get this over with.Wait for input
"\\E0* Alright^1.&* Let's get this over with./", "scr_text_slash_scr_text_gml_80_0"
);
global.msg[1] = stringsetloc(
* We'll get more chalk.Delay 11
* Mosey back to class.Delay 11
* And then,Delay 11 Kris...Wait for input
"* We'll get more chalk^1.&* Mosey back to class^1.&* And then^1, Kris.../", "scr_text_slash_scr_text_gml_81_0"
);
global.msg[2] = stringsetloc(
Face 2* YOU'LL do our project.Wait for input
"\\E2* YOU'LL do our project./", "scr_text_slash_scr_text_gml_82_0"
);
global.msg[3] = stringsetloc(
* How's that sound?

Good BadChoice type 1
"* How's that sound?& &Good Bad\\C1 ", "scr_text_slash_scr_text_gml_83_0"
);
global.msg[4] = stringsetloc(
" ", "scr_text_slash_scr_text_gml_86_0"
);
break; case 105: global.msg[0] = stringsetloc(
Close MessageClose Message
" %%", "scr_text_slash_scr_text_gml_90_0"
);
break; case 110: global.choicemsg[0] = stringsetloc(
#Yes
"#Yes", "scr_text_slash_scr_text_gml_92_0"
);
global.choicemsg[1] = stringsetloc(
#No
"#No", "scr_text_slash_scr_text_gml_93_0"
);
global.choicemsg[2] = stringsetloc(
" ", "scr_text_slash_scr_text_gml_96_0"
);
global.choicemsg[3] = stringsetloc(
" ", "scr_text_slash_scr_text_gml_97_0"
);
if (global.flag[100 got_glowshard] == 0) { global.msg[0] = stringsetloc(
* (There's something glowing inside.)Wait for input
"* (There's something glowing inside.)/", "scr_text_slash_scr_text_gml_98_0"
);
global.msg[1] = stringsetloc(
* (Take it?)Wait for input
"* (Take it?)/ ", "scr_text_slash_scr_text_gml_99_0"
);
global.msg[2] = stringsetloc(
Choice type 2
" \\C2", "scr_text_slash_scr_text_gml_100_0"
);
} else { global.msg[0] = stringsetloc(
* (It's dark inside.)Wait for inputClose Message
"* (It's dark inside.)/%", "scr_text_slash_scr_text_gml_104_0"
);
} break; case 111: ...
(global.msc);
204
        d_make();
205
    }
206
}
207
if (endcon == 2 && !d_ex())
208
{
209
    endcon = 1;
210
    obj_b3bs_console.swordinteract = 0;
211
    global.interact = 0;
212
}