Deltarune (Chapter 1) script viewer

← back to main script listing

gml_GlobalScript_scr_healitem

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

function scr_healitem(arg0, arg1) { scr_heal(arg0, arg1); healx = scr_charbox_x(arg0); healtext = instance_create(healx + 70 + xx, yy + 430, obj_healwriter); healtext.healamt = arg1; }
(arg0, arg1)
2
{
3
    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; }
(arg0, arg1);
4
    healx = scr_charbox_x
scr_charbox_x

function scr_charbox_x(arg0) { if (arg0 == 0 && chartotal == 3) return 0; if (arg0 == 1 && chartotal == 3) return 212; if (arg0 == 2 && chartotal == 3) return 424; if (arg0 == 0 && chartotal == 2) return 106; if (arg0 == 1 && chartotal == 2) return 326; if (arg0 == 0 && chartotal == 1) return 212; }
(arg0);
5
    healtext = instance_create(healx + 70 + xx, yy + 430, obj_healwriter);
6
    healtext.healamt = arg1;
7
}