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