Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_berdlyb_spearblast_Draw_0

(view raw script w/o annotations or w/e)
1
if (firedShots >= bulletCount)
2
    exit;
3
if (progressLoop > (pathLifetime + 1))
4
{
5
    if (timer >= shootSpeed)
6
    {
7
        if (firedShots == 0)
8
        {
9
            var muzzleflash = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(x - 21, y, obj_berdlyb_spearblast_trail);
10
            muzzleflash.image_angle = 180;
11
            muzzleflash.depth -= 2;
12
        }
13
        d = 
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(x, y, obj_berdlyb_spearblast_bullet);
14
        d.grazepoints = grazepoints;
15
        d.childgraze = childgraze;
16
        d.direction = point_direction(x, y, path_get_x(mypath, 0.02), path_get_y(mypath, 0.02));
17
        timer = 0;
18
        d.bulletPath = mypath;
19
        if (special >= 1 && firedShots == 1)
20
            d.spawnchild = special;
21
        firedShots++;
22
    }
23
    else
24
    {
25
        timer++;
26
    }
27
    exit;
28
}
29
if (progressLoop < pathLifetime)
30
    draw_set_alpha(1);
31
else
32
    draw_set_alpha((pathLifetime + 1) - progressLoop);
33
loopStart = progressLoop;
34
if (progressLoop > 1)
35
    loopStart = 1;
36
colorProgress = 0;
37
if (progressLoop > 1)
38
{
39
    if (progressLoop > 2)
40
        colorProgress = 1;
41
    else
42
        colorProgress = progressLoop - 1;
43
}
44
i = loopStart;
45
while (i > 0)
46
{
47
    firstColor = merge_color(c_white, c_red, colorProgress);
48
    if (colorProgress < 1)
49
        colorProgress += 0.05;
50
    secondColor = merge_color(c_white, c_red, colorProgress);
51
    x1 = path_get_x(mypath, i);
52
    y1 = path_get_y(mypath, i);
53
    x2 = path_get_x(mypath, i - 0.0125);
54
    y2 = path_get_y(mypath, i - 0.0125);
55
    draw_line_color(x1, y1, x2, y2, firstColor, secondColor);
56
    i -= 0.0125;
57
}
58
if (progressLoop == (pathLifetime + 1))
59
{
60
}
61
if (progressLoop >= pathLifetime)
62
    progressLoop += fadeSpeed;
63
else
64
    progressLoop += 0.1;
65
draw_set_alpha(1);