Deltarune (Chapter 4) script viewer

← back to main script listing

gml_GlobalScript_scr_shopmenu

(view raw script w/o annotations or w/e)
1
function 
scr_shopmenu
scr_shopmenu

function
scr_shopmenu(arg0)
{ if (arg0 == 0) { if (menu == 1 || menu == 2) {
scr_darkbox_black(camerax() + 400, cameray() + minimenuy, camerax() + 640, cameray() + 255);
draw_set_color(c_white);
scr_84_set_draw_font("mainbig");
if (menuc[1] == 0) draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[0])); if (menuc[1] == 1) draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[1])); if (menuc[1] == 2) draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[2])); if (menuc[1] == 3) draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[3]));
scr_84_set_draw_font("dotumche");
if (itemtype[menuc[1]] == "weapon" || itemtype[menuc[1]] == "armor") { for (i = 0; i < 3; i += 1) { can_index = 0; facetype = spr_headkris; which = global.char[i]; if (global.char[i] == 1) facetype = spr_headkris; if (global.char[i] == 2) facetype = spr_headsusie; if (global.char[i] == 3) facetype = spr_headralsei; if (which != 0) { if (i == 0) { locx = 0; locy = 0; } if (i == 1) { locx = 100; locy = 0; } if (i == 2) { locx = 0; locy = 45; } if (canequip[menuc[1]][which] == 0) can_index = 8; draw_sprite(facetype, can_index, camerax() + 426 + locx, cameray() + minimenuy + 140 + locy); if (itemtype[menuc[1]] == "weapon" && can_index != 8) { draw_set_color(c_white); sum[0] = itematk[menuc[1]] - global.itemat[which][0]; sum[1] = itemmagic[menuc[1]] - global.itemmag[which][0]; for (j = 0; j < 2; j += 1) { dcolor = c_white; addt = ""; draw_set_color(c_white); if (sum[j] > 0) { draw_set_color(c_yellow); addt = "+"; } if (sum[j] < 0) draw_set_color(c_aqua); draw_sprite_ext(spr_shopicon, j, camerax() + 470 + locx, cameray() + minimenuy + locy + 135 + (20 * j), 1, 1, 0, dcolor, 1); draw_text(camerax() + 490 + locx, cameray() + minimenuy + locy + 135 + (20 * j), string_hash_to_newline(addt + string(sum[j]))); } } if (itemtype[menuc[1]] == "armor" && can_index != 8) { sum[0] = itemdef[menuc[1]] - global.itemdf[which][1]; sum[1] = itemdef[menuc[1]] - global.itemdf[which][2]; for (j = 0; j < 2; j += 1) { dcolor = c_white; addt = ""; draw_set_color(c_white); if (sum[j] > 0) { draw_set_color(c_yellow); addt = "+"; } if (sum[j] < 0) draw_set_color(c_aqua); draw_sprite_ext(spr_shopicon, 2 + j, camerax() + 470 + locx, cameray() + minimenuy + locy + 135 + (20 * j), 1, 1, 0, dcolor, 1); draw_text(camerax() + 490 + locx, cameray() + minimenuy + 135 + (20 * j) + locy, string_hash_to_newline(addt + string(sum[j]))); } } } } } } } if (arg0 == 4) { if (menu == 11 || menu == 15) { ...
(arg0)
2
{
3
    if (arg0 == 0)
4
    {
5
        if (menu == 1 || menu == 2)
6
        {
7
            
scr_darkbox_black
scr_darkbox_black

function
scr_darkbox_black(arg0, arg1, arg2, arg3)
{ draw_set_color(c_black); ossafe_fill_rectangle(arg0 + 20, arg1 + 20, arg2 - 20, arg3 - 20, false);
scr_darkbox(arg0, arg1, arg2, arg3);
}
(camerax() + 400, cameray() + minimenuy, camerax() + 640, cameray() + 255);
8
            draw_set_color(c_white);
9
            
scr_84_set_draw_font
scr_84_set_draw_font

function
scr_84_set_draw_font(arg0)
{ global.chemg_font = arg0; draw_set_font(
scr_84_get_font(arg0));
}
("mainbig");
10
            if (menuc[1] == 0)
11
                draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[0]));
12
            if (menuc[1] == 1)
13
                draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[1]));
14
            if (menuc[1] == 2)
15
                draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[2]));
16
            if (menuc[1] == 3)
17
                draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[3]));
18
            
scr_84_set_draw_font
scr_84_set_draw_font

function
scr_84_set_draw_font(arg0)
{ global.chemg_font = arg0; draw_set_font(
scr_84_get_font(arg0));
}
("dotumche");
19
            if (itemtype[menuc[1]] == "weapon" || itemtype[menuc[1]] == "armor")
