Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_elnina_mascotattack_Step_0

(view raw script w/o annotations or w/e)
1
if (!i_ex(obj_growtangle))
2
{
3
    instance_destroy();
4
    exit;
5
}
6
if (global.turntimer <= 2)
7
{
8
    mascot[0].image_alpha = 0;
9
    mascot[1].image_alpha = 0;
10
    exit;
11
}
12
if (i_ex(obj_growtangle))
13
{
14
    var xx = obj_growtangle.x;
15
    var yy = obj_growtangle.y;
16
    siner++;
17
    if (attacktype >= 0)
18
    {
19
        if (con == 0)
20
        {
21
            if (dummy == true)
22
            {
23
                mascot[0] = 
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; }
(xx + 51 + 130, yy, ms[1][0]);
24
                mascot[1] = 
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; }
((xx - 51) + 130, yy, ms[0][0]);
25
                mascot[0].image_xscale = mascot[0].image_xscale * -1;
26
                mascot[1].image_xscale = mascot[1].image_xscale * -1;
27
            }
28
            else
29
            {
30
                mascot[0] = 
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; }
(xx + 72, yy - 116, ms[0][0]);
31
                mascot[1] = 
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; }
(xx - 72, yy - 116, ms[1][0]);
32
            }
33
            if (attacktype == 1)
34
            {
35
                mascot[favored].image_xscale = 2.25;
36
                mascot[favored].image_yscale = 2.25;
37
            }
38
            if (attacktype == 2)
39
            {
40
                for (var i = 0; i < 2; i++)
41
                {
42
                    if (favored == i)
43
                    {
44
                        mascot[i].image_xscale = 1.7;
45
                        mascot[i].image_yscale = 1.7;
46
                        mascot[i].sprite_index = ms[i][2];
47
                        mascot[i].y -= 10;
48
                    }
49
                    else
50
                    {
51
                        mascot[i].image_xscale = 1.5;
52
                        mascot[i].image_yscale = 1.5;
53
                        mascot[i].sprite_index = ms[i][4];
54
                        mascot[i].y += 10;
55
                        mascot[i].x -= 30 * facing[i];
56
                    }
57
                }
58
            }
59
            if (attacktype == 3)
60
            {
61
                chasecon = 0;
62
                for (var i = 0; i < 2; i++)
63
                {
64
                    if (favored == i)
65
                    {
66
                        mascot[i].image_xscale = 2;
67
                        mascot[i].image_yscale = 2;
68
                        mascot[i].sprite_index = ms[i][2];
69
                        mascot[i].y -= 16;
70
                        mascot[i].direction = 90 + (90 * facing[favored]);
71
                        mascot[i].speed = 6;
72
                    }
73
                    else
74
                    {
75
                        mascot[i].image_xscale = 1;
76
                        mascot[i].image_yscale = 1;
77
                        mascot[i].sprite_index = ms[i][4];
78
                        mascot[i].y += 20;
79
                        mascot[i].image_xscale *= -1;
80
                        mascot[i].direction = 90 + (90 * facing[favored]);
81
                        mascot[i].speed = 4.4;
82
                        mascot[i].image_speed = 0.5;
83
                    }
84
                }
85
            }
86
            if (attacktype == 4)
87
            {
88
                for (var i = 0; i < 2; i++)
89
                {
90
                    if (favored == i)
91
                    {
92
                        mascot[i].image_xscale = 2;
93
                        mascot[i].image_yscale = 2;
94
                        mascot[i].sprite_index = ms[i][3];
95
                        mascot[i].y -= 16;
96
                        mascot[i].direction = 90 + (90 * facing[favored]);
97
                        mascot[i].x = xx;
98
                    }
99
                    else
100
                    {
101
                        mascot[i].image_xscale = 1;
102
                        mascot[i].image_yscale = 1;
103
                        mascot[i].sprite_index = ms[i][6];
104
                        mascot[i].y -= 20;
105
                        mascot[i].image_xscale *= -1;
106
                        mascot[i].direction = 90 + (90 * facing[favored]);
107
                        mascot[i].speed = 0;
108
                        mascot[i].image_speed = 0.5;
109
                        mascot[i].x = xx - 120;
110
                    }
111
                }
112
            }
113
            con = 1;
114
        }
115
        if (con == 1)
