Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_queen_bulletcontroller_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    sameattack = 
scr_monsterattacknamecount
scr_monsterattacknamecount

function
scr_monsterattacknamecount(arg0)
{ __sameattack = 0; for (_sameattacki = 0; _sameattacki < 3; _sameattacki++) { if (global.monsterattackname[_sameattacki] == arg0 && global.monster[_sameattacki] == 1) __sameattack++; } return __sameattack; }
(global.monsterattackname[creator]);
4
    if (sameattack > 1)
5
    {
6
        if (creator == 2)
7
            sameattacker = sameattack - 1;
8
        else if (creator == 1)
9
            sameattacker = (sameattack == 3) ? creator : (global.monsterattackname[0] == global.monsterattackname[1]);
10
    }
11
    if (instance_exists(obj_growtangle))
12
    {
13
        miny = obj_growtangle.y - (obj_growtangle.sprite_height / 2);
14
        maxy = obj_growtangle.y + (obj_growtangle.sprite_height / 2);
15
        minx = obj_growtangle.x - (obj_growtangle.sprite_width / 2);
16
        maxx = obj_growtangle.x + (obj_growtangle.sprite_width / 2);
17
    }
18
    init = 1;
19
}
20
if (!
scr_queen_buffercheck
scr_queen_buffercheck

function
scr_queen_buffercheck()
{ return instance_exists(obj_queen_buffercontroller) && obj_queen_buffercontroller.buffering == 1; }
())
21
    btimer += 1;
