Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_debug_overworld_Step_1

(view raw script w/o annotations or w/e)
1
script_execute(gml_Script_scr_controls_debug_overworld)
2
if key_debug
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_slow || key_slow_right || (!key_fast_left))
12
    {
13
        key_fast_left = 0
14
        key_fast_ct_left = 0
15
    }
16
    if (key_slow || key_slow_left || (!key_fast_right))
17
    {
18
        key_fast_right = 0
19
        key_fast_ct_right = 0
20
    }
21
    if key_fast_left
22
    {
23
        key_fast_ct_left += 1
24
        if (key_fast_ct_left < key_fast_ct_limit)
25
            key_fast_left = 0
26
        else
27
            key_fast_ct_left = key_fast_ct_limit
28
    }
29
    if key_fast_right
30
    {
31
        key_fast_ct_right += 1
32
        if (key_fast_ct_right < key_fast_ct_limit)
33
            key_fast_right = 0
34
        else
35
            key_fast_ct_right = key_fast_ct_limit
36
    }
37
    if key_reset
38
        game_restart()
39
    if key_fps3
40
        room_speed = 3
41
    else if key_fps30
42
        room_speed = 30
43
    else if key_fps60
44
        room_speed = 60
45
    if (seldepth_main == 0)
46
    {
47
        var key_vert = key_down - key_up
48
        selnum_main += key_vert
49
        if (selnum_main > selmax_main)
50
            selnum_main = 0
51
        if (selnum_main < 0)
52
            selnum_main = selmax_main
53
        if key_select
54
        {
55
            if (selnum_main == 6)
56
                game_restart()
57
            else
58
            {
59
                event_user(0)
60
                seldepth_main += 1
61
            }
62
        }
63
    }
64
    else if (seldepth_main == 1)
