Undertale script viewer

← back to main script listing

gml_Object_obj_spinbullet_huge_gen_Step_0

(view raw script w/o annotations or w/e)
1
if (counter == (num * trip))
2
{
3
    xx = lengthdir_x(radius, add_dir + ((num / maxnum) * 360 * side));
4
    yy = lengthdir_y(radius, add_dir + ((num / maxnum) * 360 * side));
5
    spinbullet[num] = instance_create(centerx + xx, centery + yy, obj_spinbullet_huge);
6
    num += 1;
7
}
8
counter += 1;
9
if (counter > ((maxnum - 1) * trip))
10
{
11
    snd_stop(snd_instanoise);
12
    snd_play(snd_instanoise);
13
    deactivate = 1;
14
    num = -99;
15
    counter = -50;
16
    for (var i = 0; i < maxnum; i += 1)
17
    {
18
        if (instance_exists(spinbullet[i]))
19
        {
20
            if (i == 0)
21
                spinbullet[i].king = obj_musicobjectparent;
22
            spinbullet[i].centerx = centerx;
23
            spinbullet[i].centery = centery;
24
        }
25
        if (strike == 0)
26
        {
27
            with (spinbullet[i])
28
alarm[3]
29
        }
30
        if (strike == 1)
31
        {
32
            with (spinbullet[i])
33
            {
34
                move_towards_point(centerx, centery, 12);
35
                friction = 1;
36
            }
37
        }
38
    }
39
    if (strike == 0)
40
        instance_destroy();
41
}
42
if (counter == -44 && strike == 1)
43
{
44
    for (var i = 0; i < maxnum; i += 1)
45
    {
46
        if (instance_exists(spinbullet[i]))
47
        {
48
            with (spinbullet[i])
49
                instance_destroy();
50
        }
51
    }
52
    instance_create(centerx, centery, obj_chaosbomb);
53
    instance_destroy();
54
}