Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_dw_church_pushableshelf_darklight_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
    if (ladder != 0)
24
    {
25
        ladder.x += xshift;
26
        ladder.y += yshift;
27
        ladder.image_alpha = 0.5;
28
    }
29
    if (climbpoint != 0)
30
    {
31
        climbpoint.x += xshift;
32
        climbpoint.y += yshift;
33
    }
34
    if (resetblocks == true)
35
    {
36
        resetblocks = false;
37
        setxy(xstart, ystart);
38
        if (ladder != 0)
39
        {
40
            with (ladder)
41
                setxy(xstart, ystart);
42
        }
43
        if (climbpoint != 0)
44
        {
45
            with (climbpoint)
46
                setxy(xstart, ystart);
47
        }
48
        for (var i = 0; i < array_length(myblock); i++)
49
        {
50
            if (i_ex(myblock[i]))
51
            {
52
                with (myblock[i])
53
                    setxy(xstart, ystart);
54
            }
55
        }
56
        for (var i = 0; i < array_length(upstairs); i++)
57
        {
58
            if (i_ex(upstairs[i]))
59
            {
60
                with (upstairs[i])
61
                    setxy(xstart, ystart);
62
            }
63
        }
64
    }
65
}