116
        {
117
            for (var i = 0; i < 2; i++)
118
            {
119
                if (i_ex(mascot[i]))
120
                {
121
                    if (attacktype == 0 || attacktype == 1)
122
                    {
123
                        if (!(attacktype == 1 && favored == i))
124
                        {
125
                            mascot[i].x -= sin(siner / 8) * facing[i];
126
                            mascot[i].x -= facing[i] / 10;
127
                            if (siner == 162 && attacktype == 0 && dummy == false)
128
                                mascot[i].sprite_index = ms[i][1];
129
                        }
130
                    }
131
                    else if (attacktype == 2)
132
                    {
133
                        if (favored != i)
134
                            mascot[i].x += (0.2 * facing[i]) + random_range(-1, 1);
135
                        else
136
                            mascot[i].x += (sin(siner / 6) * 3) - (0.3 * facing[i]);
137
                    }
138
                    else if (attacktype == 3)
139
                    {
140
                        var turning = 0;
141
                        var threshold = 140;
142
                        if (i != favored)
143
                            threshold = 110;
144
                        if (mascot[i].x < (xx - threshold))
145
                            turning = 1;
146
                        if (mascot[i].x > (xx + threshold))
147
                            turning = 1;
148
                        if (mascot[i].y < (yy - threshold))
149
                            turning = 1;
150
                        if (mascot[i].y > (yy + threshold))
151
                            turning = 1;
152
                        if (turning)
153
                        {
154
                            mascot[i].x += -mascot[i].hspeed;
155
                            mascot[i].y += -mascot[i].vspeed;
156
                            mascot[i].image_angle += 90 * facing[favored];
157
                            mascot[i].direction += 90 * facing[favored];
158
                        }
159
                    }
160
                    else if (attacktype == 4)
161
                    {
162
                        if (global.turntimer > 250)
163
                        {
164
                            if (i == favored)
165
                                mascot[i].x = xx + (sin(siner / 3) * 3) + (cos(siner / 7) * 2);
166
                        }
167
                    }
168
                }
169
            }
170
            if (siner == 168 && attacktype == 0 && dummy == false)
171
            {
172
                var heartmarker = 
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; }
(xx, yy - 120, spr_ch3_bullet_heart);
173
                heartmarker.vspeed = -6;
174
                heartmarker.friction = 0.334;
175
                
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(heartmarker, 32);
176
                
scr_lerpvar_instance
scr_lerpvar_instance

function
scr_lerpvar_instance()
{ __lerpvar = instance_create(0, 0, obj_lerpvar); __lerpvar.target = argument[0]; __lerpvar.varname = argument[1]; __lerpvar.pointa = argument[2]; __lerpvar.pointb = argument[3]; __lerpvar.maxtime = argument[4]; if (argument_count >= 6) __lerpvar.easetype = argument[5]; if (argument_count >= 7) __lerpvar.easeinout = argument[6]; return __lerpvar; } function scr_lerp_var_instance() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
} function scr_lerp_instance_var() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
}
(heartmarker, "image_alpha", 3, 0, 32);
177
            }
178
            shotrate[0] = 11;
179
            shotrate[1] = 11;
180
            if (encounterno == 113)
181
            {
182
                shotrate[0] = 11;
183
                shotrate[1] = 11;
184
            }
185
            if (i_ex(obj_elnina_rematch_enemy) && !i_ex(obj_bullet_blocker) && !i_ex(obj_elnina_umbrella))
186
            {
187
                shotrate[0] = 8;
188
                shotrate[1] = 8;
189
            }
190
            var randomhspeed = 2 + random(3);
191
            var randomvspeed = 1 + random(3.2);
192
            if (attacktype == 1)
193
                shotrate[favored] = 11;
194
            if (attacktype == 2)
195
            {
196
                shotrate[0] = 14 + extrabulletrate;
197
                shotrate[1] = 14 + extrabulletrate;
198
                shotrate[favored] = 8;
199
                randomhspeed += (0.2 + random(0.5));
200
                randomvspeed += (0.2 + random(0.5));
201
            }
202
            if (attacktype == 3)
203
            {
204
                shotrate[0] = 13 + extrabulletrate;
205
                shotrate[1] = 13 + extrabulletrate;
206
                shotrate[favored] = 6 + extrabulletrate;
207
            }
208
            if (attacktype == 4)
209
            {
210
                shotrate[0] = 21 + extrabulletrate;
211
                shotrate[1] = 21 + extrabulletrate;
212
                shotrate[favored] = 7 + extrabulletrate;
213
                if (global.hp[1] >= (global.maxhp[1] / 2))
214
                    shotrate[favored] = 6 + extrabulletrate;
215
                if (global.turntimer < 500)
216
                {
217
                    shotrate[favored] = (65 + extrabulletrate) - (global.turntimer / 10);
218
                    if (global.turntimer <= 250)
219
                        shotrate[favored] = 9999;
220
                    mus_volume(global.batmusic[0], (global.turntimer / 500) - 0.2, 0);
221
                    with (mascot[favored])
222
                    {
223
                        image_speed = 0;
224
                        image_index = 0;
225
                        sprite_index = other.ms[other.favored][7];
226
                        if (global.turntimer < 350)
227
                            image_index = 1;
228
                        if (global.turntimer < 200)
229
                            image_index = 2;
230
                    }
231
                }
232
            }
