Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_musicenemy_boombox_Step_0

(view raw script w/o annotations or w/e)
1
if (global.turntimer < 1)
2
{
3
    instance_destroy();
4
    exit;
5
}
6
siner++;
7
image_yscale = 1 - (abs(sin(siner / 5)) * 0.1);
8
buffer--;
9
if (makebullet > 0)
10
{
11
    if (makebullet == 1)
12
    {
13
        bullet = instance_create(x, (y - sprite_height) + 90, obj_musical_note_bullet);
14
        bullet.direction = point_direction(bullet.x, bullet.y, obj_heart.x + 8, obj_heart.y + 8);
15
        bullet.speed = 3.5;
16
        bullet.depth = depth - 10;
17
        bullet.grow = 1;
18
        bullet.active = 1;
19
        bullet.damage = damage;
20
        bullet.target = target;
21
        if (irandom(100) < 50)
22
            bullet.y += 70;
23
    }
24
    if (makebullet == 2)
25
    {
26
        if (segmentcountmax == 0)
27
        {
28
            bullet = instance_create(x, (y - sprite_height) + 90, obj_musical_note_bullet);
29
            if (instance_exists(obj_growtangle))
30
            {
31
                if (lightningvary == 0)
32
                    bullet.y = obj_growtangle.y + random_range(-obj_growtangle.sprite_height / 2, 0);
33
                if (lightningvary == 1)
34
                    bullet.y = obj_growtangle.y + random_range(0, obj_growtangle.sprite_height / 2);
35
            }
36
            with (bullet)
37
                
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; }
();
38
            bullet.image_yscale = 1;
39
            bullet.image_xscale = 0.4;
40
            bullet.speed = image_xscale;
41
            bullet.x -= image_xscale * 13;
42
            bullet.friction = -0.15;
43
            bullet.sprite_index = spr_electricity_wave;
44
            bullet.image_angle = bullet.direction;
45
            bullet.depth = depth - 10;
46
            bullet.growb = 1;
47
            bullet.image_angle = 90;
48
            bullet.copymake = 0;
49
            bullet.active = 1;
50
            bullet.damage = damage;
51
            bullet.target = target;
52
            if (lightningvary == 0)
53
                lightningvary = 1;
54
            else
55
                lightningvary = 0;
56
        }
57
        else
58
        {
59
            makelong = 1;
60
        }
61
    }
62
    if (makebullet == 3)
63
    {
64
        if (singlenote == 1)
65
        {
66
            with (obj_musicenemy_dancer)
67
                bultype = 0;
68
            if (type == 0)
69
            {
70
                with (obj_musicenemy_dancer)
71
                {
72
                    if (headimage == 2)
73
                        active = 1;
74
                }
75
            }
76
            if (type == 1)
77
            {
78
                with (obj_musicenemy_dancer)
79
                {
80
                    if (headimage == 5)
81
                        active = 1;
82
                }
83
            }
84
            if (type == 2)
85
            {
86
                with (obj_musicenemy_dancer)
87
                {
88
                    if (headimage == 8)
89
                        active = 1;
90
                }
91
            }
92
            type++;
93
            if (type > 2)
94
                type = 0;
95
        }
96
        else
97
        {
98
            with (obj_musicenemy_dancer)
99
            {
100
                active = 1;
101
                headframe = 0;
102
                bultype = 1;
103
            }
104
        }
105
    }
106
    buffer = 2;
107
}
108
makebullet = 0;
109
if (makelong == 1)
110
{
111
    makelongtimer++;
112
    if (makelongtimer >= 4)
113
    {
114
        var a = 0;
115
        repeat (4)
116
        {
117
            bullet = instance_create(x, (y - sprite_height) + 90, obj_musical_note_bullet_segment);
118
            if (instance_exists(obj_growtangle))
119
                bullet.y = obj_growtangle.y + random_range(-obj_growtangle.sprite_height / 2, obj_growtangle.sprite_height / 2);
120
            bullet.image_yscale = 0.75;
121
            bullet.image_xscale = 0.2;
122
            bullet.speed = image_xscale;
123
            bullet.x -= image_xscale * 13;
124
            bullet.friction = -0.2;
125
            bullet.speed = 0.37;
126
            bullet.y = y - 45;
127
            bullet.depth = depth - 10;
128
            bullet.active = 1;
129
            bullet.damage = damage;
130
            bullet.target = target;
131
            if (image_xscale < 0)
132
            {
133
                if (a == 0)
134
                    bullet.direction = (direction + 180 + angleoffset) - 80;
135
                if (a == 1)
136
                    bullet.direction = (direction + 180 + angleoffset) - 40;
137
                if (a == 2)
138
                    bullet.direction = direction + 180 + angleoffset;
139
                if (a == 3)
140
                    bullet.direction = direction + 180 + angleoffset + 40;
141
            }
142
            else
143
            {
144
                if (a == 0)
145
                    bullet.direction = (direction + angleoffset) - 80;
146
                if (a == 0)
147
                    bullet.direction = (direction + angleoffset) - 40;
148
                if (a == 1)
149
                    bullet.direction = direction + angleoffset;
150
                if (a == 2)
151
                    bullet.direction = direction + angleoffset + 40;
152
            }
153
            bullet.image_angle = bullet.direction;
154
            a++;
155
        }
156
        if (segmentcount < segmentcountmax)
157
        {
158
            segmentcount += 1;
159
            makelongtimer = 0;
160
        }
161
        else
162
        {
163
            segmentcountmax = 0;
164
            segmentcount = 0;
165
            makelong = 0;
166
            makelongtimer = 0;
167
        }
168
    }
169
}