Deltarune (Chapter 3) script viewer

← back to main script listing

gml_GlobalScript_scr_board_battlehealth

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

function
scr_board_battlehealth()
{ with (obj_mainchara_board) { if (name == "kris") global.hp[1] = round((myhealth / maxhealth) * global.maxhp[1]); if (name == "susie") global.hp[2] = round((myhealth / maxhealth) * global.maxhp[2]); if (name == "ralsei") global.hp[3] = round((myhealth / maxhealth) * global.maxhp[3]); } } function scr_board_boardhealth() { with (obj_mainchara_board) { if (name == "kris") { global.hp[1] = round((myhealth / maxhealth) * global.maxhp[1]); myhealth = round((global.hp[1] / global.maxhp[1]) * maxhealth); if (myhealth < 1) myhealth = 1; } if (name == "susie") { myhealth = round((global.hp[2] / global.maxhp[2]) * maxhealth); if (myhealth < 1) myhealth = 1; } if (name == "ralsei") { myhealth = round((global.hp[3] / global.maxhp[3]) * maxhealth); if (myhealth < 1) myhealth = 1; } } }
()
2
{
3
    with (obj_mainchara_board)
4
    {
5
        if (name == "kris")
6
            global.hp[1] = round((myhealth / maxhealth) * global.maxhp[1]);
7
        if (name == "susie")
8
            global.hp[2] = round((myhealth / maxhealth) * global.maxhp[2]);
9
        if (name == "ralsei")
10
            global.hp[3] = round((myhealth / maxhealth) * global.maxhp[3]);
11
    }
12
}
13
14
function scr_board_boardhealth()
15
{
16
    with (obj_mainchara_board)
17
    {
18
        if (name == "kris")
19
        {
20
            global.hp[1] = round((myhealth / maxhealth) * global.maxhp[1]);
21
            myhealth = round((global.hp[1] / global.maxhp[1]) * maxhealth);
22
            if (myhealth < 1)
23
                myhealth = 1;
24
        }
25
        if (name == "susie")
26
        {
27
            myhealth = round((global.hp[2] / global.maxhp[2]) * maxhealth);
28
            if (myhealth < 1)
29
                myhealth = 1;
30
        }
31
        if (name == "ralsei")
32
        {
33
            myhealth = round((global.hp[3] / global.maxhp[3]) * maxhealth);
34
            if (myhealth < 1)
35
                myhealth = 1;
36
        }
37
    }
38
}