Undertale script viewer

← back to main script listing

gml_Script_scr_binfowrite

(view raw script w/o annotations or w/e)
1
draw_set_color(c_white);
2
var namex = 30;
3
var namey = 400;
4
var namewidth = scr_draw_name_curs
scr_draw_name_curs

var xx = argument0; var yy = argument1; var use_font; if (global.language == "ja") { use_font = 12; yy += 3; } else { use_font = 7; for (var i = 1; i < strlen(global.charname); i++) { if (ord(string_char_at(global.charname, i)) >= 12288) { use_font = 12; yy += 3; break; } } } draw_set_font(use_font); draw_text(xx, yy, global.charname); return string_width(global.charname);
(namex, namey);
5
draw_set_font(fnt_curs);
6
draw_text(namex + namewidth, 400, "   LV " + string(global.lv));
7
if (global.flag[271 fighting_sans] == 0)
8
{
9
    draw_set_color(c_red);
10
    ossafe_fill_rectangle(275, 400, 275 + (global.maxhp * 1.2), 420);
11
    draw_set_color(c_yellow);
12
    ossafe_fill_rectangle(275, 400, 275 + (global.hp * 1.2), 420);
13
    draw_set_color(c_white);
14
    draw_set_font(fnt_curs);
15
    hpwrite = string(global.hp);
16
    if (global.hp < 10)
17
        hpwrite = "0" + string(global.hp);
18
    if (global.hp < 0)
19
        hpwrite = "0";
20
    if (global.flag[509 decimal_hp_state] == 1)
21
        hpwrite = "00.001";
22
    if (global.flag[509 decimal_hp_state] == 2)
23
        hpwrite = "00.0001";
24
    if (global.flag[509 decimal_hp_state] == 3)
25
        hpwrite = "00.000001";
26
    if (global.flag[509 decimal_hp_state] == 4)
27
        hpwrite = "00.0000000001";
28
    draw_text(290 + (global.maxhp * 1.2), 400, hpwrite + " / " + string(global.maxhp));
29
}
30
else
31
{
32
    draw_set_color(merge_color(c_red, c_maroon, 0.5));
33
    ossafe_fill_rectangle(255, 400, 255 + (global.maxhp * 1.2), 420);
34
    draw_set_color(c_yellow);
35
    ossafe_fill_rectangle(255, 400, 255 + (global.hp * 1.2), 420);
36
    draw_set_color(c_fuchsia);
37
    if (global.km > 40)
38
        global.km = 40;
39
    if (global.km >= global.hp)
40
        global.km = global.hp - 1;
41
    ossafe_fill_rectangle(255 + (global.hp * 1.2), 400, (255 + (global.hp * 1.2)) - (global.km * 1.2), 420);
42
    draw_sprite(spr_krmeter, 0, 265 + (global.maxhp * 1.2), 405);
43
    draw_set_color(c_white);
44
    draw_set_font(fnt_curs);
45
    hpwrite = string(global.hp);
46
    if (global.km > 0)
47
        draw_set_color(c_fuchsia);
48
    if (global.hp < 10)
49
        hpwrite = "0" + string(global.hp);
50
    if (global.hp < 0)
51
        hpwrite = "0";
52
    draw_text(305 + (global.maxhp * 1.2), 400, hpwrite + " / " + string(global.maxhp));
53
    draw_set_color(c_white);
54
    if (instance_exists(obj_hpname))
55
    {
56
        with (obj_hpname)
57
            instance_destroy();
58
    }
59
    draw_sprite(spr_hpname, 0, 220, 400);
60
}