Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_mainchara_Step_0

(view raw script w/o annotations or w/e)
1
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
2
{
3
    var noclipinput = false;
4
    var glointforce = false;
5
    for (var i = 0; i < 8; i++)
6
    {
7
        if ((gamepad_button_check(i, gp_shoulderl) || gamepad_button_check(i, gp_shoulderlb)) && (gamepad_button_check(i, gp_shoulderr) || gamepad_button_check(i, gp_shoulderrb)))
8
        {
9
            if (gamepad_button_check_pressed(i, gp_face4))
10
                noclipinput = true;
11
            if (gamepad_button_check_pressed(i, gp_select))
12
                glointforce = true;
13
        }
14
    }
15
    if ((keyboard_check(vk_shift) && keyboard_check(vk_control) && keyboard_check_pressed(ord("N"))) || noclipinput)
16
    {
17
        noclip = !noclip;
18
        var str = "off";
19
        if (noclip == 1)
20
            str = "on";
21
        debug_print("noclip=" + str);
22
    }
23
    if ((keyboard_check(vk_shift) && keyboard_check(vk_control) && keyboard_check_pressed(ord("0"))) || glointforce)
24
    {
25
        debug_print("global.interact set to 0");
26
        global.interact = 0;
27
    }
28
}
29
if (ignoredepth == 0)
30
    
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
31
wallcheck = 0;
32
nowx = x;
33
nowy = y;
34
if (press_d == 0 && press_l == 0 && press_u == 0 && press_r == 0)
35
    nopress = 1;
