Undertale script viewer

← back to main script listing

gml_Object_obj_scrollaway_event_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    con = 1;
4
    snd_play(snd_spearappear);
5
    alarm[4] = 20;
6
}
7
if (con == 1)
8
{
9
    tile_layer_shift(l2, 0, -1);
10
    tile_layer_shift(l2x, 0, -1);
11
    with (obj_mettboss_event)
12
    {
13
        obj_mainchara.y -= 1;
14
        mett.y -= 1;
15
        sixty.y -= 1;
16
    }
17
}
18
if (con == 2)
19
{
20
    remay = obj_mainchara.y;
21
    remby = obj_mettaton_actor.y;
22
    snd_play(snd_impact);
23
    con = 3;
24
    alarm[4] = 30;
25
    blastup = -6;
26
    bltotal = 0;
27
    bl = 0;
28
    ttotal = 0;
29
    ttotal2 = 0;
30
    cl = 0;
31
}
32
if (con == 4)
33
{
34
    if (cl == 0)
35
    {
36
        snd_play(snd_spearrise);
37
        cl = 1;
38
    }
39
    tspeed += 0.4;
40
    if (tspeed > 22)
41
        tspeed = 22;
42
    if (bl == 0)
43
    {
44
        blastup += 0.2;
45
        bltotal += blastup;
46
        tile_layer_shift(l2, 0, blastup);
47
        tile_layer_shift(l2x, 0, blastup);
48
        sixty.y += blastup;
49
        obj_mainchara.y += blastup;
50
        obj_mettaton_actor.y += blastup;
51
        if (blastup > 0 && bltotal >= 20)
52
            blastup = -2;
53
    }
54
    if (ttotal < 300)
55
    {
56
        ttotal += tspeed;
57
        ttotal2 += tspeed;
58
        tile_layer_shift(l1, 0, tspeed);
59
        tile_layer_shift(l3, 0, tspeed);
60
    }
61
    obj_mettboss_event.bly += tspeed;
62
    if (ttotal > 400)
63
    {
64
        ttotal -= 400;
65
        tile_layer_shift(l1, 0, -400);
66
    }
67
    instance_create(0, 0, obj_speedline);
68
}
69
if (con == 6)
70
{
71
    with (obj_speedline)
72
        instance_destroy();
73
    con = 7;
74
    tile_layer_shift(l2, 0, -bltotal + 20);
75
    tile_layer_shift(l2x, 0, -bltotal + 20);
76
    if (instance_exists(sixty))
77
        sixty.y += -bltotal + 20;
78
    tile_layer_shift(l3, 0, -ttotal2);
79
    tile_layer_shift(l1, 0, -ttotal);
80
}
81
if (con == 7)
82
    instance_destroy();