Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_mainchara_board_Step_0

(view raw script w/o annotations or w/e)
1
var _upbound = 64;
2
var _downbound = 288;
3
var _leftbound = 128;
4
var _rightbound = 480;
5
var debugpathmessage = 0;
6
if (room == room_dw_puzzlecloset_3)
7
{
8
    _leftbound = 2688;
9
    _upbound = 608;
10
    _rightbound = (_leftbound + 384) - 32;
11
    _downbound = (_upbound + 256) - 32;
12
}
13
if (init == 0)
14
{
15
    init = 1;
16
    if (name == "kris")
17
    {
18
        kris = id;
19
        sleepsprite = 4293;
20
        sprite_index = spr_board_kris_walk_down;
21
        if (i_ex(obj_board_controller))
22
            obj_board_controller.kris_object = id;
23
        if (i_ex(obj_board_instawarp_helper))
24
        {
25
            x = obj_board_instawarp_helper.krissavex;
26
            y = obj_board_instawarp_helper.krissavey;
27
        }
28
        if (!
scr_swordroom
scr_swordroom

function
scr_swordroom()
{ if (room == room_board_dungeon_2 || room == room_board_dungeon_3 || room == room_board_sword_intro || room == room_board_1_sword || room == room_board_1_sword_trees || room == room_board_preshadowmantle || room == room_board_preshadowmantle_repeat || room == room_shadowmantle || room == room_board_prepostshadowmantle || room == room_board_postshadowmantle || room == room_board_2_sword || room == room_board_3_sword) return true; else return false; }
() && dontteam == false)
29
        {
30
            susie = instance_create(x + 32, y, obj_mainchara_board);
31
            susie.name = "susie";
32
            susie.sprite_index = spr_board_susie_walk_down;
33
            if (i_ex(obj_board_instawarp_helper) && obj_board_instawarp_helper.sussavex != 0 && obj_board_instawarp_helper.sussavey != 0)
34
            {
35
                susie.x = obj_board_instawarp_helper.sussavex;
36
                susie.y = obj_board_instawarp_helper.sussavey;
37
            }
38
            if (i_ex(obj_board_controller))
39
                obj_board_controller.susie_object = susie;
40
            ralsei = instance_create(x - 32, y, obj_mainchara_board);
41
            ralsei.name = "ralsei";
42
            ralsei.sprite_index = spr_board_ralsei_walk_down;
43
            ralsei.follow = true;
44
            ralsei.allow_diagonals = false;
45
            if (i_ex(obj_board_instawarp_helper) && obj_board_instawarp_helper.ralsavex != 0 && obj_board_instawarp_helper.ralsavey != 0)
46
            {
47
                ralsei.x = obj_board_instawarp_helper.ralsavex;
48
                ralsei.y = obj_board_instawarp_helper.ralsavey;
49
            }
50
            if (i_ex(obj_board_controller))
51
                obj_board_controller.ralsei_object = ralsei;
52
            for (var i = 0; i < 75; i += 1)
53
            {
54
                susie.remx[i] = x;
55
                susie.remy[i] = y;
56
                susie.facing[i] = 0;
57
            }
58
            for (var i = 0; i < 75; i += 1)
59
            {
60
                ralsei.remx[i] = x;
61
                ralsei.remy[i] = y;
62
                ralsei.facing[i] = 0;
63
            }
64
        }
65
        if (room == room_board_preshadowmantle || room == room_shadowmantle)
66
            facing = 2;
67
        with (obj_board_instawarp_helper)
68
            instance_destroy();
69
        controlled = 1;
70
    }
71
    if (name == "susie")
72
    {
73
        dsprite = spr_board_susie_walk_down;
74
        rsprite = spr_board_susie_walk_right;
75
        usprite = spr_board_susie_walk_up;
76
        lsprite = spr_board_susie_walk_left;
77
        hurtsprite = spr_board_susie_hurt;
78
        dsprite_carry = 1300;
79
        rsprite_carry = 4305;
80
        lsprite_carry = 2383;
81
        usprite_carry = 3940;
82
        dsprite_item = 2407;
83
        sleepsprite = 4052;
84
    }
85
    if (name == "ralsei")
86
    {
87
        dsprite = spr_board_ralsei_walk_down;
88
        rsprite = spr_board_ralsei_walk_right;
89
        usprite = spr_board_ralsei_walk_up;
90
        lsprite = spr_board_ralsei_walk_left;
91
        hurtsprite = spr_board_ralsei_hurt;
92
        dsprite_carry = 4183;
93
        rsprite_carry = 4653;
94
        lsprite_carry = 4151;
95
        usprite_carry = 3832;
96
        dsprite_item = 3102;
97
        sleepsprite = 4433;
98
    }
99
    if (name == "lancer")
100
    {
101
        dsprite = spr_board_lancer_down;
102
        rsprite = spr_board_lancer_right;
103
        usprite = spr_board_lancer_up;
104
        lsprite = spr_board_lancer_left;
105
        hurtsprite = spr_board_lancer_down;
106
        dsprite_carry = 4555;
107
        rsprite_carry = 474;
108
        lsprite_carry = 2082;
109
        usprite_carry = 3188;
110
        dsprite_item = 4555;
111
        sleepsprite = 4555;
112
    }
113
    if (name == "elnina")
114
    {
115
        dsprite = spr_board_elnina_idle_right;
116
        rsprite = spr_board_elnina_idle_right;
117
        usprite = spr_board_elnina_idle_up;
118
        lsprite = spr_board_elnina_idle_left;
119
        hurtsprite = spr_board_elnina_idle_right;
120
        dsprite_carry = dsprite;
121
        rsprite_carry = rsprite;
122
        lsprite_carry = lsprite;
123
        usprite_carry = usprite;
124
        dsprite_item = dsprite;
125
        sleepsprite = dsprite;
126
    }
127
}
128
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
129
{
130
    if (keyboard_check_pressed(ord("1")))
131
    {
132
        controlled = 0;
133
        if (name == "kris")
134
            controlled = 1;
135
    }
136
    if (keyboard_check_pressed(ord("2")))
137
    {
138
        controlled = 0;
139
        if (name == "susie")
140
            controlled = 1;
141
    }
142
    if (keyboard_check_pressed(ord("3")))
143
    {
144
        controlled = 0;
145
        if (name == "ralsei")
146
            controlled = 1;
147
        follow = 0;
148
    }
149
    if (keyboard_check_pressed(ord("4")))
150
        randmove = 1 - randmove;
151
    if (keyboard_check_pressed(ord("5")))
152
    {
153
        myhealth = 12;
154
        if (invincible == 0)
155
            invincible = 1;
156
        else
157
            invincible = 0;
158
    }
159
    if (invincible == 1)
160
        myhealth = 12;
161
}
162
if (ignoredepth == 0)
163
    
scr_depth_board
scr_depth_board

function
scr_depth_board()
{ depth = 1000000 - ((y * 10) + ((sprite_height - sprite_yoffset) * 10)); } function scr_board_depth() {
scr_depth_board();
}
();
164
wallcheck = 0;
165
nowx = x;
166
nowy = y;
167
if (press_d == 0 && press_l == 0 && press_u == 0 && press_r == 0)
168
    nopress = 1;
