Deltarune script viewer

← back to main script listing

gml_GlobalScript_scr_become_light_ch1

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

function scr_become_light_ch1() { if (scr_litemcheck_ch1(5) == 0) scr_litemget_ch1(5); if (scr_keyitemcheck_ch1(2)) { if (scr_litemcheck_ch1(8) == 0) scr_litemget_ch1(8); } if (scr_keyitemcheck_ch1(13)) { if (scr_litemcheck_ch1(11) == 0) scr_litemget_ch1(11); } else { scr_litemremove_ch1(11); } global.lhp = ceil(global.hp[1] / global.maxhp[1]) * global.lmaxhp; if (global.lhp < 1) global.lhp = 1; if (global.lhp > global.lmaxhp) global.lhp = global.lmaxhp; global.lwstrength = 1; if (global.charweapon[1] == 1) global.lweapon = 2; if (global.charweapon[1] == 5) global.lweapon = 6; if (global.charweapon[1] == 8) global.lweapon = 7; global.darkzone = 0; }
()
2
{
3
    if (scr_litemcheck_ch1
scr_litemcheck_ch1

function scr_litemcheck_ch1(arg0) { haveit = 0; itemcount = 0; for (i = 0; i < 8; i += 1) { if (global.litem[i] == arg0) haveit = 1; if (global.litem[i] == arg0) itemcount += 1; } return haveit; }
(5) == 0)
4
        scr_litemget_ch1
scr_litemget_ch1

function scr_litemget_ch1(arg0) { i = 0; loop = 1; noroom = 0; global.litem[8] = 999; while (loop == 1) { if (global.litem[i] == 0) { global.litem[i] = arg0; break; } if (i == 8) { noroom = 1; break; } i += 1; } scr_litemname_ch1(); }
(5);
5
    if (scr_keyitemcheck_ch1
scr_keyitemcheck_ch1

function scr_keyitemcheck_ch1(arg0) { haveit = 0; itemcount = 0; for (i = 0; i < 12; i += 1) { if (global.keyitem[i] == arg0) haveit = 1; if (global.keyitem[i] == arg0) itemcount += 1; } return haveit; }
(2))
6
    {
7
        if (scr_litemcheck_ch1
scr_litemcheck_ch1

function scr_litemcheck_ch1(arg0) { haveit = 0; itemcount = 0; for (i = 0; i < 8; i += 1) { if (global.litem[i] == arg0) haveit = 1; if (global.litem[i] == arg0) itemcount += 1; } return haveit; }
(8) == 0)
8
            scr_litemget_ch1
scr_litemget_ch1

function scr_litemget_ch1(arg0) { i = 0; loop = 1; noroom = 0; global.litem[8] = 999; while (loop == 1) { if (global.litem[i] == 0) { global.litem[i] = arg0; break; } if (i == 8) { noroom = 1; break; } i += 1; } scr_litemname_ch1(); }
(8);
9
    }
10
    if (scr_keyitemcheck_ch1
scr_keyitemcheck_ch1

function scr_keyitemcheck_ch1(arg0) { haveit = 0; itemcount = 0; for (i = 0; i < 12; i += 1) { if (global.keyitem[i] == arg0) haveit = 1; if (global.keyitem[i] == arg0) itemcount += 1; } return haveit; }
(13))
11
    {
12
        if (scr_litemcheck_ch1
scr_litemcheck_ch1

function scr_litemcheck_ch1(arg0) { haveit = 0; itemcount = 0; for (i = 0; i < 8; i += 1) { if (global.litem[i] == arg0) haveit = 1; if (global.litem[i] == arg0) itemcount += 1; } return haveit; }
(11) == 0)
13
            scr_litemget_ch1
scr_litemget_ch1

function scr_litemget_ch1(arg0) { i = 0; loop = 1; noroom = 0; global.litem[8] = 999; while (loop == 1) { if (global.litem[i] == 0) { global.litem[i] = arg0; break; } if (i == 8) { noroom = 1; break; } i += 1; } scr_litemname_ch1(); }
(11);
14
    }
15
    else
16
    {
17
        scr_litemremove_ch1
scr_litemremove_ch1

function scr_litemremove_ch1(arg0) { for (i = 0; i < 8; i += 1) { if (global.litem[i] == arg0) script_execute(scr_litemshift_ch1, i, 0); } }
(11);
18
    }
19
    global.lhp = ceil(global.hp[1] / global.maxhp[1]) * global.lmaxhp;
20
    if (global.lhp < 1)
21
        global.lhp = 1;
22
    if (global.lhp > global.lmaxhp)
23
        global.lhp = global.lmaxhp;
24
    global.lwstrength = 1;
25
    if (global.charweapon[1] == 1)
26
        global.lweapon = 2;
27
    if (global.charweapon[1] == 5)
28
        global.lweapon = 6;
29
    if (global.charweapon[1] == 8)
30
        global.lweapon = 7;
31
    global.darkzone = 0;
32
}