Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_martlet_g_head_Step_2

(view raw script w/o annotations or w/e)
1
if (!instance_exists(obj_martlet_g_body))
2
{
3
    instance_destroy()
4
    return;
5
}
6
if (obj_martlet_g_body.animating == true)
7
{
8
    if (obj_martlet_g_body.fight_mode == false)
9
        x = obj_martlet_g_body.x
10
    else
11
        x = obj_martlet_g_body.x - 10
12
    y = obj_martlet_g_body.head_displacement_y
13
}
14
else
15
{
16
    x = starting_point_x
17
    y = starting_point_y
18
}
19
if instance_exists(obj_quote_defeat_parent)
20
    var text_parent = obj_quote_defeat_parent
21
else
22
    text_parent = obj_quote_battle_martlet_parent
23
if (instance_exists(text_parent) && instance_exists(obj_quote_bubble_battle))
24
{
25
    if (sprite_index != text_parent.portrait_head[text_parent.message_current])
26
        sprite_index = text_parent.portrait_head[text_parent.message_current]
27
}
28
else
29
    sprite_index = head_sprite
30
if (instance_exists(text_parent) && instance_exists(obj_quote_bubble_battle))
31
{
32
    if (text_parent.can_talk == true)
33
    {
34
        if (can_talk_no_loop == false)
35
        {
36
            image_index = 1
37
            can_talk_no_loop = true
38
        }
39
        image_speed = global.text_speed * global.talk_speed_martlet * text_parent.hold
40
    }
41
    else
42
    {
43
        can_talk_no_loop = false
44
        image_speed = 0
45
        image_index = 0
46
    }
47
}
48
else
49
{
50
    can_talk_no_loop = false
51
    image_speed = 0
52
    image_index = 0
53
}
54
with (obj_martlet_g_head_shadow)
55
    event_user(0)