169
if (controlled == 1)
170
{
171
    press_l = 0;
172
    press_r = 0;
173
    press_d = 0;
174
    press_u = 0;
175
    press_1 = 0;
176
    press_2 = 0;
177
}
178
if (susierecordcon == 1 && global.interact == 0)
179
{
180
    susierecordstring += "0";
181
    var no_input = true;
182
    if (left_h())
183
    {
184
        susierecordstring += "L";
185
        no_input = false;
186
    }
187
    if (right_h())
188
    {
189
        susierecordstring += "R";
190
        no_input = false;
191
    }
192
    if (down_h())
193
    {
194
        susierecordstring += "D";
195
        no_input = false;
196
    }
197
    if (up_h())
198
    {
199
        susierecordstring += "U";
200
        no_input = false;
201
    }
202
    if (button1_p())
203
    {
204
        susierecordstring += "1";
205
        no_input = false;
206
    }
207
    if (button2_p())
208
    {
209
        susierecordstring += "2";
210
        no_input = false;
211
    }
212
    if (no_input == true)
213
        susierecordstring += "W";
214
    susierecordcount++;
215
}
216
if (susierecordcon == 2 && global.interact == 0)
217
{
218
    press_l = 0;
219
    press_r = 0;
220
    press_u = 0;
221
    press_d = 0;
222
    press_1 = 0;
223
    press_2 = 0;
224
    if (susierecordcount < string_length(susierecordstring))
225
    {
226
        var _end = 0;
227
        while (_end == 0)
228
        {
229
            var _input = string_char_at(susierecordstring, susierecordcount);
230
            susierecordcount++;
231
            if (_input == "L")
232
                press_l = 1;
233
            if (_input == "R")
234
                press_r = 1;
235
            if (_input == "U")
236
                press_u = 1;
237
            if (_input == "D")
238
                press_d = 1;
239
            if (_input == "1")
240
                press_1 = 1;
241
            if (_input == "2")
242
                press_2 = 1;
243
            if (_input == "0")
244
                _end = 1;
245
            if (susierecordcount >= string_length(susierecordstring))
246
                _end = 1;
247
        }
248
    }
249
    else
250
    {
251
        if (susierecordsave == true)
252
            _string_save = get_string("Here's the string:", susierecordstring);
253
        susierecordstring = "";
254
        susierecordcon = 0;
255
        susierecordcount = 0;
256
    }
257
}
258
if (obj_board_camera.con != 0)
259
{
260
    if (susierecordcon == 1)
261
    {
262
        if (susierecordsave == true && show_question("Do you want to save the Susie recording?"))
263
        {
264
            _string_save = get_string("Input string file name:", "default");
265
            ini_open("susieplayback.ini");
266
            ini_write_string("Susie Playback Info", _string_save, susierecordstring);
267
            ini_close();
268
        }
269
        else
270
        {
271
        }
272
        susierecordstring = "";
273
        susierecordcon = 0;
274
        susierecordcount = 0;
275
    }
276
    if (susierecordcon == 2)
277
    {
278
        susierecordstring = "";
279
        susierecordcon = 0;
280
        susierecordcount = 0;
281
    }
282
}
283
if (abouttoregaincontrol == true)
284
{
285
    if (!left_h() && !right_h() && !up_h() && !down_h() && swordbuffer <= 0)
286
    {
287
        abouttoregaincontrol = false;
288
        controlled = 1;
289
    }
290
}
291
if (susierecordcon == 2)
292
{
293
}
294
else if (controlled == 1)
295
{
296
    if (left_h())
297
        press_l = 1;
298
    if (right_h())
299
        press_r = 1;
300
    if (up_h())
301
        press_u = 1;
302
    if (down_h())
303
        press_d = 1;
304
    if (button1_p())
305
        press_1 = 1;
306
    if (button2_p())
307
        press_2 = 1;
308
    if (press_l && press_r)
309
    {
310
        press_l = 0;
311
        press_r = 0;
312
    }
313
    if (press_u && press_d)
314
    {
315
        press_u = 0;
316
        press_d = 0;
317
    }
318
}
319
else
320
{
321
    press_l = 0;
322
    press_r = 0;
323
    press_d = 0;
324
    press_u = 0;
325
    press_1 = 0;
326
    press_2 = 0;
327
}
328
bkx = 0;
329
bky = 0;
330
bkxy = 0;
331
if (((global.interact == 0 || interactoverride == true) && canfreemove == 1 && myhealth > 0) || runawayfromsusie == true)
332
{
333
    px = 0;
334
    py = 0;
335
    pressdir = -1;
336
    if (press_r == 1)
337
    {
338
        px = wspeed;
339
        pressdir = 1;
340
    }
341
    if (press_l == 1)
342
    {
343
        px = -wspeed;
344
        pressdir = 3;
345
    }
346
    if (press_d == 1)
347
    {
348
        py = wspeed;
349
        pressdir = 0;
350
    }
351
    if (press_u == 1)
352
    {
353
        py = -wspeed;
354
        pressdir = 2;
355
    }
356
    if (nopress == 1 && pressdir != -1)
357
        facing = pressdir;
358
    if (i_ex(obj_board_enemy_black_deer) && (px != 0 || py != 0) && name == "kris")
359
    {
360
        obj_board_enemy_black_deer.px = px * -1;
361
        obj_board_enemy_black_deer.py = py * -1;
362
        obj_board_enemy_black_deer.press_r = press_l;
363
        obj_board_enemy_black_deer.press_l = press_r;
364
        obj_board_enemy_black_deer.press_d = press_u;
365
        obj_board_enemy_black_deer.press_u = press_d;
366
    }
367
    if (facing == 2)
368
    {
369
        if (press_d == 1)
370
            facing = 0;
371
        if (press_u == 0 && pressdir != -1)
372
            facing = pressdir;
373
    }
374
    if (facing == 0)
375
    {
376
        if (press_u == 1)
377
            facing = 2;
378
        if (press_d == 0 && pressdir != -1)
379
            facing = pressdir;
380
    }
381
    if (facing == 3)
382
    {
383
        if (press_r == 1)
384
            facing = 1;
385
        if (press_l == 0 && pressdir != -1)
386
            facing = pressdir;
387
    }
388
    if (facing == 1)
389
    {
390
        if (press_l == 1)
391
            facing = 3;
392
        if (press_r == 0 && pressdir != -1)
393
            facing = pressdir;
394
    }
395
    nopress = 0;
396
    xmeet = 0;
397
    ymeet = 0;
398
    xymeet = 0;
399
    var lenient_x = px;
400
    var lenient_y = py;
401
    var on_top_of_ice_block = false;
402
    var checkcol = true;
403
    if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
404
    {
405
        if (obj_mainchara.noclip)
406
            checkcol = false;
407
    }
408
    if (checkcol)
409
    {
410
        if (place_meeting(x + px, y + py, obj_board_solid))
411
            xymeet = 1;
412
        if (place_meeting(x + px, y, obj_board_solid))
413
        {
414
            var block = instance_place(x + px, y, obj_board_solid);
415
            if (block.object_index == obj_pushableblock_board && block.jello == true)
416
            {
417
            }
418
            else
419
            {
420
                if (place_meeting(x + px, y, obj_board_solid))
421
                {
422
                    for (g = wspeed; g > 0; g -= 1)
423
                    {
424
                        mvd = 0;
425
                        if (press_d == 0 && !place_meeting(x + px, y - g, obj_board_solid))
426
                        {
427
                            y -= g;
428
                            py = 0;
429
                            break;
430
                            mvd = 1;
431
                        }
432
                        if (press_u == 0 && mvd == 0 && !place_meeting(x + px, y + g, obj_board_solid))
433
                        {
434
                            y += g;
435
                            py = 0;
436
                            break;
437
                        }
438
                    }
439
                }
440
                xmeet = 1;
441
                bkx = 0;
442
                if (px > 0)
443
                {
444
                    for (var i = px; i >= 0; i -= 1)
445
                    {
446
                        if (!place_meeting(x + i, y, obj_board_solid))
447
                        {
448
                            px = i;
449
                            bkx = 1;
450
                            break;
451
                        }
452
                    }
453
                }
454
                if (px < 0)
455
                {
456
                    for (var i = px; i <= 0; i += 1)
457
                    {
458
                        if (!place_meeting(x + i, y, obj_board_solid))
459
                        {
460
                            px = i;
461
                            bkx = 1;
462
                            break;
463
                        }
464
                    }
465
                }
466
                if (bkx == 0)
467
                    px = 0;
468
            }
469
        }
470
        if (place_meeting(x, y + py, obj_board_solid))
471
        {
472
            var block = instance_place(x, y + py, obj_board_solid);
473
            if (block.object_index == obj_pushableblock_board && block.jello == true)
474
            {
475
            }
476
            else
477
            {
478
                ymeet = 1;
479
                bky = 0;
480
                if (place_meeting(x, y + py, obj_board_solid))
481
                {
482
                    for (g = wspeed; g > 0; g -= 1)
483
                    {
484
                        mvd = 0;
485
                        if (press_r == 0 && !place_meeting(x - g, y + py, obj_board_solid))
486
                        {
487
                            x -= g;
488
                            px = 0;
489
                            break;
490
                            mvd = 1;
491
                        }
492
                        if (mvd == 0 && press_l == 0 && !place_meeting(x + g, y + py, obj_board_solid))
493
                        {
494
                            x += g;
495
                            px = 0;
496
                            break;
497
                        }
498
                    }
499
                }
500
                if (py > 0)
501
                {
502
                    for (var i = py; i >= 0; i -= 1)
503
                    {
504
                        if (!place_meeting(x, y + i, obj_board_solid))
505
                        {
506
                            py = i;
507
                            bky = 1;
508
                            break;
509
                        }
510
                    }
511
                }
512
                if (py < 0)
513
                {
514
                    for (var i = py; i <= 0; i += 1)
515
                    {
516
                        if (!place_meeting(x, y + i, obj_board_solid))
517
                        {
518
                            py = i;
519
                            bky = 1;
520
                            break;
521
                        }
522
                    }
523
                }
524
                if (bky == 0)
525
                    py = 0;
526
            }
527
        }
528
        if (place_meeting(x + px, y + py, obj_board_solid))
529
        {
530
            var block = instance_place(x + px, y + py, obj_board_solid);
531
            if (block.object_index == obj_pushableblock_board && block.jello == true)
532
            {
533
            }
534
            else
535
            {
536
                xymeet = 1;
537
                bkxy = 0;
538
                var i = px;
539
                var j = py;
540
                while (j != 0 || i != 0)
541
                {
542
                    if (!place_meeting(x + i, y + j, obj_board_solid))
543
                    {
544
                        px = i;
545
                        py = j;
546
                        bkxy = 1;
547
                        break;
548
                    }
549
                    if (abs(j) >= 1)
550
                    {
551
                        if (j > 0)
552
                            j -= 1;
553
                        if (j < 0)
554
                            j += 1;
555
                    }
556
                    else
557
                    {
558
                        j = 0;
559
                    }
560
                    if (abs(i) >= 1)
561
                    {
562
                        if (i > 0)
563
                            i -= 1;
564
                        if (i < 0)
565
                            i += 1;
566
                    }
567
                    else
568
                    {
569
                        i = 0;
570
                    }
571
                }
572
                if (bkxy == 0)
573
                {
574
                    px = 0;
575
                    py = 0;
576
                }
577
            }
578
        }
579
        var lenient_amount = 8;
580
        if (px == 0 && lenient_y == 0 && lenient_x > 0)
581
        {
582
            var colllide_count = 0;
583
            for (var i = 0; i <= 16; i += 1)
584
            {
585
                if (position_meeting(x + 32, (y + 32) - i, obj_board_solid))
586
                    colllide_count = i;
587
            }
588
            if (colllide_count <= lenient_amount)
589
                y -= wspeed;
590
            colllide_count = 0;
591
            for (var i = 0; i <= 16; i += 1)
592
            {
593
                if (position_meeting(x + 32, y + 16 + i, obj_board_solid))
594
                    colllide_count = i;
595
            }
596
            if (colllide_count <= lenient_amount)
597
                y += wspeed;
598
        }
599
        if (px == 0 && lenient_y == 0 && lenient_x < 0)
600
        {
601
            var colllide_count = 0;
602
            for (var i = 0; i <= 16; i += 1)
603
            {
604
                if (position_meeting(x - 1, (y + 32) - i, obj_board_solid))
605
                    colllide_count = i;
606
            }
607
            if (colllide_count <= lenient_amount)
608
                y -= wspeed;
609
            colllide_count = 0;
610
            for (var i = 0; i <= 16; i += 1)
611
            {
612
                if (position_meeting(x - 1, y + 16 + i, obj_board_solid))
613
                    colllide_count = i;
614
            }
615
            if (colllide_count <= lenient_amount)
616
                y += wspeed;
617
        }
618
        if (py == 0 && lenient_x == 0 && lenient_y > 0)
619
        {
620
            lenient_amount = 12;
621
            var colllide_count = 0;
622
            for (var i = 0; i <= 32; i += 1)
623
            {
624
                if (position_meeting((x + 32) - i, y + 32, obj_board_solid))
625
                    colllide_count = i;
626
            }
627
            if (colllide_count <= lenient_amount)
628
                x -= wspeed;
629
            colllide_count = 0;
630
            for (var i = 0; i <= 32; i += 1)
631
            {
632
                if (position_meeting(x + i, y + 32, obj_board_solid))
633
                    colllide_count = i;
634
            }
635
            if (colllide_count <= lenient_amount)
636
                x += wspeed;
637
            lenient_amount = 8;
638
        }
639
        if (py == 0 && lenient_x == 0 && lenient_y < 0)
640
        {
641
            var colllide_count = 0;
642
            for (var i = 0; i <= 32; i += 1)
643
            {
644
                if (position_meeting((x + 32) - i, y, obj_board_solid))
645
                    colllide_count = i;
646
            }
647
            if (colllide_count <= lenient_amount)
648
                x -= wspeed;
649
            colllide_count = 0;
650
            for (var i = 0; i <= 32; i += 1)
651
            {
652
                if (position_meeting(x + i, y, obj_board_solid))
653
                    colllide_count = i;
654
            }
655
            if (colllide_count <= lenient_amount)
656
                x += wspeed;
657
        }
658
    }
659
    x += px;
660
    y += py;
661
}
662
if (myhealth > maxhealth)
663
    myhealth = maxhealth;
664
if (iframes > -5)
665
    iframes--;
666
var caminvincible = false;
667
if (i_ex(mycam))
668
{
669
    if (mycam.picturetaken == true)
670
        caminvincible = true;
671
}
672
if (place_meeting(x, y, obj_board_hazard) && (canfreemove == 1 || (canfreemove == 0 && swordbuffer > 0) || (canfreemove == 0 && boat == true) || (canfreemove == 0 && i_ex(obj_board_playercamera) && caminvincible == false)) && iframes <= 0 && myhealth > 0 && global.interact == 0)
673
{
674
    var dodamage = true;
675
    var hazard = instance_place(x, y, obj_board_hazard);
676
    if (hazard.krisonly == true && name != "kris")
677
        dodamage = false;
678
    if (hazard.active_hitbox == true && dodamage == true)
679
    {
680
        iframes = 20;
681
        snd_play(snd_board_playerhurt);
682
        if (name == "kris")
683
        {
684
            if (sword == true)
685
            {
686
                with (obj_board_controller)
687
                {
688
                    crt_glitch = 6;
689
                    crt_glitchstrength = 10;
690
                }
691
            }
692
            if (room == room_shadowmantle)
693
            {
694
                var _fatal = 0;
695
                if ((myhealth - hazard.damage) <= 0)
696
                    _fatal = 1;
697
                if (!_fatal)
698
                {
699
                    with (obj_board_controller)
700
                    {
701
                        crt_glitch = 10;
702
                        crt_glitchstrength = 50;
703
                        
scr_shakescreen
scr_shakescreen

function
scr_shakescreen()
{ instance_create(x, y, obj_shake); }
();
704
                        var numberofhitskriscantake = 6;
705
                        var realhurt = round((hazard.damage / other.maxhealth) * global.maxhp[1]);
706
                        with (obj_mainchara)
707
                        {
708
                            
scr_shakeobj
scr_shakeobj

function
scr_shakeobj()
{ var _shakeobj = instance_create(x, y, obj_shakeobj); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakeamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakereduct = argument2; } with (_shakeobj) event_user(0); }
();
709
                            snd_play(snd_hurt1);
710
                            dmg = instance_create(x, (y + 54) - 4, obj_dmgwriter);
711
                            with (dmg)
712
                            {
713
                                damage = realhurt;
714
                                type = 0;
715
                                lightb = 16777215;
716
                            }
717
                            dmg.depth = 0;
718
                            fun = 1;
719
                            sprite_index = spr_krisu_holdcontroller_hurt;
720
                            scr_delay_var("sprite_index", 4313, 5);
721
                            var __shock = 
scr_board_afterimage
scr_board_afterimage

function
scr_board_afterimage()
{ var afterimage = instance_create(x, y, obj_board_afterimage); afterimage.depth = depth; afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_speed = image_speed; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; if (argument_count >= 1) afterimage.type = argument0; if (argument_count >= 2) afterimage.length = argument1; if (argument_count >= 3) afterimage.flickerrate = argument2; return afterimage; }
(0, 5, 3);
722
                            __shock.depth = obj_gameshow_swordroute.depth - 10;
723
                            __shock.sprite_index = spr_swordroute_shadowmantle_krishitflash;
724
                            __shock.image_alpha = 0.25;
725
                        }
726
                        with (obj_event_manager)
727
                            trigger_event(UnknownEnum.Value_1);
728
                    }
729
                }
730
            }
731
        }
732
        image_blend = c_red;
733
        myhealth -= hazard.damage;
734
        with (obj_board_healthbar)
735
        {
736
            if (target == other.id)
737
            {
738
                
scr_shakeobj
scr_shakeobj

function
scr_shakeobj()
{ var _shakeobj = instance_create(x, y, obj_shakeobj); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakeamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakereduct = argument2; } with (_shakeobj) event_user(0); }
();
739
                scr_delay_var("mycolor", mycolor, 2);
740
                mycolor = c_red;
741
            }
742
        }
