Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_choicer_neo_Step_0

(view raw script w/o annotations or w/e)
1
global.flag[33 choice_time_taken] += 1;
2
if (!variable_instance_exists(id, "textinit"))
3
{
4
    if (choicetotal == 1)
5
    {
6
        if (global.darkzone == 0)
7
            yy -= 2;
8
        if (global.darkzone == 1)
9
        {
10
            yy -= 3;
11
            if (global.lang == "ja")
12
                yy -= 2;
13
        }
14
    }
15
    textinit = 1;
16
}
17
if (canchoose == 1)
18
{
19
    if (mychoice >= 0)
20
    {
21
        if (button1_p())
22
            event_user(0);
23
    }
24
    if (choiced == 0)
25
    {
26
        if (left_h())
27
            mychoice = 0;
28
        if (choicetotal >= 1 && right_h())
29
            mychoice = 1;
30
        if (choicetotal >= 2 && up_h())
31
            mychoice = 2;
32
        if (choicetotal >= 3 && down_h())
33
            mychoice = 3;
34
    }
35
}
36
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");
37
heartposx[0] = xx + (30 * dar);
38
heartposy[0] = yy + ((34 + d_add) * dar) + (fighting * 30);
39
textposx[0] = heartposx[0] + (16 * dar);
40
textposy[0] = yy + ((13 + d_add) * dar) + (fighting * 30);
41
if (choicetotal >= 1)
42
{
43
    var str1width = string_width(string_hash_to_newline(global.choicemsg[1]));
44
    heartposx[1] = (xx + (276 * dar)) - str1width;
45
    heartposy[1] = yy + ((34 + d_add) * dar) + (fighting * 30);
46
    textposx[1] = heartposx[1] + (16 * dar);
47
    textposy[1] = yy + ((13 + d_add) * dar) + (fighting * 30);
48
}
49
if (choicetotal >= 2)
50
{
51
    var msg0right = heartposx[0] + (16 * dar) + string_width(string_hash_to_newline(global.choicemsg[0]));
52
    var msg1left = heartposx[1];
53
    var msg2width = string_width(string_hash_to_newline(global.choicemsg[2])) + (16 * dar);
54
    if (choicetotal == 3)
55
    {
56
        var msg3width = string_width(string_hash_to_newline(global.choicemsg[3])) + (16 * dar);
57
        if (msg3width > msg2width)
58
            msg2width = msg3width;
59
    }
60
    heartposx[2] = (msg0right + ((msg1left - msg0right) / 2)) - (msg2width / 2);
61
    heartposy[2] = yy + ((16 + d_add) * dar) + (fighting * 30);
62
    textposx[2] = heartposx[2] + (16 * dar);
63
    textposy[2] = yy + ((13 + d_add) * dar) + (fighting * 30);
64
}
65
if (choicetotal >= 3)
66
{
67
    heartposx[3] = heartposx[2];
68
    heartposy[3] = yy + ((60 + d_add) * dar) + (fighting * 30);
69
    textposx[3] = heartposx[3] + (16 * dar);
70
    textposy[3] = yy + ((56 + d_add) * dar) + (fighting * 30);
71
}
72
if (mychoice >= 0)
73
{
74
    hx = heartposx[mychoice];
75
    hy = heartposy[mychoice];
76
}