Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_quote_battle_guardener_attack_end_Step_0

(view raw script w/o annotations or w/e)
1
script_execute(gml_Script_scr_controls_text)
2
if instance_exists(obj_quote_bubble_battle)
3
{
4
    if (draw_enabled == false)
5
        obj_quote_bubble_battle.visible = 0
6
    else
7
        obj_quote_bubble_battle.visible = 1
8
}
9
if is_array(enemy_talker)
10
{
11
    var bubble_type = obj_quote_bubble_battle_yellow_3
12
    var bubble_x = 402
13
    var bubble_y = 68
14
    switch enemy_talker[message_current]
15
    {
16
        case 0:
17
            bubble_type = obj_quote_bubble_battle_yellow_3
18
            bubble_x = 402
19
            bubble_y = 68
20
            break
21
        case 1:
22
            bubble_type = obj_quote_bubble_battle_yellow_above_larger
23
            bubble_x = obj_guardener_guy_a.x - sprite_get_width(spr_quote_bubble_battle_yellow_above) * 0.5 - 8
24
            bubble_y = obj_guardener_guy_a.bbox_top - sprite_get_height(spr_quote_bubble_battle_yellow_above)
25
            break
26
        case 2:
27
            bubble_type = obj_quote_bubble_battle_yellow_above_larger
28
            bubble_x = obj_guardener_guy_b.x - sprite_get_width(spr_quote_bubble_battle_yellow_above) * 0.5 - 8
29
            bubble_y = obj_guardener_guy_b.bbox_top - sprite_get_height(spr_quote_bubble_battle_yellow_above)
30
            break
31
    }
32
33
    if ((!instance_exists(bubble_type)) || bubble_type.x != bubble_x)
34
    {
35
        with (obj_quote_bubble_battle)
36
            instance_destroy()
37
        instance_create(bubble_x, bubble_y, bubble_type)
38
    }
39
}
40
switch global.turns_passed
41
{
42
    case 10:
43
        script_execute(gml_Script_scr_cutscene_battle_guardener_2)
44
        break
45
}
46
47
if key_revert_pressed
48
{
49
    characters = message_length
50
    message_draw = string_copy(message[message_current], 0, characters)
51
}
52
if (characters < message_length)
53
{
54
    if (counter == 0)
55
    {
56
        script_execute(gml_Script_scr_text_increase)
57
        if (enemy_talker != 0)
58
        {
59
            switch enemy_talker[message_current]
60
            {
61
                case 0:
62
                    script_execute(gml_Script_scr_talking_guardener)
63
                    break
64
                case 1:
65
                case 2:
66
                    script_execute(gml_Script_scr_talking_enemy)
67
                    break
68
            }
69
70
        }
71
        else
72
            script_execute(gml_Script_scr_talking_guardener)
73
    }
74
    else
75
        can_talk = false
76
}
77
else
78
{
79
    can_talk = false
80
    if (key_select_pressed && skippable == true)
81
    {
82
        if (message_current < message_end)
83
            message_adv = true
84
        else
85
        {
86
            with (obj_dialogue_box_battle_transformation_any)
87
                event_user(0)
88
            with (obj_quote_bubble_battle)
89
                instance_destroy()
90
            instance_destroy()
91
        }
92
    }
93
}
94
if (message_adv == true)
95
{
96
    message_current += 1
97
    message_length = string_length(message[message_current])
98
    characters = 0
99
    message_draw = ""
100
    draw_enabled = true
101
    message_adv = false
102
}
103
script_execute(gml_Script_scr_text_counter)