Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_dw_church_pushableshelf_3x3_Step_2

(view raw script w/o annotations or w/e)
1
var xshift = x - beginx;
2
var yshift = y - beginy;
3
if (init == 1)
4
{
5
    for (var i = 0; i < array_length(myblock); i++)
6
    {
7
        if (i_ex(myblock[i]))
8
        {
9
            if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
10
                myblock[i].image_alpha = 0.5;
11
            myblock[i].x += xshift;
12
            myblock[i].y += yshift;
13
        }
14
    }
15
    for (var i = 0; i < array_length(upstairs); i++)
16
    {
17
        if (i_ex(upstairs[i]))
18
        {
19
            upstairs[i].x += xshift;
20
            upstairs[i].y += yshift;
21
        }
22
    }
23
    for (var i = 0; i < array_length(altupstairs); i++)
24
    {
25
        if (i_ex(altupstairs[i]))
26
        {
27
            altupstairs[i].x += xshift;
28
            altupstairs[i].y += yshift;
29
        }
30
    }
31
    if (ladder != 0)
32
    {
33
        ladder.x += xshift;
34
        ladder.y += yshift;
35
        ladder.image_alpha = 0.5;
36
    }
37
    if (climbpoint != 0)
38
    {
39
        climbpoint.x += xshift;
40
        climbpoint.y += yshift;
41
    }
42
    if (resetblocks == true)
43
    {
44
        resetblocks = false;
45
        setxy(xstart, ystart);
46
        if (ladder != 0)
47
        {
48
            with (ladder)
49
                setxy(xstart, ystart);
50
        }
51
        if (climbpoint != 0)
52
        {
53
            with (climbpoint)
54
                setxy(xstart, ystart);
55
        }
56
        for (var i = 0; i < array_length(myblock); i++)
57
        {
58
            if (i_ex(myblock[i]))
59
            {
60
                with (myblock[i])
61
                    setxy(xstart, ystart);
62
            }
63
        }
64
        for (var i = 0; i < array_length(upstairs); i++)
65
        {
66
            if (i_ex(upstairs[i]))
67
            {
68
                with (upstairs[i])
69
                    setxy(xstart, ystart);
70
            }
71
        }
72
        for (var i = 0; i < array_length(altupstairs); i++)
73
        {
74
            if (i_ex(altupstairs[i]))
75
            {
76
                with (altupstairs[i])
77
                    setxy(xstart, ystart);
78
            }
79
        }
80
    }
81
}