Deltarune (Chapter 3) 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); 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 (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
        burstbolt = instance_create((x + 80 + (boltframe[qualifybolt] * boltspeed)) - (boltx * boltspeed), y + (38 * bc), obj_burstbolt);
37
        if (p == 0)
38
        {
39
            points[bc] += 150;
40
            with (burstbolt)
41
                image_blend = c_yellow;
42
            with (burstbolt)
43
                mag = 0.2;
44
        }
45
        if (p == 1)
46
            points[bc] += 120;
47
        if (p == 2)
48
            points[bc] += 110;
49
        if (p >= 3)
50
        {
51
            points[bc] += 100 - (abs(topclose) * 2);
52
            burstbolt.image_blend = boltcolor[bc];
53
        }
54
        if (p >= 15)
55
            burstbolt.image_blend = charcolor[bc];
56
        boltalive[qualifybolt] = 0;
57
        if (dualbolt == 1)
58
        {
59
            bc = boltchar[dualboltid];
60
            p = abs(topclose);
61
            burstbolt = instance_create((x + 80 + (boltframe[dualboltid] * boltspeed)) - (boltx * boltspeed), y + (38 * bc), obj_burstbolt);
62
            if (p == 0)
63
            {
64
                points[bc] += 150;
65
                with (burstbolt)
66
                    image_blend = c_yellow;
67
                with (burstbolt)
68
                    mag = 0.2;
69
            }
70
            if (p == 1)
71
                points[bc] += 120;
72
            if (p == 2)
73
                points[bc] += 110;
74
            if (p >= 3)
75
            {
76
                points[bc] += 100 - (abs(topclose) * 2);
77
                burstbolt.image_blend = boltcolor[bc];
78
            }
79
            if (p >= 15)
80
                burstbolt.image_blend = charcolor[bc];
81
            boltalive[dualboltid] = 0;
82
        }
83
    }
84
}