Deltarune (Chapter 1) script viewer

← back to main script listing

gml_GlobalScript_scr_attackphase

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

function
scr_attackphase()
{ with (obj_battlecontroller) { techwon = 0; if (
scr_monsterpop() == 0)
techwon = 1; if (techwon == 0) { fightphase = 1; global.charturn = 3; if (global.charaction[0] == 4 || global.charaction[0] == 2) fightphase = 0; if (global.charaction[1] == 4 || global.charaction[1] == 2) fightphase = 0; if (global.charaction[2] == 4 || global.charaction[2] == 2) fightphase = 0; if (global.myfight == 4) fightphase = 1; if (fightphase == 1) { global.myfight = 1; instance_create(xx + 2, yy + 365, obj_attackpress); } else { global.myfight = 4; instance_create(0, 0, obj_spellphase); } } else {
scr_wincombat();
} } }
()
2
{
3
    with (obj_battlecontroller)
4
    {
5
        techwon = 0;
6
        if (
scr_monsterpop
scr_monsterpop

function
scr_monsterpop()
{ return global.monster[0] + global.monster[1] + global.monster[2]; }
() == 0)
7
            techwon = 1;
8
        if (techwon == 0)
9
        {
10
            fightphase = 1;
11
            global.charturn = 3;
12
            if (global.charaction[0] == 4 || global.charaction[0] == 2)
13
                fightphase = 0;
14
            if (global.charaction[1] == 4 || global.charaction[1] == 2)
15
                fightphase = 0;
16
            if (global.charaction[2] == 4 || global.charaction[2] == 2)
17
                fightphase = 0;
18
            if (global.myfight == 4)
19
                fightphase = 1;
20
            if (fightphase == 1)
21
            {
22
                global.myfight = 1;
23
                instance_create(xx + 2, yy + 365, obj_attackpress);
24
            }
25
            else
26
            {
27
                global.myfight = 4;
28
                instance_create(0, 0, obj_spellphase);
29
            }
30
        }
31
        else
32
        {
33
            
scr_wincombat
scr_wincombat

function
scr_wincombat()
{ global.myfight = 7; global.mnfight = -1; with (obj_battlecontroller) victory = 1; for (i = 0; i < 3; i += 1) { if (global.monster[i] == 1 && instance_exists(global.monsterinstance[i])) { with (global.monsterinstance[i])
scr_monsterdefeat();
} } }
();
34
        }
35
    }
36
}