Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_attack_orange_superattack_Draw_0

(view raw script w/o annotations or w/e)
1
if (!i_ex(obj_growtangle))
2
    exit;
3
if (i_ex(obj_bullet_orange_debris))
4
{
5
    var ___x = gt_minx() + 8;
6
    var ___y = gt_miny() + 5;
7
    if (!surface_exists(surf))
8
        surf = surface_create(gt_maxx() - ___x - 4, gt_maxy() - ___y - 3);
9
    surface_set_target(surf);
10
    draw_clear_alpha(c_black, 0);
11
    with (obj_bullet_orange_debris)
12
        draw_sprite_ext(sprite_index, image_index, x - ___x, y - ___y, image_xscale, image_yscale, image_angle, make_color_rgb(255 * image_alpha, 255 * image_alpha, 255 * image_alpha), 1);
13
    surface_reset_target();
14
    gpu_set_blendmode(bm_normal);
15
    draw_surface(surf, ___x, ___y);
16
}
17
if (con == 0)
18
{
19
    var jumptime = 15;
20
    
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("x", x, (obj_growtangle.x + 22) - (sprite_width / 2), round(jumptime * 1.2), 1, "out");
21
    
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("y", y, obj_growtangle.y + (obj_growtangle.sprite_height / 2) + 20, jumptime, 3, "out");
22
    con = -99;
23
    
scr_script_delayed
scr_script_delayed

function
scr_script_delayed()
{ var __scriptdelay = instance_create(0, 0, obj_script_delayed); __scriptdelay.script = argument[0]; __scriptdelay.alarm[0] = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; } function scr_script_delayed_until() { var __scriptdelay = instance_create(0, 0, obj_script_delayed_function); __scriptdelay.script = argument[0]; __scriptdelay.condition = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; } function delay_function(arg0, arg1) { return
scr_script_delayed(arg0, arg1);
}
(scr_var, jumptime, "con", 1);
24
    foodalpha = 0;
25
    foodtimer = 0;
26
    flash = 0;
27
    foodangle = 0;
28
    with (obj_growtangle)
29
        
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("image_xscale", image_xscale, 3, 30);
30
}
31
if (con == 1)
32
{
33
    var mcx = x + (sprite_width / 2);
34
    var mcy = y + (sprite_height / 2);
35
    foodtimer += 4;
36
    foodalpha = lerp(foodalpha, 1, 0.125);
37
    foodangle = lerp(foodangle, 145, 0.1);
38
    var foodlength = 100 - foodtimer;
39
    if (foodcollected > 0 && foodlength > 0)
40
    {
41
        for (var i = 0; i < foodcollected; i++)
42
            draw_sprite_ext(spr_bullet_green_egg, 0, mcx + lengthdir_x(foodlength, ((360 / foodcollected) * i) + foodangle), mcy + lengthdir_y(foodlength, ((360 / foodcollected) * i) + foodangle), 1, 1, 0, c_white, foodalpha);
43
    }
44
    if (foodlength < 25 && flash == 0)
45
    {
46
        flash = 1;
47
        sprite_index = spr_enemy_orange_prepare;
48
        var oflash = 
scr_oflash
scr_oflash

function
scr_oflash()
{ _oflash = instance_create(x, y, obj_oflash); _oflash.image_xscale = image_xscale; _oflash.image_speed = 0; _oflash.image_angle = image_angle; _oflash.image_index = image_index; _oflash.image_yscale = image_yscale; _oflash.sprite_index = sprite_index; _oflash.depth = depth - 1; _oflash.target = id; return _oflash; }
();
49
        oflash.flashspeed = 0.5;
50
    }
51
    if (foodlength <= 0 && !i_ex(obj_oflash))
52
    {
53
        sprite_index = spr_enemy_orange_fly_withfist;
54
        aurasiner = 0;
55
        auraalpha = 0;
56
        gensiner = 0;
57
        con = 2;
58
        foodtimer = 0;
59
    }
60
    draw_self();
61
}
62
if (con == 2)
63
{
64
    foodtimer++;
65
    auraalpha = lerp(auraalpha, 1, 0.125);
66
    aurasiner++;
67
    auracolor = merge_color(c_white, hexcolor(#33ADFF), aurasiner / 10);
68
    if (aurasiner == 10)
69
        aurasiner = 0;
70
    gensiner++;
71
    if (foodtimer == 2)
72
        dustlift = 1;
73
    createrocks = true;
74
    var attacktime = 90;
75
    var _endy = -60;
76
    vspeed = -21;
77
    
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("vspeed", vspeed, vspeed / 2, 38);
78
    var etx = -21;
79
    var ety = -32;
80
    draw_sprite_ext(spr_enemy_orange_energytrail, 0, etx + x + (sprite_width / 2), (ety + y) - 2, 1.3, 2, 0, auracolor, 0.5 * auraalpha);
81
    draw_sprite_ext(sprite_index, image_index, x + choose(-2, 0, 2), y + choose(-2, 0, 2), image_xscale, image_yscale, image_angle, image_blend, image_alpha);
82
    draw_sprite_ext(spr_enemy_orange_energytrail, 0, etx + x + (sprite_width / 2), (ety + y) - 2, 1.4, 2, 0, auracolor, 0.15 * auraalpha);
83
    counter = 0;
84
    con = 3;
85
    sound_play(snd_punchheavythunder);
86
}
87
if (con == 3)
88
{
89
    counter++;
90
    var etx = -21;
91
    var ety = -34;
92
    if (counter > 40)
93
    {
94
        counter = 0;
95
        con = 4;
96
        _dir = random(360);
97
        loops = 9;
98
    }
99
    draw_sprite_ext(spr_enemy_orange_energytrail, 0, etx + x + (sprite_width / 2), ety + y, 1.3, 2, image_angle, auracolor, 0.5 * auraalpha);
100
    draw_sprite_ext(sprite_index, image_index, x + choose(-2, 0, 2), y + choose(-2, 0, 2), image_xscale, image_yscale, image_angle, image_blend, image_alpha);
101
    draw_sprite_ext(spr_enemy_orange_energytrail, 0, etx + x + (sprite_width / 2), ety + y, 1.4, 2, image_angle, auracolor, 0.15 * auraalpha);
102
}
103
if (con == 4)
104
{
105
    if (counter == 0)
106
    {
107
        _dir += (120 + random(30));
108
        x = obj_growtangle.x + lengthdir_x(480, _dir);
109
        y = obj_growtangle.y + lengthdir_y(480, _dir);
110
        extendo = 0;
111
        speed = 0;
112
    }
113
    if (counter < 24)
114
    {
115
        extendo = 
scr_approach_curve
scr_approach_curve

function
scr_approach_curve(arg0, arg1, arg2, arg3 = 0.1)
{ return
scr_approach(arg0, arg1, max(arg3, abs(arg1 - arg0) / arg2));
}
(extendo, 230, sqrt(30 - counter), 0);
116
        draw_set_color(c_red);
117
        d_line_width(x, y, x + lengthdir_x(extendo * 4, _dir + 180), y + lengthdir_y(extendo * 4, _dir + 180), 2);
118
        draw_set_color(c_white);
119
    }
120
    if (counter == 25)
121
    {
122
        sound_play(snd_punchheavythunder);
123
        image_angle = _dir + 90;
124
        direction = _dir + 180;
125
        speed = 64 - (6.5 * max(0, loops - 4));
126
        friction = 0.25;
127
        var spin = choose(-5, 5);
128
        with (obj_bullet_orange_debris)
129
            launched = false;
130
    }
131
    with (obj_bullet_orange_debris)
132
    {
133
        if (launched < 0.5 && ((other.counter > 25 && abs(angle_difference(other._dir, point_direction(other.x, other.y, x, y))) < (90 - (point_distance(x, y, other.x, other.y) / 9))) || launched > 0))
134
        {
135
            if (launched == 0)
136
            {
137
                _dir = other._dir + 180;
138
                dist = 3;
139
                spindir = sign(angle_difference(_dir, point_direction(other.x, other.y, x, y)));
140
                rate = 1.75 - ((min(5, 10 - other.loops) * 2) / 30);
141
                grazed = false;
142
            }
143
            hspeed += (lengthdir_x(0.72 - (launched * 1.5), _dir) * rate);
144
            vspeed += (lengthdir_y(0.72 - (launched * 1.5), _dir) * rate);
145
            launched += (0.011 * rate);
146
            spinrate = (-speed / 1.5) * spindir;
147
        }
148
    }
149
    var etx = lengthdir_x(-21 + (sprite_width / 3), _dir - 90) + lengthdir_x(-34, _dir);
150
    var ety = lengthdir_y(-21 + (sprite_width / 3), _dir - 90) + lengthdir_y(-34, _dir);
151
    if (counter > 25)
152
    {
153
        draw_sprite_ext(spr_enemy_orange_energytrail, 0, etx + x, ety + y, 1.3, 2, image_angle, auracolor, 0.5 * auraalpha);
154
        draw_sprite_ext(sprite_index, image_index, x + choose(-2, 0, 2), y + choose(-2, 0, 2), image_xscale, image_yscale, image_angle, image_blend, image_alpha);
155
        draw_sprite_ext(spr_enemy_orange_energytrail, 0, etx + x, ety + y, 1.4, 2, image_angle, auracolor, 0.15 * auraalpha);
156
    }
157
    if (counter == (38 + (5 * max(0, loops - 4)) + (24 * (loops == 1))))
158
    {
159
        counter = -1;
160
        loops--;
161
        if (loops == 0)
162
        {
163
            con = 5;
164
            speed = 0;
165
            image_angle = 0;
166
            with (obj_bullet_orange_debris)
167
                
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("image_alpha", 1, 0, 60);
168
        }
169
    }
170
    counter++;
171
}
172
if (con == 5)
173
{
174
    sprite_index = spr_enemy_orange_down;
175
    if (i_ex(obj_orange_enemy))
176
        x = obj_orange_enemy.xstart;
177
    y = obj_growtangle.y - 400;
178
    gravity = 0.65;
179
    con = 6;
180
    with (obj_bullet_orange_debris)
181
        active = false;
182
}
183
if (con == 6 && i_ex(obj_orange_enemy))
184
{
185
    if (y >= obj_orange_enemy.ystart)
186
    {
187
        y = obj_orange_enemy.ystart;
188
        dust = instance_create(x + 16, y + 28, obj_animation);
189
        dust.sprite_index = spr_dust2;
190
        
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(dust);
191
        dust.image_speed = 0.5;
192
        dust.depth = depth - 5;
193
        dust.hspeed = -2;
194
        dust = instance_create(x + 36, y + 28, obj_animation);
195
        dust.sprite_index = spr_dust2;
196
        
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(dust);
197
        dust.image_speed = 0.5;
198
        dust.depth = depth - 5;
199
        dust.hspeed = 2;
200
        gravity = 0;
201
        vspeed = 0;
202
        mode = 0;
203
        siner = 0;
204
        instance_destroy();
205
        with (obj_bullet_orange_debris)
206
            instance_destroy();
207
    }
208
}
209
draw_self();
210
if (dustlift == 1)
211
{
212
    dustlift = 0;
213
    for (var i = 0; i < 6; i++)
214
    {
215
        dust = instance_create(x + 16, y + 28, obj_animation);
216
        dust.sprite_index = spr_dust2;
217
        
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(dust);
218
        dust.image_speed = 0.5 - random(0.2);
219
        dust.depth = depth - 5;
220
        dust.hspeed = -(2 + i + random(0.5));
221
        dust.vspeed = (i / 3) + random(0.5);
222
        dust.friction = 0.1;
223
        dust = instance_create(x + 36, y + 28, obj_animation);
224
        dust.sprite_index = spr_dust2;
225
        
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(dust);
226
        dust.image_speed = 0.5 - random(0.2);
227
        dust.depth = depth - 5;
228
        dust.hspeed = 2 + i + random(0.5);
229
        dust.vspeed = (i / 3) + random(0.5);
230
        dust.friction = 0.1;
231
    }
232
}
233
if (createrocks == 1)
234
{
235
    createrocks = false;
236
    var growtanglesize = obj_growtangle.sprite_width;
237
    for (var xx = -500; xx < 500; xx += 100)
238
    {
239
        for (var yy = -500; yy < 500; yy += 100)
240
        {
241
            var xxx = random_range(-27, 27) + (((yy + 360) % 160) * 0.48);
242
            with (instance_create_depth(obj_growtangle.x + xx + (xxx / 2), obj_growtangle.y + 240, obj_growtangle.depth + 1, obj_bullet_orange_debris))
243
            {
244
                if (yy < -300)
245
                    y = obj_growtangle.y + yy + random_range(-25, 25);
246
                else
247
                    
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("y", y, obj_growtangle.y + yy + random_range(-25, 25), 48 + ((y - yy) / 20), 1, "out");
248
                
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("x", x, obj_growtangle.x + xx + xxx, 48 + ((y - yy) / 20), 1, "out");
249
                spinrate = sign(x - obj_growtangle.x) + (xx / 45);
250
                launched = 0;
251
                image_angle = 90;
252
                direction = 90;
253
            }
254
        }
255
    }
256
}