743
        var hazard_hitbox = hazard.object_index;
744
        if (hazard_hitbox == 1728)
745
            hazard_hitbox = hazard_hitbox.parentid;
746
        if (i_ex(hazard_hitbox))
747
        {
748
            if (hazard_hitbox.object_index == obj___ || hazard_hitbox.object_index == obj_board_enemy_parent)
749
            {
750
                path_end();
751
                is_moving = false;
752
                is_moving_timer = 0;
753
                speed = 0;
754
                move_type = 0;
755
                movecon = 0;
756
                movetimer = 0;
757
            }
758
            if (hazard_hitbox.object_index == obj_board_enemy_monster)
759
            {
760
                with (instance_nearest(x + 16, y + 16, obj_board_enemy_monster))
761
                {
762
                    path_end();
763
                    is_moving = false;
764
                    is_moving_timer = 0;
765
                    speed = 0;
766
                    move_type = 0;
767
                    movecon = 0;
768
                    movetimer = 0;
769
                    delay = 10;
770
                    if (type == 2)
771
                        delay = 30;
772
                }
773
            }
774
        }
775
        hurttimer = 5;
776
        canfreemove = 0;
777
        hitmove = 32;
778
        hitcon = 1;
779
        hitmovespeed = 16;
780
        _hitx = 0;
781
        _hity = 0;
782
        var dir;
783
        if (hazard.object_index == obj_shadow_mantle_fire || hazard.object_index == obj_shadow_mantle_cloud_bullet || hazard.object_index == obj_shadow_mantle_fire3)
784
            dir = point_direction(x, y, hazard.remx[4], hazard.remy[4]);
785
        else
786
            dir = point_direction(x, y, hazard.xprevious, hazard.yprevious);
787
        if (dir >= 135 && dir < 225)
788
        {
789
            if (!place_meeting(x + 16, y, obj_board_solid))
790
                _hitx += hitmovespeed;
791
            else if (hazard.y > y && !place_meeting(x, y - 16, obj_board_solid))
792
                _hity -= hitmovespeed;
793
            else if (!place_meeting(x, y + 16, obj_board_solid))
794
                _hity += hitmovespeed;
795
        }
796
        if (dir >= 315 || dir < 45)
797
        {
798
            if (!place_meeting(x - 16, y, obj_board_solid))
799
                _hitx -= hitmovespeed;
800
            else if (hazard.y > y && !place_meeting(x, y - 16, obj_board_solid))
801
                _hity -= hitmovespeed;
802
            else if (!place_meeting(x, y + 16, obj_board_solid))
803
                _hity += hitmovespeed;
804
        }
805
        if (dir >= 45 && dir < 135)
806
        {
807
            if (!place_meeting(x, y + 16, obj_board_solid))
808
                _hity += hitmovespeed;
809
            else if (hazard.x < x && !place_meeting(x - 16, y, obj_board_solid))
810
                _hitx -= hitmovespeed;
811
            else if (!place_meeting(x + 16, y, obj_board_solid))
812
                _hitx += hitmovespeed;
813
        }
814
        if (dir >= 225 && dir < 315)
815
        {
816
            if (!place_meeting(x, y - 16, obj_board_solid))
817
                _hity -= hitmovespeed;
818
            else if (hazard.x < x && !place_meeting(x - 16, y, obj_board_solid))
819
                _hitx -= hitmovespeed;
820
            else if (!place_meeting(x + 16, y, obj_board_solid))
821
                _hitx += hitmovespeed;
822
        }
823
    }
824
}
825
if (place_meeting(x, y, obj_board_hazard))
826
{
827
    var hazard = instance_place(x, y, obj_board_hazard);
828
    dodelete = true;
829
    if (hazard.krisonly == true && name != "kris")
830
        dodelete = false;
831
    if (hazard.destroyonhit == true && dodelete == true)
832
    {
833
        with (hazard)
834
            instance_destroy();
835
    }
836
}
837
if (hitcon == 1)
838
{
839
    if (hitmove > 0)
840
    {
841
        blocker = 0;
842
        hitmove -= hitmovespeed;
843
        var move = 1;
844
        if (place_meeting(x + _hitx, y + _hity, obj_board_solid))
845
            move = 0;
846
        if (move == 1)
847
        {
848
            x += _hitx;
849
            y += _hity;
850
        }
851
    }
852
    else
853
    {
854
        image_blend = c_white;
855
        if (myhealth <= 0)
856
        {
857
            myhealth = 0;
858
            hitcon = 99;
859
            if (i_ex(obj_shadow_mantle_enemy))
860
                global.shadow_mantle_losses++;
861
            if (controlled || 
scr_swordroom
scr_swordroom

function
scr_swordroom()
{ if (room == room_board_dungeon_2 || room == room_board_dungeon_3 || room == room_board_sword_intro || room == room_board_1_sword || room == room_board_1_sword_trees || room == room_board_preshadowmantle || room == room_board_preshadowmantle_repeat || room == room_shadowmantle || room == room_board_prepostshadowmantle || room == room_board_postshadowmantle || room == room_board_2_sword || room == room_board_3_sword) return true; else return false; }
())
862
            {
863
                if (room == room_shadowmantle)
864
                {
865
                    global.screenshot = sprite_create_from_surface(application_surface, 0, 0, __view_get(e__VW.WView, 0), __view_get(e__VW.HView, 0), 0, 0, 0, 0);
866
                    with (obj_mainchara)
867
                    {
868
                        global.heartx = (x + 12) - camerax();
869
                        global.hearty = (y + 40) - cameray();
870
                    }
871
                    gameover = instance_create_depth(global.heartx, global.hearty, -100, obj_gameover_heart_effect);
872
                    gameover.special = 1;
873
                    controlled = 0;
874
                    with (obj_shadow_mantle_bg)
875
                        instance_destroy();
876
                    with (obj_shadow_mantle_path)
877
                        instance_destroy();
878
                    with (obj_shadowmantle_crtcontroller)
879
                        instance_destroy();
880
                    with (obj_shadow_mantle_fire)
881
                        instance_destroy();
882
                    with (obj_shadow_mantle_fire_controller)
883
                        instance_destroy();
884
                    with (obj_shadow_mantle_bomb)
885
                        instance_destroy();
886
                    with (obj_shadow_mantle_cloud)
887
                        instance_destroy();
888
                    with (obj_shadow_mantle_cloud_bullet)
889
                        instance_destroy();
890
                    with (obj_shadow_mantle_dash_hitbox)
891
                        instance_destroy();
892
                    with (obj_shadow_mantle_groundfire)
893
                        instance_destroy();
894
                    with (obj_board_enemy_contact_hitbox)
895
                        instance_destroy();
896
                    with (obj___)
897
                        instance_destroy();
898
                    with (obj_shadow_mantle_transition_particle)
899
                        instance_destroy();
900
                    with (obj_shadow_mantle_fire3)
901
                        instance_destroy();
902
                    with (obj_shadow_mantle_bomb_spawn)
903
                        instance_destroy();
904
                    with (obj_shadow_mantle_enemy)
905
                        instance_destroy();
906
                    with (obj_shadow_mantle_enemy_outro)
907
                    {
908
                        instance_destroy();
909
                        global.interact = 0;
910
                    }
911
                    with (obj_event_manager)
912
                        trigger_event(UnknownEnum.Value_0, UnknownEnum.Value_13);
913
                }
914
                else if (
scr_swordroom
scr_swordroom

function
scr_swordroom()
{ if (room == room_board_dungeon_2 || room == room_board_dungeon_3 || room == room_board_sword_intro || room == room_board_1_sword || room == room_board_1_sword_trees || room == room_board_preshadowmantle || room == room_board_preshadowmantle_repeat || room == room_shadowmantle || room == room_board_prepostshadowmantle || room == room_board_postshadowmantle || room == room_board_2_sword || room == room_board_3_sword) return true; else return false; }
())
915
                {
916
                    global.flag[1007 swordroute_evict] = 1;
917
                    deathevent = instance_create(x, y, obj_board_death_event_sword);
918
                    global.interact = 1;
919
                }
920
                else
921
                {
922
                    deathevent = instance_create(x, y, obj_board_deathevent);
923
                    deathevent.name = name;
924
                    deathevent.target = id;
925
                    deathevent.depth = depth - 5000;
926
                    global.interact = 1;
927
                }
928
            }
929
            else
930
            {
931
                deathevent = instance_create(x, y, obj_board_caterpillardeath);
932
                deathevent.name = name;
933
                image_alpha = 0;
934
            }
935
        }
936
        else
937
        {
938
            hitcon = 0;
939
            if (name == "kris")
940
                
scr_board_caterpillar_interpolate_ralsei
scr_board_caterpillar_interpolate_ralsei

function
scr_board_caterpillar_interpolate_ralsei()
{ var _ralsei = obj_board_controller.ralsei_object; if (_ralsei != -1) { with (_ralsei) { for (i = 0; i < 75; i += 1) { remx[i] = x; remy[i] = y; facing[i] = 0; } } var _a = 0; var _dir = point_direction(_ralsei.x, _ralsei.y, x, y); repeat (_ralsei.ralsei_target) { _ralsei.remx[_a] = lerp(obj_board_controller.kris_object.x, _ralsei.x, _a / _ralsei.ralsei_target); _ralsei.remy[_a] = lerp(obj_board_controller.kris_object.y, _ralsei.y, _a / _ralsei.ralsei_target); if (_dir >= 45 && _dir < 135) _ralsei.facingdir[_a] = 2; else if (_dir >= 135 && _dir < 225) _ralsei.facingdir[_a] = 3; else if (_dir >= 225 && _dir < 315) _ralsei.facingdir[_a] = 0; else if (_dir >= 315 || _dir < 45) _ralsei.facingdir[_a] = 1; _a++; } } }
();
941
            if (name == "ralsei")
942
                
scr_board_caterpillar_interpolate
scr_board_caterpillar_interpolate

function
scr_board_caterpillar_interpolate()
{ var _____kris = 0; with (obj_mainchara_board) { if (name == "kris") _____kris = id; } if (_____kris != 0) { remx[0] = _____kris.x; remy[0] = _____kris.y; for (var __rempos = 75; __rempos > 0; __rempos -= 1) { remx[__rempos] = lerp(_____kris.x, x, __rempos / 75); remy[__rempos] = lerp(_____kris.y, y + 6, __rempos / 75); } } }
();
943
        }
944
    }
945
}
946
if (hurttimer == 1)
947
    canfreemove = 1;
