Undertale script viewer

← back to main script listing

gml_Object_obj_mettheart_2_Step_0

(view raw script w/o annotations or w/e)
1
q = 0;
2
s2 += 0.2;
3
repeat (num)
4
{
5
    greg = degtorad((q * 360) / num);
6
    if (instance_exists(kid[q]))
7
    {
8
        kid[q].x = (x + (sin(greg + s2) * sf2)) - 10;
9
        kid[q].y = (y + (cos(greg + s2) * sf2)) - 10;
10
    }
11
    q += 1;
12
}
13
if (movetype == 0)
14
{
15
    x = xstart + (sin(s / sp) * sf);
16
    y = ystart + ((sin((s / sp) * 2) * sf) / 3);
17
    if (shake == 0)
18
        s += 1;
19
    if (shake > 0)
20
    {
21
        x = (memx + random(shake * 2)) - shake;
22
        y = (memy + random(shake * 2)) - shake;
23
        shake -= 1;
24
    }
25
}
26
lightning_timer += 1;
27
if (lightning_timer > 40 && lightning_timer < 50)
28
{
29
    ddir = random(360);
30
    image_speed = 0.5;
31
}
32
if (lightning_timer == 50)
33
{
34
    image_speed = 0;
35
    i = 0;
36
    repeat (11)
37
    {
38
        lt = instance_create(x, y, obj_mettlightning_pl);
39
        if (instance_exists(lt))
40
        {
41
            lt.speed = 2;
42
            lt.friction = -0.09;
43
            lt.direction = 0 + ((i * 360) / 11) + ddir;
44
        }
45
        i += 1;
46
    }
47
}
48
if (lightning_timer == 56)
49
{
50
    image_speed = 0;
51
    i = 0;
52
    repeat (11)
53
    {
54
        lt = instance_create(x, y, obj_mettlightning_pl);
55
        if (instance_exists(lt))
56
        {
57
            lt.speed = 2;
58
            lt.friction = -0.09;
59
            lt.direction = 0 + (((i + 0.5) * 360) / 11) + ddir;
60
        }
61
        i += 1;
62
    }
63
}
64
if (lightning_timer == 62)
65
{
66
    image_speed = 0;
67
    i = 0;
68
    repeat (11)
69
    {
70
        lt = instance_create(x, y, obj_mettlightning_pl);
71
        if (instance_exists(lt))
72
        {
73
            lt.speed = 2;
74
            lt.friction = -0.09;
75
            lt.direction = 0 + ((i * 360) / 11) + ddir;
76
        }
77
        i += 1;
78
    }
79
}
80
if (lightning_timer == 94938249)
81
{
82
    image_speed = 0;
83
    i = 0;
84
    repeat (11)
85
    {
86
        lt = instance_create(x, y, obj_mettlightning_pl);
87
        if (instance_exists(lt))
88
        {
89
            lt.speed = 2;
90
            lt.friction = -0.09;
91
            lt.direction = 0 + (((i + 0.5) * 360) / 11) + ddir;
92
        }
93
        i += 1;
94
    }
95
}
96
if (lightning_timer > 100 && lightning_timer < 145)
97
{
98
    s2 -= 0.17;
99
    sf2 += 9;
100
}
101
if (lightning_timer == 145)
102
{
103
    q = 0;
104
    repeat (num)
105
    {
106
        with (kid[q])
107
            visible = true;
108
        q += 1;
109
    }
110
}
111
if (lightning_timer > 145 && lightning_timer < 300)
112
{
113
    s2 -= 0.15;
114
    sf2 -= 8;
115
    if (sf2 < 35)
116
    {
117
        sf2 = 30;
118
        lightning_timer = 40;
119
    }
120
}
121
if (movetype == 99)
122
{
123
    if (lightning_timer == 110)
124
    {
125
        i = 0;
126
        repeat (7)
127
        {
128
            bb[i] = instance_create(global.idealborder[0] + (i * 25), 100, obj_npc_marker);
129
            with (bb[i])
130
                sprite_index = spr_plusbomb;
131
            i += 1;
132
        }
133
    }
134
    if (lightning_timer > 110 && lightning_timer < 125)
135
    {
136
        i = 0;
137
        repeat (7)
138
        {
139
            with (bb[i])
140
            {
141
                if (visible == false)
142
                    visible = true;
143
                else
144
                    visible = false;
145
            }
146
            i += 1;
147
        }
148
    }
149
    if (lightning_timer == 125)
150
    {
151
        lightning_timer = 35;
152
        i = 0;
153
        fs = choose(0, 1, 2, 3, 4, 5, 6);
154
        fs0 = choose(0, 1, 2, 3, 4, 5, 6);
155
        if (fs == fs0)
156
            fs += 1;
157
        if (fs > 6)
158
            fs = 0;
159
        repeat (7)
160
        {
161
            with (bb[i])
162
                instance_destroy();
163
            br[i] = instance_create(global.idealborder[0] + (i * 25), 100, obj_plusbomb);
164
            with (br[i])
165
                friction = 0;
166
            v = choose(4, 4.5, 5);
167
            if (instance_exists(br[i]))
168
            {
169
                br[i].vspeed = v;
170
                if (i == fs)
171
                    br[i].vspeed = 6;
172
                if (i == fs0)
173
                    br[i].vspeed = 3;
174
            }
175
            i += 1;
176
        }
177
    }
178
}
179
if (lightning_timer == 95 && movetype == 99)
180
{
181
    mt = instance_create(global.idealborder[0], -20, obj_dancemett);
182
    mt.vspeed = 3;
183
    mt.type = 2;
184
    mt.early = 200;
185
    mt = instance_create(global.idealborder[1] - 25, -20, obj_dancemett);
186
    mt.vspeed = 3;
187
    mt.early = 200;
188
    mt.type = 2;
189
}
190
if (global.turntimer < 5)
191
{
192
    with (obj_mettb_body)
193
    {
194
        if (noarm == 0)
195
            event_user(2);
196
    }
197
}
198
life -= 1;