Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_heart_dimensional_box_overworld_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
var dimensional_box_number_row = global.dimensional_box_number_row
4
var dimensional_box_number_column = global.dimensional_box_number_column
5
if keyboard_multicheck_pressed(0)
6
{
7
    audio_play_sound(snd_confirm, 0, 0)
8
    if (dimensional_box_number_column == 1)
9
    {
10
        if (global.item_slot[dimensional_box_number_row] != "Nothing")
11
        {
12
            ds_list_insert(global.box_slot_list, 0, global.item_slot[dimensional_box_number_row])
13
            scr_item_remove
scr_item_remove

function scr_item_remove(argument0) //gml_Script_scr_item_remove { i = 1 while (i <= 8) { if (global.item_slot[i] == argument0) { while (i < 8) { global.item_slot[i] = global.item_slot[(i + 1)] i += 1 } global.item_slot[8] = "Nothing" return true; } else { if (i == 8) return false; i += 1 continue } } }
(global.item_slot[dimensional_box_number_row])
14
        }
15
        else
16
        {
17
            audio_stop_sound(snd_confirm)
18
            audio_play_sound(snd_fail, 1, 0)
19
        }
20
    }
21
    else if (dimensional_box_number_column == 2)
22
    {
23
        var retrieved_item = ds_list_find_value(global.box_slot_list, (dimensional_box_number_row - 1 + global.dimensional_box_offset))
24
        if (retrieved_item != undefined && 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 } } }
(retrieved_item))
25
            ds_list_delete(global.box_slot_list, (dimensional_box_number_row - 1 + global.dimensional_box_offset))
26
        else
27
        {
28
            audio_stop_sound(snd_confirm)
29
            audio_play_sound(snd_fail, 1, 0)
30
        }
31
    }
32
}
33
else if keyboard_multicheck_pressed(1)
34
{
35
    audio_play_sound(snd_fail, 1, 0)
36
    with (obj_dimensional_box_screen_overworld)
37
        instance_destroy()
38
    scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
39
    instance_destroy()
40
    return;
41
}
42
if (!keyboard_multicheck_pressed(0))
43
{
44
    if (global.right_keyp && global.left_keyp == 0)
45
    {
46
        if (dimensional_box_number_column < 2)
47
            global.dimensional_box_number_column += 1
48
        audio_play_sound(snd_mainmenu_select, 1, 0)
49
    }
50
    if (global.left_keyp && global.right_keyp == 0)
51
    {
52
        if (dimensional_box_number_column > 1)
53
        {
54
            if (dimensional_box_number_row > 8)
55
                global.dimensional_box_number_row = 8
56
            global.dimensional_box_number_column -= 1
57
        }
58
        audio_play_sound(snd_mainmenu_select, 1, 0)
59
    }
60
}
61
if (dimensional_box_number_column == 1)
62
    var max_row_number = 8
63
else if (dimensional_box_number_column == 2)
64
    max_row_number = 10
65
if (!keyboard_multicheck_pressed(0))
66
{
67
    if (global.down_keyp && global.up_keyp == 0)
68
    {
69
        if (dimensional_box_number_row == max_row_number && dimensional_box_number_column == 2)
70
        {
71
            if ((dimensional_box_number_row + global.dimensional_box_offset) <= ds_list_size(global.box_slot_list))
72
                global.dimensional_box_offset += 1
73
        }
74
        else if (dimensional_box_number_row < max_row_number)
75
            global.dimensional_box_number_row += 1
76
        audio_play_sound(snd_mainmenu_select, 1, 0)
77
    }
78
    if (global.up_keyp && global.down_keyp == 0)
79
    {
80
        if (dimensional_box_number_row == 1 && dimensional_box_number_column == 2)
81
        {
82
            if (global.dimensional_box_offset > 0)
83
                global.dimensional_box_offset -= 1
84
        }
85
        if (dimensional_box_number_row > 1)
86
            global.dimensional_box_number_row -= 1
87
        audio_play_sound(snd_mainmenu_select, 1, 0)
88
    }
89
}
90
dimensional_box_number_row = global.dimensional_box_number_row
91
dimensional_box_number_column = global.dimensional_box_number_column
92
var x_offset = 8
93
var y_offset = 8
94
if (dimensional_box_number_column == 1)
95
{
96
    if (dimensional_box_number_row == 1)
97
    {
98
        xx = x_offset + 20
99
        yy = y_offset + 37
100
    }
101
    else if (dimensional_box_number_row == 2)
102
    {
103
        xx = x_offset + 20
104
        yy = y_offset + 53
105
    }
106
    else if (dimensional_box_number_row == 3)
107
    {
108
        xx = x_offset + 20
109
        yy = y_offset + 69
110
    }
111
    else if (dimensional_box_number_row == 4)
112
    {
113
        xx = x_offset + 20
114
        yy = y_offset + 85
115
    }
116
    else if (dimensional_box_number_row == 5)
117
    {
118
        xx = x_offset + 20
119
        yy = y_offset + 101
120
    }
121
    else if (dimensional_box_number_row == 6)
122
    {
123
        xx = x_offset + 20
124
        yy = y_offset + 117
125
    }
126
    else if (dimensional_box_number_row == 7)
127
    {
128
        xx = x_offset + 20
129
        yy = y_offset + 133
130
    }
131
    else if (dimensional_box_number_row == 8)
132
    {
133
        xx = x_offset + 20
134
        yy = y_offset + 149
135
    }
136
}
137
else if (dimensional_box_number_column == 2)
138
{
139
    if (dimensional_box_number_row == 1)
140
    {
141
        xx = x_offset + 168
142
        yy = y_offset + 37
143
    }
144
    else if (dimensional_box_number_row == 2)
145
    {
146
        xx = x_offset + 168
147
        yy = y_offset + 53
148
    }
149
    else if (dimensional_box_number_row == 3)
150
    {
151
        xx = x_offset + 168
152
        yy = y_offset + 69
153
    }
154
    else if (dimensional_box_number_row == 4)
155
    {
156
        xx = x_offset + 168
157
        yy = y_offset + 85
158
    }
159
    else if (dimensional_box_number_row == 5)
160
    {
161
        xx = x_offset + 168
162
        yy = y_offset + 101
163
    }
164
    else if (dimensional_box_number_row == 6)
165
    {
166
        xx = x_offset + 168
167
        yy = y_offset + 117
168
    }
169
    else if (dimensional_box_number_row == 7)
170
    {
171
        xx = x_offset + 168
172
        yy = y_offset + 133
173
    }
174
    else if (dimensional_box_number_row == 8)
175
    {
176
        xx = x_offset + 168
177
        yy = y_offset + 149
178
    }
179
    else if (dimensional_box_number_row == 9)
180
    {
181
        xx = x_offset + 168
182
        yy = y_offset + 165
183
    }
184
    else if (dimensional_box_number_row == 10)
185
    {
186
        xx = x_offset + 168
187
        yy = y_offset + 181
188
    }
189
}