36
press_l = 0;
37
press_r = 0;
38
press_d = 0;
39
press_u = 0;
40
bkx = 0;
41
bky = 0;
42
bkxy = 0;
43
jelly = 2;
44
if (!roomenterfreezeend)
45
{
46
    if (global.interact == 3)
47
    {
48
        if (global.flag[21 door_freeze_timer] > 0)
49
        {
50
            global.flag[21 door_freeze_timer]--;
51
        }
52
        else
53
        {
54
            roomenterfreezeend = 1;
55
            global.interact = 0;
56
            global.flag[21 door_freeze_timer] = -10;
57
        }
58
    }
59
}
60
if (global.interact == 0)
61
{
62
    if (button3_p() && threebuffer < 0)
63
    {
64
        if (global.flag[7 disable_menu?] == 0 && battlemode == 0 && swordmode == 0)
65
        {
66
            with (obj_darkcontroller)
67
                threebuffer = 2;
68
            with (obj_overworldc)
69
            {
70
                movenoise = 1;
71
                threebuffer = 2;
72
            }
73
            global.menuno = 0;
74
            global.interact = 5;
75
            threebuffer = 2;
76
            twobuffer = 2;
77
        }
78
    }
79
}
80
if (swordcon == 1)
81
{
82
    swordtimer++;
83
    if (swordtimer >= 15)
84
    {
85
        with (slashmarker)
86
            instance_destroy();
87
        swordcon = 0;
88
        swordsprite = rsprite;
89
        fun = 0;
90
        if (global.interact == 4)
91
            global.interact = 0;
92
        swordtimer = 0;
93
        image_speed = 0;
94
        image_index = 0;
95
        image_alpha = 1;
96
    }
97
}
98
if (global.interact == 0 && freeze == 0)
99
{
100
    if (global.flag[11 auto_run] == 1)
101
    {
102
        if (button2_h() && twobuffer < 0)
103
            run = 0;
104
        else
105
            run = 1;
106
    }
107
    else if (button2_h() && twobuffer < 0)
108
    {
109
        run = 1;
110
    }
111
    else
112
    {
113
        run = 0;
114
    }
115
    if (autorun > 0)
116
    {
117
        if (autorun == 1)
118
        {
119
            run = 1;
120
            runtimer = 200;
121
        }
122
        if (autorun == 2)
123
        {
124
            run = 1;
125
            runtimer = 50;
126
        }
127
    }
128
    if (!canrun)
129
        run = 0;
130
    if (run == 1)
131
    {
132
        if (darkmode == 0)
133
        {
134
            wspeed = bwspeed + 1;
135
            if (runtimer > 10)
136
                wspeed = bwspeed + 2;
137
            if (runtimer > 60)
138
                wspeed = bwspeed + 3;
139
        }
140
        if (darkmode == 1)
141
        {
142
            wspeed = bwspeed + 2;
143
            if (runtimer > 10)
144
                wspeed = bwspeed + 4;
145
            if (runtimer > 60)
146
                wspeed = bwspeed + 5;
147
        }
148
    }
149
    if (run == 0)
150
        wspeed = bwspeed;
151
    if (climbing == 1)
152
        wspeed = ceil(wspeed * 0.7);
153
    if (left_h())
154
        press_l = 1;
155
    if (right_h())
156
        press_r = 1;
157
    if (up_h())
158
        press_u = 1;
159
    if (down_h())
160
        press_d = 1;
161
    px = 0;
162
    py = 0;
163
    pressdir = -1;
164
    if (press_r == 1)
165
    {
166
        px = wspeed;
167
        pressdir = 1;
168
    }
169
    if (press_l == 1)
170
    {
171
        px = -wspeed;
172
        pressdir = 3;
173
    }
174
    if (press_d == 1)
175
    {
176
        py = wspeed;
177
        pressdir = 0;
178
    }
179
    if (press_u == 1)
180
    {
181
        py = -wspeed;
182
        pressdir = 2;
183
    }
184
    if (nopress == 1 && pressdir != -1)
185
        global.facing = pressdir;
186
    if (global.facing == 2)
187
    {
188
        if (press_d == 1)
189
            global.facing = 0;
190
        if (press_u == 0 && pressdir != -1)
191
            global.facing = pressdir;
192
    }
193
    if (global.facing == 0)
194
    {
195
        if (press_u == 1)
196
            global.facing = 2;
197
        if (press_d == 0 && pressdir != -1)
198
            global.facing = pressdir;
199
    }
200
    if (global.facing == 3)
201
    {
202
        if (press_r == 1)
203
            global.facing = 1;
204
        if (press_l == 0 && pressdir != -1)
205
            global.facing = pressdir;
206
    }
207
    if (global.facing == 1)
208
    {
209
        if (press_l == 1)
210
            global.facing = 3;
211
        if (press_r == 0 && pressdir != -1)
212
            global.facing = pressdir;
213
    }
214
    if (press_r == 1)
215
        swordfacing = 1;
216
    if (press_l == 1)
217
        swordfacing = -1;
218
    if (swordmode == 1)
219
    {
220
        if (button1_p() && swordcon == 0 && global.interact == 0)
221
        {
222
            global.interact = 4;
223
            swordsprite = rsprite;
224
            slashmarker = 
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; }
(x, y, rsprite);
225
            slashmarker.depth = depth;
226
            slashmarker.image_speed = 1;
227
            if (swordfacing == -1)
228
            {
229
                slashmarker.x += sprite_width;
230
                slashmarker.image_xscale = -image_xscale;
231
            }
232
            image_alpha = 0;
233
            fun = 1;
234
            snd_play(snd_laz_c);
235
            image_index = 0;
236
            image_speed = 0.5;
237
            swordtimer = 0;
238
            swordcon = 1;
239
            press_l = 0;
240
            press_r = 0;
241
            press_u = 0;
242
            press_d = 0;
243
            swordhitbox = instance_create(slashmarker.x, slashmarker.y, obj_swordhitbox);
244
            swordhitbox.image_xscale = slashmarker.image_xscale;
245
            swordhitbox.image_yscale = image_yscale;
246
        }
247
    }
248
    nopress = 0;
249
    xmeet = 0;
250
    ymeet = 0;
251
    xymeet = 0;
252
    if (floorheight == 0)
