Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_numberentry_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    if (down_h())
4
        dholdbuff++;
5
    else
6
        dholdbuff = -1;
7
    if (up_h())
8
        uholdbuff++;
9
    else
10
        uholdbuff = -1;
11
    if (up_h() && down_h())
12
    {
13
        dholdbuff = -1;
14
        uholdbuff = -1;
15
    }
16
    if (left_h())
17
        lholdbuff++;
18
    else
19
        lholdbuff = -1;
20
    if (right_h())
21
        rholdbuff++;
22
    else
23
        rholdbuff = -1;
24
    if (left_h() && right_h())
25
    {
26
        rholdbuff = -1;
27
        lholdbuff = -1;
28
    }
29
    var nummod = numinc;
30
    var uprate = 10;
31
    if (fasterovertime)
32
    {
33
        if (up_h() || down_h())
34
            uspeedbuff++;
35
        else
36
            uspeedbuff = 0;
37
        if (up_h() && down_h())
38
            uspeedbuff = 0;
39
        if (uspeedbuff == 0)
40
            buffmodrate = buffmoddefault;
41
        if (uspeedbuff > (uprate * 1))
42
            buffmodrate = 4;
43
        if (uspeedbuff > (uprate * 2))
44
            buffmodrate = 3;
45
        if (uspeedbuff > (uprate * 3))
46
            buffmodrate = 2;
47
        if (uspeedbuff > (uprate * 4))
48
            buffmodrate = 1;
49
        if (uspeedbuff > (uprate * 6))
50
            nummod = 5 * numinc;
51
        if (uspeedbuff > (uprate * 10))
52
            nummod = 10 * numinc;
53
        if (uspeedbuff > (uprate * 15))
54
            nummod = 100 * numinc;
55
        if (uspeedbuff > (uprate * 20))
56
            nummod = 1000 * numinc;
57
        if (nummod != 1 && roundval == true)
58
            num = round(num / nummod) * nummod;
59
    }
60
    if (up_h() && (uholdbuff % buffmodrate) == 0)
61
    {
62
        if (num < maxnum)
63
        {
64
            snd_stop(snd_menumove);
65
            snd_play_pitch(snd_menumove, 1);
66
        }
67
        num += nummod;
68
    }
69
    else if (down_h() && (dholdbuff % buffmodrate) == 0)
70
    {
71
        if (num > minnum)
72
        {
73
            snd_stop(snd_menumove);
74
            snd_play_pitch(snd_menumove, 0.9);
75
        }
76
        num -= nummod;
77
    }
78
    var checkround = false;
79
    if (biginc != -1)
80
    {
81
        if (right_h() && (rholdbuff % buffmodrate) == 0)
82
        {
83
            if (num < maxnum)
84
            {
85
                snd_stop(snd_menumove);
86
                snd_play_pitch(snd_menumove, 1);
87
            }
88
            num += biginc;
89
            checkround = false;
90
        }
91
        else if (left_h() && (lholdbuff % buffmodrate) == 0)
92
        {
93
            if (num > minnum)
94
            {
95
                snd_stop(snd_menumove);
96
                snd_play_pitch(snd_menumove, 0.9);
97
            }
98
            num -= biginc;
99
            checkround = false;
100
        }
101
        if (roundval == true && checkround)
102
            num = round(num / biginc) * biginc;
103
    }
104
    num = clamp(num, minnum, maxnum);
105
    if (button1_p())
106
    {
107
        snd_play_pitch(snd_menumove, 1.2);
108
        con = 1;
109
        result = num;
110
    }
111
    if (button2_p())
112
    {
113
        con = 1;
114
        result = -2;
115
    }
116
}
117
if (con == 1)
118
{
119
    visible = false;
120
    con = 2;
121
    if (nokill == false)
122
        
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(id, 1000);
123
}