Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_debug_overworld_old_Step_1

(view raw script w/o annotations or w/e)
1
script_execute(scr_controls_debug_overworld_old)
2
if key_display
3
{
4
    if (global.debug_toggle == true)
5
        global.debug_toggle = false
6
    else
7
        global.debug_toggle = true
8
}
9
if (global.debug_toggle == true)
10
{
11
    if key_left
12
    {
13
        var i = array_length_1d(enemy) - 1
14
        if (enemy_selection_number <= 0)
15
            enemy_selection_number = i
16
        else
17
            enemy_selection_number -= 1
18
    }
19
    else if key_right
20
    {
21
        i = array_length_1d(enemy) - 1
22
        if (enemy_selection_number >= i)
23
            enemy_selection_number = 0
24
        else
25
            enemy_selection_number += 1
26
    }
27
    if key_left2
28
    {
29
        i = array_length_1d(shop) - 1
30
        if (shop_selection_number <= 0)
31
            shop_selection_number = i
32
        else
33
            shop_selection_number -= 1
34
    }
35
    else if key_right2
36
    {
37
        i = array_length_1d(shop) - 1
38
        if (shop_selection_number >= i)
39
            shop_selection_number = 0
40
        else
41
            shop_selection_number += 1
42
    }
43
    if key_select
44
    {
45
        if (enemy[enemy_selection_number] == "dalv normal")
46
        {
47
            global.route = 1
48
            global.melancholy[1] = false
49
            global.battle_enemy_name = "dalv"
50
        }
51
        else if (enemy[enemy_selection_number] == "dalv melancholy")
52
        {
53
            global.melancholy[1] = true
54
            global.battle_enemy_name = "dalv"
55
        }
56
        else if (enemy[enemy_selection_number] == "dalv genocide")
57
        {
58
            global.route = 3
59
            global.battle_enemy_name = "dalv"
60
        }
61
        else
62
            global.battle_enemy_name = enemy[enemy_selection_number]
63
        switch global.battle_enemy_name
64
        {
65
            case "froggit intro":
66
            case "flowey intro":
67
            case "decibat":
68
            case "micro froggit":
69
            case "dalv":
70
            case "martlet pacifist":
71
            case "martlet genocide":
72
            case "shufflers":
73
            case "el bailador":
74
            case "dummy training pacifist":
75
                global.exclamation_mark_type = "nothing"
76
                global.battling_enemy = false
77
                global.battling_boss = true
78
                global.battle_start = true
79
                break
80
            default:
81
                global.exclamation_mark_type = "normal"
82
                global.battling_enemy = true
83
                global.battling_boss = false
84
                global.battle_start = true
85
        }
86
87
    }
88
    if key_select2
89
    {
90
        global.shop_name = shop[shop_selection_number]
91
        switch global.shop_name
92
        {
93
            case "Honeydew Resort Normal":
94
                global.sound_carry_overworld = true
95
                instance_create(__view_get((0 << 0), 0), __view_get((1 << 0), 0), obj_overworld_shop_fade_out_screen)
96
                with (obj_frisk)
97
                {
98
                    moveable = false
99
                    event = true
100
                }
101
                break
102
            default:
103
                instance_create(__view_get((0 << 0), 0), __view_get((1 << 0), 0), obj_overworld_shop_fade_out_screen)
104
                with (obj_frisk)
105
                {
106
                    moveable = false
107
                    event = true
108
                }
109
        }
110
111
    }
112
    if key_reset
113
        game_restart()
114
    if key_fps3
115
        room_speed = 3
116
    else if key_fps30
117
        room_speed = 30
118
    else if key_fps60
119
        room_speed = 60
120
    if key_worldprevious
121
    {
122
        world_var -= 1
123
        if (world_var < 0)
124
            world_var = array_length_1d(world_room) - 1
125
    }
126
    else if key_worldnext
127
    {
128
        world_var += 1
129
        if (world_var > (array_length_1d(world_room) - 1))
130
            world_var = 0
131
    }
132
    if (key_worldprevious || key_worldnext || key_worldcurrent)
133
    {
134
        if instance_exists(obj_room_special_holder)
135
        {
136
            with (obj_room_special_holder)
137
                instance_destroy()
138
        }
139
        instance_create(0, 0, obj_room_special_holder)
140
        with (obj_room_special_holder)
141
        {
142
            player_x = obj_debug_overworld.world_x[obj_debug_overworld.world_var]
143
            player_y = obj_debug_overworld.world_y[obj_debug_overworld.world_var]
144
            player_direction = "down"
145
            next_room = obj_debug_overworld.world_room[obj_debug_overworld.world_var]
146
        }
147
        with (obj_frisk)
148
        {
149
            instance_create(__view_get((0 << 0), 0), __view_get((1 << 0), 0), obj_overworld_room_special_fade_out_screen)
150
            moveable = false
151
            event = true
152
        }
153
    }
154
}