Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_debugger_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
if show_timer
4
    scr_determine_playtime
scr_determine_playtime

function scr_determine_playtime() //gml_Script_scr_determine_playtime { var time_new = date_current_datetime() var time_difference = floor(date_second_span(global.saved_datetime, time_new)) global.elapsed_seconds += time_difference global.saved_datetime = time_new }
()
5
var dbg_soundtest = mouse_check_button_pressed(mb_left)
6
if dbg_soundtest
7
    audio_play_sound(snd_monster_damage_death, 1, 0)
8
var dbg_up = keyboard_check_pressed(ord("W"))
9
var dbg_down = keyboard_check_pressed(ord("S"))
10
var dbg_right = keyboard_check_pressed(ord("D"))
11
var dbg_left = keyboard_check_pressed(ord("A"))
12
var dbg_conf = keyboard_check_pressed(ord("E"))
13
var dbg_canc = keyboard_check_pressed(ord("Q"))
14
var dbg_time = keyboard_check_pressed(ord("M"))
15
if (dbg_up && (!alarm[0]))
16
    alarm[0] = 5
17
else
18
    dbg_up = false
19
if (dbg_down && (!alarm[1]))
20
    alarm[1] = 5
21
else
22
    dbg_down = false
23
if dbg_time
24
{
25
    if (show_timer == false)
26
        show_timer = true
27
    else
28
        show_timer = false
29
}
30
switch dbg_menu
31
{
32
    case 0:
33
        if dbg_down
34
        {
35
            if (dbg_pos < 5)
36
                dbg_pos += 1
37
            else
38
                dbg_pos = 1
39
        }
40
        if dbg_up
41
        {
42
            if (dbg_pos > 1)
43
                dbg_pos -= 1
44
            else
45
                dbg_pos = 5
46
        }
47
        if dbg_conf
48
        {
49
            if (dbg_pos == 5)
50
            {
51
                var code_string = (get_string("Enter code:", "")) + "; return 1"
52
                show_debug_message("code_string: " + code_string)
53
                if live_execute_string(code_string)
54
                    show_debug_message("Result: " + string(global.live_result))
55
                else
56
                    show_debug_message("Error: " + string(global.live_result))
57
                return;
58
            }
59
            else
60
            {
61
                dbg_menu = dbg_pos
62
                dbg_pos = 1
63
            }
64
        }
65
        if dbg_canc
66
            instance_destroy()
67
        break
68
    case 1:
69
        if dbg_down
70
        {
71
            if (dbg_pos < dbg_room_count)
72
                dbg_pos += 1
73
            else
74
                dbg_pos = 0
75
        }
76
        if dbg_up
77
        {
78
            if (dbg_pos > 0)
79
                dbg_pos -= 1
80
            else
81
                dbg_pos = dbg_room_count
82
        }
83
        if dbg_right
84
        {
85
            if (dbg_pos < dbg_room_count)
86
                dbg_pos += 5
87
            else
88
                dbg_pos = 0
89
        }
90
        if dbg_left
91
        {
92
            if (dbg_pos > 0)
93
                dbg_pos -= 5
94
            else
95
                dbg_pos = dbg_room_count
96
        }
97
        if dbg_conf
98
            room_goto(asset_get_index(ds_list_find_value(room_list, dbg_pos)))
99
        if dbg_canc
100
        {
101
            dbg_pos = 1
102
            dbg_menu = 0
103
        }
104
        break
105
    case 2:
106
        if dbg_down
107
        {
108
            if (dbg_pos < 4)
109
                dbg_pos += 1
110
            else
111
                dbg_pos = 1
112
        }
113
        if dbg_up
114
        {
115
            if (dbg_pos > 1)
116
                dbg_pos -= 1
117
            else
118
                dbg_pos = 4
119
        }
120
        if dbg_right
121
        {
122
            if (dbg_pos == 3)
123
            {
124
                if (dbg_enemy_current < (array_length_1d(dbg_battle_enemy_name) - 1))
125
                    dbg_enemy_current++
126
                else
127
                    dbg_enemy_current = 0
128
            }
129
            if (dbg_pos == 4)
130
            {
131
                if (dbg_boss_current < (array_length_1d(dbg_battle_boss_name) - 1))
132
                    dbg_boss_current++
133
                else
134
                    dbg_boss_current = 0
135
            }
136
        }
137
        if dbg_left
138
        {
139
            if (dbg_pos == 3)
140
            {
141
                if (dbg_enemy_current > 0)
142
                    dbg_enemy_current--
143
                else
144
                    dbg_enemy_current = array_length_1d(dbg_battle_enemy_name) - 1
145
            }
146
            if (dbg_pos == 4)
147
            {
148
                if (dbg_boss_current > 0)
149
                    dbg_boss_current--
150
                else
151
                    dbg_boss_current = array_length_1d(dbg_battle_boss_name) - 1
152
            }
153
        }
154
        if dbg_conf
155
        {
156
            if (dbg_pos == 1)
157
            {
158
                if (global.player_level >= 19)
159
                    return;
160
                global.player_level += 1
161
                global.max_hp_self = global.player_hp_next[global.player_level]
162
                global.current_hp_self = global.max_hp_self
163
                global.player_attack = global.player_attack_next[global.player_level]
164
                global.player_defense = global.player_defense_next[global.player_level]
165
            }
166
            if (dbg_pos == 2)
167
            {
168
                global.player_level = 1
169
                global.max_hp_self = 20
170
                global.current_hp_self = global.max_hp_self
171
                global.player_attack = global.player_attack_next[1]
172
                global.player_defense = global.player_defense_next[1]
173
            }
174
            if (dbg_pos == 3)
175
            {
176
                instance_create((obj_pl.x - 4), (obj_pl.y - 26), obj_exclamation_mark)
177
                global.battle_enemy_name = dbg_battle_enemy_name[dbg_enemy_current]
178
                global.current_room_overworld = room_get_name(room)
179
                global.battling_boss = false
180
                global.battle_start = true
181
                instance_destroy()
182
            }
183
            if (dbg_pos == 4)
184
            {
185
                instance_create((obj_pl.x - 4), (obj_pl.y - 26), obj_exclamation_mark)
186
                global.battle_enemy_name = dbg_battle_boss_name[dbg_boss_current]
187
                global.current_room_overworld = room_get_name(room)
188
                global.battling_enemy = false
189
                global.battling_boss = true
190
                global.battle_start = true
191
                instance_destroy()
192
            }
193
        }
194
        if dbg_canc
195
        {
196
            dbg_pos = 1
197
            dbg_menu = 0
198
        }
199
        break
200
    case 3:
201
        if dbg_down
202
        {
203
            if (dbg_pos < (ds_map_size(cheat_map) - 1))
204
                dbg_pos += 1
205
            else
206
                dbg_pos = 0
207
        }
208
        if dbg_up
209
        {
210
            if (dbg_pos > 0)
211
                dbg_pos -= 1
212
            else
213
                dbg_pos = ds_map_size(cheat_map) - 1
214
        }
215
        if dbg_canc
216
        {
217
            dbg_pos = 1
218
            dbg_menu = 0
219
        }
220
        var current_value = ds_map_find_value(cheat_map, dbg_pos)
221
        switch dbg_pos
222
        {
223
            case 0:
224
                if dbg_left
225
                {
226
                    if (current_value > 0.5)
227
                        ds_map_replace(cheat_map, dbg_pos, (current_value - 0.5))
228
                    else
229
                        ds_map_replace(cheat_map, dbg_pos, 6)
230
                }
231
                else if dbg_right
232
                {
233
                    if (current_value < 4)
234
                        ds_map_replace(cheat_map, dbg_pos, (current_value + 0.5))
235
                    else
236
                        ds_map_replace(cheat_map, dbg_pos, 0.5)
237
                }
238
                else if dbg_conf
239
                    room_speed = current_value * 30
240
                break
241
            case 1:
242
                if (dbg_left || dbg_right)
243
                {
244
                    if (current_value == 1)
245
                        ds_map_replace(cheat_map, dbg_pos, 0)
246
                    else
247
                        ds_map_replace(cheat_map, dbg_pos, 1)
248
                }
249
                if dbg_conf
250
                {
251
                    if (current_value == 1)
252
                    {
253
                        global.current_hp_self = 9999
254
                        global.max_hp_self = 9999
255
                    }
256
                    else if (current_value == 2)
257
                    {
258
                        global.max_hp_self = global.player_hp_next[global.player_level]
259
                        global.current_hp_self = global.max_hp_self
260
                    }
261
                }
262
                break
263
            case 2:
264
                if (dbg_left || dbg_right)
265
                {
266
                    if (current_value == 1)
267
                        ds_map_replace(cheat_map, dbg_pos, 0)
268
                    else
269
                        ds_map_replace(cheat_map, dbg_pos, 1)
270
                }
271
                if dbg_conf
272
                {
273
                    if (current_value == 1)
274
                        global.debug_move = true
275
                    else if (current_value == 0)
276
                        global.debug_move = false
277
                }
278
                break
279
            case 3:
280
                if dbg_right
281
                {
282
                    if (current_value < 9999)
283
                        ds_map_replace(cheat_map, dbg_pos, (current_value + 1))
284
                }
285
                else if dbg_left
286
                {
287
                    if (current_value > 0)
288
                        ds_map_replace(cheat_map, dbg_pos, (current_value - 1))
289
                }
290
                else if dbg_conf
291
                {
292
                    audio_play_sound(snd_success, 1, 0)
293
                    global.player_gold += current_value
294
                }
295
                break
296
            case 4:
297
                if dbg_conf
298
                {
299
                    scr_item
scr_item

function scr_item(argument0) //gml_Script_scr_item { nm = argument0 var i = 1 while (i <= 8) { if (global.item_slot[i] == "Nothing") { global.item_slot[i] = nm return true; } else { if (i == 8) return false; i++ continue } } }
("Golden Scarf")
300
                    scr_item
scr_item

function scr_item(argument0) //gml_Script_scr_item { nm = argument0 var i = 1 while (i <= 8) { if (global.item_slot[i] == "Nothing") { global.item_slot[i] = nm return true; } else { if (i == 8) return false; i++ continue } } }
("Super Ammo")
301
                }
302
                break
303
            case 5:
304
                if dbg_right
305
                {
306
                    if (global.route < 3)
307
                        ds_map_replace(cheat_map, dbg_pos, (current_value + 1))
308
                }
309
                else if dbg_left
310
                {
311
                    if (global.route > 1)
312
                        ds_map_replace(cheat_map, dbg_pos, (current_value - 1))
313
                }
314
                else if dbg_conf
315
                {
316
                    audio_play_sound(snd_confirm, 1, 0)
317
                    global.route = current_value
318
                }
319
                break
320
            case 6:
321
                if dbg_conf
322
                {
323
                    if (!kanako_time)
324
                        kanako_time = true
325
                    else
326
                    {
327
                        kanako_time = false
328
                        global.player_sprites = "normal"
329
                    }
330
                }
331
                break
332
            case 7:
333
                if dbg_conf
334
                {
335
                    if (!instance_exists(obj_debug_skipper))
336
                        instance_create(0, 0, obj_debug_skipper)
337
                    else
338
                    {
339
                        room_speed = 30
340
                        instance_destroy(obj_debug_skipper)
341
                    }
342
                }
343
                break
344
        }
345
346
        break
347
    case 4:
348
        game_restart()
349
        break
350
}
351
352
if no_encounters
353
{
354
    if instance_exists(obj_rndenc)
355
        instance_destroy(obj_rndenc)
356
    if instance_exists(obj_scriptedencounters)
357
        instance_destroy()
358
}
359
if sixty_fps
360
{
361
    if (room_speed < 180)
362
        room_speed += 15
363
    else
364
        room_speed = 30
365
    sixty_fps = false
366
}
367
if (kanako_time == true)
368
    global.player_sprites = "kanako"
369
if mouse_check_button_pressed(mb_left)
370
{
371
    obj_pl.x = mouse_x
372
    obj_pl.y = mouse_y
373
}
374
if mouse_check_button_pressed(mb_right)
375
{
376
    var inst = instance_position(mouse_x, mouse_y, all)
377
    show_debug_message(object_get_name(inst.object_index))
378
}