Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_ch4_PDC14A_choicer_Step_0

(view raw script w/o annotations or w/e)
1
global.flag[33 choice_time_taken] += 1;
2
if (canchoose == 1)
3
{
4
    if (mychoice >= 0 && button1_p())
5
        event_user(0);
6
    if (choiced == 0)
7
    {
8
        if (left_h())
9
            mychoice = 0;
10
        if (choicetotal >= 1 && right_h())
11
            mychoice = 1;
12
    }
13
}
14
scr_84_set_draw_font
scr_84_set_draw_font

function
scr_84_set_draw_font(arg0)
{ global.chemg_font = arg0; draw_set_font(
scr_84_get_font(arg0));
}
("main");
15
if (choicerstyle == 0)
16
{
17
    var str0width = string_width(string_hash_to_newline(global.choicemsg[0]));
18
    textposx[0] = camerax() + 30;
19
    textposy[0] = yy + ((13 + d_add) * dar) + (fighting * 30);
20
    heartposx[0] = textposx[0] + str0width + 10;
21
    heartposy[0] = yy + ((34 + d_add) * dar) + (fighting * 30);
22
    if (choicetotal >= 1)
23
    {
24
        var str1width = string_width(string_hash_to_newline(global.choicemsg[1]));
25
        textposx[1] = (xx + (276 * dar)) - str1width;
26
        textposy[1] = yy + ((13 + d_add) * dar) + (fighting * 30);
27
        heartposx[1] = camerax() + 284;
28
        heartposy[1] = yy + ((34 + d_add) * dar) + (fighting * 30);
29
    }
30
    if (choicetotal >= 2)
31
    {
32
        var msg0right = heartposx[0] + (16 * dar) + string_width(string_hash_to_newline(global.choicemsg[0]));
33
        var msg1left = heartposx[1];
34
        var msg2width = string_width(string_hash_to_newline(global.choicemsg[2])) + (16 * dar);
35
        heartposx[2] = (msg0right + ((msg1left - msg0right) / 2)) - (msg2width / 2);
36
        heartposy[2] = yy + ((16 + d_add) * dar) + (fighting * 30);
37
        textposx[2] = heartposx[2] + (16 * dar);
38
        textposy[2] = yy + ((13 + d_add) * dar) + (fighting * 30);
39
    }
40
    if (mychoice >= 0)
41
    {
42
        hx = heartposx[mychoice];
43
        hy = heartposy[mychoice];
44
    }
45
}