Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_bq_baseball_final_Other_25

(view raw script w/o annotations or w/e)
1
if (hit == -1)
2
{
3
    if (image_xscale < 6)
4
    {
5
        image_xscale += 0.1;
6
        image_yscale += 0.1;
7
    }
8
    x = (xstart - 5) + irandom(10);
9
    y = (ystart - 5) + irandom(10);
10
}
11
if (hit != 1)
12
    image_angle += 3;
13
if (hit == 1)
14
{
15
    hit_timer += 1;
16
    if (hit_timer == 1)
17
    {
18
        repeat (3)
19
        {
20
            fakesplash = instance_create((x - 20) + irandom(40), (y - 20) + irandom(40), o_boxing_splash);
21
            fakesplash.friction = -0.5;
22
            fakesplash.sprite_index = spr_boxing_splash2;
23
            if (hit_direction == -1)
24
                fakesplash.hspeed = -1 - random(2);
25
            if (hit_direction == 1)
26
                fakesplash.hspeed = 1 + random(2);
27
            fakesplash.vspeed = 1 + random(2);
28
        }
29
        xbase = x;
30
        ybase = y;
31
    }
32
    if (hit_timer > 0 && hit_timer < (40 / f))
33
    {
34
        x = (xbase + (40 / hit_timer)) - irandom(80 / hit_timer);
35
        y = (ybase + (40 / hit_timer)) - irandom(80 / hit_timer);
36
        player_basex = o_boxingcontroller.x;
37
        player_basey = o_boxingcontroller.y;
38
    }
39
    if (hit_timer > (120 / f) && hit_timer < (160 / f))
40
    {
41
        player_shake_timer++;
42
        o_boxingcontroller.x = (player_basex + (40 / player_shake_timer)) - irandom(80 / player_shake_timer);
43
        o_boxingcontroller.y = (player_basey + (40 / player_shake_timer)) - irandom(80 / player_shake_timer);
44
    }
45
    if (hit_timer == (160 / f))
46
        player_shake_timer = 0;
47
    if (hit_timer > (240 / f) && hit_timer < (280 / f))
48
    {
49
        player_shake_timer++;
50
        o_boxingcontroller.x = (player_basex + (40 / player_shake_timer)) - irandom(80 / player_shake_timer);
51
        o_boxingcontroller.y = (player_basey + (40 / player_shake_timer)) - irandom(80 / player_shake_timer);
52
    }
53
    if (hit_timer == (280 / f))
54
        instance_create(x, y + 96, obj_bq_fist_flash);
55
    if (hit_timer > (320 / f))
56
        vspeed = -64 / f;
57
    if (y < -850)
58
    {
59
        instance_destroy();
60
        instance_create(x, y, obj_bq_baseball_final_hits_boss);
61
    }
62
}
63
if (y > 20 && !instance_exists(o_bq_whitefade) && hit != 1)
64
    instance_create(x, y, o_bq_whitefade);