Undertale script viewer

← back to main script listing

gml_Object_obj_gunarm_firepattern_Step_0

(view raw script w/o annotations or w/e)
1
ks += 1;
2
king.y += sin(ks / 8) * 0.5;
3
y += tyspeed;
4
x += txspeed;
5
if (abs(txspeed) > 0)
6
    txspeed *= 0.5;
7
if (abs(txspeed) <= 1)
8
    txspeed = 0;
9
if (abs(tyspeed) > 0)
10
    tyspeed *= 0.5;
11
if (abs(tyspeed) <= 1)
12
    tyspeed = 0;
13
if (x < thisx)
14
    x += ((thisx - x) / 3);
15
if (y < thisy)
16
    y += ((thisy - y) / 3);
17
if (x > thisx)
18
    x += ((thisx - x) / 3);
19
if (y > thisy)
20
    y += ((thisy - y) / 3);
21
if (abs(x - thisx) < 2)
22
    x = thisx;
23
if (abs(x - thisy) < 2)
24
    y = thisy;
25
if (bb == 99)
26
{
27
    if (vspeed > 0 && y >= thisy)
28
    {
29
        y = thisy;
30
        x = thisx;
31
        bb = 0;
32
        gravity = 0;
33
        vspeed = 0;
34
        hspeed = 0;
35
    }
36
}
37
if (unhinge == 0)
38
{
39
    if (image_index > 0 && vspeed > -2)
40
        image_index -= 1;
41
}
42
if (home == 1)
43
    image_angle = point_direction(x, y, obj_heart.x + 8, obj_heart.y + 8) + 90;
