Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_heart_battle_menu_guardener_fake_Step_0

(view raw script w/o annotations or w/e)
1
var battle_menu_number = global.battle_menu_number
2
var battle_enemy_name = global.battle_enemy_name
3
var enemy_count = global.enemy_count
4
var game_mode = global.game_mode
5
image_blend = c_gray
6
script_execute(gml_Script_scr_controls_battle_main)
7
if key_select
8
{
9
    if (battle_menu_number == 1)
10
    {
11
        if (obj_guardener_vines_controller.vine_count[0] <= 0)
12
        {
13
            if (global.enemy_dead == false && global.enemy_spared == false)
14
                instance_create(0, 0, obj_text_battle_move_selected_enemy_fight)
15
            if (enemy_count >= 2)
16
            {
17
                if (global.enemy_dead_2 == false && global.enemy_spared_2 == false)
18
                    instance_create(0, 0, obj_text_battle_move_selected_enemy_fight_2)
19
            }
20
            if (enemy_count >= 3)
21
            {
22
                if (global.enemy_dead_3 == false && global.enemy_spared_3 == false)
23
                    instance_create(0, 0, obj_text_battle_move_selected_enemy_fight_3)
24
            }
25
            instance_create((obj_dialogue_box_battle.x + 44), (obj_dialogue_box_battle.y + 36), obj_heart_battle_menu_fight)
26
            script_execute(gml_Script_scr_battle_core_directory_hp_displacements)
27
            script_execute(gml_Script_scr_determine_can_display_enemy_hp_ui)
28
            if (enemy_count >= 1)
29
            {
30
                if (global.enemy_vulnerable == false && global.enemy_dead == false && global.enemy_spared == false)
31
                {
32
                    with (obj_battle_hp_current_enemy)
33
                        instance_destroy()
34
                    with (obj_battle_hp_max_enemy)
35
                        instance_destroy()
36
                }
37
            }
38
            if (enemy_count >= 2)
39
            {
40
                if (global.enemy_vulnerable_2 == false && global.enemy_dead_2 == false && global.enemy_spared_2 == false)
41
                {
42
                    with (obj_battle_hp_current_enemy_2)
43
                        instance_destroy()
44
                    with (obj_battle_hp_max_enemy_2)
45
                        instance_destroy()
46
                }
47
            }
48
            if (enemy_count >= 3)
49
            {
50
                if (global.enemy_vulnerable_3 == false && global.enemy_dead_3 == false && global.enemy_spared_3 == false)
51
                {
52
                    with (obj_battle_hp_current_enemy_3)
53
                        instance_destroy()
54
                    with (obj_battle_hp_max_enemy_3)
55
                        instance_destroy()
56
                }
57
            }
58
            with (obj_dialogue_battle_move_select_parent)
59
                instance_destroy()
60
            audio_play_sound(snd_battle_item_weapon_select, 20, false)
61
            image_alpha = 0
62
        }
63
        else
64
            obj_guardener_vines_controller.vine_cut[0] = true
65
    }
66
    if (battle_menu_number == 2)
67
    {
68
        if (obj_guardener_vines_controller.vine_count[1] <= 0)
69
        {
70
            if (global.enemy_dead == false && global.enemy_spared == false)
71
                instance_create(0, 0, obj_text_battle_move_selected_enemy_name)
72
            if (enemy_count >= 2)
73
            {
74
                if (global.enemy_dead_2 == false && global.enemy_spared_2 == false)
75
                    instance_create(0, 0, obj_text_battle_move_selected_enemy_name_2)
76
            }
77
            if (enemy_count >= 3)
78
            {
79
                if (global.enemy_dead_3 == false && global.enemy_spared_3 == false)
80
                    instance_create(0, 0, obj_text_battle_move_selected_enemy_name_3)
81
            }
82
            instance_create((obj_dialogue_box_battle.x + 44), (obj_dialogue_box_battle.y + 36), obj_heart_battle_menu_act)
83
            with (obj_dialogue_battle_move_select_parent)
84
                instance_destroy()
85
            audio_play_sound(snd_battle_item_weapon_select, 20, false)
86
            image_alpha = 0
87
        }
88
        else
89
            obj_guardener_vines_controller.vine_cut[1] = true
90
    }
91
    if (battle_menu_number == 3)
92
    {
93
        if (obj_guardener_vines_controller.vine_count[2] <= 0)
94
        {
95
            if (obj_item.image_index == 1)
96
            {
97
                global.item_page_count = 1
98
                global.item_number_row = 1
99
                global.item_number_column = 1
100
                if (global.item_slot[1] != "Nothing")
101
                    instance_create(0, 0, obj_text_battle_move_selected_item_1)
102
                if (global.item_slot[2] != "Nothing")
103
                    instance_create(0, 0, obj_text_battle_move_selected_item_2)
104
                if (global.item_slot[3] != "Nothing")
105
                    instance_create(0, 0, obj_text_battle_move_selected_item_3)
106
                if (global.item_slot[4] != "Nothing")
107
                    instance_create(0, 0, obj_text_battle_move_selected_item_4)
108
                instance_create(0, 0, obj_text_battle_move_selected_item_page_count)
109
                instance_create((obj_dialogue_box_battle.x + 44), (obj_dialogue_box_battle.y + 36), obj_heart_battle_menu_item)
110
                with (obj_dialogue_battle_move_select_parent)
111
                    instance_destroy()
112
                audio_play_sound(snd_battle_item_weapon_select, 20, false)
113
                image_alpha = 0
114
            }
115
            else
116
                audio_play_sound(snd_hurt, 20, false)
117
        }
118
        else
119
            obj_guardener_vines_controller.vine_cut[2] = true
120
    }
121
    if (battle_menu_number == 4)
122
    {
123
        if (obj_guardener_vines_controller.vine_count[3] <= 0)
124
        {
125
            instance_create(0, 0, obj_text_battle_move_selected_spare)
126
            if (global.enemy_fleeable == true)
127
                instance_create(0, 0, obj_text_battle_move_selected_flee)
128
            instance_create((obj_dialogue_box_battle.x + 44), (obj_dialogue_box_battle.y + 36), obj_heart_battle_menu_mercy)
129
            with (obj_dialogue_battle_move_select_parent)
130
                instance_destroy()
131
            audio_play_sound(snd_battle_item_weapon_select, 20, false)
132
            image_alpha = 0
133
        }
134
        else
135
            obj_guardener_vines_controller.vine_cut[3] = true
136
    }
137
}
138
if (key_select == 0)
139
{
140
    if (key_right && key_left == 0)
141
    {
142
        var battle_menu_number_prev = battle_menu_number
143
        var move_number = true
144
        while (move_number == true)
145
        {
146
            if (battle_menu_number == 4)
147
                global.battle_menu_number = 1
148
            else
149
                global.battle_menu_number += 1
150
            battle_menu_number = global.battle_menu_number
151
            if ((battle_menu_number == 1 && instance_exists(obj_fight)) || (battle_menu_number == 2 && instance_exists(obj_act)) || (battle_menu_number == 3 && instance_exists(obj_item)) || (battle_menu_number == 4 && instance_exists(obj_mercy)))
152
                move_number = false
153
        }
154
        if (global.battle_menu_number != battle_menu_number_prev)
155
            audio_play_sound(snd_mainmenu_select, 20, false)
156
    }
157
    if (key_left && key_right == 0)
158
    {
159
        battle_menu_number_prev = battle_menu_number
160
        move_number = true
161
        while (move_number == true)
162
        {
163
            if (battle_menu_number == 1)
164
                global.battle_menu_number = 4
165
            else
166
                global.battle_menu_number -= 1
167
            battle_menu_number = global.battle_menu_number
168
            if ((battle_menu_number == 1 && instance_exists(obj_fight)) || (battle_menu_number == 2 && instance_exists(obj_act)) || (battle_menu_number == 3 && instance_exists(obj_item)) || (battle_menu_number == 4 && instance_exists(obj_mercy)))
169
                move_number = false
170
        }
171
        if (global.battle_menu_number != battle_menu_number_prev)
172
            audio_play_sound(snd_mainmenu_select, 20, false)
173
    }
174
}
175
battle_menu_number = global.battle_menu_number
176
if (battle_menu_number == 1)
177
{
178
    x = obj_fight.x + 17
179
    y = obj_fight.y + 23
180
}
181
else if (battle_menu_number == 2)
182
{
183
    x = obj_act.x + 17
184
    y = obj_act.y + 23
185
}
186
else if (battle_menu_number == 3)
187
{
188
    x = obj_item.x + 17
189
    y = obj_item.y + 23
190
}
191
else if (battle_menu_number == 4)
192
{
193
    x = obj_mercy.x + 17
194
    y = obj_mercy.y + 23
195
}
196
if (no_loop_determine_sparing == false)
197
{
198
    script_execute(gml_Script_scr_determine_low_hp_enemy_sparing)
199
    no_loop_determine_sparing = true
200
}
201
if (image_alpha == 1 && no_loop == false)
202
{
203
    script_execute(gml_Script_scr_battle_core_directory_flavor_text_recreation)
204
    no_loop = true
205
}