Deltarune script viewer

← back to main script listing

gml_GlobalScript_scr_retarget_spell

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

function scr_retarget_spell() { cancelattack = 0; if (star == 0) { if (global.monster[0] == 0) star = 1; } if (star == 1) { if (global.monster[1] == 0) star = 2; } if (star == 2) { if (global.monster[2] == 0) star = 3; if (star == 3 && global.monster[0] == 1) star = 0; if (star == 3 && global.monster[1] == 1) star = 1; if (star == 3) cancelattack = 1; } }
()
2
{
3
    cancelattack = 0;
4
    if (star == 0)
5
    {
6
        if (global.monster[0] == 0)
7
            star = 1;
8
    }
9
    if (star == 1)
10
    {
11
        if (global.monster[1] == 0)
12
            star = 2;
13
    }
14
    if (star == 2)
15
    {
16
        if (global.monster[2] == 0)
17
            star = 3;
18
        if (star == 3 && global.monster[0] == 1)
19
            star = 0;
20
        if (star == 3 && global.monster[1] == 1)
21
            star = 1;
22
        if (star == 3)
23
            cancelattack = 1;
24
    }
25
}