22
if (type == 0 || type == 9 || type == 8)
23
{
24
    if (bufferattack && !instance_exists(obj_queen_buffercontroller))
25
    {
26
        bc = instance_create(obj_growtangle.x, cameray() + 60, obj_queen_buffercontroller);
27
        if (type == 0)
28
        {
29
            global.turntimer += 40;
30
            special = 4;
31
            made = -4;
32
            bc.bufferdelay = 161;
33
            bc.bufferduration = 45;
34
        }
35
        else if ((special % 2) == 1)
36
        {
37
            bc.bufferdelay = 150;
38
            bc.bufferduration = 45;
39
        }
40
    }
41
    if (init == 1)
42
    {
43
        if (special == 4)
44
        {
45
            side = irandom(1) + 1;
46
            if (bufferattack && side == 2)
47
                bc.bufferdelay -= 10;
48
        }
49
        else if (special == 5)
50
        {
51
            side = 0;
52
        }
53
        else if (special >= 2 && (special % 2) == 0)
54
        {
55
            side = choose(-2, -1, 0);
56
        }
57
        else
58
        {
59
            side = choose(-2, -1);
60
        }
61
        lastside = side;
62
        init = 2;
63
        if (special >= 2)
64
            made = -2;
65
    }
66
    if (special > 1 && made <= 0 && (btimer >= 7 || (special == 4 && btimer >= 3)))
67
    {
68
        if (special == 3 && bufferattack)
69
        {
70
            if (made == -2)
71
            {
72
                xx = obj_growtangle.x + 150;
73
                yy = obj_growtangle.y;
74
            }
75
            if (made == -1)
76
            {
77
                xx = obj_growtangle.x - 150;
78
                yy = obj_growtangle.y;
79
            }
80
            if (made == 0)
81
            {
82
                xx = obj_growtangle.x;
83
                yy = obj_growtangle.y - 150;
84
            }
85
        }
86
        else if (special == 4)
87
        {
88
            if (made == -1)
89
            {
90
                xx = obj_growtangle.x + 150;
91
                yy = obj_growtangle.y + ((made == side) ? random_range(20, -40) : 0);
92
            }
93
            else if (made == 0)
94
            {
95
                xx = obj_growtangle.x - 150;
96
                yy = obj_growtangle.y + ((made == side) ? random_range(20, -40) : 0);
97
            }
98
            else
99
            {
100
                yy = obj_growtangle.y + random_range(-180, 70);
101
                if (yy > (obj_growtangle.y - 130))
102
                    xx = obj_growtangle.x + (random_range(200, 250) * randomsign());
103
                else
104
                    xx = obj_growtangle.x + (irandom(250) * randomsign());
105
            }
106
        }
107
        else if (special == 5)
108
        {
109
            if (made == -2)
110
            {
111
                xx = obj_growtangle.x + 150;
112
                yy = obj_growtangle.y;
113
            }
114
            if (made == -1)
115
            {
116
                xx = obj_growtangle.x - 150;
117
                yy = obj_growtangle.y;
118
            }
119
        }
120
        else if ((special % 2) == 0)
121
        {
122
            if (made == -2)
123
            {
124
                xx = obj_growtangle.x + 150;
125
                yy = obj_growtangle.y + random_range(20, -40);
126
            }
127
            if (made == -1)
128
            {
129
                xx = obj_growtangle.x - 150;
130
                yy = obj_growtangle.y + random_range(20, -40);
131
            }
132
            if (made == 0)
133
            {
134
                xx = obj_growtangle.x + random_range(-60, 60);
135
                yy = obj_growtangle.y - ((side == made) ? 140 : 100);
136
            }
137
        }
138
        else
139
        {
140
            if (made == -2)
141
            {
142
                xx = obj_growtangle.x + 150;
143
                yy = obj_growtangle.y + ((made == side) ? 0 : random_range(20, -40));
144
            }
145
            if (made == -1)
146
            {
147
                xx = obj_growtangle.x - 150;
148
                yy = obj_growtangle.y + ((made == side) ? 0 : random_range(20, -40));
149
            }
150
            if (made == 0)
151
            {
152
                xx = obj_growtangle.x + (randomsign() * 60);
153
                yy = obj_growtangle.y - 100;
154
            }
155
        }
156
    }
157
    else if (btimer >= ((special == 2) ? 40 : 60))
158
    {
159
        btimer = 0;
160
        var _side;
161
        if (special == 0)
162
        {
163
            _side = 0;
164
        }
165
        else
166
        {
167
            _side = irandom((made == 0) ? 2 : 1);
168
            if (_side == lastside)
169
                _side = 2;
170
        }
171
        if ((special % 2) == 0)
172
        {
173
            if (_side == 0)
174
            {
175
                xx = obj_growtangle.x + 150;
176
                yy = obj_growtangle.y + random_range(20, -40);
177
            }
178
            if (_side == 1)
179
            {
180
                xx = obj_growtangle.x - 150;
181
                yy = obj_growtangle.y + random_range(20, -40);
182
            }
183
            if (_side == 2)
184
            {
185
                xx = obj_growtangle.x + random_range(-100, 100);
186
                yy = obj_growtangle.y - 140;
187
            }
188
        }
189
        else
190
        {
191
            if (_side == 0)
192
            {
193
                xx = obj_growtangle.x + 150;
194
                yy = obj_growtangle.y;
195
            }
196
            if (_side == 1)
197
            {
198
                xx = obj_growtangle.x - 150;
199
                yy = obj_growtangle.y;
200
            }
201
            if (_side == 2)
202
            {
203
                xx = obj_growtangle.x;
204
                yy = obj_growtangle.y - 100;
205
            }
206
        }
207
        lastside = _side;
208
        side = 0;
209
    }
210
    else
211
    {
212
        exit;
213
    }
214
    if (special == 4)
215
    {
216
        d = instance_create(xx, yy, obj_queen_search_window);
217
        if (made == side)
218
            d.search = 1;
219
        else if (made > 0)
220
            d.search = 2;
221
        else
222
            d.search = -1;
223
        d.damage = damage;
224
        d.target = target;
225
    }
226
    else if (special == 5)
227
    {
228
        d = instance_create(xx, yy, obj_queen_search_window);
229
        if (made == side)
230
            d.search = 2;
231
        else
232
            d.search = 3;
233
        d.damage = damage;
234
        d.target = target;
235
        if (made == 1)
236
            made = 3;
237
    }
238
    else if (special == 99)
239
    {
240
        d = instance_create(xx, yy, obj_queen_search_window_bday);
241
        if (made == -2)
242
            d.search = 3;
243
        else
244
            d.search = 4;
245
        d.damage = damage;
246
        d.target = target;
247
        if (made == 1)
248
            made = 3;
249
    }
250
    else if ((special % 2) == 0)
251
    {
252
        d = instance_create(xx, yy, obj_queen_search_window);
253
        if (made > 0)
254
            d.quick = true;
255
        if (made == side || made > 0)
256
            d.search = 1;
257
        else
258
            d.search = -1;
259
        d.damage = damage;
260
        d.target = target;
261
    }
262
    else if ((special % 2) == 1)
263
    {
264
        d = instance_create(xx, yy, obj_queen_search_window);
265
        if (made > 0)
266
            d.quick = true;
267
        if (made == side || made > 0 || bufferattack)
268
            d.search = 2;
269
        else
270
            d.search = -1;
271
        d.damage = damage;
272
        d.target = target;
273
        if (bufferattack)
274
            d.spawndelay = 14 - (made * 7);
275
    }
276
    if (special < 2 && made < 3)
277
    {
278
        made = 3;
279
        d.firsttime = true;
280
        btimer = -30;
281
    }
282
    else
283
    {
284
        made++;
285
        btimer = 0;
286
    }
287
    if (made < 3 && special == 5)
288
        btimer = -120;
289
}
290
else if (type == 1)
291
{
292
    if (init == 1)
293
    {
294
        d = instance_create(obj_growtangle.x, obj_growtangle.y, obj_queen_ultimate_attack_controller);
295
        d = instance_create(obj_heart.x, obj_heart.y, obj_hiddenheart);
296
        d.depth -= 20;
297
        init = 2;
298
    }
299
}
300
else if (type == 2 || type == 2.1 || type == 2.2)
301
{
302
    if (init == 1)
303
    {
304
        init = 2;
305
        btimer = 30;
306
        d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(x, y, obj_queen_wineglass);
307
        d.xx = x + 20;
308
        d.yy = y + 37;
309
        if (type == 2.1)
310
        {
311
            threshold = 8;
312
            wineadd = 4;
313
            turnamount *= 1.2;
314
            obj_queen_enemy.beatwine2nodamage = 1;
315
        }
316
        if (type == 2.2)
317
        {
318
            threshold = 6;
319
            wineadd = 3;
320
            turnamount *= 2;
321
        }
322
    }
323
    if (init == 3 || init == 4)
324
    {
325
        if (init == 3)
326
        {
327
            init = 4;
328
            with (obj_heartmarker)
329
                instance_destroy();
330
            instance_create(obj_growtangle.x - 8, obj_growtangle.y + 30, obj_heartmarker);
331
            
scr_moveheart
scr_moveheart

function
scr_moveheart()
{ global.inv = 0; if (global.chapter == 2 && instance_exists(obj_gigaqueen_enemy)) return instance_create(o_boxingcontroller.x + 4, o_boxingcontroller.y - 120, obj_moveheart); else return instance_create(obj_herokris.x + 10, obj_herokris.y + 40, obj_moveheart); }
();
332
        }
333
        if ((btimer >= (threshold + (wineadded / 12)) && winedebug == 0) || (winedebug == 1 && button1_p()))
334
        {
335
            droplet[dropletcount] = instance_create(x, y, obj_queen_wine_attack_droplet);
336
            with (droplet[dropletcount])
337
            {
338
                
scr_bullet_init
scr_bullet_init

function
scr_bullet_init()
{ grazed = 0; grazetimer = 0; destroyonhit = 1; target = 0; inv = 60; damage = 10; element = 0; grazepoints = 1; timepoints = 1; active = 1; updateimageangle = 0; }
();
339
                destroyonhit = 0;
340
            }
341
            if (instance_exists(obj_heart))
342
                droplet[dropletcount].depth = obj_heart.depth;
343
            droplet[dropletcount].sprite_index = spr_dropletbullet;
344
            droplet[dropletcount].ydist = 280;
345
            droplet[dropletcount].active = 1;
346
            droplet[dropletcount].xdist = -65 + random(130);
347
            droplet[dropletcount].timefrommade = 0;
348
            droplet[dropletcount].fakespeed = 2;
349
            droplet[dropletcount].boss = obj_queen_wineglass.id;
350
            with (droplet[dropletcount])
351
            {
352
                if (instance_exists(obj_queen_enemy))
353
                    damage = global.monsterat[obj_queen_enemy.myself] * 5;
354
                if (instance_exists(obj_queen_bulletcontroller))
355
                    target = obj_queen_bulletcontroller.target;
356
                grazepoints = 4;
357
            }
358
            dropletcount++;
359
            btimer = 0;
360
        }
361
        for (i = 0; i < dropletcount; i++)
362
        {
363
            with (droplet[i])
364
            {
365
                fakespeed += 0.2;
366
                timefrommade += fakespeed;
367
                image_angle = obj_queen_wineglass.image_angle;
368
                x2 = obj_queen_wineglass.x + lengthdir_x(ydist - timefrommade, image_angle + 90);
369
                y2 = obj_queen_wineglass.y + lengthdir_y(ydist - timefrommade, image_angle + 90);
370
                x3 = x2 + lengthdir_x(xdist, image_angle);
371
                y3 = y2 + lengthdir_y(xdist, image_angle);
372
                y = y3;
373
                x = x3;
374
                if (y3 >= (obj_queen_wineglass.y + 70 + ((75 - abs(xdist)) / 1.7)))
375
                {
376
                    obj_queen_wineglass.prefill += obj_queen_bulletcontroller.wineadd;
377
                    obj_queen_bulletcontroller.wineadded += 1;
378
                    instance_destroy();
379
                }
380
            }
381
        }
382
        ctimer++;
383
        if (type == 2.1 || type == 2.2 || type == 2.3)
384
        {
385
            if (winedebug == 0)
386
            {
387
                obj_queen_wineglass.image_angle = sin(ctimer / turnperiod) * turnamount;
388
            }
389
            else
390
            {
391
                if (button2_h())
392
                    obj_queen_wineglass.image_angle += 0.5;
393
                if (button3_h())
394
                    obj_queen_wineglass.image_angle -= 0.5;
395
            }
396
            image_angle = obj_queen_wineglass.image_angle;
397
        }
398
        if (winedebug == 1)
399
            global.turntimer = 100;
400
    }
401
}
402
else if (type == 3 || type == 3.1 || type == 3.2 || type == 3.3 || type == 3.4)
403
{
404
    if (type == 3)
405
    {
406
        if (btimer >= 30)
407
        {
408
            chooselocation = irandom(2);
409
            if (stomplocation[0] == 0 && stomplocation[1] == 1 && stomplocation[2] == 1)
410
                chooselocation = 0;
411
            if (stomplocation[0] == 1 && stomplocation[1] == 0 && stomplocation[2] == 1)
412
                chooselocation = 1;
413
            if (stomplocation[0] == 1 && stomplocation[1] == 1 && stomplocation[2] == 0)
414
                chooselocation = 2;
415
            if (stomplocation[0] == 0 && stomplocation[1] == 0 && stomplocation[2] == 1)
416
                chooselocation = choose(0, 1);
417
            if (stomplocation[0] == 0 && stomplocation[1] == 1 && stomplocation[2] == 0)
418
                chooselocation = choose(0, 2);
419
            if (stomplocation[0] == 1 && stomplocation[1] == 0 && stomplocation[2] == 0)
420
                chooselocation = choose(1, 2);
421
            if (stomplocation[0] == 1 && stomplocation[1] == 1 && stomplocation[2] == 1)
422
            {
423
                stomplocation[0] = 0;
424
                stomplocation[1] = 0;
425
                stomplocation[2] = 0;
426
            }
427
            repeat (1)
428
            {
429
                if (chooselocation == 0)
430
                {
431
                    d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x + -47, miny - 4, obj_queen_leg);
432
                    stomplocation[0] = 1;
433
                }
434
                if (chooselocation == 1)
435
                {
436
                    d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x, miny - 4, obj_queen_leg);
437
                    stomplocation[1] = 1;
438
                }
439
                if (chooselocation == 2)
440
                {
441
                    d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x + 47, miny - 4, obj_queen_leg);
442
                    stomplocation[2] = 1;
443
                }
444
                d.pos = chooselocation;
445
                d.shootbullets = 1;
446
            }
