Undertale script viewer

← back to main script listing

gml_Object_obj_mettheart_1_Step_0

(view raw script w/o annotations or w/e)
1
if (movetype == 0)
2
{
3
    x = xstart + (sin(s / sp) * sf);
4
    if (shake == 0)
5
        s += 1;
6
    if (shake > 0)
7
    {
8
        x = (memx + random(shake * 2)) - shake;
9
        y = (memy + random(shake * 2)) - shake;
10
        shake -= 1;
11
    }
12
}
13
lightning_timer += 1;
14
if (lightning_timer > 50 && lightning_timer < 60)
15
{
16
    ddir = random(360);
17
    image_speed = 0.5;
18
}
19
if (lightning_timer == 60)
20
{
21
    image_speed = 0;
22
    i = 0;
23
    repeat (10)
24
    {
25
        lt = instance_create(x, y, obj_mettlightning_pl);
26
        lt.speed = 2;
27
        lt.friction = -0.1;
28
        lt.direction = 0 + ((i * 360) / 10) + ddir;
29
        i += 1;
30
    }
31
}
32
if (lightning_timer == 66)
33
{
34
    image_speed = 0;
35
    i = 0;
36
    repeat (10)
37
    {
38
        lt = instance_create(x, y, obj_mettlightning_pl);
39
        lt.speed = 2;
40
        lt.friction = -0.1;
41
        lt.direction = 0 + (((i + 0.5) * 360) / 10) + ddir;
42
        i += 1;
43
    }
44
}
45
if (lightning_timer == 72)
46
{
47
    image_speed = 0;
48
    i = 0;
49
    repeat (10)
50
    {
51
        lt = instance_create(x, y, obj_mettlightning_pl);
52
        lt.speed = 2;
53
        lt.friction = -0.1;
54
        lt.direction = 0 + ((i * 360) / 10) + ddir;
55
        i += 1;
56
    }
57
}
58
if (movetype == 99)
59
{
60
    if (lightning_timer == 110)
61
    {
62
        i = 0;
63
        repeat (7)
64
        {
65
            bb[i] = instance_create(global.idealborder[0] + (i * 25), 100, obj_npc_marker);
66
            bb[i].sprite_index = spr_blackbox_pl;
67
            i += 1;
68
        }
69
    }
70
    if (lightning_timer > 110 && lightning_timer < 125)
71
    {
72
        i = 0;
73
        repeat (7)
74
        {
75
            if (bb[i].visible == false)
76
                bb[i].visible = true;
77
            else
78
                bb[i].visible = false;
79
            i += 1;
80
        }
81
    }
82
    if (lightning_timer == 125)
83
    {
84
        lightning_timer = 40;
85
        i = 0;
86
        repeat (7)
87
        {
88
            with (bb[i])
89
                instance_destroy();
90
            br[i] = instance_create(global.idealborder[0] + (i * 25), 100, obj_blackbox_pl);
91
            br[i].friction = -0.05;
92
            br[i].vspeed -= random(0.2);
93
            i += 1;
94
        }
95
    }
96
}
97
if (lightning_timer == 95)
98
{
99
    mt = instance_create(global.idealborder[0], -20, obj_mettfodder);
100
    mt.vspeed = 5;
101
    mt.type = 2;
102
    mt.early = 200;
103
    mt = instance_create(global.idealborder[1] - 25, -20, obj_mettfodder);
104
    mt.vspeed = 5;
105
    mt.early = 200;
106
    mt.type = 2;
107
}
108
if (lightning_timer == 130)
109
    lightning_timer = 36;
110
life -= 1;