44
if (con == 0)
45
{
46
    if (image_alpha < 1)
47
        image_alpha += 0.1;
48
    else
49
        con = 1;
50
}
51
if (h_mode == 0)
52
{
53
    if (con == 1)
54
    {
55
        ctimer += 0.5;
56
        if (ctimer >= 27.5)
57
            ctimer += 0.5;
58
        if (ctimer == 1)
59
        {
60
            l_timer = 20;
61
            home = 1;
62
            type = 1;
63
            fire = 0;
64
            maxfire = 6;
65
            alarm[5] = 20;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
66
        }
67
        if (ctimer == 28)
68
        {
69
            l_timer = 10;
70
            home = 1;
71
            type = 2;
72
            fire = 0;
73
            maxfire = 6;
74
            alarm[5] = 10;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
75
        }
76
        if (ctimer == 54)
77
        {
78
            l_timer = 8;
79
            home = 1;
80
            type = 1;
81
            fire = 0;
82
            maxfire = 5;
83
            alarm[5] = 8;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
84
        }
85
        if (ctimer == 78)
86
        {
87
            l_timer = 8;
88
            home = 1;
89
            type = 2;
90
            fire = 0;
91
            maxfire = 5;
92
            alarm[5] = 8;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
93
        }
94
        if (ctimer == 100)
95
        {
96
            l_timer = 8;
97
            home = 1;
98
            type = 1;
99
            fire = 0;
100
            maxfire = 4;
101
            alarm[5] = 8;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
102
        }
103
        if (ctimer == 122)
104
        {
105
            l_timer = 8;
106
            home = 1;
107
            type = 2;
108
            fire = 0;
109
            maxfire = 4;
110
            alarm[5] = 8;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
111
        }
112
        if (ctimer == 140)
113
        {
114
            l_timer = 6;
115
            home = 1;
116
            type = 1;
117
            fire = 0;
118
            maxfire = 4;
119
            alarm[5] = 6;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
120
        }
121
        if (ctimer == 156)
122
        {
123
            l_timer = 6;
124
            home = 1;
125
            type = 2;
126
            fire = 0;
127
            maxfire = 4;
128
            alarm[5] = 6;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
129
        }
130
        if (ctimer == 170)
131
        {
132
            l_timer = 6;
133
            home = 1;
134
            type = 1;
135
            fire = 0;
136
            maxfire = 8;
137
            alarm[5] = 6;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
138
        }
139
        if (ctimer == 190)
140
        {
141
            caster_play(sfx_p, 1, 0.55);
142
            meter = 1;
143
        }
144
        if (ctimer == 205)
145
        {
146
            home = 0;
147
            aaspeed = 45;
148
        }
149
        if (ctimer >= 205 && ctimer < 255)
150
        {
151
            image_angle += aaspeed;
152
            if (aaspeed > 0)
153
            {
154
                aaspeed -= 3;
155
            }
156
            else
157
            {
158
                aaspeed = 0;
159
                ctimer = 255;
160
            }
161
        }
162
        if (ctimer == 255)
163
            home = 1;
164
        if (ctimer == 257)
165
        {
166
            sprite_index = spr_asriel_gunarm_unhinge;
167
            image_speed = 1;
168
            unhinge = 1;
169
            home = 0;
170
        }
171
        if (ctimer == 275)
172
        {
173
            metercounter = 7;
174
            caster_play(sfx_l, 1, 1.1);
175
            blast = 1;
176
            bt = 70;
177
            btimer = 0;
178
        }
179
        if (ctimer >= 315)
180
        {
181
            with (king)
182
            {
183
                if (guncon == 5)
184
                    guncon = 7;
185
            }
186
            image_alpha -= 0.1;
187
            if (image_alpha < 0.1)
188
                instance_destroy();
189
        }
190
    }
191
}
192
if (h_mode == 1)
193
{
194
    if (con == 1)
195
    {
196
        ctimer += 0.5;
197
        if (ctimer >= 19.5)
198
            ctimer += 0.5;
199
        if (ctimer == 1)
200
        {
201
            l_timer = 20;
202
            home = 1;
203
            type = 1;
204
            fire = 0;
205
            maxfire = 6;
206
            alarm[5] = 20;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
207
        }
208
        if (ctimer == 25)
209
        {
210
            l_timer = 10;
211
            home = 1;
212
            type = choose(1, 2);
213
            fire = 0;
214
            maxfire = 6;
215
            alarm[5] = 10;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
216
        }
217
        if (ctimer == 50)
218
        {
219
            l_timer = 8;
220
            home = 1;
221
            type = choose(1, 2);
222
            fire = 0;
223
            maxfire = 5;
224
            alarm[5] = 8;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
225
        }
226
        if (ctimer == 75)
227
        {
228
            l_timer = 7;
229
            home = 1;
230
            type = 2;
231
            fire = 0;
232
            maxfire = 4;
233
            alarm[5] = 7;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
234
        }
235
        if (ctimer == 95)
236
        {
237
            l_timer = 7;
238
            home = 1;
239
            type = 1;
240
            fire = 0;
241
            maxfire = 4;
242
            alarm[5] = 7;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
243
        }
244
        if (ctimer == 115)
245
        {
246
            l_timer = 7;
247
            home = 1;
248
            type = choose(1, 2);
249
            fire = 0;
250
            maxfire = 4;
251
            alarm[5] = 7;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
252
        }
253
        if (ctimer == 132)
254
        {
255
            l_timer = 6;
256
            home = 1;
257
            type = 2;
258
            fire = 0;
259
            maxfire = 4;
260
            alarm[5] = 6;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
261
        }
262
        if (ctimer == 156)
263
        {
264
            l_timer = 6;
265
            home = 1;
266
            type = 2;
267
            fire = 0;
268
            maxfire = 4;
269
            alarm[5] = 6;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
270
        }
271
        if (ctimer == 170)
272
        {
273
            l_timer = 6;
274
            home = 1;
275
            type = 1;
276
            fire = 0;
277
            maxfire = 10;
278
            alarm[5] = 6;
gml_Object_obj_gunarm_firepattern_Alarm_5.gml

if (fire < maxfire) { event_user(0); alarm[5] = 2; } fire += 1;
279
        }
280
        if (ctimer == 200)
281
        {
282
            caster_play(sfx_p, 1, 0.55);
283
            meter = 1;
284
        }
285
        if (ctimer == 215)
286
        {
287
            home = 0;
288
            aaspeed = 90;
289
        }
290
        if (ctimer >= 215 && ctimer < 240)
291
        {
292
            image_angle += aaspeed;
293
            if (aaspeed > 0)
294
            {
295
                aaspeed -= 6;
296
            }
297
            else
298
            {
299
                aaspeed = 0;
300
                ctimer = 255;
301
            }
302
        }
303
        if (ctimer == 255)
304
            home = 1;
305
        if (ctimer == 257)
306
        {
307
            sprite_index = spr_asriel_gunarm_unhinge;
308
            image_speed = 1;
309
            unhinge = 1;
310
            home = 0;
311
        }
312
        if (ctimer == 270)
313
        {
314
            metercounter = 7;
315
            caster_play(sfx_l, 1, 1.1);
316
            blast = 1;
317
            bt = 70;
318
            btimer = 0;
319
        }
320
        if (ctimer == 272 || ctimer == 274 || ctimer == 276 || ctimer == 278 || ctimer == 280 || ctimer == 282 || ctimer == 284)
321
        {
322
            jr += 8;
323
            for (i = 0; i < 24; i += 1)
324
            {
325
                star = instance_create(x, y, obj_regstar_blt);
326
                star.h_mode = 0;
327
                star.friction = -0.1;
328
                star.speed = 8;
329
                star.direction = jr + (15 * i);
330
                star.depth = -9000;
331
            }
332
        }
333
        if (ctimer >= 310)
334
        {
335
            with (king)
336
            {
337
                if (guncon == 5)
338
                    guncon = 7;
339
            }
340
            image_alpha -= 0.1;
341
            if (image_alpha < 0.1)
342
                instance_destroy();
343
        }
344
    }
345
}