253
    {
254
        var checkcol = true;
255
        if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
() && noclip)
256
            checkcol = false;
257
        if (checkcol)
258
        {
259
            if (place_meeting(x + px, y + py, obj_solidblock))
260
            {
261
                xymeet = 1;
262
                if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
() && noclip)
263
                    xymeet = 0;
264
            }
265
            if (place_meeting(x + px, y, obj_solidblock))
266
            {
267
                if (place_meeting(x + px, y, obj_solidblock))
268
                {
269
                    for (g = wspeed; g > 0; g -= 1)
270
                    {
271
                        mvd = 0;
272
                        if (press_d == 0 && !place_meeting(x + px, y - g, obj_solidblock))
273
                        {
274
                            y -= g;
275
                            py = 0;
276
                            break;
277
                            mvd = 1;
278
                        }
279
                        if (press_u == 0 && mvd == 0 && !place_meeting(x + px, y + g, obj_solidblock))
280
                        {
281
                            y += g;
282
                            py = 0;
283
                            break;
284
                        }
285
                    }
286
                }
287
                xmeet = 1;
288
                bkx = 0;
289
                if (px > 0)
290
                {
291
                    for (var i = px; i >= 0; i -= 1)
292
                    {
293
                        if (!place_meeting(x + i, y, obj_solidblock))
294
                        {
295
                            px = i;
296
                            bkx = 1;
297
                            break;
298
                        }
299
                    }
300
                }
301
                if (px < 0)
302
                {
303
                    for (var i = px; i <= 0; i += 1)
304
                    {
305
                        if (!place_meeting(x + i, y, obj_solidblock))
306
                        {
307
                            px = i;
308
                            bkx = 1;
309
                            break;
310
                        }
311
                    }
312
                }
313
                if (bkx == 0)
314
                    px = 0;
315
            }
316
            if (place_meeting(x, y + py, obj_solidblock))
317
            {
318
                ymeet = 1;
319
                bky = 0;
320
                if (place_meeting(x, y + py, obj_solidblock))
321
                {
322
                    for (g = wspeed; g > 0; g -= 1)
323
                    {
324
                        mvd = 0;
325
                        if (press_r == 0 && !place_meeting(x - g, y + py, obj_solidblock))
326
                        {
327
                            x -= g;
328
                            px = 0;
329
                            break;
330
                            mvd = 1;
331
                        }
332
                        if (mvd == 0 && press_l == 0 && !place_meeting(x + g, y + py, obj_solidblock))
333
                        {
334
                            x += g;
335
                            px = 0;
336
                            break;
337
                        }
338
                    }
339
                }
340
                if (py > 0)
341
                {
342
                    for (var i = py; i >= 0; i -= 1)
343
                    {
344
                        if (!place_meeting(x, y + i, obj_solidblock))
345
                        {
346
                            py = i;
347
                            bky = 1;
348
                            break;
349
                        }
350
                    }
351
                }
352
                if (py < 0)
353
                {
354
                    for (var i = py; i <= 0; i += 1)
355
                    {
356
                        if (!place_meeting(x, y + i, obj_solidblock))
357
                        {
358
                            py = i;
359
                            bky = 1;
360
                            break;
361
                        }
362
                    }
363
                }
364
                if (bky == 0)
365
                    py = 0;
366
            }
367
            if (place_meeting(x + px, y + py, obj_solidblock))
368
            {
369
                xymeet = 1;
370
                bkxy = 0;
371
                var i = px;
372
                j = py;
373
                while (j != 0 || i != 0)
374
                {
375
                    if (!place_meeting(x + i, y + j, obj_solidblock))
376
                    {
377
                        px = i;
378
                        py = j;
379
                        bkxy = 1;
380
                        break;
381
                    }
382
                    if (abs(j) >= 1)
383
                    {
384
                        if (j > 0)
385
                            j -= 1;
386
                        if (j < 0)
387
                            j += 1;
388
                    }
389
                    else
390
                    {
391
                        j = 0;
392
                    }
393
                    if (abs(i) >= 1)
394
                    {
395
                        if (i > 0)
396
                            i -= 1;
397
                        if (i < 0)
398
                            i += 1;
399
                    }
400
                    else
401
                    {
402
                        i = 0;
403
                    }
404
                }
405
                if (bkxy == 0)
406
                {
407
                    px = 0;
408
                    py = 0;
409
                }
410
            }
