Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_chainbullet_Step_0

(view raw script w/o annotations or w/e)
1
if (!instance_exists(obj_heart))
2
    instance_destroy();
3
if (init == 1)
4
{
5
    timer++;
6
    if (timer >= firingSpeed)
7
    {
8
        timer = 0;
9
        bulletsSpawned++;
10
        d = scr_childbullet
scr_childbullet

function scr_childbullet() { var __child = instance_create(argument[0], argument[1], argument[2]); var __parent = (argument_count == 4) ? argument[3] : id; if (__parent.damage != -1) __child.damage = __parent.damage; if (__parent.grazepoints != -1) __child.grazepoints = __parent.grazepoints; if (__parent.timepoints != -1) __child.timepoints = __parent.timepoints; if (__parent.inv != -1) __child.inv = __parent.inv; if (__parent.target != -1) __child.target = __parent.target; if (__parent.grazed != -1) __child.grazed = __parent.grazed; if (__parent.grazetimer != -1) __child.grazetimer = __parent.grazetimer; __child.element = __parent.element; return __child; }
(x, y, childBullet);
11
        if (i_ex(d))
12
        {
13
            d.sprite_index = sprite_index;
14
            d.direction = direction;
15
            d.speed = childSpeed;
16
            d.gravity = childgravity;
17
            direction += shotRotation;
18
            d.image_angle = direction;
19
        }
20
        if (bulletsSpawned >= totalBullets)
21
            instance_destroy();
22
    }
23
}
24
init = 1;