Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_titan_enemy_Other_11

(view raw script w/o annotations or w/e)
1
with (obj_dmgwriter)
2
{
3
    if (delaytimer >= 1)
4
        killactive = 1;
5
}
6
for (i = 0; i < 3; i++)
7
{
8
    if (global.hp[i + 1] <= 0)
9
    {
10
        var _hltarget = global.char[i];
11
        var _curhp = global.hp[_hltarget];
12
        var _healpower;
13
        if (_curhp <= 0)
14
            _healpower = -_curhp + 5;
15
        else
16
            _healpower = 1;
17
        
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, _healpower);
18
        with (global.charinstance[i])
19
        {
20
            ha = instance_create(x, y, obj_healanim);
21
            ha.target = id;
22
            dmgwr = 
scr_dmgwriter_selfchar
scr_dmgwriter_selfchar

function
scr_dmgwriter_selfchar()
{ return instance_create(x, (y + myheight) - 24 - (tu * 20), obj_dmgwriter); }
();
23
            with (dmgwr)
24
            {
25
                delay = 8;
26
                type = 3;
27
                damage = _healpower;
28
            }
29
            if (global.hp[global.char[myself]] >= global.maxhp[global.char[myself]])
30
            {
31
                with (dmgwr)
32
                    specialmessage = 3;
33
            }
34
            tu += 1;
35
        }
36
    }
37
}
38
for (i = 0; i < 3; i++)
39
{
40
    with (global.charinstance[i])
41
        tu--;
42
}