65
    {
66
        if (selnum_main == 0)
67
        {
68
            key_vert = key_down - key_up
69
            selnumh_world += key_vert
70
            var array_max = array_length_1d(selnuml_world) - 1
71
            if (selnumh_world > array_max)
72
                selnumh_world = 0
73
            if (selnumh_world < 0)
74
                selnumh_world = array_max
75
            var key_hor = sign(key_right - key_left + (key_fast_right - key_fast_left))
76
            selnuml_world[selnumh_world] += key_hor
77
            array_max = (array_length_2d(world_room, selnumh_world)) - 1
78
            if (selnuml_world[selnumh_world] > array_max)
79
                selnuml_world[selnumh_world] = 0
80
            if (selnuml_world[selnumh_world] < 0)
81
                selnuml_world[selnumh_world] = array_max
82
            if key_select
83
            {
84
                if instance_exists(obj_room_special_holder)
85
                {
86
                    with (obj_room_special_holder)
87
                        instance_destroy()
88
                }
89
                instance_create(0, 0, obj_room_special_holder)
90
                with (obj_room_special_holder)
91
                {
92
                    var h = obj_debug_overworld.selnumh_world
93
                    var l = obj_debug_overworld.selnuml_world[h]
94
                    player_x = obj_debug_overworld.world_x[h][l]
95
                    player_y = obj_debug_overworld.world_y[h][l]
96
                    player_direction = "down"
97
                    next_room = obj_debug_overworld.world_room[h][l]
98
                }
99
                with (obj_frisk)
100
                {
101
                    instance_create(__view_get((0 << 0), 0), __view_get((1 << 0), 0), obj_overworld_room_special_fade_out_screen)
102
                    moveable = false
103
                    event = true
104
                }
105
            }
106
            else if key_revert
107
                seldepth_main -= 1
108
        }
109
        else if (selnum_main == 1)
110
        {
111
            key_vert = key_down - key_up
112
            selnumh_enemy += key_vert
113
            array_max = array_length_1d(selnuml_enemy) - 1
114
            if (selnumh_enemy > array_max)
115
                selnumh_enemy = 0
116
            if (selnumh_enemy < 0)
117
                selnumh_enemy = array_max
118
            key_hor = sign(key_right - key_left + (key_fast_right - key_fast_left))
119
            selnuml_enemy[selnumh_enemy] += key_hor
120
            array_max = (array_length_2d(enemy, selnumh_enemy)) - 1
121
            if (selnuml_enemy[selnumh_enemy] > array_max)
122
                selnuml_enemy[selnumh_enemy] = 0
123
            if (selnuml_enemy[selnumh_enemy] < 0)
124
                selnuml_enemy[selnumh_enemy] = array_max
125
            if key_select
126
            {
127
                var selection_enemy = enemy[selnumh_enemy][selnuml_enemy[selnumh_enemy]]
128
                if (selection_enemy == "dalv normal")
129
                {
130
                    global.route = 1
131
                    global.melancholy[1] = false
132
                    global.battle_enemy_name = "dalv"
133
                }
134
                else if (selection_enemy == "dalv melancholy")
135
                {
136
                    global.melancholy[1] = true
137
                    global.battle_enemy_name = "dalv"
138
                }
139
                else if (selection_enemy == "dalv genocide")
140
                {
141
                    global.route = 3
142
                    global.battle_enemy_name = "dalv"
143
                }
144
                else
145
                    global.battle_enemy_name = selection_enemy
146
                switch global.battle_enemy_name
147
                {
148
                    case "froggit intro":
149
                    case "flowey intro":
150
                    case "decibat":
151
                    case "micro froggit":
152
                    case "dalv":
153
                    case "martlet pacifist":
154
                    case "martlet genocide":
155
                    case "shufflers":
156
                    case "el bailador":
157
                    case "dummy training pacifist":
158
                        global.exclamation_mark_type = "nothing"
159
                        global.battling_enemy = false
160
                        global.battling_boss = true
161
                        global.battle_start = true
162
                        break
163
                    default:
164
                        global.exclamation_mark_type = "normal"
165
                        global.battling_enemy = true
166
                        global.battling_boss = false
167
                        global.battle_start = true
168
                }
169
170
            }
171
            else if key_revert
172
                seldepth_main -= 1
173
        }
174
        else if (selnum_main == 2)
175
        {
176
            key_vert = key_down - key_up
177
            selnumh_shop += key_vert
178
            array_max = array_length_1d(selnuml_shop) - 1
179
            if (selnumh_shop > array_max)
180
                selnumh_shop = 0
181
            if (selnumh_shop < 0)
182
                selnumh_shop = array_max
183
            key_hor = sign(key_right - key_left + (key_fast_right - key_fast_left))
184
            selnuml_shop[selnumh_shop] += key_hor
185
            array_max = (array_length_2d(shop, selnumh_shop)) - 1
186
            if (selnuml_shop[selnumh_shop] > array_max)
187
                selnuml_shop[selnumh_shop] = 0
188
            if (selnuml_shop[selnumh_shop] < 0)
189
                selnuml_shop[selnumh_shop] = array_max
190
            if key_select
191
            {
192
                global.shop_name = shop[selnumh_shop][selnuml_shop[selnumh_shop]]
193
                switch global.shop_name
194
                {
195
                    case "Honeydew Resort Normal":
196
                        global.sound_carry_overworld = true
197
                        break
198
                }
199
200
                instance_create(__view_get((0 << 0), 0), __view_get((1 << 0), 0), obj_overworld_shop_fade_out_screen)
201
                with (obj_frisk)
202
                {
203
                    moveable = false
204
                    event = true
205
                }
206
            }
207
            else if key_revert
208
                seldepth_main -= 1
209
        }
210
        else if (selnum_main == 3)
211
        {
212
            key_vert = key_down - key_up
213
            selnumh_item += key_vert
214
            array_max = array_length_1d(selnuml_item) - 1
215
            if (selnumh_item > array_max)
216
                selnumh_item = 0
217
            if (selnumh_item < 0)
218
                selnumh_item = array_max
219
            key_hor = sign(key_right - key_left + (key_fast_right - key_fast_left))
220
            selnuml_item[selnumh_item] += key_hor
221
            array_max = (array_length_2d(item, selnumh_item)) - 1
222
            if (selnuml_item[selnumh_item] > array_max)
223
                selnuml_item[selnumh_item] = 0
224
            if (selnuml_item[selnumh_item] < 0)
225
                selnuml_item[selnumh_item] = array_max
226
            if key_select
227
            {
228
                global.item_hold_take = item[selnumh_item][selnuml_item[selnumh_item]]
229
                script_execute(scr_item_take_check)
230
                if (can_take == true)
231
                    audio_play_sound(snd_shop_purchase, 20, false)
232
                else
233
                    audio_play_sound(snd_hurt, 20, false)
234
            }
235
            else if key_revert
236
                seldepth_main -= 1
237
        }
238
        else if (selnum_main == 4)
239
        {
240
            key_vert = key_down - key_up
241
            selnumh_equip += key_vert
242
            array_max = array_length_1d(selnuml_equip) - 1
243
            if (selnumh_equip > array_max)
244
                selnumh_equip = 0
245
            if (selnumh_equip < 0)
246
                selnumh_equip = array_max
247
            key_hor = sign(key_right - key_left + (key_fast_right - key_fast_left))
248
            selnuml_equip[selnumh_equip] += key_hor
249
            array_max = (array_length_2d(item, (selnumh_equip + equip_disjoint))) - 1
250
            if (selnuml_equip[selnumh_equip] > array_max)
251
                selnuml_equip[selnumh_equip] = 0
252
            if (selnuml_equip[selnumh_equip] < 0)
253
                selnuml_equip[selnumh_equip] = array_max
254
            if key_select
255
            {
256
                if (selnumh_equip == 0)
257
                {
258
                    global.player_weapon = item[(selnumh_equip + equip_disjoint)][selnuml_equip[selnumh_equip]]
259
                    global.player_weapon_attack = script_execute(gml_Script_scr_determine_weapon_attack)
260
                }
261
                else if (selnumh_equip == 1)
262
                {
263
                    global.player_armor = item[(selnumh_equip + equip_disjoint)][selnuml_equip[selnumh_equip]]
264
                    global.player_armor_defense = script_execute(gml_Script_scr_determine_armor_defense)
265
                }
266
                else if (selnumh_equip == 2)
267
                {
268
                    global.player_weapon_modifier = item[(selnumh_equip + equip_disjoint)][selnuml_equip[selnumh_equip]]
269
                    global.player_weapon_modifier_attack = script_execute(gml_Script_scr_determine_weapon_modifier_attack)
270
                }
271
                else if (selnumh_equip == 3)
272
                {
273
                    global.player_armor_modifier = item[(selnumh_equip + equip_disjoint)][selnuml_equip[selnumh_equip]]
274
                    global.player_armor_modifier_defense = script_execute(gml_Script_scr_determine_armor_modifier_defense)
275
                }
276
                audio_play_sound(snd_battle_item_equip, 20, false)
277
            }
278
            else if key_revert
279
                seldepth_main -= 1
280
        }
281
        else if (selnum_main == 5)
282
        {
283
            key_vert = key_down - key_up
284
            selnumh_stat += key_vert
285
            array_max = array_length_1d(selnuml_stat) - 1
286
            if (selnumh_stat > array_max)
287
                selnumh_stat = 0
288
            if (selnumh_stat < 0)
289
                selnumh_stat = array_max
290
            key_hor = sign(key_right - key_left + (key_fast_right - key_fast_left))
291
            selnuml_stat[selnumh_stat] += key_hor
292
            var array_min = stat[selnumh_stat][0]
293
            array_max = stat[selnumh_stat][1]
294
            if (selnuml_stat[selnumh_stat] > array_max)
295
                selnuml_stat[selnumh_stat] = array_min
296
            if (selnuml_stat[selnumh_stat] < array_min)
297
                selnuml_stat[selnumh_stat] = array_max
298
            if key_select
299
            {
300
                h = selnumh_stat
301
                l = selnuml_stat[h]
302
                if (h == 0)
303
                {
304
                    global.player_level = l
305
                    global.max_hp_self = global.player_hp_next[l]
306
                    global.current_hp_self = global.max_hp_self
307
                    global.player_attack = global.player_attack_next[l]
308
                    global.player_defense = global.player_defense_next[l]
309
                    if (global.player_level == 1)
310
                        global.player_exp = 0
311
                    else
312
                        global.player_exp = global.player_exp_next[(l - 1)]
313
                    stat[2][1] = global.max_hp_self
314
                    selnuml_stat[2] = global.current_hp_self
315
                    audio_play_sound(snd_love_increased, 20, false)
316
                }
317
                else if (h == 1)
318
                {
319
                    global.player_gold = l
320
                    audio_play_sound(snd_battle_item_weapon_select, 20, false)
321
                }
322
                else if (h == 2)
323
                {
324
                    global.current_hp_self = l
325
                    audio_play_sound(snd_battle_item_eat, 20, false)
326
                }
327
                else if (h == 3)
328
                {
329
                    global.current_pp_self = l
330
                    audio_play_sound(snd_battle_item_eat, 20, false)
331
                }
332
                else if (h == 4)
333
                {
334
                    global.current_sp_self = l
335
                    audio_play_sound(snd_battle_item_eat, 20, false)
336
                }
337
            }
338
            else if key_revert
339
                seldepth_main -= 1
340
        }
341
    }
342
}