Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dialogue_battle_action_selected_item_Create_0

(view raw script w/o annotations or w/e)
1
global.item_use_hold = id
2
item_slot = global.item_slot[global.item_number_use]
3
game_mode = global.game_mode
4
item_category = "nothing"
5
item_type = "nothing"
6
item_number = 0
7
item_sound = snd_battle_item_eat
8
con_keep_previous = true
9
con_message_number = 1
10
if (game_mode == "customs")
11
{
12
    if (item_slot == "Hot Dog...?")
13
    {
14
        message[0] = "* You eat the " + string(item_slot)
15
        message[1] = "#* Your HP was maxed out."
16
    }
17
}
18
else if (game_mode == "yellow")
19
    script_execute(gml_Script_scr_item_use_text_yellow)
20
if (item_type == "weapon")
21
{
22
    var item_hold = global.player_weapon
23
    global.player_weapon = global.item_slot[global.item_number_use]
24
    global.item_slot[global.item_number_use] = item_hold
25
    global.player_weapon_attack = script_execute(gml_Script_scr_determine_weapon_attack)
26
    audio_play_sound(item_sound, 20, 0)
27
}
28
else if (item_type == "armor")
29
{
30
    item_hold = global.player_armor
31
    global.player_armor = global.item_slot[global.item_number_use]
32
    global.item_slot[global.item_number_use] = item_hold
33
    global.player_armor_defense = script_execute(gml_Script_scr_determine_armor_defense)
34
    audio_play_sound(item_sound, 20, 0)
35
}
36
else if (item_type == "ammo")
37
{
38
    item_hold = global.player_weapon_modifier
39
    global.player_weapon_modifier = global.item_slot[global.item_number_use]
40
    global.item_slot[global.item_number_use] = item_hold
41
    global.player_weapon_modifier_attack = script_execute(gml_Script_scr_determine_weapon_modifier_attack)
42
    audio_play_sound(item_sound, 20, 0)
43
}
44
else if (item_type == "accessory")
45
{
46
    item_hold = global.player_armor_modifier
47
    global.player_armor_modifier = global.item_slot[global.item_number_use]
48
    global.item_slot[global.item_number_use] = item_hold
49
    global.player_armor_modifier_defense = script_execute(gml_Script_scr_determine_armor_modifier_defense)
50
    audio_play_sound(item_sound, 20, 0)
51
}
52
message_current = 0
53
message_end = array_length_1d(message) - 1
54
message_draw = ""
55
increase = global.text_speed
56
characters = 0
57
hold = 0
58
message_length = string_length(message[message_current])
59
no_loop = false
60
script_execute(gml_Script_scr_generate_text_counters)