Deltarune (Chapter 4) script viewer

← back to main script listing

gml_GlobalScript_scr_attack_override

(view raw script w/o annotations or w/e)
1
function 
scr_attack_override
scr_attack_override

function
scr_attack_override(arg0, arg1, arg2)
{ var __attackdebug = arg0; if (arg1 > 10) arg1 = 10; if (sunkus_kb_check_pressed(110) || sunkus_kb_check_pressed(189)) { __attackdebug = -1;
scr_debug_print(arg2 + " attack randomized.");
} else { for (i = 0; i < arg1; i++) { if (sunkus_kb_check_pressed(ord(string(i))) || sunkus_kb_check_pressed(96 + i)) __attackdebug = i; } for (i = arg1; i < 10; i++) { if (sunkus_kb_check_pressed(ord(string(i))) || sunkus_kb_check_pressed(96 + i))
scr_debug_print(arg2 + " does not have an attack no. " + string(i));
} } if (__attackdebug != arg0 && __attackdebug > -1)
scr_debug_print(arg2 + " attack set to no. " + string(__attackdebug));
if (sunkus_kb_check_pressed(9)) { if (window_get_height() == 480) { var __screensize = floor(display_get_height() / 480); window_set_size(640 * __screensize, 480 * __screensize); } else { window_set_size(640, 480); } } return __attackdebug; }
(arg0, arg1, arg2)
2
{
3
    var __attackdebug = arg0;
4
    if (arg1 > 10)
5
        arg1 = 10;
6
    if (sunkus_kb_check_pressed(110) || sunkus_kb_check_pressed(189))
7
    {
8
        __attackdebug = -1;
9
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { scr_debug_clear_persistent(); }
(arg2 + " attack randomized.");
10
    }
11
    else
12
    {
13
        for (i = 0; i < arg1; i++)
14
        {
15
            if (sunkus_kb_check_pressed(ord(string(i))) || sunkus_kb_check_pressed(96 + i))
16
                __attackdebug = i;
17
        }
18
        for (i = arg1; i < 10; i++)
19
        {
20
            if (sunkus_kb_check_pressed(ord(string(i))) || sunkus_kb_check_pressed(96 + i))
21
                
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { scr_debug_clear_persistent(); }
(arg2 + " does not have an attack no. " + string(i));
22
        }
23
    }
24
    if (__attackdebug != arg0 && __attackdebug > -1)
25
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { scr_debug_clear_persistent(); }
(arg2 + " attack set to no. " + string(__attackdebug));
26
    if (sunkus_kb_check_pressed(9))
27
    {
28
        if (window_get_height() == 480)
29
        {
30
            var __screensize = floor(display_get_height() / 480);
31
            window_set_size(640 * __screensize, 480 * __screensize);
32
        }
33
        else
34
        {
35
            window_set_size(640, 480);
36
        }
37
    }
38
    return __attackdebug;
39
}