Undertale script viewer

← back to main script listing

gml_Object_obj_floweydmgwriter_Draw_0

(view raw script w/o annotations or w/e)
1
thisnum = dmg;
2
if (thisnum >= 0)
3
{
4
    place = 0;
5
    numadd = 10;
6
    if (thisnum >= numadd)
7
    {
8
        while (thisnum >= numadd)
9
        {
10
            place += 1;
11
            numadd *= 10;
12
        }
13
    }
14
}
15
else
16
{
17
    thisnum = 0;
18
    place = 0;
19
}
20
thisnum2 = thisnum;
21
for (i = place; i >= 0; i -= 1)
22
{
23
    numnum[i] = floor(thisnum2 / power(10, i));
24
    thisnum2 -= (numnum[i] * power(10, i));
25
}
26
draw_set_color(c_black);
27
ossafe_fill_rectangle(x - 1, ystart + 7, x + (global.floweymaxhp * stretchfactor) + 1, ystart + 28);
28
draw_set_color(c_dkgray);
29
ossafe_fill_rectangle(x, ystart + 8, x + (global.floweymaxhp * stretchfactor), ystart + 28);
30
draw_set_color(c_lime);
31
if (apparenthp > 0)
32
    ossafe_fill_rectangle(x, ystart + 8, x + (apparenthp * stretchfactor), ystart + 28);
33
for (i = place; i >= 0; i -= 1)
34
{
35
    draw_set_color(c_red);
36
    draw_sprite_ext(spr_dmgnum_o, numnum[i], (((x - 20) + (stretchwidth / 2)) - (i * 32)) + (place * 16), y - 28, 1, 1, 0, c_red, 1);
37
}
38
if (y > ystart)
39
{
40
    y = ystart;
41
    vspeed = 0;
42
    gravity = 0;
43
}