Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_time_Step_1

(view raw script w/o annotations or w/e)
1
if (!paused)
2
{
3
    global.time += 1;
4
    if (global.is_console && os_is_paused())
5
    {
6
        paused = true;
7
        if (!sprite_exists(screenshot))
8
        {
9
            var sw = surface_get_width(application_surface);
10
            var sh = surface_get_height(application_surface);
11
            screenshot = sprite_create_from_surface(application_surface, 0, 0, sw, sh, 0, 0, 0, 0);
12
        }
13
        exit;
14
    }
15
}
16
else
17
{
18
    exit;
19
}
20
if (scr_debug
scr_debug

function scr_debug() { return 0; }
())
21
{
22
}
23
if (keyboard_check(vk_escape))
24
{
25
    if (quit_timer < 0)
26
        quit_timer = 0;
27
    quit_timer += 1;
28
    if (quit_timer >= 30)
29
        ossafe_game_end();
30
}
31
else
32
{
33
    quit_timer -= 2;
34
}
35
if (keyboard_check_pressed(vk_f4) || fullscreen_toggle == 1)
36
    alarm[1] = 1;
gml_Object_obj_time_Alarm_1.gml

if (window_get_fullscreen()) { window_set_fullscreen(false); ini_open("true_config.ini"); ini_write_real("SCREEN", "FULLSCREEN", 0); ini_close(); window_set_size(640 * window_size_multiplier, 480 * window_size_multiplier); alarm[2] = 1; } else { window_set_fullscreen(true); ini_open("true_config.ini"); ini_write_real("SCREEN", "FULLSCREEN", 1); ini_close(); } fullscreen_toggle = 0;
37
for (var i = 0; i < 10; i += 1)
38
{
39
    global.input_released[i] = 0;
40
    global.input_pressed[i] = 0;
41
}
42
gamepad_check_timer += 1;
43
if (gamepad_check_timer >= 90)
44
{
45
    if (!gamepad_is_connected(obj_gamecontroller.gamepad_id))
46
    {
47
        var gp_num = gamepad_get_device_count();
48
        var any_connected = false;
49
        for (var i = 0; i < gp_num; i++)
50
        {
51
            if (gamepad_is_connected(i))
52
            {
53
                obj_gamecontroller.gamepad_active = 1;
54
                obj_gamecontroller.gamepad_id = i;
55
                any_connected = true;
56
                break;
57
            }
58
        }
59
        if (any_connected == false)
60
            obj_gamecontroller.gamepad_active = 0;
61
    }
62
    gamepad_check_timer = 0;
63
}
64
if (obj_gamecontroller.gamepad_active == 1 && quicksaved != 2)
65
{
66
    for (var i = 0; i < 4; i += 1)
67
    {
68
        if (keyboard_check(global.input_k[i]) || (i_ex(obj_gamecontroller) && (gamepad_button_check(obj_gamecontroller.gamepad_id, global.input_g[i]) || scr_gamepad_axis_check
scr_gamepad_axis_check

function scr_gamepad_axis_check(arg0, arg1) { axis_value = instance_exists(obj_time) ? obj_time.axis_value : 0.4; __returnvalue = 0; if (arg1 == 0) { if (gamepad_axis_value(arg0, gp_axislv) >= axis_value) __returnvalue = 1; } if (arg1 == 1) { if (gamepad_axis_value(arg0, gp_axislh) >= axis_value) __returnvalue = 1; } if (arg1 == 2) { if (gamepad_axis_value(arg0, gp_axislv) <= -axis_value) __returnvalue = 1; } if (arg1 == 3) { if (gamepad_axis_value(arg0, gp_axislh) <= -axis_value) __returnvalue = 1; } return __returnvalue; }
(obj_gamecontroller.gamepad_id, i))))
69
        {
70
            if (global.input_held[i] == 0)
71
                global.input_pressed[i] = 1;
72
            global.input_held[i] = 1;
73
        }
74
        else
75
        {
76
            if (global.input_held[i] == 1)
77
                global.input_released[i] = 1;
78
            global.input_held[i] = 0;
79
        }
80
    }
81
    for (var i = 4; i < 10; i += 1)
82
    {
83
        if (keyboard_check(global.input_k[i]) || (i_ex(obj_gamecontroller) && gamepad_button_check(obj_gamecontroller.gamepad_id, global.input_g[i])))
84
        {
85
            if (global.input_held[i] == 0)
86
                global.input_pressed[i] = 1;
87
            global.input_held[i] = 1;
88
        }
89
        else
90
        {
91
            if (global.input_held[i] == 1)
92
                global.input_released[i] = 1;
93
            global.input_held[i] = 0;
94
        }
95
    }
96
}
97
else
98
{
99
    for (var i = 0; i < 10; i += 1)
100
    {
101
        if (keyboard_check(global.input_k[i]))
102
        {
103
            if (global.input_held[i] == 0)
104
                global.input_pressed[i] = 1;
105
            global.input_held[i] = 1;
106
        }
107
        else
108
        {
109
            if (global.input_held[i] == 1)
110
                global.input_released[i] = 1;
111
            global.input_held[i] = 0;
112
        }
113
    }
114
}
115
if (scr_debug
scr_debug

function scr_debug() { return 0; }
())
116
{
117
}