Deltarune (Chapter 4) script viewer

← back to main script listing

gml_GlobalScript_scr_itemget

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

function scr_itemget(arg0) { var __i = 0; var loop = 1; noroom = 0; _pocketed = 0; _noroominventory = 0; global.item[12] = 999; while (loop == 1) { if (global.item[__i] == 0) { global.item[__i] = arg0; break; } if (__i == 12) { _noroominventory = 1; noroom = 1; for (var __j = 0; __j < global.flag[64 storage_size]; __j++) { if (global.pocketitem[__j] == 0) { debug_message("Placed in pocket :" + string(__j)); global.pocketitem[__j] = arg0; _pocketed = 1; noroom = 0; break; } } break; } __i += 1; } script_execute(scr_iteminfo_all); debug_message("noroom=" + string(noroom)); debug_message("_pocketed=" + string(_pocketed)); debug_message("_noroominventory=" + string(_noroominventory)); }
(arg0)
2
{
3
    var __i = 0;
4
    var loop = 1;
5
    noroom = 0;
6
    _pocketed = 0;
7
    _noroominventory = 0;
8
    global.item[12] = 999;
9
    while (loop == 1)
10
    {
11
        if (global.item[__i] == 0)
12
        {
13
            global.item[__i] = arg0;
14
            break;
15
        }
16
        if (__i == 12)
17
        {
18
            _noroominventory = 1;
19
            noroom = 1;
20
            for (var __j = 0; __j < global.flag[64 storage_size]; __j++)
21
            {
22
                if (global.pocketitem[__j] == 0)
23
                {
24
                    debug_message("Placed in pocket :" + string(__j));
25
                    global.pocketitem[__j] = arg0;
26
                    _pocketed = 1;
27
                    noroom = 0;
28
                    break;
29
                }
30
            }
31
            break;
32
        }
33
        __i += 1;
34
    }
35
    script_execute(scr_iteminfo_all);
36
    debug_message("noroom=" + string(noroom));
37
    debug_message("_pocketed=" + string(_pocketed));
38
    debug_message("_noroominventory=" + string(_noroominventory));
39
}