Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_lantern_shrinking_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    if (r_littlesize != -1)
4
        littlesize = r_littlesize;
5
    if (r_bigsize != -1)
6
        bigsize = r_bigsize;
7
    if (r_maxtimer != -1)
8
        maxtimer = r_maxtimer;
9
    if (r_timebuffer != -1)
10
        timebuffer = r_timebuffer;
11
    nointeract = true;
12
    init = 1;
13
}
14
siner++;
15
size = ease_inout_expo(timer, littlesize, bigsize - littlesize, maxtimer + timebuffer);
16
if (!nointeract)
17
{
18
    if (con == 0 && global.interact == 0)
19
    {
20
        timer = max(timer - 1, 0);
21
        if (mytrig.myinteract == 3)
22
        {
23
            snd_play(snd_wing, 1, 1.4);
24
            mytrig.myinteract = 0;
25
            growtime = timetogrow;
26
            
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("timer", timer, maxtimer + timebuffer, growtime, 2, "in");
27
            con = 1;
28
        }
29
    }
30
    if (con == 1)
31
    {
32
        growtime--;
33
        if (growtime <= 0)
34
        {
35
            mytrig.myinteract = 0;
36
            con = 0;
37
        }
38
    }
39
}
40
if (extflag != "")
41
{
42
    var amon = false;
43
    with (obj_floorswitch)
44
    {
45
        if (extflag == other.extflag)
46
        {
47
            if (pressed)
48
                amon = true;
49
        }
50
    }
51
    if (amon)
52
        timer = clamp(round(lerp(timer, maxtimer + timebuffer + 1, 0.25)), 0, maxtimer + timebuffer);
53
    else
54
        timer--;
55
}
56
if (i_ex(myspr2))
57
    myspr2.image_alpha = ((((size + (littlesize / 6)) * 1.125) + (sin(siner / 30) * 2)) - littlesize) / (bigsize - littlesize);