447
            btimer = 9;
448
        }
449
    }
450
    if (type == 3.1)
451
    {
452
        if (btimer >= 30)
453
        {
454
            d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(maxx + 4, obj_growtangle.y + choose(-47, 0, 47), obj_queen_leg);
455
            d.direction = 180;
456
            d.sprite_index = spr_queen_leg_side;
457
            btimer = 0;
458
        }
459
    }
460
    if (type == 3.2)
461
    {
462
        if (btimer == 110)
463
            d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x + choose(-47, 0, 47), miny - 4, obj_queen_leg);
464
        if (btimer == 130)
465
        {
466
            d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(maxx + 4, obj_growtangle.y + choose(-47, 0, 47), obj_queen_leg);
467
            d.direction = 180;
468
            d.sprite_index = spr_queen_leg_side;
469
        }
470
        if (btimer == 150)
471
            d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x + choose(-47, 0, 47), miny - 4, obj_queen_leg);
472
        if (btimer == 170)
473
        {
474
            d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(maxx + 4, obj_growtangle.y + choose(-47, 0, 47), obj_queen_leg);
475
            d.direction = 180;
476
            d.sprite_index = spr_queen_leg_side;
477
        }
478
        if (btimer == 190)
479
            d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x + -47, miny - 4, obj_queen_leg);