20
            {
21
                for (i = 0; i < 3; i += 1)
22
                {
23
                    can_index = 0;
24
                    facetype = spr_headkris;
25
                    which = global.char[i];
26
                    if (global.char[i] == 1)
27
                        facetype = spr_headkris;
28
                    if (global.char[i] == 2)
29
                        facetype = spr_headsusie;
30
                    if (global.char[i] == 3)
31
                        facetype = spr_headralsei;
32
                    if (which != 0)
33
                    {
34
                        if (i == 0)
35
                        {
36
                            locx = 0;
37
                            locy = 0;
38
                        }
39
                        if (i == 1)
40
                        {
41
                            locx = 100;
42
                            locy = 0;
43
                        }
44
                        if (i == 2)
45
                        {
46
                            locx = 0;
47
                            locy = 45;
48
                        }
49
                        if (canequip[menuc[1]][which] == 0)
50
                            can_index = 8;
51
                        draw_sprite(facetype, can_index, camerax() + 426 + locx, cameray() + minimenuy + 140 + locy);
52
                        if (itemtype[menuc[1]] == "weapon" && can_index != 8)
53
                        {
54
                            draw_set_color(c_white);
55
                            sum[0] = itematk[menuc[1]] - global.itemat[which][0];
56
                            sum[1] = itemmagic[menuc[1]] - global.itemmag[which][0];
57
                            for (j = 0; j < 2; j += 1)
58
                            {
59
                                dcolor = c_white;
60
                                addt = "";
61
                                draw_set_color(c_white);
62
                                if (sum[j] > 0)
63
                                {
64
                                    draw_set_color(c_yellow);
65
                                    addt = "+";
66
                                }
67
                                if (sum[j] < 0)
68
                                    draw_set_color(c_aqua);
69
                                draw_sprite_ext(spr_shopicon, j, camerax() + 470 + locx, cameray() + minimenuy + locy + 135 + (20 * j), 1, 1, 0, dcolor, 1);
70
                                draw_text(camerax() + 490 + locx, cameray() + minimenuy + locy + 135 + (20 * j), string_hash_to_newline(addt + string(sum[j])));
71
                            }
72
                        }
73
                        if (itemtype[menuc[1]] == "armor" && can_index != 8)
74
                        {
75
                            sum[0] = itemdef[menuc[1]] - global.itemdf[which][1];
76
                            sum[1] = itemdef[menuc[1]] - global.itemdf[which][2];
77
                            for (j = 0; j < 2; j += 1)
78
                            {
79
                                dcolor = c_white;
80
                                addt = "";
81
                                draw_set_color(c_white);
82
                                if (sum[j] > 0)
83
                                {
84
                                    draw_set_color(c_yellow);
85
                                    addt = "+";
86
                                }
87
                                if (sum[j] < 0)
88
                                    draw_set_color(c_aqua);
89
                                draw_sprite_ext(spr_shopicon, 2 + j, camerax() + 470 + locx, cameray() + minimenuy + locy + 135 + (20 * j), 1, 1, 0, dcolor, 1);
90
                                draw_text(camerax() + 490 + locx, cameray() + minimenuy + 135 + (20 * j) + locy, string_hash_to_newline(addt + string(sum[j])));
91
                            }
92
                        }
93
                    }
94
                }
95
            }
96
        }
97
    }
98
    if (arg0 == 4)
