Undertale script viewer

← back to main script listing

gml_Object_obj_mettfodder_Step_0

(view raw script w/o annotations or w/e)
1
if (y > (global.idealborder[2] - early - 15) && flash == 0)
2
{
3
    flash = 1;
4
    alarm[4] = 20;
5
}
6
if (flash == 1 && early <= 20)
7
{
8
    if (vspeed > 1.5)
9
        vspeed -= 0.15;
10
}
11
if (early > 20 && y > (global.idealborder[2] - 20 - 15))
12
{
13
    if (vspeed > 1.5)
14
        vspeed -= 0.15;
15
}
16
if (flash == 2)
17
{
18
    flash = 3;
19
    alarm[4] = 30;
20
}
21
if (flash == 3)
22
{
23
    if (alarm[4] < 26)
24
        image_speed = 0.5;
25
}
26
if (flash == 4)
27
{
28
    lt = instance_create(x + 10, y + 10, obj_kissybullet_pl);
29
    lt.speed = 5;
30
    lt.direction = point_direction(lt.x, lt.y, obj_heart.x + 10, obj_heart.y + 10);
31
    flash = 5;
32
}
33
if (flash == 5)
34
{
35
    flash = 1;
36
    alarm[4] = 30;
37
    if (type == 2)
38
    {
39
        flash = 9;
40
        if (x < (room_width / 2))
41
        {
42
            gravity_direction = 180;
43
            gravity = 0.5;
44
            friction = 0.2;
45
        }
46
        if (x > (room_width / 2))
47
        {
48
            gravity_direction = 0;
49
            gravity = 0.5;
50
            friction = 0.2;
51
        }
52
    }
53
}
54
if (y > room_height)
55
    instance_destroy();
56
if (collision_rectangle(x + 2, y + 2, x + 22, y + 22, obj_heartshot, 0, 1))
57
{
58
    g = collision_rectangle(x + 2, y + 2, x + 22, y + 22, obj_heartshot, 0, 1);
59
    with (g)
60
        instance_destroy();
61
    snd_play(snd_mtt_burst);
62
    if (instance_exists(obj_ratingsmaster))
63
        global.ratings += 20;
64
    bp = instance_create(x - 20, y - 23, obj_brokenpiece);
65
    bp.sprite_index = sprite_index;
66
    bp.image_index = image_index;
67
    bp.depth = depth + 1;
68
    instance_destroy();
69
}
70
if (image_index > 16 && image_speed > 0)
71
{
72
    image_index = 0;
73
    image_speed = 0;
74
}