Deltarune (Chapter 4) script viewer

← back to main script listing

gml_GlobalScript_scr_charbox_mike

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

function
scr_charbox_mike()
{ for (c = 0; c < 4; c += 1) { if (havechar[c] == 1) { if (c == 0) charcolor = hpcolor[0]; if (c == 1) charcolor = hpcolor[1]; if (c == 2) charcolor = hpcolor[2]; if (c == 3) charcolor = hpcolor[3]; gc = global.charturn; xchunk = 0; if (charpos[c] == 0 && chartotal == 3) xchunk = 0; if (charpos[c] == 1 && chartotal == 3) xchunk = 213; if (charpos[c] == 2 && chartotal == 3) xchunk = 426; if (charpos[c] == 0 && chartotal == 2) xchunk = 108; if (charpos[c] == 1 && chartotal == 2) xchunk = 322; if (charpos[c] == 0 && chartotal == 1) xchunk = 213; if (gc == charpos[c]) { if (global.myfight == 0)
scr_selectionmatrix(xx + xchunk, (480 - bp) + yy);
if (mmy[c] > -32) mmy[c] -= 2; if (mmy[c] > -24) mmy[c] -= 4; if (mmy[c] > -16) mmy[c] -= 6; if (mmy[c] > -8) mmy[c] -= 8; if (mmy[c] < -32) mmy[c] = -64; } else if (mmy[c] < -14) { mmy[c] += 15; } else { mmy[c] = 0; } btc[0] = 0; btc[1] = 0; btc[2] = 0; btc[3] = 0; btc[4] = 0; if (gc == charpos[c]) btc[global.bmenucoord[0][global.charturn]] = 1; if (gc == charpos[c]) draw_set_color(charcolor); else draw_set_color(bcolor); if (global.charselect == charpos[c] || global.charselect == 3) draw_set_color(charcolor); ossafe_fill_rectangle(xx + xchunk, (480 - bp - 3) + yy + mmy[c], xx + xchunk + 212, ((480 - bp) + yy) - 2, false); draw_set_color(c_black); ossafe_fill_rectangle(xx + xchunk + 2, (480 - bp - 1) + yy + mmy[c], xx + xchunk + 210, (480 - bp) + yy + mmy[c] + 33, false); b_offset = 480; if (global.fighting == 0) b_offset = 430; if (global.fighting == 1) b_offset = 336; if (c == 0) { draw_sprite(spr_headkris, global.faceaction[charpos[c]], xx + 13 + xchunk, bpoff + b_offset + mmy[c]); draw_sprite(
scr_84_get_sprite("spr_bnamekris"), 0, xx + 51 + xchunk, bpoff + b_offset + 3 + mmy[c]);
} if (c == 1) { draw_sprite(spr_headsusie, global.faceaction[charpos[c]], xx + 13 + xchunk, bpoff + b_offset + mmy[c]); draw_sprite(
scr_84_get_sprite("spr_bnamesusie"), 0, xx + 51 + xchunk, bpoff + b_offset + 3 + mmy[c]);
} if (c == 2) { draw_sprite(spr_headralsei, global.faceaction[charpos[c]], xx + 13 + xchunk, bpoff + b_offset + mmy[c]); draw_sprite(
scr_84_get_sprite("spr_bnameralsei"), 0, xx + 51 + xchunk, bpoff + b_offset + 3 + mmy[c]);
} if (c == 3) { draw_sprite(spr_headnoelle, global.faceaction[charpos[c]], xx + 13 + xchunk, bpoff + b_offset + mmy[c]); draw_sprite(
scr_84_get_sprite("spr_bnamenoelle"), 0, xx + 51 + xchunk, bpoff + b_offset + 3 + mmy[c]);
} draw_sprite(spr_hpname, 0, xx + 109 + xchunk, bpoff + b_offset + 11 + mmy[c]); draw_set_color(c_white); draw_set_font(global.hpfont); if ((global.hp[c + 1] / global.maxhp[c + 1]) <= 0.25) draw_set_color(c_yellow); if (global.hp[c + 1] <= 0) draw_set_color(c_red); draw_set_halign(fa_right); draw_text(xx + 160 + xchunk, ((bpoff + b_offset) - 2) + mmy[c], string_hash_to_newline(global.hp[c + 1])); ...
()
2
{
3
    for (c = 0; c < 4; c += 1)
4
    {
5
        if (havechar[c] == 1)
6
        {
7
            if (c == 0)
8
                charcolor = hpcolor[0];
9
            if (c == 1)
10
                charcolor = hpcolor[1];
11
            if (c == 2)
12
                charcolor = hpcolor[2];
13
            if (c == 3)
14
                charcolor = hpcolor[3];
15
            gc = global.charturn;
16
            xchunk = 0;
17
            if (charpos[c] == 0 && chartotal == 3)
18
                xchunk = 0;
19
            if (charpos[c] == 1 && chartotal == 3)
20
                xchunk = 213;
21
            if (charpos[c] == 2 && chartotal == 3)
22
                xchunk = 426;
23
            if (charpos[c] == 0 && chartotal == 2)
24
                xchunk = 108;
25
            if (charpos[c] == 1 && chartotal == 2)
26
                xchunk = 322;
27
            if (charpos[c] == 0 && chartotal == 1)
28
                xchunk = 213;
29
            if (gc == charpos[c])
30
            {
31
                if (global.myfight == 0)
32
                    
scr_selectionmatrix
scr_selectionmatrix

function
scr_selectionmatrix(arg0, arg1)
{ slmxx = arg0; slmyy = arg1; s_siner += 2; draw_set_color(charcolor); ossafe_fill_rectangle(slmxx, slmyy, slmxx + 210, slmyy + 3, false); for (i = 0; i < 12; i += 1) { myxx = s_siner + (i * (10 * pi)); draw_set_alpha(sin(myxx / 60)); d_line_width(slmxx, slmyy - 3, slmxx, slmyy + 33, 2); d_line_width(slmxx + 210 + 1, slmyy - 3, slmxx + 210 + 1, slmyy + 33, 2); if (cos(myxx / 60) < 0) { d_line_width((slmxx - (sin(myxx / 60) * 30)) + 30, slmyy, (slmxx - (sin(myxx / 60) * 30)) + 30, slmyy + 33, 2); d_line_width((slmxx + 210 + (sin(myxx / 60) * 30)) - 30, slmyy, (slmxx + 210 + (sin(myxx / 60) * 30)) - 30, slmyy + 33, 2); } } draw_set_alpha(1); }
(xx + xchunk, (480 - bp) + yy);
33
                if (mmy[c] > -32)
34
                    mmy[c] -= 2;
35
                if (mmy[c] > -24)
36
                    mmy[c] -= 4;
37
                if (mmy[c] > -16)
38
                    mmy[c] -= 6;
39
                if (mmy[c] > -8)
40
                    mmy[c] -= 8;
41
                if (mmy[c] < -32)
42
                    mmy[c] = -64;
43
            }
44
            else if (mmy[c] < -14)
45
            {
46
                mmy[c] += 15;
47
            }
48
            else
49
            {
50
                mmy[c] = 0;
51
            }
52
            btc[0] = 0;
53
            btc[1] = 0;
54
            btc[2] = 0;
55
            btc[3] = 0;
56
            btc[4] = 0;
57
            if (gc == charpos[c])
58
                btc[global.bmenucoord[0][global.charturn]] = 1;
59
            if (gc == charpos[c])
60
                draw_set_color(charcolor);
61
            else
62
                draw_set_color(bcolor);
63
            if (global.charselect == charpos[c] || global.charselect == 3)
64
                draw_set_color(charcolor);
65
            ossafe_fill_rectangle(xx + xchunk, (480 - bp - 3) + yy + mmy[c], xx + xchunk + 212, ((480 - bp) + yy) - 2, false);
66
            draw_set_color(c_black);
67
            ossafe_fill_rectangle(xx + xchunk + 2, (480 - bp - 1) + yy + mmy[c], xx + xchunk + 210, (480 - bp) + yy + mmy[c] + 33, false);
68
            b_offset = 480;
69
            if (global.fighting == 0)
70
                b_offset = 430;
71
            if (global.fighting == 1)
72
                b_offset = 336;
73
            if (c == 0)
74
            {
75
                draw_sprite(spr_headkris, global.faceaction[charpos[c]], xx + 13 + xchunk, bpoff + b_offset + mmy[c]);
76
                draw_sprite(
scr_84_get_sprite
scr_84_get_sprite

function
scr_84_get_sprite(arg0)
{ return ds_map_find_value(global.chemg_sprite_map, arg0); }
("spr_bnamekris"), 0, xx + 51 + xchunk, bpoff + b_offset + 3 + mmy[c]);
77
            }
78
            if (c == 1)
79
            {
80
                draw_sprite(spr_headsusie, global.faceaction[charpos[c]], xx + 13 + xchunk, bpoff + b_offset + mmy[c]);
81
                draw_sprite(
scr_84_get_sprite
scr_84_get_sprite

function
scr_84_get_sprite(arg0)
{ return ds_map_find_value(global.chemg_sprite_map, arg0); }
("spr_bnamesusie"), 0, xx + 51 + xchunk, bpoff + b_offset + 3 + mmy[c]);
82
            }
83
            if (c == 2)
84
            {
85
                draw_sprite(spr_headralsei, global.faceaction[charpos[c]], xx + 13 + xchunk, bpoff + b_offset + mmy[c]);
86
                draw_sprite(
scr_84_get_sprite
scr_84_get_sprite

function
scr_84_get_sprite(arg0)
{ return ds_map_find_value(global.chemg_sprite_map, arg0); }
("spr_bnameralsei"), 0, xx + 51 + xchunk, bpoff + b_offset + 3 + mmy[c]);
87
            }
88
            if (c == 3)
89
            {
90
                draw_sprite(spr_headnoelle, global.faceaction[charpos[c]], xx + 13 + xchunk, bpoff + b_offset + mmy[c]);
91
                draw_sprite(
scr_84_get_sprite
scr_84_get_sprite

function
scr_84_get_sprite(arg0)
{ return ds_map_find_value(global.chemg_sprite_map, arg0); }
("spr_bnamenoelle"), 0, xx + 51 + xchunk, bpoff + b_offset + 3 + mmy[c]);
92
            }
93
            draw_sprite(spr_hpname, 0, xx + 109 + xchunk, bpoff + b_offset + 11 + mmy[c]);
94
            draw_set_color(c_white);
95
            draw_set_font(global.hpfont);
96
            if ((global.hp[c + 1] / global.maxhp[c + 1]) <= 0.25)
97
                draw_set_color(c_yellow);
98
            if (global.hp[c + 1] <= 0)
99
                draw_set_color(c_red);
100
            draw_set_halign(fa_right);
101
            draw_text(xx + 160 + xchunk, ((bpoff + b_offset) - 2) + mmy[c], string_hash_to_newline(global.hp[c + 1]));
102
            draw_sprite(spr_hpslash, 0, xx + 159 + xchunk, ((bpoff + b_offset) - 4) + mmy[c]);
103
            draw_text(xx + 205 + xchunk, ((bpoff + b_offset) - 2) + mmy[c], string_hash_to_newline(global.maxhp[c + 1]));
104
            draw_set_halign(fa_left);
105
            draw_set_color(c_maroon);
106
            ossafe_fill_rectangle(xx + 128 + xchunk, bpoff + b_offset + 11 + mmy[c], xx + 203 + xchunk, bpoff + b_offset + 19 + mmy[c], false);
107
            if (global.hp[c + 1] > 0 && global.maxhp[c + 1] > 0)
108
            {
109
                draw_set_color(charcolor);
110
                ossafe_fill_rectangle(xx + 128 + xchunk, bpoff + b_offset + 11 + mmy[c], xx + xchunk + 128 + ceil((global.hp[c + 1] / global.maxhp[c + 1]) * 75), bpoff + b_offset + 19 + mmy[c], false);
111
            }
112
        }
113
    }
114
}