99
    {
100
        if (menu == 11 || menu == 15)
101
        {
102
            draw_set_color(c_white);
103
            
scr_84_set_draw_font
scr_84_set_draw_font

function
scr_84_set_draw_font(arg0)
{ global.chemg_font = arg0; draw_set_font(
scr_84_get_font(arg0));
}
("mainbig");
104
            
scr_itemcheck
scr_itemcheck

function
scr_itemcheck(arg0)
{ haveit = 0; itemcount = 0; for (var __i = 0; __i < 12; __i += 1) { if (global.item[__i] == arg0) haveit = 1; if (global.item[__i] == arg0) itemcount += 1; } return haveit; }
(0);
105
            menumax = selltotal - nothingcount - 1;
106
            if (menumax < 0)
107
                menumax = 0;
108
            if (menu == 11)
109
            {
110
                _up_pressed = 0;
111
                _down_pressed = 0;
112
                if (down_h())
113
                {
114
                    hold_up = 0;
115
                    if (down_p())
116
                        _down_pressed = 1;
117
                    hold_down += 1;
118
                    if (hold_down >= 8)
119
                    {
120
                        _down_pressed = 1;
121
                        hold_down = 6;
122
                    }
123
                    if (_down_pressed == 1)
124
                    {
125
                        if (menuc[menu] < menumax)
126
                        {
127
                            menuc[menu] += 1;
128
                            if (menuc[menu] > (pagemax + 4))
129
                                pagemax += 1;
130
                        }
131
                    }
132
                }
133
                else
134
                {
135
                    hold_down = 0;
136
                }
137
                if (up_h())
138
                {
139
                    hold_down = 0;
140
                    if (up_p())
141
                        _up_pressed = 1;
142
                    hold_up += 1;
143
                    if (hold_up >= 8)
144
                    {
145
                        _up_pressed = 1;
146
                        hold_up = 6;
147
                    }
148
                    if (_up_pressed == 1)
149
                    {
150
                        if (menuc[menu] > 0)
151
                        {
152
                            menuc[menu] -= 1;
153
                            if (menuc[menu] < pagemax)
154
                                pagemax -= 1;
155
                        }
156
                    }
157
                }
158
                else
159
                {
160
                    hold_up = 0;
161
                }
162
            }
163
            j = 0;
164
            for (i = pagemax; i < (5 + pagemax); i += 1)
165
            {
166
                draw_sprite(spr_heart, 0, camerax() + 30, cameray() + 270 + ((menuc[11] - pagemax) * 40));
167
                g = 0;
168
                draw_set_color(c_white);
169
                _itempname = itemsellname[i];
170
                if (_itempname == " ")
171
                {
172
                    _itempname = "--------";
173
                    draw_set_color(c_dkgray);
174
                }
175
                draw_text(camerax() + 60, cameray() + 260 + (j * 40), string_hash_to_newline(_itempname));
176
                if (itemsellvalue[i] > 1)
177
                    draw_text(camerax() + 300, cameray() + 260 + (j * 40), string_hash_to_newline(stringsetsubloc("$~1", string(ceil(itemsellvalue[i] / 2)), "scr_shopmenu_slash_scr_shopmenu_gml_158_0")));
178
                j += 1;
179
            }
180
            draw_set_color(c_white);
181
            if (menu == 11)
182
            {
183
                if (button1_p() && onebuffer < 0)
184
                {
185
                    sellvalue = ceil(itemsellvalue[menuc[menu]] / 2);
186
                    if (itemsellvalue[menuc[menu]] > 1)
187
                        menu = 15;
188
                    else if (itemsellname[menuc[menu]] == " ")
189
                        sidemessage2 = 4;
190
                    else
191
                        sidemessage2 = 3;
192
                    tempmenu = 11;
193
                    onebuffer = 2;
194
                    with (obj_writer)
195
                        instance_destroy();
196
                }
197
                if (button2_p() && twobuffer < 0 && onebuffer < 2)
198
                {
199
                    sidemessage = 0;
200
                    menu = 10;
201
                    twobuffer = 2;
202
                    with (obj_writer)
203
                        instance_destroy();
204
                }
205
            }
206
            if (selltype == "pocket")
207
            {
208
                
scr_shopmorearrow
scr_shopmorearrow

function
scr_shopmorearrow(arg0)
{ if (pagemax > 0) draw_sprite_ext(spr_morearrow, 0, camerax() + 370, (cameray() + 280) - (sin(cur_jewel / 12) * 3), 1, -1, 0, c_white, 1); if ((5 + pagemax) < arg0) { if (menu == 11 && selltype == "item") { if (itemsellname[5 + pagemax] != " ") draw_sprite_ext(spr_morearrow, 0, camerax() + 370, cameray() + 440 + (sin(cur_jewel / 12) * 3), 1, 1, 0, c_white, 1); } else { draw_sprite_ext(spr_morearrow, 0, camerax() + 370, cameray() + 440 + (sin(cur_jewel / 12) * 3), 1, 1, 0, c_white, 1); } } }
(menumax + 1);
209
                buff = 3;
210
                ossafe_fill_rectangle((camerax() + 375) - buff, (cameray() + 295 + (pagemax * (130 / menumax))) - buff, camerax() + 377 + buff, cameray() + 297 + (pagemax * (130 / menumax)) + buff, false);
211
            }
212
            else
213
            {
214
                if (menu != 15)
215
                    
scr_shopmorearrow
scr_shopmorearrow

function
scr_shopmorearrow(arg0)
{ if (pagemax > 0) draw_sprite_ext(spr_morearrow, 0, camerax() + 370, (cameray() + 280) - (sin(cur_jewel / 12) * 3), 1, -1, 0, c_white, 1); if ((5 + pagemax) < arg0) { if (menu == 11 && selltype == "item") { if (itemsellname[5 + pagemax] != " ") draw_sprite_ext(spr_morearrow, 0, camerax() + 370, cameray() + 440 + (sin(cur_jewel / 12) * 3), 1, 1, 0, c_white, 1); } else { draw_sprite_ext(spr_morearrow, 0, camerax() + 370, cameray() + 440 + (sin(cur_jewel / 12) * 3), 1, 1, 0, c_white, 1); } } }
(menumax + 1);
216
                if (menumax > 4)
217
                {
218
                    for (i = 0; i <= menumax; i += 1)
219
                    {
220
                        buff = 0;
221
                        if (menuc[11] == i)
222
                            buff = 3;
223
                        ossafe_fill_rectangle((camerax() + 375) - buff, (cameray() + 295 + (i * (130 / menumax))) - buff, camerax() + 377 + buff, cameray() + 297 + (i * (130 / menumax)) + buff, false);
224
                    }
225
                }
226
            }
227
        }
228
        if (menu == 12 || menu == 16)
229
        {
230
            draw_set_color(c_white);
231
            
scr_84_set_draw_font
scr_84_set_draw_font

function
scr_84_set_draw_font(arg0)
{ global.chemg_font = arg0; draw_set_font(
scr_84_get_font(arg0));
}
("mainbig");
232
            menumax = 47;
233
            if (menu == 12)
234
            {
235
                _up_pressed = 0;
236
                _down_pressed = 0;
237
                if (down_h())
238
                {
239
                    hold_up = 0;
240
                    if (down_p())
241
                        _down_pressed = 1;
242
                    hold_down += 1;
243
                    if (hold_down >= 8)
244
                    {
245
                        _down_pressed = 1;
246
                        hold_down = 6;
247
                    }
248
                    if (_down_pressed == 1)
249
                    {
250
                        if (menuc[menu] < menumax)
251
                        {
252
                            menuc[menu] += 1;
253
                            if (menuc[menu] > (pagemax + 4))
254
                                pagemax += 1;
255
                        }
256
                    }
257
                }
258
                else
259
                {
260
                    hold_down = 0;
261
                }
262
                if (up_h())
263
                {
264
                    hold_down = 0;
265
                    if (up_p())
266
                        _up_pressed = 1;
267
                    hold_up += 1;
268
                    if (hold_up >= 8)
269
                    {
270
                        _up_pressed = 1;
271
                        hold_up = 6;
272
                    }
273
                    if (_up_pressed == 1)
274
                    {
275
                        if (menuc[menu] > 0)
276
                        {
277
                            menuc[menu] -= 1;
278
                            if (menuc[menu] < pagemax)
279
                                pagemax -= 1;
280
                        }
281
                    }
282
                }
283
                else
284
                {
285
                    hold_up = 0;
286
                }
287
            }
288
            j = 0;
289
            for (i = pagemax; i < (5 + pagemax); i += 1)
290
            {
291
                draw_sprite(spr_heart, 0, camerax() + 30, cameray() + 270 + ((menuc[12] - pagemax) * 40));
292
                g = 0;
293
                draw_set_color(c_white);
294
                _itempname = weaponname[i];
295
                if (_itempname == " ")
296
                {
297
                    _itempname = "--------";
298
                    draw_set_color(c_dkgray);
299
                }
300
                draw_text(camerax() + 60, cameray() + 260 + (j * 40), string_hash_to_newline(_itempname));
301
                if (weaponvalue[i] > 1)
302
                    draw_text(camerax() + 300, cameray() + 260 + (j * 40), string_hash_to_newline(stringsetsubloc("$~1", string(ceil(weaponvalue[i] / 2)), "scr_shopmenu_slash_scr_shopmenu_gml_270_0")));
303
                j += 1;
304
            }
305
            draw_set_color(c_white);
306
            if (menu == 12)
307
            {
308
                if (button1_p() && onebuffer < 0)
309
                {
310
                    if (weaponvalue[menuc[12]] > 1)
311
                        menu = 16;
312
                    else if (weaponname[menuc[12]] != " ")
313
                        sidemessage2 = 3;
314
                    else
315
                        sidemessage2 = 4;
316
                    sellvalue = ceil(weaponvalue[menuc[12]] / 2);
317
                    tempmenu = 12;
318
                    onebuffer = 2;
319
                    with (obj_writer)
320
                        instance_destroy();
321
                }
322
                if (button2_p() && twobuffer < 0 && onebuffer < 2)
323
                {
324
                    sidemessage = 0;
325
                    menu = 10;
326
                    twobuffer = 2;
327
                    with (obj_writer)
328
                        instance_destroy();
329
                }
330
            }
331
            
scr_shopmorearrow
scr_shopmorearrow

function
scr_shopmorearrow(arg0)
{ if (pagemax > 0) draw_sprite_ext(spr_morearrow, 0, camerax() + 370, (cameray() + 280) - (sin(cur_jewel / 12) * 3), 1, -1, 0, c_white, 1); if ((5 + pagemax) < arg0) { if (menu == 11 && selltype == "item") { if (itemsellname[5 + pagemax] != " ") draw_sprite_ext(spr_morearrow, 0, camerax() + 370, cameray() + 440 + (sin(cur_jewel / 12) * 3), 1, 1, 0, c_white, 1); } else { draw_sprite_ext(spr_morearrow, 0, camerax() + 370, cameray() + 440 + (sin(cur_jewel / 12) * 3), 1, 1, 0, c_white, 1); } } }
(menumax + 1);
332
            buff = 3;
333
            ossafe_fill_rectangle((camerax() + 375) - buff, (cameray() + 295 + (pagemax * (130 / menumax))) - buff, camerax() + 377 + buff, cameray() + 297 + (pagemax * (130 / menumax)) + buff, false);
334
        }
335
        if (menu == 13 || menu == 17)
336
        {
337
            draw_set_color(c_white);
338
            
scr_84_set_draw_font
scr_84_set_draw_font

function
scr_84_set_draw_font(arg0)
{ global.chemg_font = arg0; draw_set_font(
scr_84_get_font(arg0));
}
("mainbig");
339
            menumax = 47;
340
            if (menu == 13)
341
            {
342
                _up_pressed = 0;
343
                _down_pressed = 0;
344
                if (down_h())
345
                {
346
                    hold_up = 0;
347
                    if (down_p())
348
                        _down_pressed = 1;
349
                    hold_down += 1;
350
                    if (hold_down >= 8)
351
                    {
352
                        _down_pressed = 1;
353
                        hold_down = 6;
354
                    }
355
                    if (_down_pressed == 1)
356
                    {
357
                        if (menuc[menu] < menumax)
358
                        {
359
                            menuc[menu] += 1;
360
                            if (menuc[menu] > (pagemax + 4))
361
                                pagemax += 1;
362
                        }
363
                    }
364
                }
365
                else
366
                {
367
                    hold_down = 0;
368
                }
369
                if (up_h())
370
                {
371
                    hold_down = 0;
372
                    if (up_p())
373
                        _up_pressed = 1;
374
                    hold_up += 1;
375
                    if (hold_up >= 8)
376
                    {
377
                        _up_pressed = 1;
378
                        hold_up = 6;
379
                    }
380
                    if (_up_pressed == 1)
381
                    {
382
                        if (menuc[menu] > 0)
383
                        {
384
                            menuc[menu] -= 1;
385
                            if (menuc[menu] < pagemax)
386
                                pagemax -= 1;
387
                        }
388
                    }
389
                }
390
                else
391
                {
392
                    hold_up = 0;
393
                }
394
            }
395
            j = 0;
396
            for (i = pagemax; i < (5 + pagemax); i += 1)
397
            {
398
                draw_sprite(spr_heart, 0, camerax() + 30, cameray() + 270 + ((menuc[13] - pagemax) * 40));
399
                g = 0;
400
                draw_set_color(c_white);
401
                _itempname = armorname[i];
402
                if (_itempname == " ")
403
                {
404
                    _itempname = "--------";
405
                    draw_set_color(c_dkgray);
406
                }
407
                draw_text(camerax() + 60, cameray() + 260 + (j * 40), string_hash_to_newline(_itempname));
408
                if (armorvalue[i] > 1)
409
                    draw_text(camerax() + 300, cameray() + 260 + (j * 40), string_hash_to_newline(stringsetsubloc("$~1", string(ceil(armorvalue[i] / 2)), "scr_shopmenu_slash_scr_shopmenu_gml_389_0")));
410
                j += 1;
411
            }
412
            draw_set_color(c_white);
413
            if (menu == 13)
414
            {
415
                if (button1_p() && onebuffer < 0)
416
                {
417
                    if (armorvalue[menuc[13]] > 1)
418
                        menu = 17;
419
                    else if (armorname[menuc[13]] != " ")
420
                        sidemessage2 = 3;
421
                    else
422
                        sidemessage2 = 4;
423
                    sellvalue = ceil(armorvalue[menuc[13]] / 2);
424
                    tempmenu = 13;
425
                    onebuffer = 2;
426
                    with (obj_writer)
427
                        instance_destroy();
428
                }
429
                if (button2_p() && twobuffer < 0 && onebuffer < 2)
430
                {
431
                    sidemessage = 0;
432
                    menu = 10;
433
                    twobuffer = 2;
434
                    with (obj_writer)
435
                        instance_destroy();
436
                }
437
            }
438
            
scr_shopmorearrow
scr_shopmorearrow

function
scr_shopmorearrow(arg0)
{ if (pagemax > 0) draw_sprite_ext(spr_morearrow, 0, camerax() + 370, (cameray() + 280) - (sin(cur_jewel / 12) * 3), 1, -1, 0, c_white, 1); if ((5 + pagemax) < arg0) { if (menu == 11 && selltype == "item") { if (itemsellname[5 + pagemax] != " ") draw_sprite_ext(spr_morearrow, 0, camerax() + 370, cameray() + 440 + (sin(cur_jewel / 12) * 3), 1, 1, 0, c_white, 1); } else { draw_sprite_ext(spr_morearrow, 0, camerax() + 370, cameray() + 440 + (sin(cur_jewel / 12) * 3), 1, 1, 0, c_white, 1); } } }
(menumax + 1);
439
            buff = 3;
440
            ossafe_fill_rectangle((camerax() + 375) - buff, (cameray() + 295 + (pagemax * (130 / menumax))) - buff, camerax() + 377 + buff, cameray() + 297 + (pagemax * (130 / menumax)) + buff, false);
441
        }
442
    }
