Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_bpush1_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    if (i_ex(obj_board_tree_static))
4
    {
5
        var image_ind = obj_board_tree_static.image_index;
6
        hazard[0] = instance_create(x + 288, y + 128, obj_board_tree_static);
7
        hazard[1] = instance_create(x + 128, y + 192, obj_board_tree_static);
8
        hazard[2] = instance_create(x + 160, y + 192, obj_board_tree_static);
9
        hazard[0].image_index = image_ind;
10
        hazard[1].image_index = image_ind;
11
        hazard[2].image_index = image_ind;
12
        init = 1;
13
    }
14
}
15
if (kr == 0)
16
{
17
    with (obj_mainchara_board)
18
    {
19
        if (name == "kris")
20
            other.kr = id;
21
    }
22
}
23
if (su == 0)
24
{
25
    with (obj_mainchara_board)
26
    {
27
        if (name == "susie")
28
            other.su = id;
29
    }
30
}
31
if (ra == 0)
32
{
33
    with (obj_mainchara_board)
34
    {
35
        if (name == "ralsei")
36
            other.ra = id;
37
    }
38
}
39
if (susiereal == 0)
40
{
41
    with (obj_caterpillarchara)
42
    {
43
        if (name == "susie")
44
            other.susiereal = id;
45
    }
46
}
47
if (ralseireal == 0)
48
{
49
    with (obj_caterpillarchara)
50
    {
51
        if (name == "ralsei")
52
            other.ralseireal = id;
53
    }
54
}
55
if (tenna == 0)
56
{
57
    with (obj_actor_tenna)
58
        other.tenna = id;
59
}
60
if (active == 1 && obj_board_camera.con == 0)
61
{
62
    if (eventactive)
63
    {
64
        eventtimer++;
65
        if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
66
        {
67
            if (keyboard_check_pressed(vk_f5))
68
                con = 100;
69
        }
70
    }
71
    sutime++;
72
    if (susiewalkcon == 0)
73
    {
74
        if (solved == 0)
75
        {
76
            ralsei.follow = 0;
77
            if (sutime >= 30)
78
            {
79
                with (obj_mainchara_board)
80
                {
81
                    if (name == "susie")
82
                        sleepy = true;
83
                }
84
                
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("ralsei", 6, 4, 0);
85
                
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("susie", 4, 4, 0);
86
                susiewalkcon = -1;
87
            }
88
        }
89
        else
90
        {
91
            ra.follow = 1;
92
            if (sutime >= 10)
93
            {
94
                
scr_pathfind_end
scr_pathfind_end

function
scr_pathfind_end(arg0)
{ with (obj_mainchara_board) { if (name == arg0) { path_end(); path_target_x = -1; path_target_y = -1; is_moving_timer = 0; is_moving = false; } } }
("susie");
95
                with (obj_mainchara_board)
96
                {
97
                    if (name == "susie")
98
                        sleepy = true;
99
                }
100
                susiewalkcon = -1;
101
                var side = choose(0, 1);
102
                if (side == 1)
103
                    
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("susie", choose(3, 4), choose(3, 4), 0);
104
                else
105
                    
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("susie", choose(6, 7), choose(3, 4), 0);
106
            }
107
        }
108
    }
109
    if (con == 0)
110
    {
111
        with (obj_caterpillarchara)
112
            fun = 1;
113
        timer++;
114
        if (timer == 10)
115
        {
116
            timer = 0;
117
            con = 1;
118
            tenna.bounce = 1;
119
            var tetalk = stringsetloc(
Can you solve the puzzle of desert?
"Can you solve the puzzle of desert?", "obj_bpush1_slash_Step_0_gml_109_0"
);
120
            
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(tetalk, "tenna", 2, 75);
121
            eventactive = true;
122
        }
123
    }
124
    if (con == 1)
125
    {
126
        timer++;
127
        if (timer == 50)
128
        {
129
            with (susiereal)
130
            {
131
            }
132
        }
133
        if (timer == 60)
134
        {
135
            timer = 0;
136
            con = 2;
137
            var sutalk = stringsetloc(
No. Eating yogurt.
"No. Eating yogurt.", "obj_bpush1_slash_Step_0_gml_130_0"
);
138
            
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(sutalk, "susie", 2, 60);
139
        }
140
    }
141
    if (con == 2)
142
    {
143
        timer++;
144
        var pushed = 0;
145
        with (obj_pushableblock_board)
146
        {
147
            if (extflag == "push1")
148
                pushed += pushcount;
149
        }
150
        if (pushed > 0)
151
        {
152
            timer = 0;
153
            con = 10;
154
        }
155
        if (timer == 120 && pushed == 0)
156
        {
157
            var ratalk = stringsetloc(
Kris, perhaps we can use that block?
"Kris, perhaps we can use that block?", "obj_bpush1_slash_Step_0_gml_149_0"
);
158
            
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(ratalk, "ralsei", 2, 75);
159
            ralseireal.sprite_index = spr_ralsei_walk_left;
160
            with (ralseireal)
161
                
scr_var_delay
scr_var_delay

function
scr_var_delay(arg0, arg1, arg2)
{
scr_script_delayed(scr_var, arg2, arg0, arg1);
} function scr_var_delayed(arg0, arg1, arg2) {
scr_script_delayed(scr_var, arg2, arg0, arg1);
} function scr_delay_var(arg0, arg1, arg2) {
scr_script_delayed(scr_var, arg2, arg0, arg1);
}
("sprite_index", spr_ralsei_walk_up, 75);
162
        }
163
        var intheway = false;
164
        if (pushed > 0)
165
            intheway = true;
166
        with (obj_board_trigger)
167
        {
168
            if (extflag == "yogurteasteregg")
169
            {
170
                if (place_meeting(x, y, obj_mainchara_board))
171
                    intheway = true;
172
            }
173
        }
174
        if (intheway == true && timer > 120)
175
            timer--;
176
        if (timer == 300 && !intheway)
177
        {
178
            kr.cantleave = true;
179
            with (susiereal)
180
                sprite_index = rsprite;
181
            susiereal.image_speed = 0;
182
        }
183
        if (timer == 320 && !intheway)
184
        {
185
            var sutalk = stringsetloc(
Kris stay still.
"Kris stay still.", "obj_bpush1_slash_Step_0_gml_183_0"
);
186
            
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(sutalk, "susie", 2, 60);
187
            with (obj_mainchara_board)
188
            {
189
                if (name == "kris")
190
                    canfreemove = 0;
191
            }
192
        }
193
        if (timer == 330 && !intheway)
194
        {
195
            with (obj_mainchara)
196
            {
197
                fun = 1;
198
                sprite_index = spr_krisl_dark;
199
            }
200
        }
201
        if (timer == 350 && !intheway)
202
            ralseireal.sprite_index = ralseireal.lsprite;
203
        if (timer == 380 && !intheway)
204
        {
205
            var _su = 0;
206
            with (obj_caterpillarchara)
207
            {
208
                if (name == "susie")
209
                    _su = id;
210
            }
211
            snd_play(snd_wing);
212
            var throwtime = 24;
213
            var yogurt = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(_su.x + 8, _su.y + 40, spr_gameshow_yogurttube);
214
            with (yogurt)
215
            {
216
                with (obj_caterpillarchara)
217
                    other.depth = depth + 100;
218
                vspeed = -10;
219
                gravity = 1;
220
                hspeed = 10;
221
                friction = 0.24;
222
                snd_play_delay(snd_splat, 11);
223
                
scr_var_delay
scr_var_delay

function
scr_var_delay(arg0, arg1, arg2)
{
scr_script_delayed(scr_var, arg2, arg0, arg1);
} function scr_var_delayed(arg0, arg1, arg2) {
scr_script_delayed(scr_var, arg2, arg0, arg1);
} function scr_delay_var(arg0, arg1, arg2) {
scr_script_delayed(scr_var, arg2, arg0, arg1);
}
("hspeed", -3, 11);
224
                
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(id, throwtime);
225
            }
226
        }
227
        if (timer == 420 && !intheway)
228
        {
229
            susiereal.sprite_index = spr_susieu_dark_faceleft_concerned;
230
            var sutalk = stringsetloc(
Open your mouth, idiot.
"Open your mouth, idiot.", "obj_bpush1_slash_Step_0_gml_227_0"
);
231
            
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(sutalk, "susie", 2, 60);
232
        }
233
        if (timer == 430 && !intheway)
234
        {
235
            var raltalk = stringsetloc(
...
"...", "obj_bpush1_slash_Step_0_gml_232_0"
);
236
            
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(raltalk, "ralsei", 2, 40);
237
        }
238
        if (timer == 470 && !intheway)
239
        {
240
            ralseireal.sprite_index = ralseireal.usprite;
241
            kr.controlled = 0;
242
            ra.controlled = 1;
243
            ra.caninteract = true;
244
            
scr_play_ralsei_recording
scr_play_ralsei_recording

function
scr_play_ralsei_recording(arg0)
{ with (obj_mainchara_board) { if (name == "ralsei") { susierecordcon = 2; susierecordcount = 0; susierecordstring = arg0; susierecordsave = false; } } }
("0D0D0D0D0D0R0R0R0R0R0R0R0R0U0U0U0U0U0U0U0U0U0U0U0U0U0U0U0U0U0U0U0U0U0U0L0L0L0L0L0L0L0L0L0L0L0L10L0L0L0L0L0L0L0L0L0L0L0L0L10L0L0L0L0L0L0LU0U0U0U0U0U0U0L0L0L0L0L0L0L0L0L0D0D0D10D0D0D0D0D0D0D0D0D10D0D0D0D0D0D0D0D0D10D0D0D0D0D0D0L0L0L0L0L0L0L0L0D0D0D0D0D0D0D0D0D0R0R0R10R0R0R0R0R0R0R0R0R10W0W0W0W0W0W");
245
        }
246
        if (timer == 480 && !intheway)
247
            susiereal.sprite_index = susiereal.rsprite;
248
    }
249
    if (con > 2 && con < 100)
250
    {
251
        if (!i_ex(obj_board_event_push1_blocktrigger))
252
        {
253
            ra.caninteract = false;
254
            eventactive = false;
255
            safe_delete(obj_couchwriter);
256
            timer = 0;
257
            con = 100;
258
        }
259
    }
260
    if (con == 100)
261
    {
262
        solved = true;
263
        timer++;
264
        ra.controlled = 0;
265
        if (timer >= 16)
266
        {
267
            kr.controlled = 1;
268
            kr.canfreemove = true;
269
            kr.cantleave = false;
270
            obj_mainchara.sprite_index = obj_mainchara.usprite;
271
            susiereal.image_speed = 0;
272
            susiereal.image_index = 0;
273
            susiereal.sprite_index = susiereal.usprite;
274
            
scr_shakescreen
scr_shakescreen

function
scr_shakescreen()
{ instance_create(x, y, obj_shake); }
();
275
            for (var i = 0; i < array_length(hazard); i++)
276
            {
277
                with (hazard[i])
278
                {
279
                    var puff = instance_create(x, y, obj_board_smokepuff);
280
                    puff.depth = depth - 100;
281
                    instance_destroy();
282
                }
283
            }
284
            with (obj_pushableblock_board)
285
            {
286
                if (extflag == "push1")
287
                {
288
                    var replacementblock = instance_create(x, y, obj_board_solid);
289
                    replacementblock.sprite_index = sprite_index;
290
                    replacementblock.image_index = image_index;
291
                    
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(replacementblock);
292
                    replacementblock.visible = true;
293
                    replacementblock.depth = depth;
294
                    instance_destroy();
295
                }
296
            }
297
            snd_play_pitch(snd_impact_bc, 1.2);
298
            snd_play_pitch(snd_impact_bc, 0.6);
299
            con = 101;
300
            timer = 0;
301
        }
302
    }
303
    if (con == 101)
304
    {
305
        timer++;
306
        if (timer == 5)
307
        {
308
            var seconds = round(eventtimer / 30);
309
            timestring = stringsetsubloc("Wow, a ~1S time!", seconds, "obj_bpush1_slash_Step_0_gml_322_0");
310
            var earlytime = 13;
311
            var latetime = 30;
312
            if (eventtimer < (earlytime * 30))
313
            {
314
                timeresult = 1;
315
                secondstring = stringsetloc(
Impressive!
"Impressive!", "obj_bpush1_slash_Step_0_gml_330_0"
);
316
            }
317
            if (eventtimer >= (earlytime * 30) && eventtimer <= (latetime * 30))
318
            {
319
                timeresult = 2;
320
                secondstring = stringsetloc(
That's concerning!!
"That's concerning!!", "obj_bpush1_slash_Step_0_gml_335_0"
);
321
            }
322
            if (eventtimer >= (latetime * 30))
323
            {
324
                timeresult = 3;
325
                secondstring = stringsetloc(
The audience is crying!
"The audience is crying!", "obj_bpush1_slash_Step_0_gml_340_0"
);
326
            }
327
            tenna.bounce = 1;
328
            
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(timestring, "tenna", 2, 70);
329
        }
330
        if (timer == 75)
331
        {
332
            tenna.bounce = 1;
333
            
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(secondstring, "tenna", 2, 70);
334
            con = 102;
335
        }
336
    }
337
}
338
if (active == false)
339
{
340
    sutime = 0;
341
    susiewalkcon = 0;
342
    timer = 0;
343
    if (con == 1)
344
        con = 2;
345
    if (con >= 100)
346
        con = 900;
347
}