233
            shottimer[0]++;
234
            shottimer[1]++;
235
            for (var i = 0; i < 2; i++)
236
            {
237
                if (i_ex(mascot[i]) && dummy == false)
238
                {
239
                    if (shottimer[i] >= shotrate[i])
240
                    {
241
                        var mybullet = instance_create(mascot[i].x, mascot[i].y, obj_regularbullet_elnina);
242
                        mybullet.hspeed = randomhspeed * facing[i];
243
                        mybullet.vspeed = randomvspeed;
244
                        mybullet.gravity_direction = 90 + (90 * facing[i]);
245
                        mybullet.gravity = 0.2;
246
                        mybullet.sprite_index = bs[3 - (i * 2)];
247
                        mybullet.element = 5;
248
                        if (attacktype == 2)
249
                            mybullet.grazepoints = 3;
250
                        if (attacktype == 3)
251
                            mybullet.grazepoints = 3;
252
                        if (i_ex(obj_dbulletcontroller))
253
                            mybullet.target = obj_dbulletcontroller.target;
254
                        if (type == 1)
255
                            mybullet.sprite_index = bs[5];
256
                        if (type == 2)
257
                            mybullet.sprite_index = bs[1];
258
                        if (type == 3)
259
                            mybullet.sprite_index = bs[4];
260
                        if (type == 4)
261
                            mybullet.sprite_index = bs[3];
262
                        if (i == 0)
263
                        {
264
                            if (laninobulletsprite == 1474)
265
                                mybullet.sprite_index = bs[4];
266
                            if (laninobulletsprite == 783)
267
                                mybullet.sprite_index = bs[3];
268
                        }
269
                        if (i == 1)
270
                        {
271
                            if (elninabullesprite == 4255)
272
                                mybullet.sprite_index = bs[5];
273
                            if (elninabullesprite == 1650)
274
                                mybullet.sprite_index = bs[1];
275
                        }
276
                        var a = 0;
277
                        if (i_ex(obj_elnina_umbrella))
278
                            a = obj_elnina_umbrella.mercy * 2;
279
                        if (i_ex(obj_lanino_rematch_enemy))
280
                        {
281
                            if ((global.mercymod[obj_lanino_rematch_enemy.myself] + global.mercymod[obj_elnina_rematch_enemy.myself] + a) > 100)
282
                                firebulletcount = 20;
283
                            if ((global.mercymod[obj_lanino_rematch_enemy.myself] + global.mercymod[obj_elnina_rematch_enemy.myself] + a) > 198)
284
                                firebulletcount = 12;
285
                        }
286
                        bulletcount++;
287
                        if (bulletcount >= firebulletcount)
288
                        {
289
                            mybullet.sprite_index = spr_lanino_fire;
290
                            mybullet.image_blend = c_red;
291
                            mybullet.image_xscale = 2;
292
                            mybullet.image_yscale = 2;
293
                        }
294
                        if (bulletcount >= (firebulletcount + 3))
295
                            bulletcount = 0;
296
                        if (attacktype == 1 && favored == i)
297
                        {
298
                            mybullet.image_xscale = 1.25;
299
                            mybullet.image_yscale = 1.25;
300
                        }
301
                        if (attacktype == 2)
302
                        {
303
                            if (favored == i)
304
                            {
305
                                mybullet.image_xscale = 1.5;
306
                                mybullet.image_yscale = 1.5;
307
                            }
308
                            else
309
                            {
310
                                mybullet.image_xscale = 0.8;
311
                                mybullet.image_yscale = 0.8;
312
                            }
313
                        }
314
                        if (attacktype == 3)
315
                        {
316
                            mybullet.direction = (mascot[i].image_angle - (80 * facing[i])) + random_range(-10, 10);
317
                            if (favored != i)
318
                                mybullet.direction = mascot[i].image_angle + (50 * facing[i]) + random_range(-10, 10);
319
                            if (favored == 1)
320
                                mybullet.direction += 180;
321
                            mybullet.speed = 2.5;
322
                            mybullet.gravity = 0.2;
323
                            mybullet.gravity = 0;
324
                            mybullet.friction = -0.1;
325
                            if (favored == i)
326
                            {
327
                                mybullet.image_xscale = 2;
328
                                mybullet.image_yscale = 2;
329
                                mybullet.speed = 1;
330
                                mybullet.direction = point_direction(mybullet.x, mybullet.y, xx, yy) + (15 * facing[i]);
331
                            }
332
                            else
333
                            {
334
                                mybullet.image_xscale = 1;
335
                                mybullet.image_yscale = 1;
336
                                mybullet.direction = point_direction(mybullet.x, mybullet.y, xx, yy) + random_range(-35, 35);
337
                            }
338
                        }
339
                        if (attacktype == 4)
340
                        {
341
                            if (favored != i)
342
                            {
343
                                with (mybullet)
344
                                    visible = 0;
345
                                with (mybullet)
346
                                    instance_destroy();
347
                                with (mascot[i])
348
                                {
349
                                    image_alpha -= 0.05;
350
                                    image_xscale -= 0.05;
351
                                    image_yscale -= 0.05;
352
                                    x += random_range(-2, 2);
353
                                    y += random_range(-2, 2);
354
                                }
355
                            }
356
                            if (favored == i)
357
                            {
358
                                var maxscale = 3;
359
                                if (shotrate[i] > 5)
360
                                    maxscale = clamp(3 - (shotrate[i] / 10), 0.5, 3);
361
                                
scr_lerpvar_instance
scr_lerpvar_instance

function
scr_lerpvar_instance()
{ __lerpvar = instance_create(0, 0, obj_lerpvar); __lerpvar.target = argument[0]; __lerpvar.varname = argument[1]; __lerpvar.pointa = argument[2]; __lerpvar.pointb = argument[3]; __lerpvar.maxtime = argument[4]; if (argument_count >= 6) __lerpvar.easetype = argument[5]; if (argument_count >= 7) __lerpvar.easeinout = argument[6]; return __lerpvar; } function scr_lerp_var_instance() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
} function scr_lerp_instance_var() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
}
(mybullet, "image_xscale", 1, maxscale, 60, 2, "out");
362
                                
scr_lerpvar_instance
scr_lerpvar_instance

function
scr_lerpvar_instance()
{ __lerpvar = instance_create(0, 0, obj_lerpvar); __lerpvar.target = argument[0]; __lerpvar.varname = argument[1]; __lerpvar.pointa = argument[2]; __lerpvar.pointb = argument[3]; __lerpvar.maxtime = argument[4]; if (argument_count >= 6) __lerpvar.easetype = argument[5]; if (argument_count >= 7) __lerpvar.easeinout = argument[6]; return __lerpvar; } function scr_lerp_var_instance() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
} function scr_lerp_instance_var() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
}
(mybullet, "image_yscale", 1, maxscale, 60, 2, "out");
363
                                mybullet.gravity_direction = choose(0, 180);
364
                                mybullet.gravity = 0.2;
365
                                mybullet.direction = mybullet.gravity_direction + 180;
366
                                mybullet.speed = 8;
367
                                mybullet.vspeed = 0.5 + random(3);
368
                                mybullet.y += 10;
369
                                with (mybullet)
370
                                {
371
                                    
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(mybullet, 100);
372
                                    
scr_lerpvar_instance
scr_lerpvar_instance

function
scr_lerpvar_instance()
{ __lerpvar = instance_create(0, 0, obj_lerpvar); __lerpvar.target = argument[0]; __lerpvar.varname = argument[1]; __lerpvar.pointa = argument[2]; __lerpvar.pointb = argument[3]; __lerpvar.maxtime = argument[4]; if (argument_count >= 6) __lerpvar.easetype = argument[5]; if (argument_count >= 7) __lerpvar.easeinout = argument[6]; return __lerpvar; } function scr_lerp_var_instance() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
} function scr_lerp_instance_var() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
}
(mybullet, "image_alpha", 8, 0, 100, 0, "in");
373
                                }
374
                            }
375
                        }
376
                        if (attacktype < 4)
377
                        {
378
                            
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(mybullet, 80);
379
                            
scr_lerpvar_instance
scr_lerpvar_instance

function
scr_lerpvar_instance()
{ __lerpvar = instance_create(0, 0, obj_lerpvar); __lerpvar.target = argument[0]; __lerpvar.varname = argument[1]; __lerpvar.pointa = argument[2]; __lerpvar.pointb = argument[3]; __lerpvar.maxtime = argument[4]; if (argument_count >= 6) __lerpvar.easetype = argument[5]; if (argument_count >= 7) __lerpvar.easeinout = argument[6]; return __lerpvar; } function scr_lerp_var_instance() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
} function scr_lerp_instance_var() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
}
(mybullet, "image_alpha", 8, 0, 70, 0, "in");
380
                        }
381
                        shottimer[i] = 0;
382
                    }
383
                }
384
            }
385
        }
386
    }
387
}