443
    if (arg0 == 5)
444
    {
445
        if (menu == 15)
446
        {
447
            if (button2_p() && twobuffer < 0)
448
            {
449
                menu = tempmenu;
450
                sidemessage2 = 2;
451
                twobuffer = 2;
452
                onebuffer = 2;
453
            }
454
            if (button1_p() && onebuffer < 0 && twobuffer < 0)
455
            {
456
                if (menuc[15] == 0)
457
                {
458
                    snd_play(snd_locker);
459
                    global.gold += sellvalue;
460
                    var noneleft = 0;
461
                    if (selltype == "item")
462
                    {
463
                        
scr_itemshift
scr_itemshift

function
scr_itemshift(arg0, arg1)
{ global.item[12] = arg1; for (i = arg0; i < 12; i += 1) global.item[i] = global.item[i + 1];
scr_iteminfo_all();
scr_itemname();
}
(menuc[11], 0);
464
                        
scr_iteminfo_all
scr_iteminfo_all

function
scr_iteminfo_all()
{ for (i = 0; i < 12; i += 1) { itemid = global.item[i];
scr_iteminfo(itemid);
global.itemnameb[i] = itemnameb; global.itemdescb[i] = itemdescb; global.itemvalue[i] = value; global.itemusable[i] = usable; } }
();
465
                        
scr_itemcheck
scr_itemcheck

function
scr_itemcheck(arg0)
{ haveit = 0; itemcount = 0; for (var __i = 0; __i < 12; __i += 1) { if (global.item[__i] == arg0) haveit = 1; if (global.item[__i] == arg0) itemcount += 1; } return haveit; }
(0);
466
                        if (itemcount == 12)
467
                            noneleft = 1;
468
                        nothingcount = itemcount;
469
                        for (i = 0; i < selltotal; i++)
470
                        {
471
                            itemsellvalue[i] = global.itemvalue[i];
472
                            itemsellname[i] = global.itemnameb[i];
473
                        }
474
                        if (global.item[menuc[11]] == 0)
475
                        {
476
                            menuc[11] -= 1;
477
                            if (pagemax > 0)
478
                                pagemax -= 1;
479
                        }
480
                    }
481
                    if (selltype == "pocket")
482
                    {
483
                        global.pocketitem[menuc[11]] = 0;
484
                        
scr_itemcheck_pocket
scr_itemcheck_pocket

function
scr_itemcheck_pocket(arg0)
{ haveit = 0; itemcount = 0; for (var __i = 0; __i < global.flag[64 storage_size]; __i += 1) { if (global.pocketitem[__i] == arg0) haveit = 1; if (global.pocketitem[__i] == arg0) itemcount += 1; } return haveit; }
(0);
485
                        if (itemcount == global.flag[64 storage_size])
486
                            noneleft = 1;
487
                        nothingcount = 0;
488
                        for (i = 0; i < global.flag[64 storage_size]; i++)
489
                        {
490
                            
scr_iteminfo
scr_iteminfo

function
scr_iteminfo(arg0)
{ usable = 0; replaceable = 0; value = 0; itemtarget = 0; itemnameb = " "; itemdescb = " "; switch (arg0) { case 0: itemnameb = " "; itemdescb = "---"; break; case 1: itemnameb = stringsetloc(
Darker Candy
"Darker Candy", "scr_iteminfo_slash_scr_iteminfo_gml_16_0_b"
);
itemdescb = stringsetloc(
Heals#120HP
"Heals#120HP", "scr_iteminfo_slash_scr_iteminfo_gml_17_0"
);
itemtarget = 1; value = 120; usable = 1; break; case 2: itemnameb = stringsetloc(
ReviveMint
"ReviveMint", "scr_iteminfo_slash_scr_iteminfo_gml_22_0"
);
itemdescb = stringsetloc(
Heal#Downed#Ally
"Heal#Downed#Ally", "scr_iteminfo_slash_scr_iteminfo_gml_23_0"
);
itemtarget = 1; value = 400; usable = 1; break; case 3: itemnameb = stringsetloc(
Glowshard
"Glowshard", "scr_iteminfo_slash_scr_iteminfo_gml_29_0"
);
itemdescb = stringsetloc(
Sell#at#shops
"Sell#at#shops", "scr_iteminfo_slash_scr_iteminfo_gml_30_0"
);
itemtarget = 0; value = 200 + (global.chapter * 100); usable = 0; break; case 4: itemnameb = stringsetloc(
Manual
"Manual", "scr_iteminfo_slash_scr_iteminfo_gml_36_0"
);
itemdescb = stringsetloc(
Read#out of#battle
"Read#out of#battle", "scr_iteminfo_slash_scr_iteminfo_gml_37_0"
);
itemtarget = 2; value = 1; usable = 0; break; case 5: itemnameb = stringsetloc(
BrokenCake
"BrokenCake", "scr_iteminfo_slash_scr_iteminfo_gml_43_0"
);
itemdescb = stringsetloc(
Heals#20HP
"Heals#20HP", "scr_iteminfo_slash_scr_iteminfo_gml_44_0"
);
itemtarget = 1; value = 5; usable = 1; break; case 6: itemnameb = stringsetloc(
Top Cake
"Top Cake", "scr_iteminfo_slash_scr_iteminfo_gml_50_0"
);
itemdescb = stringsetloc(
Heals#team#160HP
"Heals#team#160HP", "scr_iteminfo_slash_scr_iteminfo_gml_51_0"
);
itemtarget = 2; value = 150; usable = 1; break; case 7: var healamount = (global.chapter == 1) ? 80 : 140; if (global.chapter == 3) healamount = 150; if (global.chapter >= 4) healamount = 160; itemnameb = stringsetloc(
Spincake
"Spincake", "scr_iteminfo_slash_scr_iteminfo_gml_58_0"
);
itemdescb = stringsetsubloc("Heals#team#~1HP", string(healamount), "scr_iteminfo_slash_scr_iteminfo_gml_59_0"); itemtarget = 2; value = 5; usable = 1; break; case 8: itemnameb = stringsetloc(
Darkburger
"Darkburger", "scr_iteminfo_slash_scr_iteminfo_gml_65_0"
);
itemdescb = stringsetloc(
Heals#70HP
"Heals#70HP", "scr_iteminfo_slash_scr_iteminfo_gml_66_0"
);
itemtarget = 1; value = 70; usable = 1; break; case 9: itemnameb = stringsetloc(
LancerCookie
"LancerCookie", "scr_iteminfo_slash_scr_iteminfo_gml_72_0"
);
itemdescb = stringsetloc(
Heals#50HP
"Heals#50HP", "scr_iteminfo_slash_scr_iteminfo_gml_73_0"
);
itemtarget = 1; value = 10; usable = 1; break; case 10: itemnameb = stringsetloc(
GigaSalad
"GigaSalad", "scr_iteminfo_slash_scr_iteminfo_gml_79_0"
);
itemdescb = stringsetloc(
Heals#4HP
"Heals#4HP", "scr_iteminfo_slash_scr_iteminfo_gml_80_0"
);
itemtarget = 1; value = 10; usable = 1; break; case 11: itemnameb = stringsetloc(
ClubsSandwich
"ClubsSandwich", "scr_iteminfo_slash_scr_iteminfo_gml_86_0"
);
itemdescb = stringsetloc(
Heals#team#70HP
"Heals#team#70HP", "scr_iteminfo_slash_scr_iteminfo_gml_87_0"
);
itemtarget = 2; value = 70; usable = 1; break; case 12: itemnameb = stringsetloc(
HeartsDonut
"HeartsDonut", "scr_iteminfo_slash_scr_iteminfo_gml_93_0"
);
itemdescb = stringsetloc(
Healing#varies
"Healing#varies", "scr_iteminfo_slash_scr_iteminfo_gml_94_0"
);
itemtarget = 1; value = 40; ...
(global.pocketitem[i]);
491
                            itemsellvalue[i] = value;
492
                            itemsellname[i] = itemnameb;
493
                        }
494
                    }
495
                    if (noneleft == 1)
496
                    {
497
                        menu = 10;
498
                        sidemessage = 1;
499
                    }
500
                    else
501
                    {
502
                        menu = 11;
503
                        sidemessage2 = 1;
504
                    }
505
                }
506
                if (menuc[15] == 1)
507
                {
508
                    sidemessage2 = 2;
509
                    menu = 11;
510
                }
511
            }
512
        }
513
        if (menu == 16)
514
        {
515
            if (button2_p() && twobuffer < 0)
516
            {
517
                menu = tempmenu;
518
                sidemessage2 = 2;
519
                twobuffer = 2;
520
                onebuffer = 2;
521
            }
522
            if (button1_p() && onebuffer < 0 && twobuffer < 0)
523
            {
524
                if (menuc[16] == 0)
525
                {
526
                    snd_play(snd_locker);
527
                    global.gold += sellvalue;
528
                    global.weapon[menuc[12]] = 0;
529
                    
scr_weaponinfo_all
scr_weaponinfo_all

function
scr_weaponinfo_all()
{ for (i = 0; i < 48; i += 1) {
scr_weaponinfo(global.weapon[i]);
weaponname[i] = weaponnametemp; weapondesc[i] = weapondesctemp; wmessage2[i] = wmessage2temp; wmessage3[i] = wmessage3temp; wmessage4[i] = wmessage4temp; weaponat[i] = weaponattemp; weapondf[i] = weapondftemp; weaponmag[i] = weaponmagtemp; weaponbolts[i] = weaponboltstemp; weaponstyle[i] = weaponstyletemp; weapongrazeamt[i] = weapongrazeamttemp; weapongrazesize[i] = weapongrazesizetemp; weaponchar1[i] = weaponchar1temp; weaponchar2[i] = weaponchar2temp; weaponchar3[i] = weaponchar3temp; weaponchar4[i] = weaponchar4temp; weaponvalue[i] = value; weaponability[i] = weaponabilitytemp; weaponabilityicon[i] = weaponabilityicontemp; weaponicon[i] = weaponicontemp; } }
();
530
                    
scr_weaponcheck_inventory
scr_weaponcheck_inventory

function
scr_weaponcheck_inventory(arg0)
{ haveit = 0; itemcount = 0; for (i = 0; i < 48; i += 1) { if (global.weapon[i] == arg0) haveit = 1; if (global.weapon[i] == arg0) itemcount += 1; } return haveit; }
(0);
531
                    if (itemcount == 12)
532
                    {
533
                        menu = 10;
534
                        sidemessage = 1;
535
                    }
536
                    else
537
                    {
538
                        menu = 12;
539
                        sidemessage2 = 1;
540
                    }
541
                }
542
                if (menuc[16] == 1)
543
                {
544
                    sidemessage2 = 2;
545
                    menu = 12;
546
                }
547
            }
548
        }
549
        if (menu == 17)
550
        {
551
            if (button2_p() && twobuffer < 0)
552
            {
553
                menu = tempmenu;
554
                sidemessage2 = 2;
555
                twobuffer = 2;
556
                onebuffer = 2;
557
            }
558
            if (button1_p() && onebuffer < 0 && twobuffer < 0)
559
            {
560
                if (menuc[17] == 0)
561
                {
562
                    snd_play(snd_locker);
563
                    global.gold += sellvalue;
564
                    global.armor[menuc[13]] = 0;
565
                    
scr_armorinfo_all
scr_armorinfo_all

function
scr_armorinfo_all()
{ for (i = 0; i < 48; i += 1) {
scr_armorinfo(global.armor[i]);
armorname[i] = armornametemp; armordesc[i] = armordesctemp; amessage2[i] = amessage2temp; amessage3[i] = amessage3temp; amessage4[i] = amessage4temp; armorat[i] = armorattemp; armordf[i] = armordftemp; armormag[i] = armormagtemp; armorbolts[i] = armorboltstemp; armorgrazeamt[i] = armorgrazeamttemp; armorgrazesize[i] = armorgrazesizetemp; armorchar1[i] = armorchar1temp; armorchar2[i] = armorchar2temp; armorchar3[i] = armorchar3temp; armorchar4[i] = armorchar4temp; armorvalue[i] = value; armorability[i] = armorabilitytemp; armorabilityicon[i] = armorabilityicontemp; armoricon[i] = armoricontemp; armorelement[i] = armorelementtemp; armorelementamount[i] = armorelementamounttemp; } }
();
566
                    
scr_armorcheck_inventory
scr_armorcheck_inventory

function
scr_armorcheck_inventory(arg0)
{ haveit = 0; itemcount = 0; for (i = 0; i < 48; i += 1) { if (global.armor[i] == arg0) haveit = 1; if (global.armor[i] == arg0) itemcount += 1; } return haveit; }
(0);
567
                    if (itemcount == 12)
568
                    {
569
                        menu = 10;
570
                        sidemessage = 1;
571
                    }
572
                    else
573
                    {
574
                        menu = 13;
575
                        sidemessage2 = 1;
576
                    }
577
                }
578
                if (menuc[17] == 1)
579
                {
580
                    sidemessage2 = 2;
581
                    menu = 13;
582
                }
583
            }
584
        }
585
    }
586
}