480
        if (btimer == 192)
481
        {
482
            d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(maxx + 4, obj_growtangle.y + 0, obj_queen_leg);
483
            d.direction = 180;
484
            d.sprite_index = spr_queen_leg_side;
485
        }
486
    }
487
    if (type == 3.3)
488
    {
489
        if (btimer == 110)
490
        {
491
            d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x, miny - 4, obj_queen_leg);
492
            d.special = 1;
493
            d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x + 47, miny - 4, obj_queen_leg);
494
            d.special = 1;
495
        }
496
        if (btimer == 140)
497
        {
498
            d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x - 47, miny - 4, obj_queen_leg);
499
            d.special = 2;
500
        }
501
        if (btimer > 140 && btimer < 154)
502
        {
503
            with (obj_queen_leg)
504
            {
505
                if (special == 1)
506
                    stomplerp -= 0.01;
507
            }
508
        }
509
        if (btimer == 170)
510
        {
511
            d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(maxx + 4, obj_growtangle.y + 47, obj_queen_leg);
512
            d.direction = 180;
513
            d.sprite_index = spr_queen_leg_side;
514
            d.special = 3;
515
        }
516
    }
517
    if (type == 3.4)
518
    {
519
        if (btimer >= 30)
520
        {
521
            repeat (2)
522
            {
523
                if (a == 0)
524
                    d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x + -47, miny - 4, obj_queen_leg);
525
                if (a == 1)
526
                    d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x, miny - 4, obj_queen_leg);
527
                if (a == 2)
528
                    d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x + 47, miny - 4, obj_queen_leg);