948
if (hurttimer > 0)
949
{
950
    hurttimer--;
951
    if (x < 128)
952
        x = 128;
953
    if (x > 480)
954
        x = 480;
955
    if (y < 64)
956
        y = 64;
957
    if (y > 288)
958
        y = 288;
959
}
960
if (hitcon == 99)
961
{
962
    fun = 1;
963
    if (myhealth > 0)
964
    {
965
        fun = 0;
966
        canfreemove = 1;
967
        hitcon = 0;
968
        with (obj_board_enemy_parent)
969
        {
970
            if (!i_ex(obj_shadow_mantle_enemy))
971
                instance_destroy();
972
        }
973
        with (obj_fire_bar_base)
974
            instance_destroy();
975
        with (obj_fire_bar_piece)
976
            instance_destroy();
977
        with (obj_board_enemy_spear)
978
            instance_destroy();
979
        with (obj_board_enemy_fire)
980
            instance_destroy();
981
        with (obj_board_enemy_bubble)
982
            instance_destroy();
983
        with (obj_board_enemy_note)
984
            instance_destroy();
985
        with (obj_board_enemy_pellet)
986
            instance_destroy();
987
        with (obj_shadow_mantle_fire)
988
            instance_destroy();
989
        with (obj_shadow_mantle_fire_controller)
990
            instance_destroy();
991
        with (obj_shadow_mantle_fire3)
992
            instance_destroy();
993
        with (obj_shadow_mantle_cloud_bullet)
994
            instance_destroy();
995
        with (obj_shadow_mantle_bomb)
996
            instance_destroy();
997
        with (obj_shadow_mantle_cloud)
998
            instance_destroy();
999
    }
1000
}
1001
if (fun == 0 && is_moving == false)
1002
{
1003
    walk = 0;
1004
    if (x != nowx && nopress == 0)
1005
        walk = 1;
1006
    if (y != nowy && nopress == 0)
1007
        walk = 1;
1008
    if (walk == 1)
1009
        walkbuffer = 6;
1010
    var disable = 0;
1011
    if ((name == "ralsei" || name == "susie") && controlled == 0)
1012
        disable = 1;
1013
    if (name == "susie" && susierecordcon == 2)
1014
        disable = 0;
1015
    if (name == "ralsei" && susierecordcon == 2)
1016
        disable = 0;
1017
    if (walkbuffer > 3 && disable == 0)
1018
        image_index += 0.125;
1019
    if (walkbuffer <= 0 && fun == 0 && disable == 0)
1020
    {
1021
        if (walktimer < 10)
1022
            walktimer = 9.5;
1023
        if (walktimer >= 10 && walktimer < 20)
1024
            walktimer = 19.5;
1025
        if (walktimer >= 20 && walktimer < 30)
1026
            walktimer = 29.5;
1027
        if (walktimer >= 30)
1028
            walktimer = 39.5;
1029
        image_index = 0;
1030
    }
1031
    walkbuffer -= 0.75;
1032
    if (facing == 0)
1033
        sprite_index = dsprite;
1034
    if (facing == 1)
1035
        sprite_index = rsprite;
1036
    if (facing == 2)
1037
        sprite_index = usprite;
1038
    if (facing == 3)
1039
        sprite_index = lsprite;
1040
    if (grab != 0)
1041
    {
1042
        if (facing == 0)
1043
            sprite_index = dsprite_carry;
1044
        if (facing == 1)
1045
            sprite_index = rsprite_carry;
1046
        if (facing == 2)
1047
            sprite_index = usprite_carry;
1048
        if (facing == 3)
1049
            sprite_index = lsprite_carry;
1050
    }
1051
}
1052
var interacted = 0;
1053
if (onebuffer <= 0 && controlled == 1 && swordbuffer <= 0 && global.interact == 0 && !instance_exists(obj_board_playercamera) && press_1 == 1 && controlled == 1 && (name == "kris" || caninteract == true))
1054
{
1055
    onebuffer = 6;
1056
    thisinteract = 0;
1057
    if (facing == 1)
1058
    {
1059
        if (collision_rectangle(x + 16, y + 16 + 6, x + 16 + 32, (y + 32) - 2, obj_board_interactable, false, true))
1060
            thisinteract = 1;
1061
        if (collision_rectangle(x + 16, y + 16 + 6, x + 16 + 32, (y + 32) - 2, obj_board_interactable_solid, false, true))
1062
            thisinteract = 2;
1063
    }
1064
    if (thisinteract > 0)
1065
    {
1066
        if (thisinteract == 1)
1067
            interactedobject = collision_rectangle(x + 16, y + 16 + 6, x + 16 + 32, (y + 32) - 2, obj_board_interactable, false, true);
1068
        if (thisinteract == 2)
1069
            interactedobject = collision_rectangle(x + 16, y + 16 + 6, x + 16 + 32, (y + 32) - 2, obj_board_interactable_solid, false, true);
1070
        if (interactedobject != -4)
1071
        {
1072
            with (interactedobject)
1073
                facing = 3;
1074
            with (interactedobject)
1075
                
scr_interact
scr_interact

function
scr_interact()
{ myinteract = 1; event_user(0); }
();
1076
            interacted = 1;
1077
            if (interactedobject.object_index == obj_board_heal_pickup && sword == true)
1078
                interacted = 0;
1079
        }
1080
    }
1081
    thisinteract = 0;
1082
    if (facing == 3)
1083
    {
1084
        if (collision_rectangle(x + 16, y + 16 + 6, (x + 16) - 32, (y + 32) - 2, obj_board_interactable, false, true))
1085
            thisinteract = 1;
1086
        if (collision_rectangle(x + 16, y + 16 + 6, (x + 16) - 32, (y + 32) - 2, obj_board_interactable_solid, false, true))
1087
            thisinteract = 2;
1088
    }
1089
    if (thisinteract > 0)
1090
    {
1091
        if (thisinteract == 1)
1092
            interactedobject = collision_rectangle(x + 16, y + 16 + 6, (x + 16) - 32, (y + 32) - 2, obj_board_interactable, false, true);
1093
        if (thisinteract == 2)
1094
            interactedobject = collision_rectangle(x + 16, y + 16 + 6, (x + 16) - 32, (y + 32) - 2, obj_board_interactable_solid, false, true);
1095
        if (interactedobject != -4)
1096
        {
1097
            with (interactedobject)
1098
                facing = 1;
1099
            with (interactedobject)
1100
                
scr_interact
scr_interact

function
scr_interact()
{ myinteract = 1; event_user(0); }
();
1101
            interacted = 1;
1102
            if (interactedobject.object_index == obj_board_heal_pickup && sword == true)
1103
                interacted = 0;
1104
        }
1105
    }
1106
    thisinteract = 0;
1107
    if (facing == 0)
1108
    {
1109
        if (collision_rectangle(x + 8, y + 16 + 4, (x + 32) - 8, y + 16 + 28, obj_board_interactable, false, true))
1110
            thisinteract = 1;
1111
        if (collision_rectangle(x + 8, y + 16 + 4, (x + 32) - 8, y + 16 + 28, obj_board_interactable_solid, false, true))
1112
            thisinteract = 2;
1113
    }
1114
    if (thisinteract > 0)
1115
    {
1116
        if (thisinteract == 1)
1117
            interactedobject = collision_rectangle(x + 8, y + 16 + 4, (x + 32) - 8, y + 16 + 28, obj_board_interactable, false, true);
1118
        if (thisinteract == 2)
1119
            interactedobject = collision_rectangle(x + 8, y + 16 + 4, (x + 32) - 8, y + 16 + 28, obj_board_interactable_solid, false, true);
1120
        if (interactedobject != -4)
1121
        {
1122
            with (interactedobject)
1123
                facing = 2;
1124
            with (interactedobject)
1125
                
scr_interact
scr_interact

function
scr_interact()
{ myinteract = 1; event_user(0); }
();
1126
            interacted = 1;
1127
            if (interactedobject.object_index == obj_board_heal_pickup && sword == true)
1128
                interacted = 0;
1129
        }
1130
    }
1131
    thisinteract = 0;
1132
    if (facing == 2)
1133
    {
1134
        if (collision_rectangle(x + 8, y + 16 + 4, (x + 32) - 8, (y + 16) - 28, obj_board_interactable, false, true))
1135
            thisinteract = 1;
1136
        if (collision_rectangle(x + 8, y + 16 + 4, (x + 32) - 8, (y + 16) - 28, obj_board_interactable_solid, false, true))
1137
            thisinteract = 2;
1138
    }
1139
    if (thisinteract > 0)
1140
    {
1141
        if (thisinteract == 1)
1142
            interactedobject = collision_rectangle(x + 8, y + 16 + 4, (x + 32) - 8, (y + 16) - 28, obj_board_interactable, false, true);
1143
        if (thisinteract == 2)
1144
            interactedobject = collision_rectangle(x + 8, y + 16 + 4, (x + 32) - 8, (y + 16) - 28, obj_board_interactable_solid, false, true);
1145
        if (interactedobject != -4)
1146
        {
1147
            with (interactedobject)
1148
                facing = 0;
1149
            with (interactedobject)
1150
                
scr_interact
scr_interact

function
scr_interact()
{ myinteract = 1; event_user(0); }
();
1151
            interacted = 1;
1152
            if (interactedobject.object_index == obj_board_heal_pickup && sword == true)
1153
                interacted = 0;
1154
        }
1155
    }
1156
    if (room == room_board_2_sword)
1157
    {
1158
        if (interacted > 0)
1159
        {
1160
            if (i_ex(interactedobject))
1161
            {
1162
                if (interactedobject.object_index == obj_board_tree_grayscale)
1163
                    interacted = 0;
1164
            }
1165
        }
1166
    }
1167
    if (i_ex(obj_board_boat))
1168
    {
1169
        var bpx = 0;
1170
        var bpy = 0;
1171
        if (facing == 0)
1172
            bpy = 32;
1173
        if (facing == 2)
1174
            bpy = -32;
1175
        if (facing == 1)
1176
            bpx = 32;
1177
        if (facing == 3)
1178
            bpx = -32;
1179
        if (place_meeting(x + bpx, y + bpy, obj_board_boat))
1180
        {
1181
            with (instance_place(x + bpx, y + bpy, obj_board_boat))
1182
            {
1183
                if (engaged == 0)
1184
                {
1185
                    interacted = true;
1186
                    event_user(0);
1187
                }
1188
            }
1189
        }
1190
    }
1191
}
1192
onebuffer -= 1;
1193
if (graballpots == true && global.flag[1020 got_power_croissant] && global.interact == 0 && canfreemove == true)
1194
{
1195
    susierecordcon = 0;
1196
    susierecordcount = 0;
1197
    if (graballpots_con == 0)
1198
    {
1199
        if (!i_ex(obj_board_grabbleObject))
1200
        {
1201
            graballpots = false;
1202
            graballpots_con = 0;
1203
            graballpots_timer = 0;
1204
        }
1205
        else
1206
        {
1207
            potarray[0] = -4;
1208
            array_resize(potarray, 0);
1209
            with (obj_board_grabbleObject)
1210
            {
1211
                if (x >= 128 && x <= 480 && y >= 64 && y <= 288 && cangrab == true)
1212
                    array_push(other.potarray, id);
1213
            }
1214
            _pot = -1;
1215
            var dist = 999999;
1216
            for (var i = 0; i < array_length(potarray); i++)
1217
            {
1218
                if (i_ex(potarray[i]))
1219
                {
1220
                    var thisdist = distance_to_object(potarray[i]);
1221
                    if (thisdist < dist)
1222
                    {
1223
                        dist = thisdist;
1224
                        _pot = potarray[i];
1225
                    }
1226
                }
1227
            }
1228
            if (_pot == -1)
1229
            {
1230
                graballpots = false;
1231
                graballpots_con = 0;
1232
                graballpots_timer = 0;
1233
            }
1234
            else
1235
            {
1236
                
scr_pathfind_to_closest_point_32x32
scr_pathfind_to_closest_point_32x32

function
scr_pathfind_to_closest_point_32x32(arg0, arg1, arg2, arg3, arg4)
{ with (obj_mainchara_board) { if (name == arg0) { allow_diagonals = arg4; var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } var dist = 999; var found_spot = false; if (mp_grid_path(global.grid, path, x + 16, y + 16, __destx + 2, __desty - 32, arg4) == 1) { if (distance_to_point(__destx + 2, __desty - 32) < dist) { dist = distance_to_point(__destx, __desty - 32); path_target_x = __destx + 2; path_target_y = __desty - 32; if (arg3 == -1) grab_dir = 0; found_spot = true; } } if (mp_grid_path(global.grid, path, x + 16, y + 16, __destx + 34, __desty, arg4) == 1) { if (distance_to_point(__destx + 34, __desty) < dist) { dist = distance_to_point(__destx + 34, __desty); path_target_x = __destx + 34; path_target_y = __desty; if (arg3 == -1) grab_dir = 3; found_spot = true; } } if (mp_grid_path(global.grid, path, x + 16, y + 16, __destx - 32, __desty, arg4) == 1) { if (distance_to_point(__destx - 32, __desty) < dist) { dist = distance_to_point(__destx - 32, __desty); path_target_x = __destx - 32; path_target_y = __desty; if (arg3 == -1) grab_dir = 1; found_spot = true; } } if (mp_grid_path(global.grid, path, x + 16, y + 16, __destx, __desty + 30, arg4) == 1) { if (distance_to_point(__destx, __desty + 30) < dist) { dist = distance_to_point(__destx, __desty + 30); path_target_x = __destx + 2; path_target_y = __desty + 30; if (arg3 == -1) grab_dir = 2; found_spot = true; } } if (found_spot == true) { path_end(); is_moving_timer = 0; is_moving = true; if (arg0 == "ralsei") follow = false; path_end_facing = grab_dir; } else { show_debug_message("PATHFINDING ERROR 5: cannot path to target location"); } } } }
("susie", _pot.x, _pot.y, -1, true);
1237
                graballpots_con = 1;
1238
            }
1239
        }
1240
    }
