Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dialogue_battle_action_selected_item_Step_0

(view raw script w/o annotations or w/e)
1
script_execute(gml_Script_scr_controls_text)
2
if key_revert_pressed
3
{
4
    characters = message_length
5
    message_draw = string_copy(message[message_current], 0, characters)
6
}
7
if (characters < message_length)
8
{
9
    if (counter == 0)
10
    {
11
        script_execute(gml_Script_scr_text_increase)
12
        script_execute(gml_Script_scr_talking_text)
13
    }
14
    else
15
        can_talk = false
16
}
17
else if (characters == message_length)
18
{
19
    can_talk = false
20
    if (message_current == (con_message_number - 1) && no_loop == false && item_category == "consumable")
21
    {
22
        alarm[0] = 20
alarm[0]

var item_slot = global.item_slot[global.item_number_use] var game_mode = global.game_mode if (game_mode == "customs") { if (item_slot == "Hot Dog...?") { global.current_hp_self += global.max_hp_self if (global.current_hp_self > global.max_hp_self) global.current_hp_self = global.max_hp_self audio_play_sound(snd_borfborf, 20, false) } } else if (game_mode == "yellow") { if (item_type == "healing") { if (global.current_hp_self <= global.max_hp_self) { global.current_hp_self += item_number if (global.current_hp_self > global.max_hp_self) global.current_hp_self = global.max_hp_self } } else if (item_type == "protection") { global.current_pp_self += item_number if (global.current_pp_self > global.max_pp_self) global.current_pp_self = global.max_pp_self } else if (item_type == "speed") { global.current_sp_self += item_number if (global.current_sp_self > global.max_sp_self) global.current_sp_self = global.max_sp_self } else if (item_type == "restore") { global.current_rp_self += item_number if (global.current_rp_self > global.max_rp_self) global.current_rp_self = global.max_rp_self instance_create(0, 0, obj_cactus_damager) } audio_play_sound(item_sound, 20, false) } message_current += 1 message_length = string_length(message[message_current]) characters = 0 message_draw = ""
23
        if (global.route == 3)
24
            alarm[0] = 1
alarm[0]

var item_slot = global.item_slot[global.item_number_use] var game_mode = global.game_mode if (game_mode == "customs") { if (item_slot == "Hot Dog...?") { global.current_hp_self += global.max_hp_self if (global.current_hp_self > global.max_hp_self) global.current_hp_self = global.max_hp_self audio_play_sound(snd_borfborf, 20, false) } } else if (game_mode == "yellow") { if (item_type == "healing") { if (global.current_hp_self <= global.max_hp_self) { global.current_hp_self += item_number if (global.current_hp_self > global.max_hp_self) global.current_hp_self = global.max_hp_self } } else if (item_type == "protection") { global.current_pp_self += item_number if (global.current_pp_self > global.max_pp_self) global.current_pp_self = global.max_pp_self } else if (item_type == "speed") { global.current_sp_self += item_number if (global.current_sp_self > global.max_sp_self) global.current_sp_self = global.max_sp_self } else if (item_type == "restore") { global.current_rp_self += item_number if (global.current_rp_self > global.max_rp_self) global.current_rp_self = global.max_rp_self instance_create(0, 0, obj_cactus_damager) } audio_play_sound(item_sound, 20, false) } message_current += 1 message_length = string_length(message[message_current]) characters = 0 message_draw = ""
25
        no_loop = true
26
    }
27
    else if key_select_pressed
28
    {
29
        var case_end = false
30
        if (message_current < message_end && (!((message_current == (con_message_number - 1) && item_category == "consumable"))))
31
        {
32
            message_current += 1
33
            message_length = string_length(message[message_current])
34
            characters = 0
35
            message_draw = ""
36
        }
37
        else if (message_current == message_end)
38
        {
39
            if (item_category == "consumable")
40
            {
41
                for (i = global.item_number_use; i < 8; i += 1)
42
                    global.item_slot[i] = global.item_slot[(i + 1)]
43
                global.item_slot[8] = "Nothing"
44
            }
45
            case_end = true
46
        }
47
        if (case_end == true)
48
        {
49
            global.no_hit_count += 1
50
            if (global.enemy_count >= 2)
51
                global.no_hit_count_2 += 1
52
            if (global.enemy_count >= 3)
53
                global.no_hit_count_3 += 1
54
            scr_determine_special_effect_enemy
scr_determine_special_effect_enemy

function scr_determine_special_effect_enemy(argument0) //gml_Script_scr_determine_special_effect_enemy { var battle_enemy_name = global.battle_enemy_name if (global.game_mode == "customs") { } else if (global.game_mode == "yellow") { switch battle_enemy_name { case "martlet pacifist": scr_enemy_mode_shift_martlet_pacifist(argument0) break case "martlet genocide": scr_enemy_mode_shift_martlet_genocide(argument0) break } } global.special_effect_end_value = argument0 }
("Item")
55
            global.important_cutscene = script_execute(gml_Script_scr_determine_important_cutscene_attacking)
56
            global.can_attack = script_execute(gml_Script_scr_determine_can_attack_attacking)
57
            if (global.important_cutscene == false && global.can_attack == true)
58
                global.enemy_attacking = true
59
            if (global.can_attack == false)
60
            {
61
                with (obj_dialogue_box_battle)
62
                    no_loop_can_attack = false
63
            }
64
            instance_destroy()
65
        }
66
    }
67
}
68
script_execute(gml_Script_scr_text_counter)