Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_sneo_biglaser_Draw_0

(view raw script w/o annotations or w/e)
1
if (firecon == 0)
2
{
3
    image_yscale = 0.001;
4
    image_xscale = 2;
5
    if (effecttimer <= 42 && (effecttimer % 6) == 0)
6
    {
7
        if (_type == 1)
8
        {
9
            for (i = 0; i < 3; i++)
10
            {
11
                d = instance_create(x, y, obj_rouxls_power_up_orb);
12
                d.direction = irandom(120) + (i * 120);
13
                d.lifetime = 16;
14
                d.depth = depth + 1;
15
                d.image_blend = image_blend;
16
                d.parenttarget = id;
17
                d._type = _type;
18
            }
19
        }
20
        else
21
        {
22
            for (i = 0; i < 6; i++)
23
            {
24
                d = instance_create(x, y, obj_rouxls_power_up_orb);
25
                d.direction = irandom(60) + (i * 60);
26
                d.lifetime = 16;
27
                d.depth = depth + 1;
28
                d.image_blend = image_blend;
29
                d.parenttarget = id;
30
                d._type = _type;
31
            }
32
        }
33
    }
34
    if (effecttimer > 50)
35
        orbsize -= 4;
36
    else
37
        orbsize++;
38
    draw_set_color(c_white);
39
    draw_circle(x, y, max(2, (orbsize / 2) + (sin(siner / 2) * 2)), 0);
40
    effecttimer++;
41
    siner++;
42
}
43
else if (firecon == 1)
44
{
45
    active = true;
46
    mask_index = spr_sneo_laser;
47
    if (image_yscale < 0.5)
48
        image_yscale = 
scr_movetowards
scr_movetowards

function
scr_movetowards(arg0, arg1, arg2)
{ if (arg0 == arg1) return arg0; else if (arg0 > arg1) return max(arg0 - arg2, arg1); else return min(arg0 + arg2, arg1); }
(image_yscale, 0.5, 0.1);
49
    else
50
        image_yscale -= 0.05;
51
    draw_set_color(c_white);
52
    draw_circle(x, y, image_yscale * 100, 0);
53
    draw_self();
54
}
55
else if (firecon == 2)
56
{
57
    draw_set_color(c_white);
58
    active = 0;
59
    mask_index = spr_nothing;
60
    if (image_yscale <= 0.01)
61
        image_yscale -= 0.0025;
62
    else
63
        image_yscale = 
scr_movetowards
scr_movetowards

function
scr_movetowards(arg0, arg1, arg2)
{ if (arg0 == arg1) return arg0; else if (arg0 > arg1) return max(arg0 - arg2, arg1); else return min(arg0 + arg2, arg1); }
(image_yscale, 0.01, 0.1);
64
    if (image_yscale <= 0)
65
        instance_destroy();
66
    draw_circle(x, y, image_yscale * 100, 0);
67
    draw_self();
68
}