Deltarune (Chapter 5) script viewer

← back to main script listing

gml_GlobalScript_scr_floortex_shift_objects_Zaxis

(view raw script w/o annotations or w/e)
1
function 
scr_floortex_shift_objects_Zaxis
scr_floortex_shift_objects_Zaxis

function
scr_floortex_shift_objects_Zaxis(arg0, arg1)
{ if (arg1 == 0) exit; arg0.y_ow += arg1; arg0.bbox_bottom_ow += arg1; arg0.bbox_top_ow += arg1; arg0.bbox_bottom_plat += arg1; arg0.bbox_top_plat += arg1; with (arg0) { var _mainchara = instance_place(x, y, obj_mainchara); with (_mainchara) { var _x = (bbox_left + bbox_right) / 2; if (collision_line(_x, bbox_bottom - 2, _x, bbox_bottom + 6, arg0, 0, 0)) { if (!instance_place(x, y + arg1, obj_solidblock)) y += arg1; } } } with (obj_platswap_helper) { with (obj_id) { var _walltex = -4; if (instance_exists(walltex)) { if (walltex.floortex == arg0) _walltex = walltex; } if (floortex == arg0 || instance_exists(_walltex)) { y_ow += arg1; set_floortex_obj_yplat(); if (obj_platswap.transition_time <= 0) { if (obj_platswap.mode == 0) y = y_ow; else y = y_plat; } } } } with (obj_papergrass) { if (floortex == arg0) { y_ow += arg1; set_floortex_obj_yplat(); if (obj_platswap.transition_time <= 0) { if (obj_platswap.mode == 0) y = y_ow; else y = y_plat; } } } with (obj_rock3d) { if (floortex == arg0) { y_ow += arg1; set_floortex_obj_yplat(); if (obj_platswap.transition_time <= 0) { if (obj_platswap.mode == 0) y = y_ow; else y = y_plat; } } } with (obj_pinktree) { if (floortex == arg0) { y_ow += arg1; set_floortex_obj_yplat(); if (obj_platswap.transition_time <= 0) { if (obj_platswap.mode == 0) y = y_ow; else y = y_plat; } } } }
(arg0, arg1)
2
{
3
    if (arg1 == 0)
4
        exit;
5
    arg0.y_ow += arg1;
6
    arg0.bbox_bottom_ow += arg1;
7
    arg0.bbox_top_ow += arg1;
8
    arg0.bbox_bottom_plat += arg1;
9
    arg0.bbox_top_plat += arg1;
10
    with (arg0)
11
    {
12
        var _mainchara = instance_place(x, y, obj_mainchara);
13
        with (_mainchara)
14
        {
15
            var _x = (bbox_left + bbox_right) / 2;
16
            if (collision_line(_x, bbox_bottom - 2, _x, bbox_bottom + 6, arg0, 0, 0))
17
            {
18
                if (!instance_place(x, y + arg1, obj_solidblock))
19
                    y += arg1;
20
            }
21
        }
22
    }
23
    with (obj_platswap_helper)
24
    {
25
        with (obj_id)
26
        {
27
            var _walltex = -4;
28
            if (instance_exists(walltex))
29
            {
30
                if (walltex.floortex == arg0)
31
                    _walltex = walltex;
32
            }
33
            if (floortex == arg0 || instance_exists(_walltex))
34
            {
35
                y_ow += arg1;
36
                set_floortex_obj_yplat();
37
                if (obj_platswap.transition_time <= 0)
38
                {
39
                    if (obj_platswap.mode == 0)
40
                        y = y_ow;
41
                    else
42
                        y = y_plat;
43
                }
44
            }
45
        }
46
    }
47
    with (obj_papergrass)
48
    {
49
        if (floortex == arg0)
50
        {
51
            y_ow += arg1;
52
            set_floortex_obj_yplat();
53
            if (obj_platswap.transition_time <= 0)
54
            {
55
                if (obj_platswap.mode == 0)
56
                    y = y_ow;
57
                else
58
                    y = y_plat;
59
            }
60
        }
61
    }
62
    with (obj_rock3d)
63
    {
64
        if (floortex == arg0)
65
        {
66
            y_ow += arg1;
67
            set_floortex_obj_yplat();
68
            if (obj_platswap.transition_time <= 0)
69
            {
70
                if (obj_platswap.mode == 0)
71
                    y = y_ow;
72
                else
73
                    y = y_plat;
74
            }
75
        }
76
    }
77
    with (obj_pinktree)
78
    {
79
        if (floortex == arg0)
80
        {
81
            y_ow += arg1;
82
            set_floortex_obj_yplat();
83
            if (obj_platswap.transition_time <= 0)
84
            {
85
                if (obj_platswap.mode == 0)
86
                    y = y_ow;
87
                else
88
                    y = y_plat;
89
            }
90
        }
91
    }
92
}