Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_overworld_darkness_bullet_maker_Step_0

(view raw script w/o annotations or w/e)
1
timer--;
2
if (timer <= 0)
3
{
4
    if (spreader)
5
    {
6
        var _xoff = -20;
7
        repeat (floor(sprite_width / 40))
8
        {
9
            d = instance_create(bbox_left + _xoff, y, obj_darkness_bullet);
10
            d.direction = 270;
11
            d.damage = 18;
12
            d.speed = 2;
13
            d.friction = -0.2;
14
            d.lightBullet = choose(true, false);
15
            _xoff += 40;
16
        }
17
        timer = 30;
18
    }
19
    else
20
    {
21
        var _spawnDir = direction;
22
        repeat (2)
23
        {
24
            d = instance_create(x, y, obj_darkness_bullet);
25
            d.direction = _spawnDir;
26
            d.damage = 18;
27
            d.speed = 5;
28
            if (light_mode != double_flip)
29
                d.lightBullet = true;
30
            _spawnDir -= 180;
31
        }
32
        if (double_mode)
33
            double_flip = !double_flip;
34
        timer = 4;
35
        direction += (light_mode ? 10 : -10);
36
    }
37
}
38
if (keyboard_check_pressed(ord("V")))
39
{
40
    if (keyboard_check_direct(vk_lshift))
41
    {
42
        double_mode = !double_mode;
43
        double_flip = false;
44
    }
45
    else
46
    {
47
        light_mode = !light_mode;
48
    }
49
}