1241
    if (graballpots_con == 1 && is_moving == false)
1242
    {
1243
        graballpots_timer++;
1244
        if (graballpots_timer == 1)
1245
        {
1246
            press_1 = 1;
1247
            facing = grab_dir;
1248
        }
1249
        if (graballpots_timer == 10)
1250
        {
1251
            graballpots_timer = 0;
1252
            graballpots_con = 2;
1253
        }
1254
    }
1255
    if (graballpots_con == 2)
1256
    {
1257
        graballpots_timer++;
1258
        if (graballpots_timer == 1)
1259
        {
1260
            repeat (4)
1261
            {
1262
                var _xx = 0;
1263
                var _yy = 0;
1264
                switch (facing)
1265
                {
1266
                    case 0:
1267
                        _yy = 32;
1268
                        break;
1269
                    case 1:
1270
                        _xx = 32;
1271
                        break;
1272
                    case 2:
1273
                        _yy = -32;
1274
                        break;
1275
                    case 3:
1276
                        _xx = -32;
1277
                        break;
1278
                }
1279
                var tx = round(x / 32) * 32;
1280
                var ty = round(y / 32) * 32;
1281
                var spaceFree = 1;
1282
                for (var i = 1; i < 4; i++)
1283
                {
1284
                    for (var j = 0; j < array_length(blockerlist); j++)
1285
                    {
1286
                        var blok = instance_place(tx + (_xx * i), ty + (_yy * i), blockerlist[j]);
1287
                        if (blok != -4)
1288
                        {
1289
                            if (blok != id && blok != 544)
1290
                                spaceFree = 0;
1291
                        }
1292
                    }
1293
                }
1294
                if (spaceFree != 0)
1295
                {
1296
                    with (grabmarker)
1297
                        info = 1;
1298
                    facing++;
1299
                    if (facing == 4)
1300
                        facing = 0;
1301
                    if (facing == 0)
1302
                        sprite_index = spr_board_susie_walk_down;
1303
                    if (facing == 1)
1304
                        sprite_index = spr_board_susie_walk_right;
1305
                    if (facing == 2)
1306
                        sprite_index = spr_board_susie_walk_up;
1307
                    if (facing == 3)
1308
                        sprite_index = spr_board_susie_walk_left;
1309
                }
1310
            }
1311
            if (x > 447)
1312
            {
1313
                facing = 3;
1314
                sprite_index = spr_board_susie_walk_left;
1315
            }
1316
        }
1317
        if (graballpots_timer == 3)
1318
            press_1 = 1;
1319
        if (graballpots_timer == firstpotwait)
1320
        {
1321
            graballpots_timer = 0;
1322
            graballpots_con = 0;
1323
            firstpotwait = 5;
1324
        }
1325
    }
1326
    if (graballpots_con == 3)
1327
    {
1328
        graballpots_timer++;
1329
        if (graballpots_timer == 1)
1330
            press_1 = 1;
1331
        if (graballpots_timer == 2)
1332
        {
1333
            xx = x;
1334
            yy = y;
1335
            var selfx = round(x / 32) * 32;
1336
            var selfy = round(y / 32) * 32;
1337
            done = false;
1338
            if (sprite_index == spr_board_susie_walk_down)
1339
                facing = 0;
1340
            if (sprite_index == spr_board_susie_walk_right)
1341
                facing = 1;
1342
            if (sprite_index == spr_board_susie_walk_up)
1343
                facing = 2;
1344
            if (sprite_index == spr_board_susie_walk_left)
1345
                facing = 3;
1346
            repeat (4)
1347
            {
1348
                if (done == false)
1349
                {
1350
                    if (done == false)
1351
                        facing++;
1352
                    if (facing > 3)
1353
                        facing = 0;
1354
                    if (facing == 0)
1355
                    {
1356
                        coll = collision_rectangle(selfx, selfy + 64, selfx + 32, selfy + 32 + 96, obj_board_solid, false, true);
1357
                        if (coll == -4)
1358
                        {
1359
                            xx = selfx;
1360
                            yy = selfy + 64;
1361
                            done = true;
1362
                            facing = 0;
1363
                            sprite_index = spr_board_susie_walk_down;
1364
                        }
1365
                    }
1366
                    if (facing == 1)
1367
                    {
1368
                        coll = collision_rectangle(selfx + 64, selfy + 16, selfx + 96, selfy + 31, obj_board_solid, false, true);
1369
                        if (coll == -4)
1370
                        {
1371
                            xx = selfx + 64;
1372
                            yy = selfy;
1373
                            done = true;
1374
                            facing = 1;
1375
                            sprite_index = spr_board_susie_walk_right;
1376
                        }
1377
                    }
1378
                    if (facing == 2)
1379
                    {
1380
                        coll = collision_rectangle(selfx, selfy - 32, selfx + 32, selfy - 64, obj_board_solid, false, true);
1381
                        if (coll == -4)
1382
                        {
1383
                            xx = selfx;
1384
                            yy = selfy - 64;
1385
                            done = true;
1386
                            facing = 2;
1387
                            sprite_index = spr_board_susie_walk_up;
1388
                        }
1389
                    }
1390
                    if (facing == 3)
1391
                    {
1392
                        coll = collision_rectangle(selfx - 64, selfy + 16, selfx - 32, selfy + 31, obj_board_solid, false, true);
1393
                        if (coll == -4)
1394
                        {
1395
                            xx = selfx - 64;
1396
                            yy = selfy;
1397
                            done = true;
1398
                            facing = 3;
1399
                            sprite_index = spr_board_susie_walk_left;
1400
                        }
1401
                    }
1402
                }
1403
            }
1404
            if (xx < 128)
1405
                xx = 128;
1406
            if (xx > 480)
1407
                xx = 480;
1408
            if (yy < 64)
1409
                yy = 64;
1410
            if (yy > 288)
1411
                yy = 288;
1412
        }
1413
        if (graballpots_timer == 25)
1414
            press_1 = 1;
1415
        if (graballpots_timer == 45)
1416
        {
1417
            graballpots_timer = 0;
1418
            graballpots_con = 0;
1419
            graballpots = false;
1420
        }
1421
    }
