Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_spamtonshot_Step_0

(view raw script w/o annotations or w/e)
1
if (instance_exists(obj_spamton_neo_enemy))
2
    damage = global.monsterat[obj_spamton_neo_enemy.myself] * 5;
3
if (global.turntimer < 1)
4
    instance_destroy();
5
dontexplode = 1;
6
if (instance_exists(obj_heart))
7
{
8
    if (y > (cameray() + 280))
9
        depth = obj_heart.depth + 100;
10
    else
11
        depth = obj_heart.depth + 2;
12
}
13
else if (instance_exists(obj_sneo_lilguy))
14
{
15
    depth = obj_sneo_lilguy.depth - 1;
16
}
17
else
18
{
19
    depth = obj_heart.depth + 2;
20
}
21
if (con == 0)
22
{
23
    siner += (1 * f);
24
    image_xscale = 0.5 + (sin(siner / 4) * 0.1 * f);
25
    image_yscale = 0.5 + (sin(siner / 4) * 0.1 * f);
26
    if (siner >= 30 && dontexplode == 0)
27
        con = 1;
28
}
29
if (con == 1)
30
{
31
    image_xscale -= (0.05 * f);
32
    image_yscale -= (0.05 * f);
33
    if (image_xscale <= 0 && image_yscale <= 0)
34
    {
35
        uniformangleoff = random(360);
36
        uniformanglespeed = -1 + random(2);
37
        shotamount = 20;
38
        off = 0;
39
        for (i = 0; i < shotamount; i += 1)
40
        {
41
            shot[i] = instance_create(x, y, obj_basicbullet_sneo);
42
            if (off == 0)
43
            {
44
                shot[i].destroyable = 1;
45
                shot[i].image_blend = c_yellow;
46
                off = 1;
47
            }
48
            else
49
            {
50
                off = 0;
51
            }
52
            shot[i].speed = 1 * f;
53
            shot[i].friction = -0.05 * f;
54
            if (mode == 1)
55
                shot[i].angle_speed = uniformanglespeed;
56
            if (mode == 5)
57
                shot[i].angle_speed = -2 + random(4);
58
            shot[i].image_xscale = 1.5;
59
            shot[i].image_yscale = 1.5;
60
            shot[i].sprite_index = spr_sneo_bullet_arrow;
61
        }
62
        instance_destroy();
63
    }
64
}