Deltarune (Chapter 2) 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
            timer = 0;
276
            tasquetimer = 0;
277
            image_index = 11;
278
            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);
279
            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);
280
            tasquemarker.image_alpha = 0;
281
            tasquemarker_head.depth = depth - 11;
282
            tasquemarker.depth = depth - 10;
283
            snd_play(snd_jump);
284
            tasquemarker.remid = id;
285
            with (tasquemarker)
286
            {
287
                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);
288
                remid.remjump = remjump;
289
            }
290
            with (tasquemarker_head)
291
                
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);
292
            remjump.image_alpha = 0;
293
            tasquecon = 2;
294
        }
295
    }
296
    if (tasquecon == 2)
297
    {
298
        if (tasquetimer <= 12)
299
        {
300
            image_xscale *= (1 + ((1 / (tasquetimer + 1)) * 0.25));
301
            image_yscale *= (1 + ((1 / (tasquetimer + 1)) * 0.25));
302
        }
303
        if (tasquetimer > 12)
304
        {
305
            image_xscale *= 0.6;
306
            image_yscale *= 0.6;
307
        }
308
        with (remjump)
309
            image_alpha += 0.05;
310
        tasquetimer++;
311
        if (tasquetimer >= 24)
312
            tasquecon = 3;
313
    }
314
    if (tasquecon == 3)
315
    {
316
        tenemy = instance_create(tasquemarker.x, tasquemarker.y, obj_chaseenemy);
317
        tenemy.sprite_index = spr_tasque_idle;
318
        if (tasquedir == 0)
319
            tenemy.pacetype = 21;
320
        else
321
            tenemy.pacetype = 22;
322
        tenemy.chasetype = -1;
323
        tenemy.pacespeed = tasquespeed;
324
        tenemy.eraser = 1;
325
        tenemy.facing = tasquedir;
326
        with (tasquemarker)
327
            instance_destroy();
328
        with (tasquemarker_head)
329
            instance_destroy();
330
        tasquecon = 4;
331
    }
332
    if (dismiss == 1)
333
    {
334
        timer = 0;
335
        con = 3;
336
        dismiss = 0;
337
    }
338
    if (con == 3)
339
    {
340
        timer += (timer + 1);
341
        image_xscale = lerp(2, 4, timer / 30);
342
        image_yscale = lerp(2, 0, timer / 30);
343
        if (timer >= 30)
344
            instance_destroy();
345
    }
346
}
347
if (extflag == 3 && room == room_dw_cyber_maze_virokun)
348
{
349
    bpf = 58.5;
350
    count += bpf;
351
    if (count > (bpf * 6))
352
    {
353
        if (image_index == 22)
354
            image_index = 23;
355
        else
356
            image_index = 22;
357
        count = 0;
358
    }
359
}
360
if (extflag == 7)
361
{
362
    bpf = 58.5;
363
    count += bpf;
364
    if (count > (bpf * 6))
365
    {
366
        if (image_index == 27)
367
            image_index = 31;
368
        else
369
            image_index = 27;
370
        count = 0;
371
    }
372
}
373
if (bluecheckcon == 1)
374
{
375
    visible = 1;
376
    con = 0;
377
    bluecheckcon++;
378
}
379
if (bluecheckcon == 2)
380
{
381
    if (con == 0)
382
    {
383
        timer += ((timer / 2) + 1);
384
        image_xscale = lerp(4, 1, timer / 30);
385
        image_yscale = lerp(0, 4, timer / 30);
386
        if (timer >= 30)
387
        {
388
            snd_play(snd_won);
389
            con = 1;
390
            timer = 0;
391
        }
392
    }
393
    if (con == 1)
394
    {
395
        timer += ((timer / 2) + 1);
396
        image_xscale = lerp(1, 2, timer / 15);
397
        image_yscale = lerp(4, 2, timer / 15);
398
        if (timer >= 15)
399
        {
400
            timer = 0;
401
            con = 2;
402
            image_xscale = 2;
403
            image_yscale = 2;
404
            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; }
();
405
            flash.depth = depth - 1;
406
            bluecheckcon++;
407
            timer = 0;
408
        }
409
    }
410
}
411
if (bluecheckcon == 3)
412
{
413
    timer++;
414
    if (timer > 15)
415
    {
416
        vspeed -= 0.25;
417
        image_xscale *= 0.9;
418
        if ((timer % 4) == 0)
419
            
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; }
();
420
    }
421
    if (y < (cameray() - 120))
422
        instance_destroy();
423
}