Deltarune (Chapter 3) 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 ((controlled && button1_p()) || (!controlled && remote1))
22
            event_user(0);
23
    }
24
    if (choiced == 0)
25
    {
26
        if (controlled)
27
        {
28
            if (left_h())
29
                mychoice = 0;
30
            if (choicetotal >= 1 && right_h())
31
                mychoice = 1;
32
            if (choicetotal >= 2 && up_h())
33
                mychoice = 2;
34
            if (choicetotal >= 3 && down_h())
35
                mychoice = 3;
36
        }
37
        else
38
        {
39
            if (remotel)
40
                mychoice = 0;
41
            if (choicetotal >= 1 && remoter)
42
                mychoice = 1;
43
            if (choicetotal >= 2 && remoteu)
44
                mychoice = 2;
45
            if (choicetotal >= 3 && remoted)
46
                mychoice = 3;
47
        }
48
    }
49
}
50
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");
51
if (choicerstyle == 0)
52
{
53
    heartposx[0] = xx + (30 * dar);
54
    heartposy[0] = yy + ((34 + d_add) * dar) + (fighting * 30);
55
    textposx[0] = heartposx[0] + (16 * dar);
56
    textposy[0] = yy + ((13 + d_add) * dar) + (fighting * 30);
57
    if (choicetotal >= 1)
58
    {
59
        var str1width = string_width(string_hash_to_newline(global.choicemsg[1]));
60
        heartposx[1] = (xx + (276 * dar)) - str1width;
61
        heartposy[1] = yy + ((34 + d_add) * dar) + (fighting * 30);
62
        textposx[1] = heartposx[1] + (16 * dar);
63
        textposy[1] = yy + ((13 + d_add) * dar) + (fighting * 30);
64
    }
65
    if (choicetotal >= 2)
66
    {
67
        var msg0right = heartposx[0] + (16 * dar) + string_width(string_hash_to_newline(global.choicemsg[0]));
68
        var msg1left = heartposx[1];
69
        var msg2width = string_width(string_hash_to_newline(global.choicemsg[2])) + (16 * dar);
70
        if (choicetotal == 3)
71
        {
72
            var msg3width = string_width(string_hash_to_newline(global.choicemsg[3])) + (16 * dar);
73
            if (msg3width > msg2width)
74
                msg2width = msg3width;
75
        }
76
        heartposx[2] = (msg0right + ((msg1left - msg0right) / 2)) - (msg2width / 2);
77
        heartposy[2] = yy + ((16 + d_add) * dar) + (fighting * 30);
78
        textposx[2] = heartposx[2] + (16 * dar);
79
        textposy[2] = yy + ((13 + d_add) * dar) + (fighting * 30);
80
    }
81
    if (choicetotal >= 3)
82
    {
83
        heartposx[3] = heartposx[2];
84
        heartposy[3] = yy + ((60 + d_add) * dar) + (fighting * 30);
85
        textposx[3] = heartposx[3] + (16 * dar);
86
        textposy[3] = yy + ((56 + d_add) * dar) + (fighting * 30);
87
    }
88
    if (mychoice >= 0)
89
    {
90
        hx = heartposx[mychoice];
91
        hy = heartposy[mychoice];
92
    }
93
}
94
if (choicerstyle == 1)
95
{
96
    depth = 99990;
97
    xx = boardwriter.x;
98
    yy = boardwriter.y;
99
    if (global.chapter == 3)
100
    {
101
        if (room == room_dw_ch3_man)
102
            depth = 9;
103
    }
104
}
105
remoteu = 0;
106
remoted = 0;
107
remotel = 0;
108
remoter = 0;
109
remote1 = 0;