Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_train_icee_Step_0

(view raw script w/o annotations or w/e)
1
if (trigger == -4)
2
{
3
    with (obj_traintrack_switch)
4
    {
5
        if (extflag == other.extflag)
6
            other.trigger = id;
7
    }
8
}
9
with (trigger)
10
{
11
    if (pressed == 2)
12
        other.inflation += 1;
13
    else
14
        other.inflation -= 0.4;
15
}
16
inflation = clamp(inflation, 0, 100);
17
if (inflation >= 100)
18
{
19
    image_speed = 0.2;
20
    x = xstart;
21
    can_pass = true;
22
}
23
else if (inflation >= 70)
24
{
25
    image_speed = 0;
26
    x = xstart;
27
    can_pass = true;
28
}
29
else if (inflation > 0)
30
{
31
    if (inflation >= 40)
32
    {
33
        can_pass = true;
34
        if (place_meeting(x, y, obj_train_piece_parent))
35
            inflation = max(41, inflation);
36
    }
37
    else
38
    {
39
        can_pass = false;
40
    }
41
    image_speed = 0;
42
    x = xstart + (sin(current_time / 20) * 0.5) + 0.5;
43
}
44
else
45
{
46
    image_speed = 0;
47
    x = xstart;
48
    can_pass = false;
49
}
50
image_angle = ease_out_sine(inflation, -120, 120, 100);