411
        }
412
    }
413
    else
414
    {
415
        var _hedge = bbox_right;
416
        var _vedge = bbox_bottom;
417
        var _goingright = 0;
418
        var _goingdown = 0;
419
        var _checkobj = 535;
420
        if (px > 0)
421
        {
422
            _goingright = 1;
423
            _hedge = bbox_right;
424
        }
425
        if (px < 0)
426
        {
427
            _goingright = -1;
428
            _hedge = bbox_left;
429
        }
430
        if (py > 0)
431
        {
432
            _goingdown = 1;
433
            _vedge = bbox_bottom;
434
        }
435
        if (py < 0)
436
        {
437
            _goingdown = -1;
438
            _vedge = bbox_top;
439
        }
440
        if (!check_heightfloor(px, 0, _checkobj))
441
        {
442
            for (g = wspeed; g > 0; g -= 1)
443
            {
444
                mvd = 0;
445
                if (press_d == 0)
446
                {
447
                    if (check_heightfloor(px, -g, _checkobj))
448
                    {
449
                        y -= g;
450
                        py = 0;
451
                        _vedge = bbox_top;
452
                        break;
453
                        mvd = 1;
454
                    }
455
                }
456
                if (press_u == 0)
457
                {
458
                    if (check_heightfloor(px, g, _checkobj))
459
                    {
460
                        y += g;
461
                        py = 0;
462
                        _vedge = bbox_bottom;
463
                        break;
464
                    }
465
                }
466
            }
467
            xmeet = 1;
468
            bkx = 0;
469
            if (px > 0)
470
            {
471
                for (var i = px; i >= 0; i -= 1)
472
                {
473
                    if (check_heightfloor(i, 0, _checkobj))
474
                    {
475
                        px = i;
476
                        bkx = 1;
477
                        break;
478
                    }
479
                }
480
            }
481
            if (px < 0)
482
            {
483
                for (var i = px; i <= 0; i += 1)
484
                {
485
                    if (check_heightfloor(i, 0, _checkobj))
486
                    {
487
                        px = i;
488
                        bkx = 1;
489
                        break;
490
                    }
491
                }
492
            }
493
            if (bkx == 0)
494
                px = 0;
495
        }
496
        if (!check_heightfloor(0, py, _checkobj))
497
        {
498
            ymeet = 1;
499
            bky = 0;
500
            for (g = wspeed; g > 0; g -= 1)
501
            {
502
                mvd = 0;
503
                if (press_r == 0 && check_heightfloor(-g, py, _checkobj))
504
                {
505
                    x -= g;
506
                    px = 0;
507
                    _hedge = bbox_left;
508
                    break;
509
                    mvd = 1;
510
                }
511
                if (mvd == 0 && press_l == 0 && check_heightfloor(g, py, _checkobj))
512
                {
513
                    x += g;
514
                    px = 0;
515
                    _hedge = bbox_right;
516
                    break;
517
                }
518
            }
519
            if (py > 0)
520
            {
521
                for (var i = py; i >= 0; i -= 1)
522
                {
523
                    if (check_heightfloor(0, i, _checkobj))
524
                    {
525
                        py = i;
526
                        bky = 1;
527
                        break;
528
                    }
529
                }
530
            }
531
            if (py < 0)
532
            {
533
                for (var i = py; i <= 0; i += 1)
534
                {
535
                    if (check_heightfloor(0, i, _checkobj))
536
                    {
537
                        py = i;
538
                        bky = 1;
539
                        break;
540
                    }
541
                }
542
            }
543
            if (bky == 0)
544
                py = 0;
545
        }
546
        if (!check_heightfloor(px, 0, _checkobj))
547
        {
548
            xymeet = 1;
549
            bkxy = 0;
550
            var i = px;
551
            j = py;
552
            while (j != 0 || i != 0)
553
            {
554
                if (check_heightfloor(i, j, _checkobj))
555
                {
556
                    px = i;
557
                    py = j;
558
                    bkxy = 1;
559
                    break;
560
                }
561
                if (abs(j) >= 1)
562
                {
563
                    if (j > 0)
564
                        j -= 1;
565
                    if (j < 0)
566
                        j += 1;
567
                }
568
                else
569
                {
570
                    j = 0;
571
                }
572
                if (abs(i) >= 1)
573
                {
574
                    if (i > 0)
575
                        i -= 1;
576
                    if (i < 0)
577
                        i += 1;
578
                }
579
                else
580
                {
581
                    i = 0;
582
                }
583
            }
584
            if (bkxy == 0)
585
            {
586
                px = 0;
587
                py = 0;
588
            }
589
        }
590
    }
