Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_knight_lightorb_Draw_0

(view raw script w/o annotations or w/e)
1
var scale = 0.8 + (sin(siner / 4) * 0.2);
2
if (con == 0)
3
{
4
    timer++;
5
    if (timer < 15 && darken_alpha < 0.35)
6
        darken_alpha += 0.05;
7
    if (timer > 15)
8
        darken_alpha -= 0.1;
9
    if (timer == 9)
10
        snd_play_x(snd_knight_stretch, 0.6, 1.5);
11
    if ((timer % 3) == 0)
12
        
scr_shakescreen
scr_shakescreen

function
scr_shakescreen()
{ instance_create(x, y, obj_shake); }
();
13
    if ((timer % 1) == 0)
14
        instance_create((x - 30) + random(60), (y - 30) + random(60), obj_knight_spark);
15
    if (timer < 40)
16
    {
17
        var aa = 0.25 - (timer / 100);
18
        if (aa < 0)
19
            aa = 0;
20
        draw_sprite_ext(spr_zapper_tvturnoff1, 0, x, y, 40, aa, 0, c_white, 1);
21
    }
22
    if (timer < 18)
23
    {
24
        d = instance_create(x, y, obj_rouxls_power_up_orb);
25
        d.direction = irandom(360);
26
        d.lifetime = 12;
27
        d.depth = depth + 1;
28
        d.image_blend = image_blend;
29
    }
30
    scale = lerp(scale * 0.001, scale, timer / 40);
31
    if (timer == 40)
32
    {
33
        con = 1;
34
        timer = 0;
35
        snd_stop(snd_knight_stretch);
36
        if (type == 1)
37
        {
38
            instance_create(x - splitx, y, obj_knight_bullethell2);
39
            instance_create(x + splitx, y, obj_knight_bullethell2);
40
        }
41
    }
42
    if (type == 1 && splitx < 60 && timer >= 30)
43
        splitx += 6;
44
}
45
if (con == 1)
46
{
47
    timer++;
48
    var _x = 0;
49
    if (type == 1)
50
        _x = splitx;
51
    var _rep = 1;
52
    if (type == 1)
53
        _rep = 2;
54
    repeat (_rep)
55
    {
56
        tri = instance_create(x + _x, y, obj_knight_triangle);
57
        tri.image_yscale = 1 + random(0.5);
58
        tri.image_xscale = 1 + random(0.7);
59
        if ((timer % 30) == 0 || timer == 1)
60
            instance_create(x + _x, y, obj_knight_ring);
61
        if ((timer % 1) == 0)
62
            instance_create((x - 30) + random(60) + _x, (y - 30) + random(60), obj_knight_spark);
63
        if ((timer % 10) == 0)
64
        {
65
            var basedir = ((point_direction(x + _x, y, obj_heart.x + 10, obj_heart.y + 10) + 36) - 5) + irandom(10);
66
            count++;
67
            var n = 0;
68
            if (obj_roaringknight_quickslash_attack.local_turntimer < -60 || obj_knight_enemy.difficulty == 0)
69
            {
70
                basedir = ((point_direction(x + _x, y, obj_heart.x + 10, obj_heart.y + 10) + 36) - 30) + irandom(60);
71
                if ((count % 2) == 0)
72
                    basedir = point_direction(x + _x, y, obj_heart.x + 10, obj_heart.y + 10);
73
                repeat (5)
74
                {
75
                    with (
scr_fire_bullet
scr_fire_bullet

function
scr_fire_bullet(arg0, arg1, arg2, arg3, arg4, arg5 = -4, arg6 = 0, arg7 = false, arg8 = 87135)
{ var bullet; if (arg8 != 87135) bullet = instance_create_depth(arg0, arg1, arg8, arg2); else bullet = instance_create(arg0, arg1, arg2); with (bullet) { direction = arg3; speed = arg4; if (arg5 != -4) sprite_index = arg5; updateimageangle = arg6; if (arg6) image_angle = arg3; if (arg7) { with (other)
scr_bullet_inherit(other.id);
} } return bullet; } function scr_fire_bullet_colorize(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 = 0) { var bullet = instance_create(arg0, arg1, arg2); with (bullet) { direction = arg3; speed = arg4; sprite_index = arg5; image_blend = arg6; updateimageangle = arg7; if (arg7) image_angle = arg3; } return bullet; }
(x + _x, y, obj_knight_bullethell_bullet2, basedir + (72 * n), 5 + random(2), spr_sunbolt))
76
                    {
77
                        updateimageangle = 1;
78
                        image_angle = direction;
79
                        gravity_direction = direction + 180;
80
                        gravity = speed / 90;
81
                        mask_index = spr_sunbolt;
82
                        depth -= 100;
83
                        
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ 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_lerpvar_respect() { 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]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("gravity", gravity, 0, 30);
84
                    }
85
                    n++;
86
                }
87
            }
88
            else
89
            {
90
                if ((count % 3) == 0 && _x > 0)
91
                    basedir = point_direction(x + _x, y, obj_heart.x + 10, obj_heart.y + 10);
92
                if ((count % 5) == 0 && _x < 0)
93
                    basedir = point_direction(x + _x, y, obj_heart.x + 10, obj_heart.y + 10);
94
                repeat (3)
95
                {
96
                    with (
scr_fire_bullet
scr_fire_bullet

function
scr_fire_bullet(arg0, arg1, arg2, arg3, arg4, arg5 = -4, arg6 = 0, arg7 = false, arg8 = 87135)
{ var bullet; if (arg8 != 87135) bullet = instance_create_depth(arg0, arg1, arg8, arg2); else bullet = instance_create(arg0, arg1, arg2); with (bullet) { direction = arg3; speed = arg4; if (arg5 != -4) sprite_index = arg5; updateimageangle = arg6; if (arg6) image_angle = arg3; if (arg7) { with (other)
scr_bullet_inherit(other.id);
} } return bullet; } function scr_fire_bullet_colorize(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 = 0) { var bullet = instance_create(arg0, arg1, arg2); with (bullet) { direction = arg3; speed = arg4; sprite_index = arg5; image_blend = arg6; updateimageangle = arg7; if (arg7) image_angle = arg3; } return bullet; }
(x + _x, y, obj_knight_bullethell_bullet2, basedir + (120 * n), 4.5, spr_sunbolt))
97
                    {
98
                        updateimageangle = 1;
99
                        image_angle = direction;
100
                        gravity_direction = direction + 180;
101
                        gravity = speed / 90;
102
                        mask_index = spr_sunbolt;
103
                        depth -= 100;
104
                        
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ 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_lerpvar_respect() { 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]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("gravity", gravity, 0, 30);
105
                    }
106
                    n++;
107
                }
108
            }
109
            snd_play_x(snd_stardrop, 0.8, 1);
110
        }
111
        _x = splitx * -1;
112
    }
113
}
114
siner++;
115
if ((siner % 2) == 0)
116
    image_blend = col;
117
else
118
    image_blend = c_white;
119
if ((type == 1 && con == 0 && timer > 29) || (type == 1 && con == 1))
120
{
121
    draw_sprite_ext(sprite_index, image_index, x + splitx, y, scale, scale, image_angle, image_blend, image_alpha);
122
    draw_sprite_ext(sprite_index, image_index, x - splitx, y, scale, scale, image_angle, image_blend, image_alpha);
123
}
124
else
125
{
126
    draw_sprite_ext(sprite_index, image_index, x, y, scale, scale, image_angle, image_blend, image_alpha);
127
}
128
if (global.turntimer < 1)
129
{
130
    instance_destroy();
131
    with (obj_knight_bullethell2)
132
        instance_destroy();
133
}
134
if (con == 0)
135
{
136
    if (radius > 0)
137
        radius -= 4;
138
    if (circle_alpha < 0.4)
139
        circle_alpha += 0.1;
140
    draw_set_alpha(circle_alpha);
141
    draw_circle_color(x, y, radius, c_blue, c_blue, false);
142
    draw_set_alpha(1);
143
}