529
                a += (1 + irandom(1));
530
                if (a > 2)
531
                    a -= 3;
532
            }
533
            btimer = 0;
534
        }
535
    }
536
}
537
else if (type == 4)
538
{
539
    if (instance_exists(obj_queen_finger))
540
        btimer += ((obj_queen_finger.scrollSpeed / 4) - 1);
541
    if (init == 1)
542
    {
543
        btimer = 10;
544
        d = instance_create(obj_growtangle.x - 15, -40, obj_queen_sm_deleter);
545
        d.image_xscale = 2.5;
546
        d.image_yscale = 3.5;
547
        init = 2;
548
        extra = sprite_get_number(spr_queen_pfps) - 1;
549
        d = instance_create(camerax() + 660, cameray() + 500, obj_queen_finger);
550
        if (difficulty == 2)
551
            d.bigscrollcount = irandom(1) + 1;
552
        d.timer = 0;
553
    }
554
    if (btimer >= 10)
555
    {
556
        var spawnheight = (cameray() - 40) + (4 * (btimer - 10));
557
        var everyman = irandom(499) == 0;
558
        if (!everyman)
559
        {
560
            for (i = 0; i < 6; i++)
561
            {
562
                d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(minx + (i * 30), spawnheight, obj_queen_social_media);
563
                d.image_xscale = 1.25;
564
                d.image_yscale = 1.25;
565
                d.image_speed = 0.5;
566
                d.speed = 4;
567
                d.direction = 270;
568
            }
569
        }
570
        if (special != 5)
571
        {
572
            d = instance_create(minx - 40, spawnheight, obj_queen_pfp);
573
            d.image_speed = 0;
574
            d.direction = 270;
575
            d.speed = 4;
576
            d.image_index = everyman ? extra : irandom(extra - 1);
577
            d.image_xscale = 0.65;
578
            d.image_yscale = 0.65;
579
            if (everyman)
580
                special = 0;
581
            else
582
                special = irandom(5);
583
            btimer = 0;
584
        }
585
        else
586
        {
587
            special = 0;
588
            btimer = 5;
589
        }
590
    }
591
}
592
else if (type == 5)
593
{
594
    if (init == 1)
595
    {
596
        d = instance_create(obj_growtangle.x, miny - 66, obj_queen_spadeblow);
597
        d.depth = obj_growtangle.depth;
598
        d.image_speed = 0;
599
        d.difficulty = obj_queen_enemy.difficulty;
600
        init = 2;
601
    }
602
}
603
else if (type == 6 || type == 6.1)
604
{
605
    if (init == 1)
606
        init = 2;
607
    if (btimer > 30)
608
    {
609
        if (bufferattack)
610
        {
611
            d = instance_create(obj_growtangle.x + 150, obj_growtangle.y, obj_queen_explodinghead);
612
            d.damage = damage;
613
            d.target = target;
614
            d.buffer = bufferattack;
615
            d = instance_create(obj_growtangle.x - 150, obj_growtangle.y, obj_queen_explodinghead);
616
        }
617
        else
618
        {
619
            if (irandom(100) < 60)
620
                d = instance_create(obj_growtangle.x + (lastside * 150), (obj_growtangle.y - 70) + irandom(140), obj_queen_explodinghead_intro);
621
            else
622
                d = instance_create((obj_growtangle.x - 70) + irandom(140), obj_growtangle.y + (lastside * 150), obj_queen_explodinghead_intro);
623
            lastside *= -1;
624
        }
625
        d.buffer = bufferattack;
626
        d.damage = damage;
627
        d.target = target;
628
        d.laugh = 1;
629
        btimer = 0;
630
        if (type == 6)
631
            btimer = 2;
632
        if (type == 6.1)
633
            btimer = 15;
634
        if (init == 2)
635
        {
636
            d.first = 1;
637
            init = 3;
638
            if (type == 6)
639
                btimer = 15;
640
        }
641
    }
642
}
643
else if (type == 7)
644
{
645
    if (init == 1)
646
    {
647
        instance_create(obj_berdlyplug_enemy.x, obj_berdlyplug_enemy.y, obj_queen_berdlywireattack);
648
        obj_berdlyplug_enemy.visible = false;
649
        init = 2;
650
    }
651
}
652
else if (type == 100)
653
{
654
    if (btimer >= 15)
655
    {
656
        if (made == 0)
657
        {
658
            dir = 0;
659
            made = 1;
660
        }
661
        dir = dir + 30 + random(300);
662
        len = 140 + random(10);
663
        cenx = 0;
664
        ceny = 0;
665
        if (instance_exists(obj_growtangle))
666
            cenx = obj_growtangle.x;
667
        if (instance_exists(obj_growtangle))
668
            ceny = obj_growtangle.y;
669
        gun = instance_create(cenx + lengthdir_x(len, dir), ceny + lengthdir_y(len, dir), obj_queen_lasergun);
670
        btimer = 0;
671
    }
672
}
673
else if (type == 101 || type == 102)
674
{
675
    btimerthreshold = 31;
676
    if (type == 102)
677
        btimerthreshold = 22;
678
    if (btimer >= btimerthreshold)
679
    {
680
        if (made == 0)
681
        {
682
            yway = 1;
683
            goway = 0;
684
            remyway = 1;
685
            xway = 1;
686
            made = 1;
687
            times = 0;
688
        }
689
        if (times == 0)
690
        {
691
            goway = 0;
692
            yway = 1;
693
            xway = 1;
694
        }
695
        if (times == 1)
696
        {
697
            goway = 1;
698
            yway = 1;
699
            xway = -1;
700
        }
701
        if (times == 2)
702
        {
703
            goway = 0;
704
            yway = -1;
705
            xway = -1;
706
        }
707
        if (times == 3)
708
        {
709
            goway = 1;
710
            yway = -1;
711
            xway = 1;
712
        }
713
        times += choose(-1, 1);
714
        if (times <= -1)
715
            times = 3;
716
        if (times >= 4)
717
            times = 0;
718
        cenx = 0;
719
        ceny = 0;
720
        if (instance_exists(obj_growtangle))
721
            cenx = obj_growtangle.x;
722
        if (instance_exists(obj_growtangle))
723
            ceny = obj_growtangle.y;
724
        fromx = cenx + (75 * xway);
725
        fromy = ceny + (75 * yway);
726
        if (goway == 0)
727
        {
728
            for (i = 0; i < 4; i++)
729
            {
730
                gun = instance_create(fromx - (xway * 50 * i), ceny + (125 * yway), obj_queen_lasergun);
731
                gun.inittime = i * 4;
732
                gun.randomshot = 0;
733
                gun.shotsize = 0.5;
734
                gun.maxsize = 1;
735
            }
736
        }
737
        if (goway == 1)
738
        {
739
            for (i = 0; i < 4; i++)
740
            {
741
                gun = instance_create(cenx + (125 * xway), fromy - (yway * 50 * i), obj_queen_lasergun);
742
                gun.inittime = i * 4;
743
                gun.randomshot = 0;
744
                gun.shotsize = 0.5;
745
                gun.maxsize = 1;
746
            }
747
        }
748
        btimer = 0;
749
    }
750
}
751
else if (type == 105 || type == 106 || type == 107)
752
{
753
    if (!instance_exists(obj_social_media_attack_fade_heroes))
754
        instance_create(x, y, obj_social_media_attack_fade_heroes);
755
    timerthreshold = 15;
756
    if (type == 106)
757
        timerthreshold = 20;
758
    init++;
759
    if (init == 12)
760
    {
761
        snd_play(snd_crowd);
762
        snd_loop(snd_crowd);
763
        snd_pitch(snd_crowd, 0.85);
764
    }
765
    if (btimer >= timerthreshold)
766
    {
767
        make = 1;
768
        if (type == 107 && made >= 7)
769
            make = 0;
770
        if (type == 107 && made == 4)
771
            make = 0;
772
        if (make)
773
        {
774
            side = choose(-1, 1);
775
            if (type == 107)
776
                face = instance_create(obj_growtangle.x + (160 * side), -80, obj_socialmedia_avatar);
777
            else
778
                face = instance_create(obj_growtangle.x + (125 * side), -80, obj_socialmedia_avatar);
779
            face.vspeed = 5;
780
        }
781
        if (made == 4 && type == 107)
782
        {
783
            face = instance_create(obj_growtangle.x + 125, -80, obj_socialmedia_avatar);
784
            face.vspeed = 5;
785
            face.isqueen = 1;
786
            face.side = 1;
787
            face.x = obj_growtangle.x + 125;
788
        }
789
        btimer = 0;
790
        made++;
791
    }
792
}
793
else if (type == 110 || type == 111)
794
{
795
    if (made == 0 && instance_exists(obj_growtangle))
796
    {
797
        growtangle = instance_create(obj_growtangle.x, obj_growtangle.y, obj_growtangle_electric);
798
        growtangle.damage = damage;
799
        growtangle.target = target;
800
        if (type == 111)
801
            growtangle.type = 1;
802
        made = 1;
803
    }
804
}
805
else if (type == 112 || type == 113)
806
{
807
    if (made == 0 && instance_exists(obj_growtangle))
808
    {
809
        obj_berdlyplug_enemy.con = 1;
810
        bardly = instance_create(obj_growtangle.x, obj_growtangle.y - obj_growtangle.sprite_height, obj_berdly_tornadomaker);
811
        if (type == 113)
812
            bardly.difficulty = 3;
813
        made = 1;
814
    }
815
}
816
else if (type == 114)
817
{
818
    if (btimer >= 30)
819
    {
820
        if (made == 0)
821
        {
822
            dir = 0;
823
            made = 1;
824
        }
825
        dir = dir + 30 + random(300);
826
        len = 140 + random(10);
827
        cenx = 0;
828
        ceny = 0;
829
        if (instance_exists(obj_growtangle))
830
            cenx = obj_growtangle.x;
831
        if (instance_exists(obj_growtangle))
832
            ceny = obj_growtangle.y;
833
        gun = instance_create(cenx + lengthdir_x(len, dir), ceny + lengthdir_y(len, dir), obj_queen_lasergun);
834
        btimer = 0;
835
    }
836
    ctimer++;
837
    if (ctimer == 20 || ctimer == 150)
838
    {
839
        var a = choose(1, 2, 3);
840
        if (a == 1)
841
        {
842
            xx = obj_growtangle.x + 150;
843
            yy = (obj_growtangle.y - 50) + irandom(100);
844
        }
845
        if (a == 2)
846
        {
847
            xx = obj_growtangle.x - 150;
848
            yy = (obj_growtangle.y - 50) + irandom(100);
849
        }
850
        if (a == 3)
851
        {
852
            xx = (obj_growtangle.x - 50) + irandom(100);
853
            yy = obj_growtangle.y - 100;
854
        }
855
        d = instance_create(xx, yy, obj_queen_search_window);
856
        d.quick = true;
857
        d.search = 2;
858
        d.damage = damage;
859
        d.target = target;
860
    }
861
}
862
else if (type == 115)
863
{
864
    if (btimer >= 30)
865
    {
866
        if (made == 0)
867
        {
868
            dir = 0;
869
            made = 1;
870
        }
871
        dir = dir + 30 + random(300);
872
        len = 140 + random(10);
873
        cenx = 0;
874
        ceny = 0;
875
        if (instance_exists(obj_growtangle))
876
            cenx = obj_growtangle.x;
877
        if (instance_exists(obj_growtangle))
878
            ceny = obj_growtangle.y;
879
        gun = instance_create(cenx + lengthdir_x(len, dir), ceny + lengthdir_y(len, dir), obj_queen_lasergun);
880
        btimer = 0;
881
    }
882
    ctimer++;
883
    if (ctimer == 50)
884
    {
885
        var a = irandom(2);
886
        repeat (1)
887
        {
888
            if (a == 0)
889
                d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x + -47, miny - 4, obj_queen_leg);
890
            if (a == 1)
891
                d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x, miny - 4, obj_queen_leg);
892
            if (a == 2)
893
                d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x + 47, miny - 4, obj_queen_leg);
