Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_healanim_Step_0

(view raw script w/o annotations or w/e)
1
t += 1;
2
if (instance_exists(target))
3
{
4
    if (t == 1)
5
    {
6
        x = target.x;
7
        y = target.y;
8
        image_xscale = target.image_xscale;
9
        image_yscale = target.image_yscale;
10
        sprite_index = target.sprite_index;
11
        sw = sprite_width;
12
        sh = sprite_height;
13
        herocheck = 0;
14
        if (target.object_index == obj_herokris)
15
            herocheck = 1;
16
        if (target.object_index == obj_herosusie)
17
            herocheck = 1;
18
        if (target.object_index == obj_heroralsei)
19
            herocheck = 1;
20
        if (herocheck == 1)
21
        {
22
            sw = target.mywidth;
23
            sh = target.myheight;
24
        }
25
        with (target)
26
            
scr_oflash
scr_oflash

function
scr_oflash()
{ _oflash = instance_create(x, y, obj_oflash); _oflash.image_xscale = image_xscale; _oflash.image_speed = 0; _oflash.image_index = image_index; _oflash.image_yscale = image_yscale; _oflash.sprite_index = sprite_index; _oflash.depth = depth - 1; _oflash.target = id; return _oflash; }
();
27
    }
28
    if (t >= 1 && t <= 5)
29
    {
30
        for (i = 0; i < 2; i += 1)
31
        {
32
            star[starcount] = instance_create(x + random(sw), y + random(sh), obj_marker);
33
            with (star[starcount])
34
            {
35
                image_angle = random(360);
36
                depth = -10;
37
                image_xscale = 2;
38
                image_yscale = 2;
39
                image_alpha = 2;
40
                image_speed = 0.25;
41
                hspeed = 2 - random(2);
42
                vspeed = -3 - random(2);
43
                friction = 0.2;
44
            }
45
            star[starcount].sprite_index = particlesprite;
46
            star[starcount].image_blend = particlecolor;
47
            starcount += 1;
48
        }
49
    }
50
    if (t >= 5 && t <= 30)
51
    {
52
        for (i = 0; i < starcount; i += 1)
53
        {
54
            with (star[i])
55
            {
56
                image_angle -= 10;
57
                image_alpha -= 0.1;
58
                if (image_alpha <= 0)
59
                    instance_destroy();
60
            }
61
        }
62
        if (t >= 30)
63
            instance_destroy();
64
    }
65
}
66
else
67
{
68
    for (i = 0; i < starcount; i += 1)
69
    {
70
        with (star[i])
71
            instance_destroy();
72
    }
73
    instance_destroy();
74
}