Deltarune (Chapter 4) 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 (choicerstyle == 0)
5
    {
6
        if (choicetotal == 1)
7
        {
8
            if (global.darkzone == 0)
9
                yy -= 2;
10
            if (global.darkzone == 1)
11
            {
12
                yy -= 3;
13
                if (global.lang == "ja")
14
                    yy -= 2;
15
            }
16
        }
17
    }
18
    textinit = 1;
19
}
20
if (canchoose == 1)
21
{
22
    if (mychoice >= 0 && button1_p())
23
        event_user(0);
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
if (choicerstyle == 0)
38
{
39
    heartposx[0] = xx + (30 * dar);
40
    heartposy[0] = yy + ((34 + d_add) * dar) + (fighting * 30);
41
    textposx[0] = heartposx[0] + (16 * dar);
42
    textposy[0] = yy + ((13 + d_add) * dar) + (fighting * 30);
43
    if (choicetotal >= 1)
44
    {
45
        var str1width = string_width(string_hash_to_newline(global.choicemsg[1]));
46
        heartposx[1] = (xx + (276 * dar)) - str1width;
47
        heartposy[1] = yy + ((34 + d_add) * dar) + (fighting * 30);
48
        textposx[1] = heartposx[1] + (16 * dar);
49
        if (global.chapter == 4 && i_ex(obj_holywatercooler_enemy) && obj_holywatercooler_enemy.ballooncon == 5.2)
50
            yy += 16;
51
        textposy[1] = yy + ((13 + d_add) * dar) + (fighting * 30);
52
        if (global.chapter == 4 && i_ex(obj_holywatercooler_enemy) && obj_holywatercooler_enemy.ballooncon == 5.2)
53
            yy -= 16;
54
    }
55
    if (choicetotal >= 2)
56
    {
57
        var msg0right = heartposx[0] + (16 * dar) + string_width(string_hash_to_newline(global.choicemsg[0]));
58
        var msg1left = heartposx[1];
59
        var msg2width = string_width(string_hash_to_newline(global.choicemsg[2])) + (16 * dar);
60
        if (choicetotal == 3)
61
        {
62
            var msg3width = string_width(string_hash_to_newline(global.choicemsg[3])) + (16 * dar);
63
            if (msg3width > msg2width)
64
                msg2width = msg3width;
65
        }
66
        heartposx[2] = (msg0right + ((msg1left - msg0right) / 2)) - (msg2width / 2);
67
        heartposy[2] = yy + ((16 + d_add) * dar) + (fighting * 30);
68
        textposx[2] = heartposx[2] + (16 * dar);
69
        textposy[2] = yy + ((13 + d_add) * dar) + (fighting * 30);
70
    }
71
    if (choicetotal >= 3)
72
    {
73
        if (global.chapter == 4 && i_ex(obj_holywatercooler_enemy) && obj_holywatercooler_enemy.ballooncon == 23.11)
74
            heartposx[2] += 60;
75
        heartposx[3] = heartposx[2];
76
        heartposy[3] = yy + ((60 + d_add) * dar) + (fighting * 30);
77
        textposx[3] = heartposx[3] + (16 * dar);
78
        textposy[3] = yy + ((56 + d_add) * dar) + (fighting * 30);
79
        if (global.chapter == 4 && i_ex(obj_holywatercooler_enemy) && obj_holywatercooler_enemy.ballooncon == 23.11)
80
        {
81
            heartposx[2] -= 60;
82
            textposy[3] -= 10;
83
            heartposy[3] -= 10;
84
        }
85
    }
86
    if (mychoice >= 0)
87
    {
88
        hx = heartposx[mychoice];
89
        hy = heartposy[mychoice];
90
    }
91
}
92
if (choicerstyle == 1)
93
{
94
    xx = boardwriter.x;
95
    yy = boardwriter.y;
96
}