Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_curvevar_Step_0

(view raw script w/o annotations or w/e)
1
var t = time / maxtime;
2
var func = lerp;
3
if (iscolor)
4
    func = merge_color;
5
if (i_ex(target))
6
{
7
    if (init == 0)
8
    {
9
        if (is_string(pointa))
10
            pointa = variable_instance_get(target, varname);
11
        channel = animcurve_get_channel(animcurve, channelname);
12
        init = 1;
13
    }
14
    var cont = 1;
15
    if (respectglobalinteract == true)
16
    {
17
        if (global.interact != 0)
18
            cont = 0;
19
    }
20
    if (cont)
21
        time++;
22
    variable_instance_set(target, varname, func(pointa, pointb, animcurve_channel_evaluate(channel, time / maxtime)));
23
    if (time >= maxtime)
24
    {
25
        if (loop && loopcount != 0)
26
        {
27
            if (loopcount > 0)
28
                loop--;
29
            time -= maxtime;
30
        }
31
        else
32
        {
33
            instance_destroy();
34
        }
35
    }
36
}
37
else
38
{
39
    instance_destroy();
40
}