Deltarune (Chapter 1) script viewer

← back to main script listing

gml_GlobalScript_scr_healall

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

function scr_healall(arg0) { for (i = 0; i < 3; i += 1) { if (global.char[i] != 0) scr_heal(i, arg0); } }
(arg0)
2
{
3
    for (i = 0; i < 3; i += 1)
4
    {
5
        if (global.char[i] != 0)
6
            scr_heal
scr_heal

function scr_heal(arg0, arg1) { abovemaxhp = 0; belowzero = 0; hltarget = global.char[arg0]; _curhp = global.hp[hltarget]; if (global.hp[hltarget] <= 0) belowzero = 1; if (global.hp[hltarget] > global.maxhp[hltarget]) abovemaxhp = 1; if (abovemaxhp == 0) { global.hp[hltarget] += arg1; if (global.hp[hltarget] > global.maxhp[hltarget]) global.hp[hltarget] = global.maxhp[hltarget]; } if (belowzero == 1 && global.hp[hltarget] >= 0) { if (global.hp[hltarget] < ceil(global.maxhp[hltarget] / 6)) global.hp[hltarget] = ceil(global.maxhp[hltarget] / 6); scr_revive(arg0); } snd_stop(snd_power); snd_play(snd_power); return global.hp[hltarget] - _curhp; }
(i, arg0);
7
    }
8
}