591
    runmove = 0;
592
    if (run == 1 && xmeet == 0 && ymeet == 0 && xymeet == 0)
593
    {
594
        if (abs(px) > 0 || abs(py) > 0)
595
        {
596
            runmove = 1;
597
            runtimer += 1;
598
            runcounter += 1;
599
        }
600
        else
601
        {
602
            runtimer = 0;
603
        }
604
    }
605
    else
606
    {
607
        runtimer = 0;
608
    }
609
    x += px;
610
    y += py;
611
}
612
if (fun == 0)
613
{
614
    walk = 0;
615
    if (x != nowx && nopress == 0)
616
        walk = 1;
617
    if (y != nowy && nopress == 0)
618
        walk = 1;
619
    if (walk == 1)
620
        walkbuffer = 6;
621
    if (walkbuffer > 3 && fun == 0)
622
    {
623
        walktimer += 1.5;
624
        if (runmove == 1)
625
            walktimer += 1.5;
626
        if (walktimer >= 40)
627
            walktimer -= 40;
628
        if (walktimer < 10)
629
            image_index = 0;
630
        if (walktimer >= 10)
631
            image_index = 1;
632
        if (walktimer >= 20)
633
            image_index = 2;
634
        if (walktimer >= 30)
635
            image_index = 3;
636
    }
637
    if (walkbuffer <= 0 && fun == 0 && climbing == 0)
638
    {
639
        if (walktimer < 10)
640
            walktimer = 9.5;
641
        if (walktimer >= 10 && walktimer < 20)
642
            walktimer = 19.5;
643
        if (walktimer >= 20 && walktimer < 30)
644
            walktimer = 29.5;
645
        if (walktimer >= 30)
646
            walktimer = 39.5;
647
        image_index = 0;
648
    }
649
    walkbuffer -= 0.75;
650
}
651
if (fun == 0)
652
{
653
    if (global.facing == 0)
654
        sprite_index = dsprite;
655
    if (global.facing == 1)
656
        sprite_index = rsprite;
657
    if (global.facing == 2)
658
        sprite_index = usprite;
659
    if (global.facing == 3)
660
        sprite_index = lsprite;
661
    if (climbing == 1)
662
        sprite_index = climbsprite;
663
}
664
if (stepping == 1 && fun == 0)
665
{
666
    if (image_index == 1 && stepped == 0)
667
    {
668
        if (global.flag[31 disable_loud_steps] == 0)
669
            snd_play(snd_step1);
670
        stepped = 1;
671
    }
672
    if (image_index == 0 || image_index == 2)
673
        stepped = 0;
674
    if (image_index == 3 && stepped == 0)
675
    {
676
        if (global.flag[31 disable_loud_steps] == 0)
677
            snd_play(snd_step2);
678
        stepped = 1;
679
    }
680
}
681
if (onebuffer < 0)
682
{
683
    if (global.interact == 0)
684
    {
685
        if (button1_p())
686
        {
687
            thisinteract = 0;
688
            d = global.darkzone + 1;
689
            if (global.facing == 1)
690
            {
691
                if (collision_rectangle(x + (sprite_width / 2), y + (6 * d) + (sprite_height / 2), x + sprite_width + (13 * d), y + sprite_height, obj_interactable, false, true))
692
                    thisinteract = 1;
693
                if (collision_rectangle(x + (sprite_width / 2), y + (6 * d) + (sprite_height / 2), x + sprite_width + (13 * d), y + sprite_height, obj_interactablesolid, false, true))
694
                    thisinteract = 2;
695
            }
696
            if (thisinteract > 0)
697
            {
698
                if (thisinteract == 1)
699
                    interactedobject = collision_rectangle(x + (sprite_width / 2), y + (6 * d) + (sprite_height / 2), x + sprite_width + (13 * d), y + sprite_height, obj_interactable, false, true);
700
                if (thisinteract == 2)
701
                    interactedobject = collision_rectangle(x + (sprite_width / 2), y + (6 * d) + (sprite_height / 2), x + sprite_width + (13 * d), y + sprite_height, obj_interactablesolid, false, true);
702
                if (interactedobject != -4)
703
                {
704
                    with (interactedobject)
705
                        facing = 3;
706
                    with (interactedobject)
707
                        
scr_interact
scr_interact

function
scr_interact()
{ myinteract = 1; event_user(0); }
();
708
                }
709
            }
710
            thisinteract = 0;
711
            if (global.facing == 3)
712
            {
713
                if (collision_rectangle(x + (sprite_width / 2), y + (6 * d) + (sprite_height / 2), x - (13 * d), y + sprite_height, obj_interactable, false, true))
714
                    thisinteract = 1;
715
                if (collision_rectangle(x + (sprite_width / 2), y + (6 * d) + (sprite_height / 2), x - (13 * d), y + sprite_height, obj_interactablesolid, false, true))
716
                    thisinteract = 2;
717
            }
718
            if (thisinteract > 0)
719
            {
720
                if (thisinteract == 1)
721
                    interactedobject = collision_rectangle(x + (sprite_width / 2), y + (6 * d) + (sprite_height / 2), x - (13 * d), y + sprite_height, obj_interactable, false, true);
722
                if (thisinteract == 2)
723
                    interactedobject = collision_rectangle(x + (sprite_width / 2), y + (6 * d) + (sprite_height / 2), x - (13 * d), y + sprite_height, obj_interactablesolid, false, true);
724
                if (interactedobject != -4)
725
                {
726
                    with (interactedobject)
727
                        facing = 1;
728
                    with (interactedobject)
729
                        
scr_interact
scr_interact

function
scr_interact()
{ myinteract = 1; event_user(0); }
();
730
                }
731
            }
732
            thisinteract = 0;
733
            if (global.facing == 0)
734
            {
735
                if (collision_rectangle(x + (4 * d), y + (28 * d), (x + sprite_width) - (4 * d), y + sprite_height + (15 * d), obj_interactable, false, true))
736
                    thisinteract = 1;
737
                if (collision_rectangle(x + (4 * d), y + (28 * d), (x + sprite_width) - (4 * d), y + sprite_height + (15 * d), obj_interactablesolid, false, true))
738
                    thisinteract = 2;
739
            }
740
            if (thisinteract > 0)
741
            {
742
                if (thisinteract == 1)
743
                    interactedobject = collision_rectangle(x + (4 * d), y + (28 * d), (x + sprite_width) - (4 * d), y + sprite_height + (15 * d), obj_interactable, false, true);
744
                if (thisinteract == 2)
745
                    interactedobject = collision_rectangle(x + (4 * d), y + (28 * d), (x + sprite_width) - (4 * d), y + sprite_height + (15 * d), obj_interactablesolid, false, true);
746
                if (interactedobject != -4)
747
                {
748
                    with (interactedobject)
749
                        facing = 2;
750
                    with (interactedobject)
751
                        
scr_interact
scr_interact

function
scr_interact()
{ myinteract = 1; event_user(0); }
();
752
                }
753
            }
754
            thisinteract = 0;
755
            if (global.facing == 2)
756
            {
757
                if (collision_rectangle(x + 3, (y + sprite_height) - (5 * d), (x + sprite_width) - (5 * d), y + (5 * d), obj_interactable, false, true))
758
                    thisinteract = 1;
759
                if (collision_rectangle(x + 3, (y + sprite_height) - (5 * d), (x + sprite_width) - (5 * d), y + (5 * d), obj_interactablesolid, false, true))
760
                    thisinteract = 2;
761
            }
762
            if (thisinteract > 0)
763
            {
764
                if (thisinteract == 1)
765
                    interactedobject = collision_rectangle(x + (3 * d), (y + sprite_height) - (5 * d), (x + sprite_width) - (5 * d), y + (5 * d), obj_interactable, false, true);
766
                if (thisinteract == 2)
767
                    interactedobject = collision_rectangle(x + (3 * d), (y + sprite_height) - (5 * d), (x + sprite_width) - (5 * d), y + (5 * d), obj_interactablesolid, false, true);
768
                if (interactedobject != -4)
769
                {
770
                    with (interactedobject)
771
                        facing = 0;
772
                    with (interactedobject)
773
                        
scr_interact
scr_interact

function
scr_interact()
{ myinteract = 1; event_user(0); }
();
774
                }
775
            }
776
        }
777
    }
778
}
779
onebuffer -= 1;
780
twobuffer -= 1;
781
threebuffer -= 1;
782
climbbuffer--;
783
if (climbbuffer <= 0)
784
    climbing = 0;
