Deltarune script viewer

← back to main script listing

gml_GlobalScript_scr_itemcheck_inventory_and_pocket

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

function scr_itemcheck_inventory_and_pocket(arg0) { var _haveeither = 0; var itemcounttotal = 0; scr_itemcheck(arg0); if (haveit == 1) _haveeither = 1; itemcounttotal += itemcount; scr_itemcheck_pocket(arg0); if (haveit == 1) _haveeither = 1; itemcounttotal += itemcount; haveit = _haveeither; itemcount = itemcounttotal; return haveit; }
(arg0)
2
{
3
    var _haveeither = 0;
4
    var itemcounttotal = 0;
5
    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; }
(arg0);
6
    if (haveit == 1)
7
        _haveeither = 1;
8
    itemcounttotal += itemcount;
9
    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; }
(arg0);
10
    if (haveit == 1)
11
        _haveeither = 1;
12
    itemcounttotal += itemcount;
13
    haveit = _haveeither;
14
    itemcount = itemcounttotal;
15
    return haveit;
16
}