Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_dw_church_pushableshelf_3x3_Step_0

(view raw script w/o annotations or w/e)
1
beginx = x;
2
beginy = y;
3
if (init == 0)
4
{
5
    if (room == room_overworld_darkmaku_blocks)
6
        movetype = 0;
7
    if (image_index == 0)
8
    {
9
        upstairs[0] = instance_create(x + 40, y + 0, obj_heightfloor);
10
        upstairs[1] = instance_create(x + 0, y + 40, obj_heightfloor);
11
        upstairs[1].image_xscale = 3;
12
        upstairs[2] = instance_create(x + 40, y + 80, obj_heightfloor);
13
        altupstairs[0] = instance_create(x + 0, y + 0, obj_heightfloor);
14
        altupstairs[1] = instance_create(x + 80, y + 0, obj_heightfloor);
15
        altupstairs[2] = instance_create(x + 0, y + 80, obj_heightfloor);
16
        altupstairs[3] = instance_create(x + 80, y + 80, obj_heightfloor);
17
    }
18
    if (image_index == 1)
19
    {
20
        upstairs[0] = instance_create(x + 0, y + 0, obj_heightfloor);
21
        upstairs[0].image_xscale = 3;
22
        upstairs[1] = instance_create(x + 0, y + 40, obj_heightfloor);
23
        upstairs[2] = instance_create(x + 0, y + 80, obj_heightfloor);
24
        upstairs[2].image_xscale = 3;
25
        altupstairs[0] = instance_create(x + 40, y + 40, obj_heightfloor);
26
        altupstairs[0].image_xscale = 2;
27
    }
28
    if (image_index == 2)
29
    {
30
        upstairs[0] = instance_create(x + 0, y + 0, obj_heightfloor);
31
        upstairs[0].image_xscale = 3;
32
        upstairs[1] = instance_create(x + 80, y + 40, obj_heightfloor);
33
        upstairs[2] = instance_create(x + 0, y + 80, obj_heightfloor);
34
        upstairs[2].image_xscale = 3;
35
        altupstairs[0] = instance_create(x + 0, y + 40, obj_heightfloor);
36
        altupstairs[0].image_xscale = 2;
37
    }
38
    if (image_index == 3)
39
    {
40
        upstairs[0] = instance_create(x + 80, y + 0, obj_heightfloor);
41
        upstairs[1] = instance_create(x + 0, y + 40, obj_heightfloor);
42
        upstairs[1].image_xscale = 3;
43
        upstairs[2] = instance_create(x + 0, y + 80, obj_heightfloor);
44
        altupstairs[0] = instance_create(x + 0, y + 0, obj_heightfloor);
45
        altupstairs[0].image_xscale = 2;
46
        altupstairs[1] = instance_create(x + 40, y + 80, obj_heightfloor);
47
        altupstairs[1].image_xscale = 2;
48
    }
49
    if (image_index == 4)
50
    {
51
        upstairs[0] = instance_create(x + 0, y + 0, obj_heightfloor);
52
        upstairs[1] = instance_create(x + 0, y + 40, obj_heightfloor);
53
        upstairs[1].image_xscale = 3;
54
        upstairs[2] = instance_create(x + 80, y + 80, obj_heightfloor);
55
        altupstairs[0] = instance_create(x + 40, y + 0, obj_heightfloor);
56
        altupstairs[0].image_xscale = 2;
57
        altupstairs[1] = instance_create(x + 0, y + 80, obj_heightfloor);
58
        altupstairs[1].image_xscale = 2;
59
    }
60
    if (image_index == 5)
61
    {
62
        upstairs[0] = instance_create(x + 0, y + 40, obj_heightfloor);
63
        upstairs[0].image_xscale = 3;
64
        altupstairs[0] = instance_create(x + 0, y + 0, obj_heightfloor);
65
        altupstairs[0].image_xscale = 3;
66
        altupstairs[1] = instance_create(x + 0, y + 80, obj_heightfloor);
67
        altupstairs[1].image_xscale = 3;
68
    }
69
    if (image_index == 6)
70
    {
71
        upstairs[0] = instance_create(x + 40, y + 0, obj_heightfloor);
72
        upstairs[0].image_yscale = 3;
73
        altupstairs[0] = instance_create(x + 0, y + 0, obj_heightfloor);
74
        altupstairs[0].image_yscale = 3;
75
        altupstairs[1] = instance_create(x + 80, y + 0, obj_heightfloor);
76
        altupstairs[1].image_yscale = 3;
77
    }
78
    if (image_index == 7)
79
    {
80
        upstairs[0] = instance_create(x + 0, y + 40, obj_heightfloor);
81
        upstairs[0].image_xscale = 3;
82
        upstairs[1] = instance_create(x + 40, y + 80, obj_heightfloor);
83
        altupstairs[0] = instance_create(x + 0, y + 0, obj_heightfloor);
84
        altupstairs[0].image_xscale = 3;
85
        altupstairs[1] = instance_create(x + 80, y + 80, obj_heightfloor);
86
        altupstairs[2] = instance_create(x + 0, y + 80, obj_heightfloor);
87
    }
88
    if (image_index == 8)
89
    {
90
        upstairs[0] = instance_create(x + 0, y + 40, obj_heightfloor);
91
        upstairs[0].image_xscale = 3;
92
        upstairs[1] = instance_create(x + 40, y + 80, obj_heightfloor);
93
        altupstairs[0] = instance_create(x + 0, y + 0, obj_heightfloor);
94
        altupstairs[0].image_xscale = 3;
95
        altupstairs[1] = instance_create(x + 80, y + 80, obj_heightfloor);
96
        altupstairs[2] = instance_create(x + 0, y + 80, obj_heightfloor);
97
        ladder = instance_create(x + 40, (y + 120) - 4, obj_climbingarea);
98
        ladder.image_xscale = 1;
99
        ladder.image_yscale = 2;
100
        climbpoint = instance_create(x + 40, y + 120 + 2, obj_heightfloor_changer);
101
        myblock[0].image_xscale = 1;
102
        myblock[1] = instance_create(x + 80, y + 80, obj_solidblockDark);
103
        myblock[1].image_yscale = 3;
104
        myblock[2] = instance_create(x + 40, y + 80, obj_solidblockDark);
105
    }
106
    if (image_index == 9)
107
    {
108
        upstairs[0] = instance_create(x + 0, y + 40, obj_heightfloor);
109
        upstairs[0].image_xscale = 3;
110
        upstairs[1] = instance_create(x + 40, y + 80, obj_heightfloor);
111
        upstairs[2] = instance_create(x + 40, y + 0, obj_heightfloor);
112
        altupstairs[0] = instance_create(x + 0, y + 0, obj_heightfloor);
113
        altupstairs[1] = instance_create(x + 80, y + 80, obj_heightfloor);
114
        altupstairs[2] = instance_create(x + 0, y + 80, obj_heightfloor);
115
        altupstairs[3] = instance_create(x + 80, y + 0, obj_heightfloor);
116
        ladder = instance_create(x + 40, (y + 120) - 4, obj_climbingarea);
117
        ladder.image_xscale = 1;
118
        ladder.image_yscale = 2;
119
        climbpoint = instance_create(x + 40, y + 120 + 2, obj_heightfloor_changer);
120
        myblock[0].image_xscale = 1;
121
        myblock[1] = instance_create(x + 80, y + 80, obj_solidblockDark);
122
        myblock[1].image_yscale = 3;
123
        myblock[2] = instance_create(x + 40, y + 80, obj_solidblockDark);
124
    }
125
    if (image_index == 10)
126
    {
127
        upstairs[0] = instance_create(x + 0, y + 0, obj_heightfloor);
128
        upstairs[0].image_xscale = 3;
129
        upstairs[0].image_yscale = 2;
130
        upstairs[1] = instance_create(x + 40, y + 80, obj_heightfloor);
131
        altupstairs[0] = instance_create(x + 80, y + 80, obj_heightfloor);
132
        altupstairs[1] = instance_create(x + 0, y + 80, obj_heightfloor);
133
        ladder = instance_create(x + 40, (y + 120) - 4, obj_climbingarea);
134
        ladder.image_xscale = 1;
135
        ladder.image_yscale = 2;
136
        climbpoint = instance_create(x + 40, y + 120 + 2, obj_heightfloor_changer);
137
        myblock[0].image_xscale = 1;
138
        myblock[1] = instance_create(x + 80, y + 80, obj_solidblockDark);
139
        myblock[1].image_yscale = 3;
140
        myblock[2] = instance_create(x + 40, y + 80, obj_solidblockDark);
141
    }
142
    for (var i = 0; i < array_length(altupstairs); i++)
143
    {
144
        altupstairs[i].floorheight = 2;
145
        altupstairs[i].image_blend = c_orange;
146
    }
147
    init = 1;
148
}
149
if (con == 1)
150
{
151
    moveamount = 0;
152
    var _sx = 0;
153
    var _sy = 0;
154
    if (mydir == 3)
155
        _sx = -40;
156
    else if (mydir == 1)
157
        _sx = 40;
158
    else if (mydir == 2)
159
        _sy = -40;
160
    else
161
        _sy = 40;
162
    for (var j = 1; j < maxDistance; j++)
163
    {
164
        for (var i = 0; i < array_length(myblock); i++)
165
        {
166
            myblock[i].x += _sx * j;
167
            myblock[i].y += _sy * j;
168
            with (myblock[i])
169
            {
170
                if (place_meeting(x, y, obj_solidblock) || place_meeting(x, y, obj_solidenemy))
171
                {
172
                    var ignoreblock = 0;
173
                    var foundblock = instance_place(x, y, obj_solidblock);
174
                    if (foundblock == -4)
175
                        foundblock = instance_place(x, y, obj_solidenemy);
176
                    for (var b = 0; b < array_length(other.myblock); b++)
177
                    {
178
                        if (foundblock == other.myblock[b])
179
                            ignoreblock = 1;
180
                    }
181
                    if (ignoreblock == 0)
182
                    {
183
                        if (other.moveamount == 0 || j < other.moveamount)
184
                            other.moveamount = j;
185
                    }
186
                }
187
            }
188
            myblock[i].x -= _sx * j;
189
            myblock[i].y -= _sy * j;
190
        }
191
    }
192
    con = 2;
193
}
194
if (con == 2)
195
{
196
    debug_message(moveamount);
197
    if (moveamount == 0)
198
    {
199
    }
200
    else
201
    {
202
        if (movetype == 1 && moveamount > 2)
203
            moveamount = 2;
204
        snd_play(snd_wing);
205
        timeend = moveamount * 3;
206
        if (mydir == 3)
207
            
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("x", x, x - (40 * (moveamount - 1)), timeend, 3, "in");
208
        if (mydir == 1)
209
            
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("x", x, x + (40 * (moveamount - 1)), timeend, 3, "in");
210
        if (mydir == 0)
211
            
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("y", y, y + (40 * (moveamount - 1)), timeend, 3, "in");
212
        if (mydir == 2)
213
            
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("y", y, y - (40 * (moveamount - 1)), timeend, 3, "in");
214
    }
215
    con = 3;
216
}
217
if (con == 3)
218
{
219
    timer++;
220
    if ((timer % 3) == 0 && timer < timeend)
221
        snd_play_pitch(snd_wing, 0.2 + ((timer / timeend) * 0.8));
222
    if (timer == timeend || moveamount == 0)
223
    {
224
        snd_play(snd_impact);
225
        global.interact = 0;
226
        timeend = 30;
227
        moveamount = 0;
228
        con = 0;
229
    }
230
}
231
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();