1 |
function scr_healscr_healfunction 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) |
2 |
{ |
3 |
abovemaxhp = 0; |
4 |
belowzero = 0; |
5 |
hltarget = global.char[arg0]; |
6 |
_curhp = global.hp[hltarget]; |
7 |
if (global.hp[hltarget] <= 0) |
8 |
belowzero = 1; |
9 |
if (global.hp[hltarget] > global.maxhp[hltarget]) |
10 |
abovemaxhp = 1; |
11 |
if (abovemaxhp == 0) |
12 |
{ |
13 |
global.hp[hltarget] += arg1; |
14 |
if (global.hp[hltarget] > global.maxhp[hltarget]) |
15 |
global.hp[hltarget] = global.maxhp[hltarget]; |
16 |
} |
17 |
if (belowzero == 1 && global.hp[hltarget] >= 0) |
18 |
{ |
19 |
if (global.hp[hltarget] < ceil(global.maxhp[hltarget] / 6)) |
20 |
global.hp[hltarget] = ceil(global.maxhp[hltarget] / 6); |
21 |
scr_revivescr_revivefunction scr_revive(arg0)
{
global.charmove[arg0] = 1;
global.charcantarget[arg0] = 1;
global.chardead[arg0] = 0;
} (arg0); |
22 |
} |
23 |
snd_stop(snd_power); |
24 |
snd_play(snd_power); |
25 |
return global.hp[hltarget] - _curhp; |
26 |
} |