Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_lw_town_sideb_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
        if (choicetotal >= 2 && up_h())
13
            mychoice = 2;
14
        if (choicetotal >= 3 && down_h())
15
            mychoice = 3;
16
    }
17
}
18
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));
}
((dar == 1) ? "main" : "mainbig");
19
if (choicerstyle == 0)
20
{
21
    heartposx[0] = xx + (30 * dar);
22
    heartposy[0] = yy + ((34 + d_add) * dar) + (fighting * 30);
23
    textposx[0] = heartposx[0] + (16 * dar);
24
    textposy[0] = yy + ((13 + d_add) * dar) + (fighting * 30);
25
    if (choicetotal >= 1)
26
    {
27
        var str1width = string_width(string_hash_to_newline(global.choicemsg[1]));
28
        heartposx[1] = (xx + (276 * dar)) - str1width;
29
        heartposy[1] = yy + ((34 + d_add) * dar) + (fighting * 30);
30
        textposx[1] = heartposx[1] + (16 * dar);
31
        textposy[1] = yy + ((13 + d_add) * dar) + (fighting * 30);
32
    }
33
    if (choicetotal >= 2)
34
    {
35
        var msg0right = heartposx[0] + (16 * dar) + string_width(string_hash_to_newline(global.choicemsg[0]));
36
        var msg1left = heartposx[1];
37
        var msg2width = string_width(string_hash_to_newline(global.choicemsg[2])) + (16 * dar);
38
        if (choicetotal == 3)
39
        {
40
            var msg3width = string_width(string_hash_to_newline(global.choicemsg[3])) + (16 * dar);
41
            if (msg3width > msg2width)
42
                msg2width = msg3width;
43
        }
44
        heartposx[2] = (msg0right + ((msg1left - msg0right) / 2)) - (msg2width / 2);
45
        heartposy[2] = yy + ((16 + d_add) * dar) + (fighting * 30);
46
        textposx[2] = heartposx[2] + (16 * dar);
47
        textposy[2] = yy + ((13 + d_add) * dar) + (fighting * 30);
48
    }
49
    if (choicetotal >= 3)
50
    {
51
        heartposx[3] = heartposx[2];
52
        heartposy[3] = yy + ((60 + d_add) * dar) + (fighting * 30);
53
        textposx[3] = heartposx[3] + (16 * dar);
54
        textposy[3] = yy + ((56 + d_add) * dar) + (fighting * 30);
55
    }
56
    if (mychoice >= 0)
57
    {
58
        hx = heartposx[mychoice];
59
        hy = heartposy[mychoice];
60
    }
61
}