1422
}
1423
var override = false;
1424
if (name == "susie" && doagrab)
1425
{
1426
    override = true;
1427
    doagrab = false;
1428
    press_1 = 1;
1429
}
1430
if (press_1 == 1 && name == "susie" && global.flag[1020 got_power_croissant] == 1 && (global.interact == 0 || override == true) && (canfreemove == true || override == true) && obj_board_camera.shift == "none")
1431
{
1432
    if (grab == 0)
1433
    {
1434
        var _dx = 0;
1435
        var _dy = 0;
1436
        var _dx2 = 0;
1437
        var _dy2 = 0;
1438
        grabbed = -4;
1439
        if (facing == 1)
1440
        {
1441
            _dx = 16;
1442
            _dx2 = 18;
1443
            _dy2 = 16;
1444
            _dy = -4;
1445
        }
1446
        if (facing == 3)
1447
        {
1448
            _dx = -48;
1449
            _dx2 = 14;
1450
            _dy2 = 16;
1451
            _dy = -4;
1452
        }
1453
        if (facing == 0)
1454
        {
1455
            _dy = 16;
1456
            _dy2 = 20;
1457
            _dx = -8;
1458
            _dx2 = 8;
1459
        }
1460
        if (facing == 2)
1461
        {
1462
            _dy = -20;
1463
            _dy2 = -16;
1464
            _dx = -8;
1465
            _dx2 = 8;
1466
        }
1467
        if (obj_board_controller.pathfind_debug)
1468
        {
1469
            anim = instance_create(x + _dx2, y + _dy2, obj_marker);
1470
            anim.sprite_index = spr_whitepixel;
1471
            anim.image_xscale = 4;
1472
            anim.image_yscale = 4;
1473
            anim.image_blend = c_red;
1474
            anim = instance_create(((x + 32) - 1) + _dx, ((y + 32) - 1) + _dy, obj_marker);
1475
            anim.sprite_index = spr_whitepixel;
1476
            anim.image_xscale = 4;
1477
            anim.image_yscale = 4;
1478
            anim.image_blend = c_red;
1479
        }
1480
        for (var i = 0; i < array_length(grabbablelist); i++)
1481
        {
1482
            if (grabbed == -4)
1483
            {
1484
                if (graballpots == true && graballpots_con != 3)
1485
                {
1486
                    grabbed = collision_rectangle(x + _dx2, y + _dy2, ((x + 32) - 1) + _dx, ((y + 32) - 1) + _dy, obj_board_grabbleObject, false, true);
1487
                }
1488
                else if (graballpots == true && graballpots_con == 3)
1489
                {
1490
                    grabbed = collision_rectangle(x - 999, y - 999, x + 999, y + 999, obj_board_controller.ralsei_object, false, true);
1491
                }
1492
                else
1493
                {
1494
                    grabbed = collision_rectangle(x + _dx2, y + _dy2, ((x + 32) - 1) + _dx, ((y + 32) - 1) + _dy, grabbablelist[i], false, true);
1495
                    if (i_ex(grabbed))
1496
                    {
1497
                        if (!controlled || global.flag[1023 cant_grab_ralsei] == 1)
1498
                        {
1499
                            if (grabbed.object_index == obj_mainchara_board)
1500
                            {
1501
                                if (controlled)
1502
                                    
scr_board_blcon
scr_board_blcon

function
scr_board_blcon(arg0, arg1, arg2)
{ with (obj_board_marker) { if (sprite_index == arg2) instance_destroy(); } var nolift = instance_create(arg0, arg1, obj_board_marker); nolift.sprite_index = arg2; nolift.image_speed = 0.2; nolift.image_index = 1; nolift.vspeed = -2.8; nolift.gravity = 0.2; nolift.depth = depth - 100; if (nolift.y <= 64) nolift.y = 64;
scr_darksize(nolift);
scr_doom(nolift, 20);
with (nolift) scr_delay_var("gravity", 0, 15); with (nolift) scr_delay_var("vspeed", 0, 15); snd_stop(snd_error); snd_play(snd_error); }
(grabbed.x, grabbed.y - 24, 4290);
1503
                                grabbed = -4;
1504
                            }
1505
                        }
1506
                        if (i_ex(grabbed))
1507
                        {
1508
                            if (grabbed.object_index == obj_mainchara_board)
1509
                            {
1510
                                if (grabbed.name == "kris")
1511
                                {
1512
                                    if (controlled)
1513
                                        
scr_board_blcon
scr_board_blcon

function
scr_board_blcon(arg0, arg1, arg2)
{ with (obj_board_marker) { if (sprite_index == arg2) instance_destroy(); } var nolift = instance_create(arg0, arg1, obj_board_marker); nolift.sprite_index = arg2; nolift.image_speed = 0.2; nolift.image_index = 1; nolift.vspeed = -2.8; nolift.gravity = 0.2; nolift.depth = depth - 100; if (nolift.y <= 64) nolift.y = 64;
scr_darksize(nolift);
scr_doom(nolift, 20);
with (nolift) scr_delay_var("gravity", 0, 15); with (nolift) scr_delay_var("vspeed", 0, 15); snd_stop(snd_error); snd_play(snd_error); }
(grabbed.x, grabbed.y - 24, 4290);
1514
                                    grabbed = -4;
1515
                                }
1516
                            }
1517
                        }
1518
                    }
1519
                    if (i_ex(grabbed))
1520
                    {
1521
                        if (grabbed.object_index == obj_pushableblock_board)
1522
                        {
1523
                            if (grabbed.sprite_index != spr_ralsei_board_stoolforme)
1524
                            {
1525
                            }
1526
                        }
1527
                    }
1528
                }
1529
            }
1530
        }
1531
        if (grabbed != -4)
1532
        {
1533
            if (grabbed.object_index != obj_mainchara_board)
1534
                mp_grid_clear_cell(global.grid, floor(grabbed.x / 32), floor(grabbed.y / 32));
1535
            grab = 1;
1536
            grabmarker = instance_create(x, y, obj_board_grabobject);
1537
            with (grabmarker)
1538
            {
1539
                snd_play(snd_board_lift);
1540
                grabdaddy = other.id;
1541
                grabbedid = other.grabbed;
1542
                sprite_index = grabbedid.sprite_index;
1543
                image_xscale = grabbedid.image_xscale;
1544
                image_yscale = grabbedid.image_yscale;
1545
                image_speed = grabbedid.image_speed;
1546
                sourcex = grabbedid.x;
1547
                sourcey = grabbedid.y;
1548
            }
1549
            with (grabbed)
1550
            {
1551
                visible = false;
1552
                frozen = true;
1553
                setxy(board_tilex(-1), board_tiley(-1));
1554
                if (object_index == obj_mainchara_board)
1555
                    canfreemove = 0;
1556
            }
1557
        }
1558
        if (grabbed == -4)
1559
        {
1560
            if (place_meeting(x, y, obj_board_grabbablegrass))
1561
            {
1562
                grabbed = instance_place(x, y, obj_board_grabbablegrass);
1563
                grabbed.grabdaddy = id;
1564
                grabbed.con = 1;
1565
                grab = 1;
1566
                fun = 1;
1567
                canfreemove = 0;
1568
                facing = 0;
1569
                sprite_index = spr_board_susie_dig;
1570
                image_speed = 0;
1571
                image_index = 0;
1572
                global.flag[1256 times_plucked_grass]++;
1573
                if (global.flag[1256 times_plucked_grass] > 99)
1574
                    global.flag[1256 times_plucked_grass] = 99;
1575
                if (room == room_board_3)
1576
                    obj_b3grassjoke.grasspullcount++;
1577
                if (room == room_dw_b3bs_rouxls_lanina)
1578
                    global.flag[1108 lanina_puzz_grass]++;
1579
            }
1580
        }
1581
    }
1582
    else if (i_ex(grabmarker))
1583
    {
1584
        if ((grabmarker.blocked != 0 || graballpots == true) && grabmarker.con == 0 && canfreemove == true && grabmarker.throwbuff <= 0)
1585
        {
1586
            canfreemove = 0;
1587
            grabmarker.con = 1;
1588
            snd_play(snd_board_throw);
1589
        }
1590
    }
1591
}
1592
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
() && name == "kris")
1593
{
1594
    if (keyboard_check(vk_shift) && keyboard_check_pressed(ord("V")))
1595
    {
1596
        camera = !camera;
1597
        snd_play_pitch(snd_won, 0.8 + (camera / 4));
1598
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { }
("CAMERA: " + string(camera));
1599
    }
1600
}
1601
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
1602
{
1603
    if (keyboard_check(ord("C")) && keyboard_check_pressed(ord("M")))
1604
    {
1605
        canfreemove = true;
1606
        cantleave = false;
1607
        if (controlled)
1608
            debug_print("debug: Can now move and leave the room");
1609
    }
1610
}
1611
camwidth = 4;
1612
camheight = 3;
1613
var canphoto = true;
1614
var makesign = true;
1615
if (i_ex(obj_board_camsolid))
1616
{
1617
    with (obj_mainchara_board)
1618
    {
1619
        if (controlled)
1620
        {
1621
            if (place_meeting(x, y, obj_board_camsolid))
1622
                canphoto = false;
1623
        }
1624
    }
1625
}
1626
if (i_ex(obj_board_lawnmower))
1627
{
1628
    if (obj_board_lawnmower.active)
1629
    {
1630
        canphoto = false;
1631
        makesign = false;
1632
    }
1633
}
1634
if (camera == false)
1635
{
1636
    if (room == room_dw_puzzlecloset_3 && global.flag[1244 parent_got_camera] == 1)
1637
        camera = true;
1638
}
1639
if (camera)
1640
{
1641
    if (!i_ex(obj_board_camera))
1642
        cambuff = 0;
1643
    else if (obj_board_camera.shift != "none")
1644
        cambuff = 2;
1645
    else if (cambuff > 0)
1646
        cambuff--;
1647
}
1648
if (camera == true && name == "kris" && controlled == 1 && (canfreemove == true || (boat == true && !i_ex(obj_board_playercamera))) && global.interact == 0 && obj_board_camera.con == 0 && interacted == 0 && cambuff <= 0 && !instance_exists(obj_gameover_minigame))
1649
{
1650
    if (press_1 || takephoto == true)
1651
    {
1652
        takephoto = false;
1653
        if (canphoto)
1654
        {
1655
            canfreemove = false;
1656
            var playxround = round(x / 32) * 32;
1657
            var playyround = round(y / 32) * 32;
1658
            playxround -= ((camwidth / 2) * 32);
1659
            playyround -= ((camheight / 2) * 32);
1660
            playxround = round(playxround / 32) * 32;
1661
            playyround = round(playyround / 32) * 32;
1662
            mycam = instance_create(playxround, playyround, obj_board_playercamera);
1663
            mycam.camwidth = camwidth;
1664
            mycam.camheight = camheight;
1665
        }
1666
        else if (makesign)
1667
        {
1668
            with (obj_board_marker)
1669
            {
1670
                if (sprite_index == spr_board_nophoto)
1671
                    instance_destroy();
1672
            }
1673
            var cantphoto = instance_create(x, y - 24, obj_board_marker);
1674
            cantphoto.sprite_index = spr_board_nophoto;
1675
            cantphoto.image_speed = 0.2;
1676
            cantphoto.image_index = 1;
1677
            cantphoto.vspeed = -2.8;
1678
            cantphoto.gravity = 0.2;
1679
            cantphoto.depth = depth - 1;
1680
            if (cantphoto.y <= 64)
1681
                cantphoto.y = 64;
1682
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(cantphoto);
1683
            
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(cantphoto, 20);
1684
            with (cantphoto)
1685
                scr_delay_var("gravity", 0, 15);
1686
            with (cantphoto)
1687
                scr_delay_var("vspeed", 0, 15);
1688
            snd_stop(snd_error);
1689
            snd_play(snd_error);
1690
        }
1691
    }
1692
}
1693
if (press_1 == 1 && controlled == 1 && name == "kris" && sword == true && swordbuffer <= 0 && (global.interact == 0 || interactoverride == true) && (canfreemove == 1 || boat == true) && obj_board_camera.con == 0 && interacted == 0)
1694
{
1695
    swordbuffer = 8;
1696
    swordfacing = facing;
1697
    canfreemove = 0;
1698
    snd_play(choose(snd_board_sword1, snd_board_sword2, snd_board_sword3));
1699
}
1700
if (swordbuffer > 0)
1701
{
1702
    swordbuffer--;
1703
    if (swordbuffer == 7 || swordbuffer == 6 || swordbuffer == 5 || swordbuffer == 4 || swordbuffer == 0)
1704
    {
1705
        if (press_d == 1)
1706
            swordfacing = 0;
1707
        if (press_u == 1)
1708
            swordfacing = 2;
1709
        if (press_r == 1)
1710
            swordfacing = 1;
1711
        if (press_l == 1)
1712
            swordfacing = 3;
1713
        if (swordbuffer == 4)
1714
        {
1715
            swordhitbox.facing = swordfacing;
1716
            swordhitbox.init = 0;
1717
        }
1718
    }
1719
    facing = swordfacing;
1720
    if (facing == 0)
1721
        sprite_index = spr_board_kris_strike_down;
1722
    if (facing == 1)
1723
        sprite_index = spr_board_kris_strike_right;
1724
    if (facing == 2)
1725
        sprite_index = spr_board_kris_strike_up;
1726
    if (facing == 3)
1727
        sprite_index = spr_board_kris_strike_left;
1728
    if (swordbuffer == 7)
1729
        image_index = 0;
1730
    if (swordbuffer == 6)
1731
        image_index = 0;
1732
    if (swordbuffer == 5)
1733
        image_index = 1;
1734
    if (swordbuffer == 4)
1735
        image_index = 1;
1736
    if (swordbuffer == 3)
1737
        image_index = 1;
1738
    if (swordbuffer == 2)
1739
        image_index = 2;
1740
    if (swordbuffer == 1)
1741
        image_index = 0;
1742
    if (swordbuffer == 0)
1743
        canfreemove = 1;
1744
    if (swordbuffer == 6)
1745
    {
1746
        with (obj_board_swordhitbox)
1747
            instance_destroy();
1748
        swordhitbox = instance_create(x, y, obj_board_swordhitbox);
1749
        swordhitbox.facing = facing;
1750
        swordhitbox.swordlv = swordlv;
1751
        swordhitbox.parentid = id;
1752
    }
1753
    if (i_ex(obj_board_enemy_deer) && obj_board_enemy_deer.follow == true && swordbuffer == 4)
1754
    {
1755
        obj_board_enemy_deer.flashtimer = 10;
1756
        ice = instance_create(obj_board_enemy_deer.x + 16, obj_board_enemy_deer.y + 16, obj_board_enemy_deer_ice_spell);
1757
        ice.speed = 12;
1758
        ice.direction = -90 + (facing * 90);
1759
        with (obj_board_enemy_deer)
1760
        {
1761
            for (var i = 75; i > 0; i -= 1)
1762
                facingdir[i] = other.facing;
1763
            switch (other.facing)
1764
            {
1765
                case 0:
1766
                    sprite_index = spr_board_deer_downsprite;
1767
                    break;
1768
                case 1:
1769
                    sprite_index = spr_board_deer_rightsprite;
1770
                    break;
1771
                case 2:
1772
                    sprite_index = spr_board_deer_upsprite;
1773
                    break;
1774
                case 3:
1775
                    sprite_index = spr_board_deer_leftsprite;
1776
                    break;
1777
            }
1778
        }
1779
    }
1780
}
1781
var stoolevolume = 0.6;
1782
if (name == "ralsei")
1783
{
1784
    if (i_ex(stool) && global.flag[1015] == 0)
1785
    {
1786
        if (obj_board_camera.con != 0)
1787
        {
1788
            setxy(stool.x, stool.y);
1789
            safe_delete(stool);
1790
            stoolforme = 0;
1791
            image_alpha = 1;
1792
            var puff = instance_create(x, y, obj_board_smokepuff);
1793
            puff.image_blend = #13D26F;
1794
        }
1795
    }
1796
    var canstool = true;
1797
    if (obj_board_camera.shift != "none")
1798
        canstool = false;
1799
    if (stoolbuff > 0)
1800
        stoolbuff--;
1801
    if ((controlled == 1 && global.interact == 0) || goStoole == 1)
1802
    {
1803
        if (stoolforme == 0 && stoolbuff <= 0 && (press_1 == 1 || goStoole == 1))
1804
        {
1805
            if (room == room_dw_puzzlecloset_3)
1806
            {
1807
                if (place_meeting(x, y, obj_board_nothrow))
1808
                    canstool = false;
1809
            }
1810
            if (canstool)
1811
            {
1812
                goStoole = 0;
1813
                stoolx = round(x / 32) * 32;
1814
                stooly = round(y / 32) * 32;
1815
                if (stooly < bbox_top)
1816
                    stooly += 32;
1817
                if (stooly > bbox_bottom)
1818
                    stooly -= 32;
1819
                x = stoolx;
1820
                y = stooly;
1821
                stool = instance_create(stoolx, stooly, obj_pushableblock_board);
1822
                stool.sprite_index = spr_ralsei_board_stoolforme;
1823
                var puff = instance_create(x, y, obj_board_smokepuff);
1824
                puff.image_blend = #13D26F;
1825
                snd_play_x(snd_board_ralsei_cube, stoolevolume, 1);
1826
                canfreemove = 0;
1827
                image_alpha = 0;
1828
                stoolbuff = 3;
1829
                stoolforme = 2;
1830
            }
1831
        }
1832
    }
1833
    if ((stoolforme == 2 && controlled == 1 && global.interact == 0 && (press_1 == 1 || press_2 == 1) && stoolbuff <= 0) || unstoole == 1)
1834
    {
1835
        unstoole = 0;
1836
        if (i_ex(stool))
1837
        {
1838
            snd_play_x(snd_board_ralsei_cube, stoolevolume, 0.7);
1839
            debug_message("unstooled");
1840
            setxy(stool.x, stool.y);
1841
            with (stool)
1842
                instance_destroy();
1843
            var puff = instance_create(x, y, obj_board_smokepuff);
1844
            puff.image_blend = #13D26F;
1845
            canfreemove = 1;
1846
            stoolforme = 0;
1847
            image_alpha = 1;
1848
            
scr_board_caterpillar_interpolate_ralsei
scr_board_caterpillar_interpolate_ralsei

function
scr_board_caterpillar_interpolate_ralsei()
{ var _ralsei = obj_board_controller.ralsei_object; if (_ralsei != -1) { with (_ralsei) { for (i = 0; i < 75; i += 1) { remx[i] = x; remy[i] = y; facing[i] = 0; } } var _a = 0; var _dir = point_direction(_ralsei.x, _ralsei.y, x, y); repeat (_ralsei.ralsei_target) { _ralsei.remx[_a] = lerp(obj_board_controller.kris_object.x, _ralsei.x, _a / _ralsei.ralsei_target); _ralsei.remy[_a] = lerp(obj_board_controller.kris_object.y, _ralsei.y, _a / _ralsei.ralsei_target); if (_dir >= 45 && _dir < 135) _ralsei.facingdir[_a] = 2; else if (_dir >= 135 && _dir < 225) _ralsei.facingdir[_a] = 3; else if (_dir >= 225 && _dir < 315) _ralsei.facingdir[_a] = 0; else if (_dir >= 315 || _dir < 45) _ralsei.facingdir[_a] = 1; _a++; } } }
();
1849
            stoolbuff = 3;
1850
        }
1851
    }
1852
}
1853
if (switchchar == true)
1854
    switchbuff--;
