Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_pushtile_room_Step_0

(view raw script w/o annotations or w/e)
1
var checktype = 0;
2
if (room == room_dw_city_postbaseball_2)
3
    checktype = 1;
4
if (pushedoverride < 0)
5
{
6
    pushed = 0;
7
    for (var i = 0; i < 3; i++)
8
    {
9
        if (checktype == 0)
10
        {
11
            if (place_meeting(x, y, pushChar[i]))
12
                pushed = 1;
13
        }
14
        if (checktype == 1)
15
        {
16
            var col = instance_place(x, y, pushChar[i]);
17
            if (instance_exists(col))
18
            {
19
                if (col.visible && col.image_alpha > 0)
20
                    pushed = 1;
21
            }
22
        }
23
    }
24
}
25
else
26
{
27
    pushed = pushedoverride;
28
}
29
var pushchanged = -1;
30
if (pushed != rempushed)
31
    pushchanged = pushed;
32
if (pushchanged == 0)
33
    variable_instance_set(instance_find(bossObject, 0), pushVariableName, pushVariableUp);
34
if (pushchanged == 1)
35
{
36
    snd_play(pushSound);
37
    variable_instance_set(instance_find(bossObject, 0), pushVariableName, pushVariableDown);
38
}
39
if (pushType == 1)
40
{
41
    if (pushed == 1)
42
        pushedoverride = 1;
43
}
44
image_index = pushed;
45
rempushed = pushed;