Deltarune script viewer

← back to main script listing

gml_Object_obj_queenscreen_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    if (room == room_dw_cyber_battle_maze_2 || room == room_dw_cyber_keyboard_puzzle_3)
4
    {
5
        image_index = 10;
6
        extflag = 4;
7
        activecon = 0;
8
        scr_depth
scr_depth

function scr_depth() { depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
9
    }
10
    if (room == room_dw_cyber_maze_tasque)
11
    {
12
        if (extflag == 4)
13
        {
14
            activecon = 0;
15
            scr_depth
scr_depth

function scr_depth() { depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
16
        }
17
    }
18
    init = 1;
19
}
20
if (activecon == 0)
21
{
22
    if (instance_exists(obj_mainchara))
23
    {
24
        aligned = 0;
25
        if (extflag == 999)
26
        {
27
            if (align_x == true && x >= camerax() && x <= (camerax() + camerawidth()))
28
            {
29
                if (abs((obj_mainchara.x + 20) - x) <= align_amount)
30
                    aligned = 1;
31
            }
32
            if (align_y == true && y >= cameray() && y <= (cameray() + cameraheight()))
33
            {
34
                if (abs((obj_mainchara.y + 20) - y) <= align_amount)
35
                    aligned = 1;
36
            }
37
            if (align_distance == true)
38
            {
39
                if (distance_to_object(obj_mainchara) < align_amount)
40
                    aligned = 1;
41
            }
42
        }
43
        if (image_index != 14 && image_index != 13 && extflag == false)
44
        {
45
            if (align_x == true && x >= camerax() && x <= (camerax() + camerawidth()))
46
            {
47
                if (abs((obj_mainchara.x + 20) - x) <= align_amount)
48
                    aligned = 1;
49
            }
50
            if (align_y == true && y >= cameray() && y <= (cameray() + cameraheight()))
51
            {
52
                if (abs((obj_mainchara.y + 20) - y) <= align_amount)
53
                    aligned = 1;
54
            }
55
            if (align_distance == true)
56
            {
57
                if (distance_to_object(obj_mainchara) < align_amount)
58
                    aligned = 1;
59
            }
60
        }
61
        if (image_index == 13)
62
        {
63
            if (point_in_rectangle(obj_mainchara.x + 18, obj_mainchara.y + 36, 120, 480, 160, 558))
64
                aligned = 1;
65
        }
66
        if (image_index == 14)
67
        {
68
            if (point_in_rectangle(obj_mainchara.x + 18, obj_mainchara.y + 36, 200, 882, 280, 962))
69
                aligned = 1;
70
        }
71
        if (extflag == 1)
72
        {
73
            if (point_in_rectangle(obj_mainchara.x + 18, obj_mainchara.y + 36, 400, 680, 480, 760))
74
                aligned = 1;
75
        }
76
        if (extflag == 2)
77
        {
78
            if (point_in_rectangle(obj_mainchara.x + 18, obj_mainchara.y + 36, 1080, 440, 1160, 520))
79
                aligned = 1;
80
        }
81
        if (extflag == 3)
82
            aligned = 1;
83
        if (image_index == 10 && bluecheckcon == 0)
84
        {
85
            image_index = 10;
86
            if (room == room_dw_cyber_battle_maze_2)
87
            {
88
                global.flag[407 got_chestmark_2] = 1;
89
                bluecheckcon = 1;
90
            }
91
            if (room == room_dw_cyber_maze_tasque)
92
            {
93
                global.flag[367 got_chestmark] = 1;
94
                bluecheckcon = 1;
95
            }
96
            if (room == room_dw_cyber_keyboard_puzzle_3)
97
            {
98
                global.flag[420 giasfelfebrehber] = 1;
99
                bluecheckcon = 1;
100
            }
101
        }
102
        if (extflag == 5)
103
        {
104
            sprite_index = spr_queenscreen_big;
105
            if (point_in_rectangle(obj_mainchara.x + 18, obj_mainchara.y + 36, 320, 200, 360, 280))
106
                aligned = 1;
107
        }
108
        if (extflag == 6)
109
        {
110
            if (align_x == true && x >= camerax() && x <= (camerax() + camerawidth()))
111
            {
112
                if (abs((obj_mainchara.x + 20) - x) <= align_amount)
113
                    aligned = 1;
114
            }
115
            if (align_y == true && y >= cameray() && y <= (cameray() + cameraheight()))
116
            {
117
                if (abs((obj_mainchara.y + 20) - y) <= align_amount)
118
                    aligned = 1;
119
            }
120
            if (align_distance == true)
121
            {
122
                if (distance_to_object(obj_mainchara) < align_amount)
123
                    aligned = 1;
124
            }
125
        }
126
        if (extflag == 7)
127
        {
128
            if (align_x == true && x >= camerax() && x <= (camerax() + camerawidth()))
129
            {
130
                if (abs((obj_mainchara.x + 20) - x) <= align_amount)
131
                    aligned = 1;
132
            }
133
            if (align_y == true && y >= cameray() && y <= (cameray() + cameraheight()))
134
            {
135
                if (abs((obj_mainchara.y + 20) - y) <= align_amount)
136
                    aligned = 1;
137
            }
138
            if (align_distance == true)
139
            {
140
                if (distance_to_object(obj_mainchara) < align_amount)
141
                    aligned = 1;
142
            }
143
        }
144
        if (extflag == 8)
145
            aligned = 1;
146
        if (extflag == 10)
147
        {
148
            if (align_x == true && x >= camerax() && x <= (camerax() + camerawidth()))
149
            {
150
                if (abs((obj_mainchara.x + 20) - x) <= align_amount)
151
                    aligned = 1;
152
            }
153
            if (align_y == true && y >= cameray() && y <= (cameray() + cameraheight()))
154
            {
155
                if (abs((obj_mainchara.y + 20) - y) <= align_amount)
156
                    aligned = 1;
157
            }
158
            if (align_distance == true)
159
            {
160
                if (distance_to_object(obj_mainchara) < align_amount)
161
                    aligned = 1;
162
            }
163
        }
164
        if (extflag == 11)
165
        {
166
            if (scr_onscreen_tolerance
scr_onscreen_tolerance

function scr_onscreen_tolerance(arg0, arg1) { obj = arg0; spacer = arg1; if ((obj.x + obj.sprite_width + spacer) < camerax() || (obj.x - spacer) > (camerax() + 640) || (obj.y + obj.sprite_height + spacer) < cameray() || (obj.y - spacer) > (cameray() + 480)) return false; else return true; }
(id, 0))
167
                aligned = 1;
168
        }
169
        if (extflag == 12)
170
        {
171
            if (global.flag[366 tasque_released] == 1)
172
                aligned = 1;
173
            if (point_in_rectangle(charaX(), charaY(), 760, 920, 960, 1040))
174
            {
175
                aligned = 1;
176
                global.flag[366 tasque_released] = 1;
177
            }
178
        }
179
        if (aligned == 1)
180
        {
181
            visible = 1;
182
            con = 0;
183
            activecon = 1;
184
        }
185
    }
186
}
187
if (activecon == 1)
188
{
189
    if (con == 0)
190
    {
191
        timer += (timer + 1);
192
        image_xscale = lerp(4, 1, timer / 30);
193
        image_yscale = lerp(0, 4, timer / 30);
194
        if (timer >= 30)
195
        {
196
            con = 1;
197
            timer = 0;
198
        }
199
    }
200
    if (con == 1)
201
    {
202
        timer += (timer + 1);
203
        image_xscale = lerp(1, 2, timer / 15);
204
        image_yscale = lerp(4, 2, timer / 15);
205
        if (timer >= 15)
206
        {
207
            timer = 0;
208
            con = 2;
209
            image_xscale = 2;
210
            image_yscale = 2;
211
        }
212
    }
213
    if (con == 2)
214
    {
215
        if (image_index == 9)
216
        {
217
            tasquecon = 1;
218
            con = 99;
219
        }
220
    }
221
    if (tasquecon == 1)
222
    {
223
        if (tasquetriggered == 0)
224
        {
225
            with (obj_triggervolume)
226
            {
227
                if (place_meeting(x, y, obj_mainchara))
228
                {
229
                    if (room == room_dw_cyber_maze_tasque)
230
                    {
231
                        if (extflag == 11 || extflag == 12)
232
                        {
233
                            if (other.extspawnflag == 1)
234
                            {
235
                                other.tasquex = 490;
236
                                other.tasquey = 386;
237
                                other.tasquedir = 0;
238
                                if (extflag == 11)
239
                                    other.tasquedir = 0;
240
                                if (extflag == 12)
241
                                    other.tasquedir = 1;
242
                                other.tasquetriggered = 1;
243
                            }
244
                        }
245
                        else if (extflag == 21 || extflag == 22)
246
                        {
247
                            if (other.extspawnflag == 2)
248
                            {
249
                                other.tasquex = 588;
250
                                other.tasquey = 586;
251
                                if (extflag == 21)
252
                                    other.tasquedir = 0;
253
                                if (extflag == 22)
254
                                    other.tasquedir = 1;
255
                                other.tasquetriggered = 1;
256
                            }
257
                        }
258
                    }
259
                    if (room == room_dw_cyber_tasque_battle)
260
                    {
261
                        other.tasquex = 746;
262
                        other.tasquey = 980;
263
                        other.tasquedir = 0;
264
                        if (extflag == 1)
265
                            other.tasquedir = 0;
266
                        if (extflag == 2)
267
                            other.tasquedir = 1;
268
                        other.tasquetriggered = 1;
269
                    }
270
                }
271
            }
272
        }
273
        if (tasquetriggered == 1)
274
        {
275
            show_debug_message("spawned at x:" + string(tasquex) + ", y:" + string(tasquey));
276
            timer = 0;
277
            tasquetimer = 0;
278
            image_index = 11;
279
            tasquemarker_head = scr_dark_marker
scr_dark_marker

function scr_dark_marker(arg0, arg1, arg2) { thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(x - 32, y - 26, spr_tasque_head);
280
            tasquemarker = scr_dark_marker
scr_dark_marker

function scr_dark_marker(arg0, arg1, arg2) { thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(x - 32, y - 26, spr_tasque_idle);
281
            tasquemarker.image_alpha = 0;
282
            tasquemarker_head.depth = depth - 11;
283
            tasquemarker.depth = depth - 10;
284
            snd_play(snd_jump);
285
            tasquemarker.remid = id;
286
            with (tasquemarker)
287
            {
288
                remjump = scr_jump_to_point
scr_jump_to_point

function scr_jump_to_point(arg0, arg1, arg2, arg3) { return scr_jump_to_point_sprite(arg0, arg1, arg2, arg3, 0, 0); }
(other.tasquex, other.tasquey, 15, 24);
289
                remid.remjump = remjump;
290
            }
291
            with (tasquemarker_head)
292
                scr_jump_to_point
scr_jump_to_point

function scr_jump_to_point(arg0, arg1, arg2, arg3) { return scr_jump_to_point_sprite(arg0, arg1, arg2, arg3, 0, 0); }
(other.tasquex, other.tasquey, 15, 24);
293
            remjump.image_alpha = 0;
294
            tasquecon = 2;
295
        }
296
    }
297
    if (tasquecon == 2)
298
    {
299
        if (tasquetimer <= 12)
300
        {
301
            image_xscale *= (1 + ((1 / (tasquetimer + 1)) * 0.25));
302
            image_yscale *= (1 + ((1 / (tasquetimer + 1)) * 0.25));
303
        }
304
        if (tasquetimer > 12)
305
        {
306
            image_xscale *= 0.6;
307
            image_yscale *= 0.6;
308
        }
309
        with (remjump)
310
            image_alpha += 0.05;
311
        tasquetimer++;
312
        if (tasquetimer >= 24)
313
            tasquecon = 3;
314
    }
315
    if (tasquecon == 3)
316
    {
317
        tenemy = instance_create(tasquemarker.x, tasquemarker.y, obj_chaseenemy);
318
        tenemy.sprite_index = spr_tasque_idle;
319
        if (tasquedir == 0)
320
            tenemy.pacetype = 21;
321
        else
322
            tenemy.pacetype = 22;
323
        tenemy.chasetype = -1;
324
        tenemy.pacespeed = tasquespeed;
325
        tenemy.eraser = 1;
326
        tenemy.facing = tasquedir;
327
        with (tasquemarker)
328
            instance_destroy();
329
        with (tasquemarker_head)
330
            instance_destroy();
331
        tasquecon = 4;
332
    }
333
    if (dismiss == 1)
334
    {
335
        timer = 0;
336
        con = 3;
337
        dismiss = 0;
338
    }
339
    if (con == 3)
340
    {
341
        timer += (timer + 1);
342
        image_xscale = lerp(2, 4, timer / 30);
343
        image_yscale = lerp(2, 0, timer / 30);
344
        if (timer >= 30)
345
            instance_destroy();
346
    }
347
}
348
if (extflag == 3 && room == room_dw_cyber_maze_virokun)
349
{
350
    bpf = 58.5;
351
    count += bpf;
352
    if (count > (bpf * 6))
353
    {
354
        if (image_index == 22)
355
            image_index = 23;
356
        else
357
            image_index = 22;
358
        count = 0;
359
    }
360
}
361
if (extflag == 7)
362
{
363
    bpf = 58.5;
364
    count += bpf;
365
    if (count > (bpf * 6))
366
    {
367
        if (image_index == 27)
368
            image_index = 31;
369
        else
370
            image_index = 27;
371
        count = 0;
372
    }
373
}
374
if (bluecheckcon == 1)
375
{
376
    visible = 1;
377
    con = 0;
378
    bluecheckcon++;
379
}
380
if (bluecheckcon == 2)
381
{
382
    if (con == 0)
383
    {
384
        timer += ((timer / 2) + 1);
385
        image_xscale = lerp(4, 1, timer / 30);
386
        image_yscale = lerp(0, 4, timer / 30);
387
        if (timer >= 30)
388
        {
389
            snd_play(snd_won);
390
            con = 1;
391
            timer = 0;
392
        }
393
    }
394
    if (con == 1)
395
    {
396
        timer += ((timer / 2) + 1);
397
        image_xscale = lerp(1, 2, timer / 15);
398
        image_yscale = lerp(4, 2, timer / 15);
399
        if (timer >= 15)
400
        {
401
            timer = 0;
402
            con = 2;
403
            image_xscale = 2;
404
            image_yscale = 2;
405
            flash = scr_afterimage_grow
scr_afterimage_grow

function scr_afterimage_grow() { afterimage = instance_create(x, y, obj_afterimage_grow); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
();
406
            flash.depth = depth - 1;
407
            bluecheckcon++;
408
            timer = 0;
409
        }
410
    }
411
}
412
if (bluecheckcon == 3)
413
{
414
    timer++;
415
    if (timer > 15)
416
    {
417
        vspeed -= 0.25;
418
        image_xscale *= 0.9;
419
        if ((timer % 4) == 0)
420
            scr_afterimage
scr_afterimage

function scr_afterimage() { afterimage = instance_create(x, y, obj_afterimage); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
();
421
    }
422
    if (y < (cameray() - 120))
423
        instance_destroy();
424
}