1855
if (i_ex(obj_board_writer) || i_ex(obj_writer))
1856
    switchbuff = 10;
1857
if (switchbuff <= 0 && switchchar == true && controlled && global.interact == 0 && button3_p() && (canfreemove == true || name == "ralsei"))
1858
{
1859
    with (obj_mainchara_board)
1860
        switchbuff = 2;
1861
    if (controlled == true)
1862
    {
1863
        var nextname = "susie";
1864
        switch (name)
1865
        {
1866
            case "kris":
1867
                nextname = "susie";
1868
                break;
1869
            case "susie":
1870
                nextname = "ralsei";
1871
                break;
1872
            case "ralsei":
1873
                nextname = "kris";
1874
                break;
1875
        }
1876
        debug_message(string(id) + ":" + nextname + "| controlled=" + string(controlled));
1877
        var newcharfound = 0;
1878
        with (obj_mainchara_board)
1879
        {
1880
            if (name == nextname)
1881
                newcharfound = id;
1882
        }
1883
        if (i_ex(newcharfound))
1884
        {
1885
            controlled = 0;
1886
            with (newcharfound)
1887
            {
1888
                controlled = 1;
1889
                snd_play(snd_board_text_main);
1890
                with (obj_board_marker)
1891
                {
1892
                    if (sprite_index == spr_board_controlledicon)
1893
                        instance_destroy();
1894
                }
1895
                var controlmarker = instance_create(x, y - 24, obj_board_marker);
1896
                if (name == "ralsei" && i_ex(stool))
1897
                {
1898
                    controlmarker.x = stool.x;
1899
                    controlmarker.y = stool.y;
1900
                }
1901
                controlmarker.sprite_index = spr_board_controlledicon;
1902
                controlmarker.vspeed = -2.8;
1903
                controlmarker.gravity = 0.2;
1904
                controlmarker.depth = depth - 1;
1905
                if (controlmarker.y <= 64)
1906
                    controlmarker.y = 64;
1907
                
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(controlmarker);
1908
                
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(controlmarker, 15);
1909
            }
1910
        }
1911
    }
1912
}
1913
hookshot = global.flag[1026];
1914
if (hookshot == true)
1915
    hookbuff--;
