Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_insomnitot_face_a_Step_2

(view raw script w/o annotations or w/e)
1
if (obj_insomnitot_body_a.animating == true)
2
{
3
    x = obj_insomnitot_body_a.x + x_offset
4
    y = obj_insomnitot_body_a.face_displacement_y
5
}
6
else
7
{
8
    x = starting_point_x
9
    y = starting_point_y
10
}
11
if (obj_insomnitot_body_a.state != "awake" || sleep == false)
12
{
13
    blink_state = "nothing"
14
    if (sprite_index == spr_insomnitot_face_blinking)
15
    {
16
        sprite_index = spr_insomnitot_face
17
        image_index = 0
18
    }
19
    else if (sprite_index == spr_insomnitot_face_critical_blinking)
20
    {
21
        sprite_index = spr_insomnitot_face_critical
22
        image_index = 0
23
    }
24
}
25
if (sleep == false)
26
{
27
    image_speed = 0
28
    image_index = 0
29
}
30
else if (obj_insomnitot_body_a.state == "asleep")
31
{
32
    image_speed = 0
33
    image_index = 4
34
}
35
else if (obj_insomnitot_body_a.state == "waking")
36
{
37
    image_speed = 0
38
    image_index = 4 - (ceil(obj_insomnitot_body_a.time_elapsed / (obj_insomnitot_body_a.time_max / 2) * 4))
39
}
40
else if (obj_insomnitot_body_a.state == "awake")
41
{
42
    if (blink_state == "nothing")
43
    {
44
        image_speed = 0.5
45
        blink_state = "blinking"
46
        if (sprite_index == spr_insomnitot_face)
47
        {
48
            sprite_index = spr_insomnitot_face_blinking
49
            image_index = 0
50
        }
51
        else if (sprite_index == spr_insomnitot_face_critical)
52
        {
53
            sprite_index = spr_insomnitot_face_critical_blinking
54
            image_index = 0
55
        }
56
    }
57
}
58
else if (obj_insomnitot_body_a.state == "sleep")
59
{
60
    image_speed = 0
61
    image_index = ceil((obj_insomnitot_body_a.time_elapsed - obj_insomnitot_body_a.time_max / 2) / (obj_insomnitot_body_a.time_max / 2) * 4)
62
}