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(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
            {
57
                game_restart();
58
            }
59
            else
60
            {
61
                event_user(0);
62
                seldepth_main += 1;
63
            }
64
        }
65
    }
66
    else if (seldepth_main == 1)
67
    {
68
        if (selnum_main == 0)
69
        {
70
            var key_vert = key_down - key_up;
71
            selnumh_world += key_vert;
72
            var array_max = array_length_1d(selnuml_world) - 1;
73
            if (selnumh_world > array_max)
74
                selnumh_world = 0;
75
            if (selnumh_world < 0)
76
                selnumh_world = array_max;
77
            var key_hor = sign((key_right - key_left) + (key_fast_right - key_fast_left));
78
            selnuml_world[selnumh_world] += key_hor;
79
            array_max = array_length_2d(world_room, selnumh_world) - 1;
80
            if (selnuml_world[selnumh_world] > array_max)
81
                selnuml_world[selnumh_world] = 0;
82
            if (selnuml_world[selnumh_world] < 0)
83
                selnuml_world[selnumh_world] = array_max;
84
            if (key_select)
85
            {
86
                if (instance_exists(obj_room_special_holder))
87
                {
88
                    with (obj_room_special_holder)
89
                        instance_destroy();
90
                }
91
                instance_create(0, 0, obj_room_special_holder);
92
                with (obj_room_special_holder)
93
                {
94
                    var h = obj_debug_overworld.selnumh_world;
95
                    var l = obj_debug_overworld.selnuml_world[h];
96
                    player_x = obj_debug_overworld.world_x[h][l];
97
                    player_y = obj_debug_overworld.world_y[h][l];
98
                    player_direction = "down";
99
                    next_room = obj_debug_overworld.world_room[h][l];
100
                }
101
                with (obj_frisk)
102
                {
103
                    instance_create(__view_get(e__VW.XView, 0), __view_get(e__VW.YView, 0), obj_overworld_room_special_fade_out_screen);
104
                    moveable = false;
105
                    event = true;
106
                }
107
            }
108
            else if (key_revert)
109
            {
110
                seldepth_main -= 1;
111
            }
112
        }
113
        else if (selnum_main == 1)
114
        {
115
            var key_vert = key_down - key_up;
116
            selnumh_enemy += key_vert;
117
            var array_max = array_length_1d(selnuml_enemy) - 1;
118
            if (selnumh_enemy > array_max)
119
                selnumh_enemy = 0;
120
            if (selnumh_enemy < 0)
121
                selnumh_enemy = array_max;
122
            var key_hor = sign((key_right - key_left) + (key_fast_right - key_fast_left));
123
            selnuml_enemy[selnumh_enemy] += key_hor;
124
            array_max = array_length_2d(enemy, selnumh_enemy) - 1;
125
            if (selnuml_enemy[selnumh_enemy] > array_max)
126
                selnuml_enemy[selnumh_enemy] = 0;
127
            if (selnuml_enemy[selnumh_enemy] < 0)
128
                selnuml_enemy[selnumh_enemy] = array_max;
129
            if (key_select)
130
            {
131
                var selection_enemy = enemy[selnumh_enemy][selnuml_enemy[selnumh_enemy]];
132
                if (selection_enemy == "dalv normal")
133
                {
134
                    global.route = 1;
135
                    global.melancholy[1] = false;
136
                    global.battle_enemy_name = "dalv";
137
                }
138
                else if (selection_enemy == "dalv melancholy")
139
                {
140
                    global.melancholy[1] = true;
141
                    global.battle_enemy_name = "dalv";
142
                }
143
                else if (selection_enemy == "dalv genocide")
144
                {
145
                    global.route = 3;
146
                    global.battle_enemy_name = "dalv";
147
                }
148
                else
149
                {
150
                    global.battle_enemy_name = selection_enemy;
151
                }
152
                switch (global.battle_enemy_name)
153
                {
154
                    case "froggit intro":
155
                    case "flowey intro":
156
                    case "decibat":
157
                    case "micro froggit":
158
                    case "dalv":
159
                    case "martlet pacifist":
160
                    case "martlet genocide":
161
                    case "shufflers":
162
                    case "el bailador":
163
                    case "dummy training pacifist":
164
                        global.exclamation_mark_type = "nothing";
165
                        global.battling_enemy = false;
166
                        global.battling_boss = true;
167
                        global.battle_start = true;
168
                        break;
169
                    default:
170
                        global.exclamation_mark_type = "normal";
171
                        global.battling_enemy = true;
172
                        global.battling_boss = false;
173
                        global.battle_start = true;
174
                }
175
            }
176
            else if (key_revert)
177
            {
178
                seldepth_main -= 1;
179
            }
180
        }
181
        else if (selnum_main == 2)
182
        {
183
            var key_vert = key_down - key_up;
184
            selnumh_shop += key_vert;
185
            var array_max = array_length_1d(selnuml_shop) - 1;
186
            if (selnumh_shop > array_max)
187
                selnumh_shop = 0;
188
            if (selnumh_shop < 0)
189
                selnumh_shop = array_max;
190
            var key_hor = sign((key_right - key_left) + (key_fast_right - key_fast_left));
191
            selnuml_shop[selnumh_shop] += key_hor;
192
            array_max = array_length_2d(shop, selnumh_shop) - 1;
193
            if (selnuml_shop[selnumh_shop] > array_max)
194
                selnuml_shop[selnumh_shop] = 0;
195
            if (selnuml_shop[selnumh_shop] < 0)
196
                selnuml_shop[selnumh_shop] = array_max;
197
            if (key_select)
198
            {
199
                global.shop_name = shop[selnumh_shop][selnuml_shop[selnumh_shop]];
200
                switch (global.shop_name)
201
                {
202
                    case "Honeydew Resort Normal":
203
                        global.sound_carry_overworld = true;
204
                        break;
205
                }
206
                instance_create(__view_get(e__VW.XView, 0), __view_get(e__VW.YView, 0), obj_overworld_shop_fade_out_screen);
207
                with (obj_frisk)
208
                {
209
                    moveable = false;
210
                    event = true;
211
                }
212
            }
213
            else if (key_revert)
214
            {
215
                seldepth_main -= 1;
216
            }
217
        }
218
        else if (selnum_main == 3)
219
        {
220
            var key_vert = key_down - key_up;
221
            selnumh_item += key_vert;
222
            var array_max = array_length_1d(selnuml_item) - 1;
223
            if (selnumh_item > array_max)
224
                selnumh_item = 0;
225
            if (selnumh_item < 0)
226
                selnumh_item = array_max;
227
            var key_hor = sign((key_right - key_left) + (key_fast_right - key_fast_left));
228
            selnuml_item[selnumh_item] += key_hor;
229
            array_max = array_length_2d(item, selnumh_item) - 1;
230
            if (selnuml_item[selnumh_item] > array_max)
231
                selnuml_item[selnumh_item] = 0;
232
            if (selnuml_item[selnumh_item] < 0)
233
                selnuml_item[selnumh_item] = array_max;
234
            if (key_select)
235
            {
236
                global.item_hold_take = item[selnumh_item][selnuml_item[selnumh_item]];
237
                script_execute(scr_item_take_check);
238
                if (can_take == true)
239
                    audio_play_sound(snd_shop_purchase, 20, false);
240
                else
241
                    audio_play_sound(snd_hurt, 20, false);
242
            }
243
            else if (key_revert)
244
            {
245
                seldepth_main -= 1;
246
            }
247
        }
248
        else if (selnum_main == 4)
249
        {
250
            var key_vert = key_down - key_up;
251
            selnumh_equip += key_vert;
252
            var array_max = array_length_1d(selnuml_equip) - 1;
253
            if (selnumh_equip > array_max)
254
                selnumh_equip = 0;
255
            if (selnumh_equip < 0)
256
                selnumh_equip = array_max;
257
            var key_hor = sign((key_right - key_left) + (key_fast_right - key_fast_left));
258
            selnuml_equip[selnumh_equip] += key_hor;
259
            array_max = array_length_2d(item, selnumh_equip + equip_disjoint) - 1;
260
            if (selnuml_equip[selnumh_equip] > array_max)
261
                selnuml_equip[selnumh_equip] = 0;
262
            if (selnuml_equip[selnumh_equip] < 0)
263
                selnuml_equip[selnumh_equip] = array_max;
264
            if (key_select)
265
            {
266
                if (selnumh_equip == 0)
267
                {
268
                    global.player_weapon = item[selnumh_equip + equip_disjoint][selnuml_equip[selnumh_equip]];
269
                    global.player_weapon_attack = script_execute(scr_determine_weapon_attack);
270
                }
271
                else if (selnumh_equip == 1)
272
                {
273
                    global.player_armor = item[selnumh_equip + equip_disjoint][selnuml_equip[selnumh_equip]];
274
                    global.player_armor_defense = script_execute(scr_determine_armor_defense);
275
                }
276
                else if (selnumh_equip == 2)
277
                {
278
                    global.player_weapon_modifier = item[selnumh_equip + equip_disjoint][selnuml_equip[selnumh_equip]];
279
                    global.player_weapon_modifier_attack = script_execute(scr_determine_weapon_modifier_attack);
280
                }
281
                else if (selnumh_equip == 3)
282
                {
283
                    global.player_armor_modifier = item[selnumh_equip + equip_disjoint][selnuml_equip[selnumh_equip]];
284
                    global.player_armor_modifier_defense = script_execute(scr_determine_armor_modifier_defense);
285
                }
286
                audio_play_sound(snd_battle_item_equip, 20, false);
287
            }
288
            else if (key_revert)
289
            {
290
                seldepth_main -= 1;
291
            }
292
        }
293
        else if (selnum_main == 5)
294
        {
295
            var key_vert = key_down - key_up;
296
            selnumh_stat += key_vert;
297
            var array_max = array_length_1d(selnuml_stat) - 1;
298
            if (selnumh_stat > array_max)
299
                selnumh_stat = 0;
300
            if (selnumh_stat < 0)
301
                selnumh_stat = array_max;
302
            var key_hor = sign((key_right - key_left) + (key_fast_right - key_fast_left));
303
            selnuml_stat[selnumh_stat] += key_hor;
304
            var array_min = stat[selnumh_stat][0];
305
            array_max = stat[selnumh_stat][1];
306
            if (selnuml_stat[selnumh_stat] > array_max)
307
                selnuml_stat[selnumh_stat] = array_min;
308
            if (selnuml_stat[selnumh_stat] < array_min)
309
                selnuml_stat[selnumh_stat] = array_max;
310
            if (key_select)
311
            {
312
                var h = selnumh_stat;
313
                var l = selnuml_stat[h];
314
                if (h == 0)
315
                {
316
                    global.player_level = l;
317
                    global.max_hp_self = global.player_hp_next[l];
318
                    global.current_hp_self = global.max_hp_self;
319
                    global.player_attack = global.player_attack_next[l];
320
                    global.player_defense = global.player_defense_next[l];
321
                    if (global.player_level == 1)
322
                        global.player_exp = 0;
323
                    else
324
                        global.player_exp = global.player_exp_next[l - 1];
325
                    stat[2][1] = global.max_hp_self;
326
                    selnuml_stat[2] = global.current_hp_self;
327
                    audio_play_sound(snd_love_increased, 20, false);
328
                }
329
                else if (h == 1)
330
                {
331
                    global.player_gold = l;
332
                    audio_play_sound(snd_battle_item_weapon_select, 20, false);
333
                }
334
                else if (h == 2)
335
                {
336
                    global.current_hp_self = l;
337
                    audio_play_sound(snd_battle_item_eat, 20, false);
338
                }
339
                else if (h == 3)
340
                {
341
                    global.current_pp_self = l;
342
                    audio_play_sound(snd_battle_item_eat, 20, false);
343
                }
344
                else if (h == 4)
345
                {
346
                    global.current_sp_self = l;
347
                    audio_play_sound(snd_battle_item_eat, 20, false);
348
                }
349
            }
350
            else if (key_revert)
351
            {
352
                seldepth_main -= 1;
353
            }
354
        }
355
    }
356
}
357
358
enum e__VW
359
{
360
    XView,
361
    YView,
362
    WView,
363
    HView,
364
    Angle,
365
    HBorder,
366
    VBorder,
367
    HSpeed,
368
    VSpeed,
369
    Object,
370
    Visible,
371
    XPort,
372
    YPort,
373
    WPort,
374
    HPort,
375
    Camera,
376
    SurfaceID
377
}