Deltarune (Chapter 3) script viewer

← back to main script listing

gml_GlobalScript_scr_spellmenu_setup

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

function
scr_spellmenu_setup()
{ var __actnamecheck = 0; var __monstertype = global.monstertype[0]; for (__i = 1; __i < 3; __i++) { if (global.monster[__i] == 1 && global.monstertype[__i] != __monstertype) __actnamecheck = 1; } for (__i = 0; __i < 3; __i++) { for (__fj = 0; __fj < 6; __fj++) { global.battlespell[__i][__fj] = 0; if (global.char[__i] == 1) { if (global.canact[0][__fj] == 1) { global.battlespell[__i][__fj] = -1; if (global.battleactcount[__i] < (__fj + 1)) global.battleactcount[__i] = __fj + 1; global.battlespellcost[__i][__fj] = global.actcost[0][__fj]; global.battlespellname[__i][__fj] = global.actname[0][__fj]; global.battlespelldesc[__i][__fj] = global.actdesc[0][__fj]; global.battlespelltarget[__i][__fj] = 0; global.battlespellspecial[__i][__fj] = 1; } } if (global.char[__i] == 2) { if (global.canactsus[0][__fj] == 1) { global.battlespell[__i][__fj] = -1; if (global.battleactcount[__i] < (__fj + 1)) global.battleactcount[__i] = __fj + 1; global.battlespellcost[__i][__fj] = global.actcostsus[0][__fj]; global.battlespellname[__i][__fj] = global.actnamesus[0][__fj]; if (__actnamecheck) global.battlespellname[__i][__fj] = stringsetloc(
S-Action
"S-Action", "scr_monstersetup_slash_scr_monstersetup_gml_1053_0"
);
if (__actnamecheck && global.chapter == 3 && i_ex(obj_elnina_lanino_controller)) global.battlespellname[__i][__fj] = stringsetloc(
ILoveTV
"ILoveTV", "scr_spellmenu_setup_slash_scr_spellmenu_setup_gml_39_0"
);
global.battlespelldesc[__i][__fj] = global.actdescsus[0][__fj]; global.battlespelltarget[__i][__fj] = 2; global.battlespellspecial[__i][__fj] = 2; } } if (global.char[__i] == 3) { if (global.canactral[0][__fj] == 1) { global.battlespell[__i][__fj] = -1; if (global.battleactcount[__i] < (__fj + 1)) global.battleactcount[__i] = __fj + 1; global.battlespellcost[__i][__fj] = global.actcostral[0][__fj]; global.battlespellname[__i][__fj] = global.actnameral[0][__fj]; if (__actnamecheck) global.battlespellname[__i][__fj] = stringsetloc(
R-Action
"R-Action", "scr_monstersetup_slash_scr_monstersetup_gml_1057_0"
);
if (__actnamecheck && global.chapter == 3 && i_ex(obj_elnina_lanino_controller)) global.battlespellname[__i][__fj] = stringsetloc(
ILoveTV
"ILoveTV", "scr_spellmenu_setup_slash_scr_spellmenu_setup_gml_54_0"
);
global.battlespelldesc[__i][__fj] = global.actdescral[0][__fj]; global.battlespelltarget[__i][__fj] = 2; global.battlespellspecial[__i][__fj] = 3; } } if (global.char[__i] == 4) { if (global.canactnoe[0][__fj] == 1) { global.battlespell[__i][__fj] = -1; if (global.battleactcount[__i] < (__fj + 1)) global.battleactcount[__i] = __fj + 1; global.battlespellcost[__i][__fj] = global.actcostnoe[0][__fj]; global.battlespellname[__i][__fj] = global.actnamenoe[0][__fj]; if (__actnamecheck) global.battlespellname[__i][__fj] = stringsetloc(
N-Action
"N-Action", "scr_monstersetup_slash_scr_monstersetup_gml_1061_0"
);
global.battlespelldesc[__i][__fj] = global.actdescnoe[0][__fj]; global.battlespelltarget[__i][__fj] = 2; global.battlespellspecial[__i][__fj] = 4; } } } }
scr_spellinfo_all();
for (__i = 0; __i < 3; __i++) { for (__fj = 0; __fj < 12; __fj++) { __ib = global.battleactcount[__i] + __fj; global.battlespell[__i][__ib] = global.spell[global.char[__i]][__fj]; global.battlespellcost[__i][__ib] = global.spellcost[global.char[__i]][__fj]; global.battlespellname[__i][__ib] = global.spellnameb[global.char[__i]][__fj]; global.battlespelldesc[__i][__ib] = global.spelldescb[global.char[__i]][__fj]; global.battlespelltarget[__i][__ib] = global.spelltarget[global.char[__i]][__fj]; } } }
()
2
{
3
    var __actnamecheck = 0;
4
    var __monstertype = global.monstertype[0];
5
    for (__i = 1; __i < 3; __i++)
6
    {
7
        if (global.monster[__i] == 1 && global.monstertype[__i] != __monstertype)
8
            __actnamecheck = 1;
9
    }
10
    for (__i = 0; __i < 3; __i++)
11
    {
12
        for (__fj = 0; __fj < 6; __fj++)
13
        {
14
            global.battlespell[__i][__fj] = 0;
15
            if (global.char[__i] == 1)
16
            {
17
                if (global.canact[0][__fj] == 1)
18
                {
19
                    global.battlespell[__i][__fj] = -1;
20
                    if (global.battleactcount[__i] < (__fj + 1))
21
                        global.battleactcount[__i] = __fj + 1;
22
                    global.battlespellcost[__i][__fj] = global.actcost[0][__fj];
23
                    global.battlespellname[__i][__fj] = global.actname[0][__fj];
24
                    global.battlespelldesc[__i][__fj] = global.actdesc[0][__fj];
25
                    global.battlespelltarget[__i][__fj] = 0;
26
                    global.battlespellspecial[__i][__fj] = 1;
27
                }
28
            }
29
            if (global.char[__i] == 2)
30
            {
31
                if (global.canactsus[0][__fj] == 1)
32
                {
33
                    global.battlespell[__i][__fj] = -1;
34
                    if (global.battleactcount[__i] < (__fj + 1))
35
                        global.battleactcount[__i] = __fj + 1;
36
                    global.battlespellcost[__i][__fj] = global.actcostsus[0][__fj];
37
                    global.battlespellname[__i][__fj] = global.actnamesus[0][__fj];
38
                    if (__actnamecheck)
39
                        global.battlespellname[__i][__fj] = stringsetloc(
S-Action
"S-Action", "scr_monstersetup_slash_scr_monstersetup_gml_1053_0"
);
40
                    if (__actnamecheck && global.chapter == 3 && i_ex(obj_elnina_lanino_controller))
41
                        global.battlespellname[__i][__fj] = stringsetloc(
ILoveTV
"ILoveTV", "scr_spellmenu_setup_slash_scr_spellmenu_setup_gml_39_0"
);
42
                    global.battlespelldesc[__i][__fj] = global.actdescsus[0][__fj];
43
                    global.battlespelltarget[__i][__fj] = 2;
44
                    global.battlespellspecial[__i][__fj] = 2;
45
                }
46
            }
47
            if (global.char[__i] == 3)
48
            {
49
                if (global.canactral[0][__fj] == 1)
50
                {
51
                    global.battlespell[__i][__fj] = -1;
52
                    if (global.battleactcount[__i] < (__fj + 1))
53
                        global.battleactcount[__i] = __fj + 1;
54
                    global.battlespellcost[__i][__fj] = global.actcostral[0][__fj];
55
                    global.battlespellname[__i][__fj] = global.actnameral[0][__fj];
56
                    if (__actnamecheck)
57
                        global.battlespellname[__i][__fj] = stringsetloc(
R-Action
"R-Action", "scr_monstersetup_slash_scr_monstersetup_gml_1057_0"
);
58
                    if (__actnamecheck && global.chapter == 3 && i_ex(obj_elnina_lanino_controller))
59
                        global.battlespellname[__i][__fj] = stringsetloc(
ILoveTV
"ILoveTV", "scr_spellmenu_setup_slash_scr_spellmenu_setup_gml_54_0"
);
60
                    global.battlespelldesc[__i][__fj] = global.actdescral[0][__fj];
61
                    global.battlespelltarget[__i][__fj] = 2;
62
                    global.battlespellspecial[__i][__fj] = 3;
63
                }
64
            }
65
            if (global.char[__i] == 4)
66
            {
67
                if (global.canactnoe[0][__fj] == 1)
68
                {
69
                    global.battlespell[__i][__fj] = -1;
70
                    if (global.battleactcount[__i] < (__fj + 1))
71
                        global.battleactcount[__i] = __fj + 1;
72
                    global.battlespellcost[__i][__fj] = global.actcostnoe[0][__fj];
73
                    global.battlespellname[__i][__fj] = global.actnamenoe[0][__fj];
74
                    if (__actnamecheck)
75
                        global.battlespellname[__i][__fj] = stringsetloc(
N-Action
"N-Action", "scr_monstersetup_slash_scr_monstersetup_gml_1061_0"
);
76
                    global.battlespelldesc[__i][__fj] = global.actdescnoe[0][__fj];
77
                    global.battlespelltarget[__i][__fj] = 2;
78
                    global.battlespellspecial[__i][__fj] = 4;
79
                }
80
            }
81
        }
82
    }
83
    
scr_spellinfo_all
scr_spellinfo_all

function
scr_spellinfo_all()
{ for (j = 0; j < 6; j += 1) { for (i = 0; i < 12; i += 1) { spellid = global.spell[j][i];
scr_spellinfo(spellid);
global.spellname[j][i] = spellname; global.spellnameb[j][i] = spellnameb; global.spelldescb[j][i] = spelldescb; global.spelldesc[j][i] = spelldesc; global.spellcost[j][i] = cost; global.spellusable[j][i] = spellusable; global.spelltarget[j][i] = spelltarget; } } }
();
84
    for (__i = 0; __i < 3; __i++)
85
    {
86
        for (__fj = 0; __fj < 12; __fj++)
87
        {
88
            __ib = global.battleactcount[__i] + __fj;
89
            global.battlespell[__i][__ib] = global.spell[global.char[__i]][__fj];
90
            global.battlespellcost[__i][__ib] = global.spellcost[global.char[__i]][__fj];
91
            global.battlespellname[__i][__ib] = global.spellnameb[global.char[__i]][__fj];
92
            global.battlespelldesc[__i][__ib] = global.spelldescb[global.char[__i]][__fj];
93
            global.battlespelltarget[__i][__ib] = global.spelltarget[global.char[__i]][__fj];
94
        }
95
    }
96
}