Undertale script viewer

← back to main script listing

gml_Object_obj_reaperbird_body_Draw_0

(view raw script w/o annotations or w/e)
1
counter += 1;
2
bodycounter += 1;
3
siner += 1;
4
if (counter > 60 && counter < 80)
5
{
6
    head_index += 0.5;
7
    if (head_index >= 6)
8
        counter = 100;
9
}
10
if (counter > 130 && counter < 160)
11
{
12
    head_index -= 0.5;
13
    if (head_index < 1)
14
    {
15
        head_index = 0;
16
        counter = 160;
17
    }
18
}
19
if (counter > 200 && counter < 210)
20
{
21
    head_index = 0;
22
    headsprite = spr_reaperbird_bite;
23
    counter = 210;
24
}
25
if (counter > 210)
26
{
27
    head_index += 0.5;
28
    if (head_index > 14)
29
    {
30
        head_index = 0;
31
        counter = -30;
32
        headsprite = spr_reaperbird_head;
33
    }
34
}
35
if (bodycounter > 150)
36
{
37
    torso_index += 0.2;
38
    if (torso_index > 7)
39
    {
40
        bodycounter = 0;
41
        torso_index = 0;
42
    }
43
}
44
sx = sin(siner / 10) * 5;
45
sy = abs(cos(siner / 8) * 6);
46
draw_sprite_ext(spr_reaperbird_torso, floor(torso_index), x + 14 + sx, (y + 90 + sy) - (mstretch * 20), 2, ystretch, 0, c_white, image_alpha);
47
if (stretchup == 2)
48
{
49
    if (ystretch > 0)
50
        ystretch -= 0.1;
51
    else
52
        ystretch = 0;
53
    if (mstretch < 2)
54
        mstretch += 0.05;
55
    else
56
        mstretch = 2;
57
}
58
if (stretchup == 1)
59
{
60
    if (ystretch > 2)
61
        ystretch -= 0.2;
62
    else
63
        ystretch = 2;
64
}
65
if (stretchup == 0)
66
{
67
    if (ystretch < 4)
68
        ystretch += 0.2;
69
    else
70
        ystretch = 4;
71
}
72
draw_sprite_ext(headsprite, floor(head_index), x, y, 2, 2 - mstretch, 0, c_white, image_alpha);