Undertale script viewer

← back to main script listing

gml_Object_obj_mettheart_3_Step_0

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