Deltarune (Chapter 3) 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)
{ var __healAmount =
scr_heal_amount_modify_by_equipment(arg0);
scr_heal(star, __healAmount);
global.spelldelay = 15; 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 = __healAmount; } if (global.hp[global.char[myself]] >= global.maxhp[global.char[myself]]) { with (dmgwr) specialmessage = 3; } tu += 1; return ha; } }
(arg0)
2
{
3
    var __healAmount = 
scr_heal_amount_modify_by_equipment
scr_heal_amount_modify_by_equipment

function
scr_heal_amount_modify_by_equipment(arg0)
{ var ___healAmount = arg0; var ___healAdd = 0; if (global.chararmor1[global.char[caster]] == 26) ___healAdd += ceil(___healAmount / 8); if (global.chararmor2[global.char[caster]] == 26) ___healAdd += ceil(___healAmount / 8); return ___healAmount + ___healAdd; }
(arg0);
4
    
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, __healAmount);
5
    global.spelldelay = 15;
6
    with (global.charinstance[star])
7
    {
8
        ha = instance_create(x, y, obj_healanim);
9
        ha.target = id;
10
        dmgwr = 
scr_dmgwriter_selfchar
scr_dmgwriter_selfchar

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