894
            d.pos = a;
895
            a += (1 + irandom(1));
896
            if (a > 2)
897
                a -= 3;
898
        }
899
        ctimer = 0;
900
    }
901
}
902
else if (type == 116)
903
{
904
    if (made == 0)
905
    {
906
        dir = 0;
907
        made = 1;
908
        ctimer = 89;
909
        dtimer = 64;
910
    }
911
    if (btimer >= 105)
912
    {
913
        dir = dir + 30 + random(300);
914
        len = 140 + random(10);
915
        cenx = 0;
916
        ceny = 0;
917
        if (instance_exists(obj_growtangle))
918
            cenx = obj_growtangle.x;
919
        if (instance_exists(obj_growtangle))
920
            ceny = obj_growtangle.y;
921
        gun = instance_create(cenx + lengthdir_x(len, dir), ceny + lengthdir_y(len, dir), obj_queen_lasergun);
922
        btimer = 55;
923
    }
924
    ctimer++;
925
    if (ctimer == 94)
926
    {
927
        var a = irandom(2);
928
        repeat (1)
929
        {
930
            if (a == 0)
931
                d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x + -47, miny - 4, obj_queen_leg);
932
            if (a == 1)
933
                d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x, miny - 4, obj_queen_leg);
934
            if (a == 2)
935
                d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(obj_growtangle.x + 47, miny - 4, obj_queen_leg);
936
            d.pos = a;
937
            a += (1 + irandom(1));
938
            if (a > 2)
939
                a -= 3;
940
        }
941
        ctimer = 0;
942
    }
943
    dtimer++;
944
    if (dtimer == 65)
945
    {
946
        if (irandom(100) < 60)
947
            d = instance_create(obj_growtangle.x + (lastside * 150), (obj_growtangle.y - 70) + irandom(140), obj_queen_explodinghead_intro);
948
        else
949
            d = instance_create((obj_growtangle.x - 70) + irandom(140), obj_growtangle.y + (lastside * 150), obj_queen_explodinghead_intro);
950
        lastside *= -1;
951
        dtimer = 0;
952
    }
953
}
954
else if (init == 1)
955
{
956
    init = 2;
957
}