785
with (collision_rectangle(bbox_left, bbox_top, bbox_right, bbox_bottom, obj_doorparent, 0, 0))
786
    event_user(9);
787
if (battlemode == 1)
788
{
789
    global.inv -= 1;
790
    if (global.inv < 0)
791
    {
792
        with (collision_rectangle(x + 12, y + 40, x + 27, y + 49, obj_overworldbulletparent, 1, 0))
793
            event_user(5);
794
        with (collision_line(x + 12, y + 49, x + 19, y + 57, obj_overworldbulletparent, 1, 0))
795
            event_user(5);
796
        with (collision_line(x + 26, y + 49, x + 19, y + 57, obj_overworldbulletparent, 1, 0))
797
            event_user(5);
798
    }
799
}
800
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
801
{
802
    if (sunkus_kb_check_pressed(45))
803
    {
804
        if (room_exists(room + ROOM_INITIALIZE))
805
            room_goto_next();
806
    }
807
    if (sunkus_kb_check_pressed(46))
808
    {
809
        if (room_exists(room - ROOM_INITIALIZE))
810
            room_goto_previous();
811
    }
812
    if (sunkus_kb_check_pressed(36) && floorheight == 0)
813
    {
814
        if (sunkus_kb_check(50))
815
        {
816
            room_goto(room_krisroom );
817
            global.plot = 0;
818
            global.darkzone = 0;
819
        }
820
        if (sunkus_kb_check(51))
821
        {
822
            room_goto(room_dw_castle_area_1 );
823
            global.plot = 7;
824
            global.darkzone = 1;
825
        }
826
        if (sunkus_kb_check(55))
827
            room_goto(room_legend_neo );
828
        if (sunkus_kb_check(56))
829
        {
830
            room_goto(room_battletest );
831
            global.darkzone = 1;
832
        }
833
        if (sunkus_kb_check(57))
834
        {
835
            room_goto(room_bullettest );
836
            global.darkzone = 1;
837
        }
838
    }
839
}