Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_susiezilla_laser_building_Draw_0

(view raw script w/o annotations or w/e)
1
if (con == 3)
2
{
3
    despawn_timer++;
4
    if (despawn_timer == 5)
5
    {
6
        var fx;
7
        if (image_xscale > 0)
8
            fx = instance_create(x - 16, y - 32, obj_susiezilla_multiexplosion);
9
        else
10
            fx = instance_create(x - 96, y - 32, obj_susiezilla_multiexplosion);
11
        fx.depth = depth - 11;
12
    }
13
    if (despawn_timer >= 5)
14
    {
15
        image_alpha = 1 - image_alpha;
16
        if (despawn_timer >= 20)
17
        {
18
            image_alpha = 0;
19
            instance_destroy();
20
            if (image_xscale > 0)
21
                collectible = instance_create(x + 40, y + 40, obj_susiezilla_collectible);
22
            else
23
                collectible = instance_create(x - 40, y + 40, obj_susiezilla_collectible);
24
            collectible.depth = depth - 100;
25
            collectible.itemtype = 4;
26
            with (collectible)
27
                event_user(0);
28
        }
29
    }
30
}
31
draw_self_offset(0, -height);
32
if (con > 0)
33
{
34
    if (eyetimer < 10)
35
        eyetimer++;
36
    if (con == 1)
37
        draw_sprite_ext(sprite_index, 1, x, y, image_xscale, image_yscale, 0, c_white, (eyetimer / 10) * image_alpha);
38
    if (con >= 2)
39
        draw_sprite_ext(sprite_index, 1, x, y, image_xscale, image_yscale, 0, c_white, (eyetimer / 10) * image_alpha);
40
}
41
if (eyeflashtimer > 0 && con != 3)
42
{
43
    eyeflashtimer--;
44
    if (eyeflashtimer == 1 || eyeflashtimer == 2 || eyeflashtimer == 5 || eyeflashtimer == 6 || eyeflashtimer == 9 || eyeflashtimer == 10)
45
        draw_sprite_ext(sprite_index, 2, x, y, image_xscale, image_yscale, 0, c_white, 1);
46
}