Deltarune script viewer

← back to main script listing

gml_Object_obj_checkers_leap_Step_0

(view raw script w/o annotations or w/e)
1
if (leapmode == 0)
2
{
3
    if (jumpcon == 1)
4
    {
5
        if (vspeed >= 0)
6
        {
7
            if (y >= (obj_growtangle.y + obj_growtangle.sprite_height / 2 - sprite_height))
8
            {
9
                snd_play(snd_impact)
10
                instance_create(0, 0, obj_shake)
11
                y = obj_growtangle.y + obj_growtangle.sprite_height / 2 - sprite_height
12
                jumptimer = 0
13
                vspeed = 0
14
                gravity = 0
15
                hspeed = 0
16
                sprite_index = spr_checkers_crouch
17
                jumpcon = 0
18
            }
19
        }
20
    }
21
    if (jumpcon == 3)
22
    {
23
        if (vspeed >= 0)
24
        {
25
            if (y >= (floory - 2))
26
            {
27
                snd_play(snd_impact)
28
                instance_create(0, 0, obj_shake)
29
                y = floory
30
                x = xstart
31
                vspeed = 0
32
                gravity = 0
33
                hspeed = 0
34
                sprite_index = spr_checkers_crouch
35
                jumpcon = 4
36
            }
37
        }
38
    }
39
    if (jumpcon == 0)
40
    {
41
        sprite_index = spr_checkers_crouch
42
        jumptimer += 1
43
        jumpmax = 20
44
        if (amt >= 1)
45
            jumpmax = 10
46
        if (jumptimer >= jumpmax)
47
        {
48
            snd_play(snd_jump)
49
            floory = y
50
            jumptimer = 0
51
            jumpcon = 1
52
            amt += 1
53
            sprite_index = spr_checkers_leap
54
            targetx = obj_heart.x + 8 - sprite_width / 2
55
            vspeed = -15
56
            if (amt == 1)
57
                vspeed = -17
58
            gravity = 1
59
            hspeed = (targetx - x) / 28
60
            if (amt >= 4)
61
            {
62
                active = 0
63
                jumpcon = 3
64
                targetx = xstart
65
                gravity = 2
66
                hspeed = (targetx - x) / 16
67
            }
68
        }
69
    }
70
    if (jumpcon == 4)
71
    {
72
        jumptimer += 1
73
        if (jumptimer >= 10)
74
        {
75
            global.turntimer = -1
76
            with (obj_checkers_enemy)
77
                visible = 1
78
            instance_destroy()
79
        }
80
    }
81
}
82
if (leapmode == 1)
83
{
84
    if (jumpcon == 7)
85
    {
86
        jumptimer += 1
87
        if (jumptimer >= 10)
88
        {
89
            with (obj_regularbullet)
90
            {
91
                active = 0
92
                image_alpha -= 0.1
93
            }
94
        }
95
        if (jumptimer >= 20)
96
        {
97
            global.turntimer = -1
98
            with (obj_checkers_enemy)
99
                visible = 1
100
            instance_destroy()
101
        }
102
    }
103
    if (jumpcon == 6)
104
    {
105
        if (y >= (floory - 2))
106
        {
107
            y = floory
108
            x = xstart
109
            vspeed = 0
110
            gravity = 0
111
            hspeed = 0
112
            sprite_index = spr_checkers_crouch
113
            jumpcon = 7
114
        }
115
    }
116
    if (jumpcon == 0)
117
    {
118
        sprite_index = spr_checkers_crouch
119
        jumptimer += 1
120
        if (jumptimer >= 20)
121
        {
122
            floory = y
123
            jumptimer = 0
124
            jumpcon = 1
125
            sprite_index = spr_checkers_leap
126
            targetx = obj_heart.x + 8 - sprite_width / 2
127
            hspeed = (targetx - x) / 17
128
            vspeed = -17
129
            snd_play(snd_jump)
130
            gravity = 1
131
            amt += 1
132
            if (amt >= 3)
133
            {
134
                active = 0
135
                jumpcon = 6
136
                targetx = xstart
137
                gravity = 2
138
                hspeed = (targetx - x) / 16
139
            }
140
        }
141
    }
142
    if (jumpcon == 1)
143
    {
144
        if (vspeed >= 0)
145
        {
146
            gravity = 0
147
            vspeed = 0
148
            hspeed = 0
149
            jumpcon = 2
150
            snd_play(snd_boost)
151
        }
152
    }
153
    if (jumpcon == 2)
154
    {
155
        image_speed = 0.25
156
        jumptimer += 1
157
        if (jumptimer >= 15)
158
        {
159
            snd_play(snd_ultraswing)
160
            image_speed = 0
161
            image_index = 0
162
            vspeed = 32
163
            jumpcon = 3
164
            jumptimer = 0
165
        }
166
    }
167
    if (jumpcon == 3)
168
    {
169
        a = scr_afterimage
scr_afterimage

function scr_afterimage() //gml_Script_scr_afterimage { afterimage = instance_create(x, y, obj_afterimage) afterimage.sprite_index = sprite_index afterimage.image_index = image_index afterimage.image_blend = image_blend afterimage.image_speed = 0 afterimage.depth = depth afterimage.image_xscale = image_xscale afterimage.image_yscale = image_yscale afterimage.image_angle = image_angle return afterimage; }
()
170
        a.image_alpha = 0.7
171
        if (y >= (obj_growtangle.y + obj_growtangle.sprite_height / 2 - sprite_height))
172
        {
173
            shrapmax = 6
174
            snd_play(snd_impact)
175
            instance_create(0, 0, obj_shake)
176
            for (i = 0; i < shrapmax; i += 1)
177
            {
178
                shrap = instance_create((x + sprite_width / 2 - 15 + i * 5), (obj_growtangle.y + obj_growtangle.sprite_height / 2), obj_regularbullet)
179
                shrap.image_xscale = 1.5
180
                shrap.image_yscale = 1.5
181
                shrap.direction = 130 - random(10) - 70 * (i / (shrapmax - 1))
182
                shrap.sprite_index = spr_checkershrapnel
183
                shrap.speed = 6 + random(1)
184
                shrap.gravity = 0.25
185
                shrap.target = target
186
                shrap.damage = damage
187
            }
188
            y = obj_growtangle.y + obj_growtangle.sprite_height / 2 - sprite_height
189
            vspeed = 0
190
            gravity = 0
191
            hspeed = 0
192
            sprite_index = spr_checkers_crouch
193
            jumpcon = 0
194
        }
195
    }
196
}
197
if (leapmode == 2)
198
{
199
    if (jumpcon == 0)
200
    {
201
        sprite_index = spr_checkers_magnificent
202
        image_speed = 0.5
203
        jumpcon = 1
204
        magamt = 0
205
    }
206
    if (jumpcon == 1)
207
    {
208
        if (image_index == 2)
209
            snd_play(snd_ultraswing)
210
        if (image_index >= 4)
211
        {
212
            image_index = 4
213
            image_speed = 0
214
            hspeed = -4
215
            gravity = -0.12
216
            jumpcon = 2
217
            siner = 0
218
        }
219
    }
220
    if (jumpcon == 2)
221
    {
222
        siner += 1
223
        y += ((sin(siner / 3)) * 4)
224
        s_timer += 1
225
        if (s_timer == 20)
226
            snd_play(snd_magicsprinkle)
227
        if (s_timer >= 24)
228
        {
229
            bul = instance_create((x + (random(sprite_width / 2))), (y + sprite_height - 50), obj_regularbullet)
230
            bul.sprite_index = spr_checkershrapnel
231
            bul.vspeed = 3
232
            bul.image_xscale = 1.5
233
            bul.image_yscale = 1.5
234
            bul.depth = depth + 1
235
            bul.gravity_direction = 135 + random(180)
236
            bul.gravity = 0.06
237
            bul.target = target
238
            bul.damage = damage
239
            if (magamt == 6 || magamt == 12)
240
            {
241
                with (bul)
242
                {
243
                    gravity = 0
244
                    move_towards_point((obj_heart.x + 8), (obj_heart.y + 8), 3)
245
                }
246
            }
247
            s_timer = 21
248
            magamt += 1
249
        }
250
        if (y < ((__view_get((1 << 0), 0)) - 200))
251
        {
252
            speed = 0
253
            gravity = 0
254
            y = ystart - 100
255
            x = xstart + 300
256
            hspeed = -30
257
            vspeed = 10
258
            jumpcon = 3
259
        }
260
    }
261
    if (jumpcon == 3)
262
    {
263
        magamt = 0
264
        jumptimer += 1
265
        if (jumptimer >= 10)
266
        {
267
            snd_play(snd_impact)
268
            instance_create(0, 0, obj_shake)
269
            amt += 1
270
            s_timer = 0
271
            x = xstart
272
            y = ystart
273
            hspeed = 0
274
            vspeed = 0
275
            jumpcon = 0
276
            jumpcon = 4
277
            jumptimer = 0
278
            sprite_index = spr_checkers_idle
279
            image_index = 0
280
            image_speed = 0
281
        }
282
    }
283
    if (jumpcon == 4)
284
    {
285
        jumptimer += 1
286
        if (jumptimer >= 20)
287
        {
288
            with (obj_regularbullet)
289
            {
290
                active = 0
291
                image_alpha -= 0.1
292
            }
293
        }
294
        if (jumptimer >= 30)
295
        {
296
            global.turntimer = -1
297
            instance_destroy()
298
            with (obj_checkers_enemy)
299
                visible = 1
300
        }
301
    }
302
}
303
if (leapmode == 3)
304
{
305
    with (obj_regularbullet)
306
    {
307
        image_xscale += 0.01
308
        image_yscale += 0.01
309
    }
310
    if (jumpcon == 0)
311
    {
312
        sprite_index = spr_checkers_leg
313
        image_index = 0
314
        image_speed = 0.5
315
        jumpcon = 1
316
    }
317
    if (jumpcon == 1)
318
    {
319
        if (image_index == 3)
320
        {
321
            snd_play(snd_swing)
322
            snd_play(snd_magicsprinkle)
323
            for (i = 0; i < 4; i += 1)
324
            {
325
                bul = instance_create((x - 40), (y + 100), obj_regularbullet)
326
                bul.sprite_index = spr_checkershrapnel
327
                bul.direction = (point_direction(bul.x, bul.y, (obj_heart.x + 8), (obj_heart.y + 8))) - 10 * i + (random(i * 20))
328
                bul.speed = 3.5 + random(1.8)
329
                bul.target = target
330
                bul.damage = damage
331
            }
332
        }
333
        if (image_index >= 5)
334
        {
335
            image_index = 5
336
            image_speed = 0
337
            jumpcon = 2
338
        }
339
    }
340
    if (jumpcon == 2)
341
    {
342
        jumptimer += 1
343
        if (jumptimer >= 10)
344
        {
345
            sprite_index = spr_checkers_idle
346
            image_index = 0
347
        }
348
        if (jumptimer >= 20)
349
        {
350
            jumptimer = 0
351
            jumpcon = 0
352
            amt += 1
353
            if (amt >= 4)
354
            {
355
                jumpcon = 3
356
                jumptimer = 0
357
            }
358
        }
359
    }
360
    if (jumpcon == 3)
361
    {
362
        jumptimer += 1
363
        if (jumptimer >= 20)
364
        {
365
            with (obj_regularbullet)
366
            {
367
                image_alpha -= 0.1
368
                active = 0
369
            }
370
        }
371
        if (jumptimer >= 30)
372
        {
373
            global.turntimer = -1
374
            instance_destroy()
375
            with (obj_checkers_enemy)
376
                visible = 1
377
        }
378
    }
379
}
380
if (leapmode == 4)
381
{
382
    if (jumpcon == 1)
383
    {
384
        if (y >= (floory - 2))
385
        {
386
            y = floory
387
            vspeed = 0
388
            gravity = 0
389
            hspeed = 0
390
            sprite_index = spr_checkers_crouch
391
            jumpcon = 0
392
            jumptimer = 10
393
        }
394
    }
395
    if (jumpcon == 3)
396
    {
397
        if (y >= (floory - 2))
398
        {
399
            y = floory
400
            x = xstart
401
            vspeed = 0
402
            gravity = 0
403
            hspeed = 0
404
            sprite_index = spr_checkers_crouch
405
            jumpcon = 4
406
        }
407
    }
408
    if (jumpcon == 0)
409
    {
410
        jumptimer += 1
411
        if (jumptimer >= 16)
412
        {
413
            floory = y
414
            jumptimer = 0
415
            jumpcon = 1
416
            sprite_index = spr_checkers_leap
417
            targetx = obj_heart.x + 8 - sprite_width / 2
418
            vspeed = -12
419
            gravity = 1
420
            hspeed = (targetx - x) / 24
421
            amt += 1
422
            if (amt >= 4)
423
            {
424
                active = 0
425
                jumpcon = 3
426
                jumptimer = 0
427
                targetx = xstart
428
                gravity = 2
429
                hspeed = (targetx - x) / 12
430
            }
431
        }
432
    }
433
    if (jumpcon == 4)
434
    {
435
        jumptimer += 1
436
        if (jumptimer >= 10)
437
        {
438
            global.turntimer = -1
439
            with (obj_checkers_enemy)
440
                visible = 1
441
            instance_destroy()
442
        }
443
    }
444
}
445
if (grazed == 1)
446
{
447
    grazetimer += 1
448
    if (grazetimer >= 10)
449
    {
450
        grazetimer = 0
451
        grazed = 0
452
    }
453
}