Deltarune (Chapter 1) script viewer

← back to main script listing

gml_GlobalScript_scr_healitemspell

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

function scr_healitemspell(arg0) { scr_heal(star, arg0); with (global.charinstance[star]) { ha = instance_create(x, y, obj_healanim); ha.target = id; dmgwr = scr_dmgwriter_selfchar(); with (dmgwr) { delay = 8; type = 3; damage = arg0; } if (global.hp[global.char[myself]] >= global.maxhp[global.char[myself]]) { with (dmgwr) specialmessage = 3; } tu += 1; } global.spelldelay = 15; }
(arg0)
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; }
(star, arg0);
4
    with (global.charinstance[star])
5
    {
6
        ha = instance_create(x, y, obj_healanim);
7
        ha.target = id;
8
        dmgwr = scr_dmgwriter_selfchar
scr_dmgwriter_selfchar

function scr_dmgwriter_selfchar() { return instance_create(x, (y + myheight) - 24 - (tu * 20), obj_dmgwriter); }
();
9
        with (dmgwr)
10
        {
11
            delay = 8;
12
            type = 3;
13
            damage = arg0;
14
        }
15
        if (global.hp[global.char[myself]] >= global.maxhp[global.char[myself]])
16
        {
17
            with (dmgwr)
18
                specialmessage = 3;
19
        }
20
        tu += 1;
21
    }
22
    global.spelldelay = 15;
23
}