Deltarune (Chapter 5) script viewer

← back to main script listing

gml_GlobalScript_scr_boltcheck_onebutton

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

function
scr_boltcheck_onebutton()
{ dualbolt = -1; dualboltid = -1; pressbuffer[0] = 5; pressbuffer[1] = 5; pressbuffer[2] = 5; pressbuffer[3] = 5; qualifybolt = -1; close = 99; topclose = 999; for (i = 0; i < bolttotal; i += 1) { if (boltalive[i] == 1) { close = boltframe[i] - boltx; if (close < 15 && close > -5) { if (close == topclose) { dualbolt = 1; dualboltid = i; } if (close < topclose) { topclose = close; qualifybolt = i; } } } } if (qualifybolt != -1) { bc = boltchar[qualifybolt]; p = abs(topclose); pp = topclose; burstbolt = instance_create((x + 80 + (boltframe[qualifybolt] * boltspeed)) - (boltx * boltspeed), y + (38 * bc), obj_burstbolt); if (p == 0) { points[bc] += 150; with (burstbolt) image_blend = c_yellow; with (burstbolt) mag = 0.2; } if (pp == 1 && global.charweapon[1] == 33) { points[bc] += 150; with (burstbolt) image_blend = c_yellow; with (burstbolt) mag = 0.2; } else if (p == 1) { points[bc] += 120; } if (p == 2) points[bc] += 110; if (p >= 3) { points[bc] += 100 - (abs(topclose) * 2); burstbolt.image_blend = boltcolor[bc]; } if (p >= 15) burstbolt.image_blend = charcolor[bc]; boltalive[qualifybolt] = 0; if (dualbolt == 1) { bc = boltchar[dualboltid]; p = abs(topclose); burstbolt = instance_create((x + 80 + (boltframe[dualboltid] * boltspeed)) - (boltx * boltspeed), y + (38 * bc), obj_burstbolt); if (p == 0) { points[bc] += 150; with (burstbolt) image_blend = c_yellow; with (burstbolt) mag = 0.2; } if (p == 1) points[bc] += 120; if (p == 2) points[bc] += 110; if (p >= 3) { points[bc] += 100 - (abs(topclose) * 2); burstbolt.image_blend = boltcolor[bc]; } if (p >= 15) burstbolt.image_blend = charcolor[bc]; boltalive[dualboltid] = 0; } } }
()
2
{
3
    dualbolt = -1;
4
    dualboltid = -1;
5
    pressbuffer[0] = 5;
6
    pressbuffer[1] = 5;
7
    pressbuffer[2] = 5;
8
    pressbuffer[3] = 5;
9
    qualifybolt = -1;
10
    close = 99;
11
    topclose = 999;
12
    for (i = 0; i < bolttotal; i += 1)
13
    {
14
        if (boltalive[i] == 1)
15
        {
16
            close = boltframe[i] - boltx;
17
            if (close < 15 && close > -5)
18
            {
19
                if (close == topclose)
20
                {
21
                    dualbolt = 1;
22
                    dualboltid = i;
23
                }
24
                if (close < topclose)
25
                {
26
                    topclose = close;
27
                    qualifybolt = i;
28
                }
29
            }
30
        }
31
    }
32
    if (qualifybolt != -1)
33
    {
34
        bc = boltchar[qualifybolt];
35
        p = abs(topclose);
36
        pp = topclose;
37
        burstbolt = instance_create((x + 80 + (boltframe[qualifybolt] * boltspeed)) - (boltx * boltspeed), y + (38 * bc), obj_burstbolt);
38
        if (p == 0)
39
        {
40
            points[bc] += 150;
41
            with (burstbolt)
42
                image_blend = c_yellow;
43
            with (burstbolt)
44
                mag = 0.2;
45
        }
46
        if (pp == 1 && global.charweapon[1] == 33)
47
        {
48
            points[bc] += 150;
49
            with (burstbolt)
50
                image_blend = c_yellow;
51
            with (burstbolt)
52
                mag = 0.2;
53
        }
54
        else if (p == 1)
55
        {
56
            points[bc] += 120;
57
        }
58
        if (p == 2)
59
            points[bc] += 110;
60
        if (p >= 3)
61
        {
62
            points[bc] += 100 - (abs(topclose) * 2);
63
            burstbolt.image_blend = boltcolor[bc];
64
        }
65
        if (p >= 15)
66
            burstbolt.image_blend = charcolor[bc];
67
        boltalive[qualifybolt] = 0;
68
        if (dualbolt == 1)
69
        {
70
            bc = boltchar[dualboltid];
71
            p = abs(topclose);
72
            burstbolt = instance_create((x + 80 + (boltframe[dualboltid] * boltspeed)) - (boltx * boltspeed), y + (38 * bc), obj_burstbolt);
73
            if (p == 0)
74
            {
75
                points[bc] += 150;
76
                with (burstbolt)
77
                    image_blend = c_yellow;
78
                with (burstbolt)
79
                    mag = 0.2;
80
            }
81
            if (p == 1)
82
                points[bc] += 120;
83
            if (p == 2)
84
                points[bc] += 110;
85
            if (p >= 3)
86
            {
87
                points[bc] += 100 - (abs(topclose) * 2);
88
                burstbolt.image_blend = boltcolor[bc];
89
            }
90
            if (p >= 15)
91
                burstbolt.image_blend = charcolor[bc];
92
            boltalive[dualboltid] = 0;
93
        }
94
    }
95
}