1916
if ((hookshot == true && hookbuff <= 0 && button2_p() && canfreemove == true && controlled == 1 && grab == 0 && global.interact == 0 && name != "ralsei") || forcehook == true)
1917
{
1918
    forcehook = false;
1919
    if (hookcon == 0)
1920
    {
1921
        hookbuff = 3;
1922
        canfreemove = false;
1923
        var hookx = x + 16;
1924
        var hooky = y + 16;
1925
        if (facing == 0)
1926
        {
1927
            hookx += 0;
1928
            hooky += 16;
1929
        }
1930
        if (facing == 1)
1931
        {
1932
            hookx += 16;
1933
            hooky += 8;
1934
        }
1935
        if (facing == 2)
1936
        {
1937
            hookx += 0;
1938
            hooky -= 16;
1939
        }
1940
        if (facing == 3)
1941
        {
1942
            hookx -= 16;
1943
            hooky += 8;
1944
        }
1945
        hook = instance_create(hookx, hooky, obj_board_hookshot);
1946
        hook.hookdaddy = id;
1947
        hook.direction = (facing * 90) - 90;
1948
        hook.depth = 999990;
1949
        hookcon = 1;
1950
    }
1951
}
1952
if (hookcon == 1 && !i_ex(hook))
1953
{
1954
    hookcon = 0;
1955
    canfreemove = true;
1956
}
1957
var _kris = 0;
1958
with (obj_mainchara_board)
1959
{
1960
    if (name == "kris")
1961
        _kris = id;
1962
}
1963
if (controlled == 1)
1964
{
1965
    if (battlemode == true)
1966
    {
1967
        canfreemove = 0;
1968
        if (!i_ex(obj_gameshow_battlemanager))
1969
        {
1970
            battlemode = false;
1971
            canfreemove = 1;
1972
            with (obj_board_parent)
1973
                event_user(11);
1974
        }
1975
    }
1976
    if (quizmode == true)
1977
    {
1978
        canfreemove = 0;
1979
        if (!i_ex(obj_quizsequence))
1980
        {
1981
            quizmode = false;
1982
            canfreemove = 1;
1983
            with (obj_board_parent)
1984
                event_user(11);
1985
        }
1986
    }
1987
    var susieholdingkris = 0;
1988
    if (name == "susie")
1989
    {
1990
        if (i_ex(obj_board_grabobject) && i_ex(_kris))
1991
        {
1992
            if (obj_board_grabobject.grabbedid == _kris)
1993
                susieholdingkris = true;
1994
        }
1995
    }
1996
    if (name == "elnina")
1997
    {
1998
        if (button1_p() && global.interact == 0 && cry == 0)
1999
        {
2000
            canfreemove = false;
2001
            fun = 1;
2002
            crybuffer = 16;
2003
            cry = 1;
2004
        }
2005
        if (cry == 1)
2006
        {
2007
            fun = 1;
2008
            sprite_index = spr_board_elnina_cry;
2009
            if ((crybuffer % 5) == 0 && crybuffer > 0)
2010
            {
2011
                if (button1_h() && !button1_p())
2012
                    crybuffer += 5;
2013
                snd_stop(snd_board_kill);
2014
                snd_play_x(snd_board_kill, 0.8, 2.5);
2015
                with (instance_create_depth(x + 22, y, depth - 1, obj_board_crytear))
2016
                {
2017
                    image_blend = #5ACEDE;
2018
                    image_xscale = 4;
2019
                    image_yscale = 4;
2020
                    gravity = 0.4;
2021
                    vspeed = -2;
2022
                    hspeed = 2;
2023
                    
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(id, 16);
2024
                }
2025
                with (instance_create_depth(x + 4, y, depth - 1, obj_board_crytear))
2026
                {
2027
                    image_blend = #5ACEDE;
2028
                    image_xscale = 4;
2029
                    image_yscale = 4;
2030
                    gravity = 0.4;
2031
                    vspeed = -2;
2032
                    hspeed = -2;
2033
                    
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(id, 16);
2034
                }
2035
            }
2036
            crybuffer--;
2037
            if (button1_p())
2038
                crybuffer = 15;
2039
            if (crybuffer <= 0 && !i_ex(obj_board_crytear))
2040
            {
2041
                fun = 0;
2042
                cry = 0;
2043
                canfreemove = true;
2044
                facing = 0;
2045
            }
2046
            if (crybuffer > 0)
2047
                image_index += 0.25;
2048
        }
2049
    }
2050
    if (name == "lancer")
2051
    {
2052
        if (button1_p() && global.interact == 0 && digfreeze == false)
2053
        {
2054
            var x1 = x - 10;
2055
            var x2 = x + 10;
2056
            var y1 = y + 10;
2057
            var y2 = y + 30;
2058
            var digmark = collision_rectangle(x1, y1, x2, y2, obj_board_treasuremarker, 0, 1);
2059
            if (i_ex(digmark))
2060
            {
2061
                snd_stop(snd_board_splash);
2062
                snd_play_pitch(snd_board_splash, 1);
2063
                var digx = digmark.x;
2064
                var digy = digmark.y;
2065
                digmark.digamt--;
2066
                if (digmark.digamt <= 0)
2067
                {
2068
                    with (digmark)
2069
                        event_user(2);
2070
                }
2071
                with (instance_create(digx, digy, obj_board_smokepuff))
2072
                {
2073
                    image_blend = #FFECBD;
2074
                    image_speed = 1;
2075
                    depth = other.depth + 1;
2076
                }
2077
            }
2078
            digcon = 1;
2079
            digtimer = 0;
2080
            fun = 1;
2081
            sprite_index = spr_board_lancer_dig;
2082
            image_speed = 0;
2083
            image_index = 0;
2084
            canfreemove = false;
2085
        }
2086
        if (digcon == 1)
2087
        {
2088
            digtime++;
2089
            if (digtime == 4)
2090
                image_index = 1;
2091
            if (digtime == 8)
2092
            {
2093
                fun = 0;
2094
                if (digfreeze == false)
2095
                    canfreemove = true;
2096
                digtime = 0;
2097
                digcon = 0;
2098
                facing = 3;
2099
            }
2100
        }
2101
    }
2102
    var totaloverwrite = 0;
2103
    if (room == room_dw_puzzlecloset_3)
2104
        totaloverwrite = 1;
2105
    if (canfreemove == 1 && controlled == 1 && boat == false && (name == "kris" || susieholdingkris == true || totaloverwrite) && !freeroam)
2106
    {
2107
        var __canscreentransition = true;
2108
        if ((
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
() && susierecordcon != 0) || cantleave == true || nocamtransition == true)
2109
            __canscreentransition = false;
2110
        if (__canscreentransition == true)
2111
        {
2112
            if (x > _rightbound)
2113
            {
2114
                x = _rightbound;
2115
                if (!place_meeting(x + 32, y, obj_board_solid))
2116
                {
2117
                    facing = 1;
2118
                    canfreemove = 0;
2119
                    with (obj_board_camera)
2120
                        shift = "right";
2121
                }
2122
            }
2123
            if (x < _leftbound)
2124
            {
2125
                x = _leftbound;
2126
                if (!place_meeting(x - 32, y, obj_board_solid))
2127
                {
2128
                    facing = 3;
2129
                    canfreemove = 0;
2130
                    with (obj_board_camera)
2131
                        shift = "left";
2132
                }
2133
            }
2134
            if (y > _downbound)
2135
            {
2136
                y = _downbound;
2137
                if (!place_meeting(x, y + 32, obj_board_solid))
2138
                {
2139
                    canfreemove = 0;
2140
                    with (obj_board_camera)
2141
                        shift = "down";
2142
                }
2143
            }
2144
            if (y < _upbound)
2145
            {
2146
                y = _upbound;
2147
                if (!place_meeting(x, y - 32, obj_board_solid))
2148
                {
2149
                    facing = 2;
2150
                    canfreemove = 0;
2151
                    with (obj_board_camera)
2152
                        shift = "up";
2153
                }
2154
            }
2155
            if (place_meeting(x, y, obj_board_warpentrance))
2156
            {
2157
                var warp = instance_place(x, y, obj_board_warpentrance);
2158
                with (obj_board_camera)
2159
                {
2160
                    if (shift != "none")
2161
                    {
2162
                        warpx = warp.warpx;
2163
                        warpy = warp.warpy;
2164
                        playerX = warp.playerX;
2165
                        playerY = warp.playerY;
2166
                        shift = "warp";
2167
                        if (warp.playStairsSound)
2168
                            snd_play(snd_board_escaped);
2169
                    }
2170
                }
2171
            }
2172
        }
2173
        if (cantleave == true)
2174
        {
2175
            x = clamp(x, _leftbound, _rightbound);
2176
            y = clamp(y, _upbound, _downbound);
2177
        }
2178
    }
2179
}
2180
if (global.flag[1016] == 0 && obj_board_camera.con == 0 && !freeroam)
2181
{
2182
    x = clamp(x, _leftbound, _rightbound);
2183
    y = clamp(y, _upbound, _downbound);
2184
}
2185
if (forget == true)
2186
{
2187
    forget = false;
2188
    for (var i = 0; i < 75; i += 1)
2189
    {
2190
        remx[i] = x;
2191
        remy[i] = y;
2192
    }
2193
}
2194
if (obj_board_camera.active || !canfreemove || global.interact == 1 || runawayfromsusie == true)
2195
{
2196
    path_speed = 0;
2197
}
2198
else
2199
{
2200
    path_speed = 4;
2201
    _kris = obj_board_controller.kris_object;
2202
    if (is_moving == true)
2203
    {
2204
        if (path_position != 1)
2205
            image_index += 0.125;
2206
        is_moving_timer++;
2207
        if (is_moving_timer == 1)
2208
        {
2209
            if (path_target_x == 1 || path_target_y != -1)
2210
            {
2211
                if (name == "susie")
2212
                {
2213
                    if (mp_grid_path(global.grid, path, x + 16, y + 16, path_target_x, path_target_y, allow_diagonals))
2214
                    {
2215
                        path_start(path, 4, path_action_stop, false);
2216
                    }
2217
                    else
2218
                    {
2219
                        debugpathmessage = 1;
2220
                        is_moving = false;
2221
                    }
2222
                }
2223
                if (name == "kris")
2224
                {
2225
                    if (mp_grid_path(global.grid, path, x + 16, y + 16, path_target_x, path_target_y, allow_diagonals))
2226
                    {
2227
                        path_start(path, 4, path_action_stop, false);
2228
                    }
2229
                    else
2230
                    {
2231
                        debugpathmessage = 1;
2232
                        is_moving = false;
2233
                    }
2234
                }
2235
                if (name == "ralsei")
2236
                {
2237
                    if (mp_grid_path(global.grid, path, x + 16, y + 16, path_target_x, path_target_y, allow_diagonals))
2238
                    {
2239
                        path_start(path, 4, path_action_stop, false);
2240
                    }
2241
                    else
2242
                    {
2243
                        debugpathmessage = 1;
2244
                        is_moving = false;
2245
                    }
2246
                }
2247
            }
2248
            else
2249
            {
2250
                if (name == "susie")
2251
                {
2252
                    var x_cell = floor(_kris.x / global.cell_size);
2253
                    var y_cell = floor((_kris.y + 18) / global.cell_size);
2254
                    var position_x = (x_cell * global.cell_size) + (global.cell_size / 2);
2255
                    var position_y = (y_cell * global.cell_size) + (global.cell_size / 2);
2256
                    if (mp_grid_path(global.grid, path, x + 16, y + 16, position_x, position_y, allow_diagonals))
2257
                        path_start(path, 4, path_action_stop, false);
2258
                    else
2259
                        show_debug_message("PATHFINDING ERROR 3: cannot path to target location");
2260
                }
2261
                if (name == "ralsei")
2262
                {
2263
                    var x_cell = floor(_kris.x / global.cell_size);
2264
                    var y_cell = floor((_kris.y + 18) / global.cell_size);
2265
                    var position_x = (x_cell * global.cell_size) + (global.cell_size / 2);
2266
                    var position_y = (y_cell * global.cell_size) + (global.cell_size / 2);
2267
                    if (mp_grid_path(global.grid, path, x + 16, y + 16, position_x, position_y, allow_diagonals))
2268
                        path_start(path, 4, path_action_stop, false);
2269
                    else
2270
                        show_debug_message("PATHFINDING ERROR 4: cannot path to target location");
2271
                }
2272
            }
2273
        }
2274
        var diag = 0;
2275
        if (direction == 45 || direction == 315 || direction == 135 || direction == 225)
2276
            diag = 1;
2277
        if (path_target_x == 1 || path_target_y != -1)
2278
        {
2279
        }
2280
        else if ((is_moving_timer >= 9 && diag == 0) || (is_moving_timer >= 12 && diag == 1))
2281
        {
2282
            is_moving_timer = 0;
2283
            path_end();
2284
            speed = 0;
2285
            if (distance_to_object(_kris) < 24 && graballpots == false && chaseralsei == false)
2286
                is_moving = false;
2287
        }
2288
        if ((direction <= 47 && direction >= 0) || direction > 317)
2289
        {
2290
            sprite_index = rsprite;
2291
            facing = 1;
2292
        }
2293
        if (direction > 47 && direction <= 137)
2294
        {
2295
            sprite_index = usprite;
2296
            facing = 2;
2297
        }
2298
        if (direction > 137 && direction <= 227)
2299
        {
2300
            sprite_index = lsprite;
2301
            facing = 3;
2302
        }
2303
        if (direction > 227 && direction <= 317)
2304
        {
2305
            sprite_index = dsprite;
2306
            facing = 0;
2307
        }
2308
    }
2309
    if (name == "ralsei" && follow)
2310
    {
2311
        if (_kris.hitcon != 1)
2312
        {
2313
            moved = 0;
2314
            if (_kris.x != remx[0])
2315
                moved = 1;
2316
            if (_kris.y != remy[0])
2317
                moved = 1;
2318
            if (moved == 1)
2319
            {
2320
                for (var i = 75; i > 0; i -= 1)
2321
                {
2322
                    remx[i] = remx[i - 1];
2323
                    remy[i] = remy[i - 1];
2324
                    facingdir[i] = facingdir[i - 1];
2325
                }
2326
                remx[0] = _kris.x;
2327
                remy[0] = _kris.y;
2328
                facingdir[0] = _kris.facing;
2329
                if (ralsei_target < 20)
2330
                    ralsei_target++;
2331
            }
2332
            else if (ralsei_target > 10)
2333
            {
2334
                ralsei_target--;
2335
            }
2336
            x = remx[ralsei_target];
2337
            y = remy[ralsei_target];
2338
            facing = facingdir[ralsei_target];
2339
        }
2340
        for (var i = 10; i > 0; i -= 1)
2341
        {
2342
            ralx[i] = ralx[i - 1];
2343
            raly[i] = raly[i - 1];
2344
        }
2345
        ralx[0] = x;
2346
        raly[0] = y;
2347
        if (ralx[0] != ralx[1] || raly[0] != raly[1])
2348
            image_index += 0.125;
2349
        else
2350
            image_index = 0;
2351
    }
2352
}
2353
if (name == "kris")
2354
{
2355
    if (xp >= xptolevel || (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
() && sword && keyboard_check_pressed(ord("O"))))
2356
    {
2357
        xp = 0;
2358
        swordlv++;
2359
        snd_stop(snd_board_ominous);
2360
        snd_play(snd_board_ominous);
2361
        swordlv = clamp(swordlv, 1, 5);
2362
        if (swordlv == 2)
2363
            xptolevel = 24;
2364
        if (swordlv == 3)
2365
            xptolevel = 15;
2366
        if (swordlv == 4)
2367
            xptolevel = 14;
2368
        if (swordlv == 5)
2369
            xptolevel = 68;
2370
        if (room == room_board_1)
2371
        {
2372
        }
2373
        if (room == room_board_dungeon_2)
2374
        {
2375
            if (swordlv == 2)
2376
                xptolevel = 4;
2377
            if (swordlv == 3)
2378
                xptolevel = 11;
2379
        }
2380
    }
2381
}
2382
if (i_ex(obj_board_camera) && obj_board_camera.con == 0)
2383
{
2384
    if (x < 129 || x > 479 || y < 65 || y > 287)
2385
    {
2386
        atdoorway = true;
2387
    }
2388
    else
2389
    {
2390
        leftdoorway = true;
2391
        atdoorway = false;
2392
    }
2393
}
2394
sleeping = false;
2395
with (obj_mainchara_board)
2396
{
2397
    if (boat == true)
2398
        other.sleepytimer = 0;
2399
}
2400
if (sleepy == true)
2401
{
2402
    if (!i_ex(obj_board_grabobject))
2403
        sleepytimer++;
2404
    if (speed != 0 || is_moving || press_l || press_r || press_u || press_d || press_1 || press_2 || global.interact != 0 || bw_ex() || d_ex() || i_ex(obj_quizsequence))
2405
        sleepytimer = 0;
2406
    if (sleepytimer > 300)
2407
    {
2408
        facing = 0;
2409
        sleeping = true;
2410
        sprite_index = sleepsprite;
2411
        if ((sleepytimer % 30) == 0)
2412
            image_index = !image_index;
2413
    }
2414
}
2415
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
2416
{
2417
    if (keyboard_check_pressed(ord("H")))
2418
        myhealth = 1;
2419
}
2420
if (name == "ralsei")
2421
    depth += 1;
2422
if (is_moving == 0 && controlled == 0)
2423
{
2424
    x = round(x);
2425
    y = round(y);
2426
}
2427
if (ribbon == true)
2428
{
2429
    if (abs(bowx - x) > 40)
2430
    {
2431
        bowx = x;
2432
        bowy = y;
2433
    }
2434
}
2435
if (stink)
2436
{
2437
    stinktimer++;
2438
    if ((stinktimer % 5) == 0)
2439
    {
2440
        var _sx = x;
2441
        var _sy = y;
2442
        var _dp = depth - 1;
2443
        if (name == "ralsei")
2444
        {
2445
            if (i_ex(stool))
2446
            {
2447
                _sx = stool.x;
2448
                _sy = stool.y;
2449
                _dp = stool.depth - 1;
2450
            }
2451
        }
2452
        var stinky = 
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; }
(_sx + 16 + irandom_range(-8, 8), _sy + 2, spr_pxwhite, 0, depth + 1, choose(2, 2, 2, 2, 2, 4));
2453
        
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(stinky, irandom(4) + 8);
2454
        stinky.vspeed = -2;
2455
        stinky.depth = _dp;
2456
        stinky.image_blend = merge_color(#5EAC37, #30790B, random(1));
2457
        stinky.friction = 0.2;
2458
    }
2459
}
2460
if (room == room_dw_b3bs_lancerget)
2461
    x = clamp(x, camerax(), (camerax() + 640) - 32);
2462
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
2463
{
2464
    if (debugpathmessage)
2465
    {
2466
        if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
2467
        {
2468
            debug_message("==========================");
2469
            debug_message(name + ": PATHFINDING ERROR 1: cannot path to target location");
2470
            debug_message(name + ": tile target:" + string((path_target_x - 128 - 16) / 32) + " | " + string((path_target_y - 64 - 16) / 32));
2471
            debug_message(name + ": x/y  target:" + string(path_target_x) + " | " + string(path_target_y));
2472
            show_debug_message("==========================");
2473
        }
2474
    }
2475
}
2476
2477
enum UnknownEnum
2478
{
2479
    Value_0,
2480
    Value_1,
2481
    Value_2,
2482
    Value_3,
2483
    Value_13 = 13
2484
}
2485
2486
enum e__VW
2487
{
2488
    XView,
2489
    YView,
2490
    WView,
2491
    HView,
2492
    Angle,
2493
    HBorder,
2494
    VBorder,
2495
    HSpeed,
2496
    VSpeed,
2497
    Object,
2498
    Visible,
2499
    XPort,
2500
    YPort,
2501
    WPort,
2502
    HPort,
2503
    Camera,
2504
    SurfaceID
2505
}