Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_battlecontroller_Create_0

(view raw script w/o annotations or w/e)
1
if (global.flag[9 battle_music] == 1)
2
    global.batmusic[1] = mus_loop_ext(global.batmusic[0], 0.7, 1);
3
victory = 0;
4
victoried = 0;
5
skipvictory = 0;
6
global.battleend = 0;
7
battlewriter = 19212912;
8
myface = 1913918291;
9
lbuffer = 0;
10
rbuffer = 0;
11
onebuffer = 0;
12
twobuffer = 0;
13
global.darkzone = 1;
14
global.fighting = 1;
15
global.fe = 0;
16
global.fc = 0;
17
global.typer = 4;
18
global.battletyper = 4;
19
global.myfight = 0;
20
global.mnfight = 0;
21
global.bmenuno = 0;
22
global.attacking = 0;
23
global.acting = 0;
24
global.tension = 0;
25
global.spelldelay = 10;
26
scr_spellinfo_all
scr_spellinfo_all

function
scr_spellinfo_all()
{ for (j = 0; j < 4; 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; } } }
();
27
global.tensionselect = 0;
28
for (j = 0; j < 3; j += 1)
29
{
30
    global.temptension[j] = global.tension;
31
    for (i = 0; i < 13; i += 1)
32
        tempitem[i][j] = global.item[i];
33
}
34
for (i = 0; i < 3; i += 1)
35
{
36
    global.charcond[i] = 0;
37
    global.automiss[i] = 0;
38
    if (global.char[i] != 0)
39
    {
40
        global.charmove[i] = 1;
41
        global.charcantarget[i] = 1;
42
        global.chardead[i] = 0;
43
    }
44
    else
45
    {
46
        global.charmove[i] = 0;
47
        global.charcantarget[i] = 0;
48
    }
49
}
50
itempage = 0;
51
global.flag[50 last_encounter_end] = 0;
52
global.flag[51 last_monster_end_0] = 0;
53
global.flag[52 last_monster_end_1] = 0;
54
global.flag[53 last_monster_end_2] = 0;
55
for (i = 0; i < 3; i += 1)
56
{
57
    global.monster[i] = 0;
58
    global.monsterx[i] = 0;
59
    global.monstery[i] = 0;
60
    global.monstername[i] = " ";
61
    global.monsterat[i] = 0;
62
    global.monsterdf[i] = 0;
63
    global.monsterhp[i] = 0;
64
    global.monstermaxhp[i] = 0;
65
    global.monsterinstance[i] = 12913921839;
66
    global.monstergold[i] = 0;
67
    global.monsterexp[i] = 0;
68
    global.sparepoint[i] = 0;
69
    global.hittarget[i] = 0;
70
    global.mercymod[i] = 0;
71
    global.mercymax[i] = 0;
72
    global.monstercomment[i] = " ";
73
    global.monsterstatus[i] = 0;
74
    for (j = 0; j < 6; j += 1)
75
    {
76
        global.act[i][j] = 0;
77
        global.canact[i][j] = 0;
78
        global.actname[i][j] = " ";
79
        global.acttype[i][j] = 0;
80
        global.actspell[i][j] = 0;
81
        global.actactor[i][j] = 1;
82
        global.actdesc[i][j] = " ";
83
        global.actcost[i][j] = 0;
84
    }
85
}
86
global.monstergold[3] = 0;
87
global.monsterexp[3] = 0;
88
for (i = 0; i < 3; i += 1)
89
{
90
    if (global.monstertype[i] > 0)
91
    {
92
        global.monster[i] = 1;
93
        global.monsterinstance[i] = instance_create(global.monstermakex[i], global.monstermakey[i], global.monsterinstancetype[i]);
94
        global.monsterinstance[i].myself = i;
95
        with (global.monsterinstance[i])
96
            event_user(12);
97
    }
98
}
99
global.charturn = 0;
100
for (i = 0; i < 3; i += 1)
101
{
102
    global.acting[i] = 0;
103
    global.charaction[i] = 0;
104
    global.charspecial[i] = 0;
105
    global.chartarget[i] = 0;
106
    global.faceaction[i] = 0;
107
    global.rembmenuno[i] = 0;
108
    global.targeted[i] = 0;
109
    global.battleat[i] = global.at[global.char[i]] + global.itemat[global.char[i]][0] + global.itemat[global.char[i]][1] + global.itemat[global.char[i]][2];
110
    global.battledf[i] = global.df[global.char[i]] + global.itemdf[global.char[i]][0] + global.itemdf[global.char[i]][1] + global.itemdf[global.char[i]][2];
111
    global.battlemag[i] = global.mag[global.char[i]] + global.itemmag[global.char[i]][0] + global.itemmag[global.char[i]][1] + global.itemmag[global.char[i]][2];
112
}
113
for (i = 0; i < 20; i += 1)
114
{
115
    for (j = 0; j < 20; j += 1)
116
        global.bmenucoord[i][j] = 0;
117
}
118
movenoise = 0;
119
selnoise = 0;
120
laznoise = 0;
121
damagenoise = 0;
122
grazenoise = 0;
123
bcolor = merge_color(c_purple, c_black, 0.7);
124
bcolor = merge_color(bcolor, c_dkgray, 0.5);
125
tp = 0;
126
tpy = 50;
127
bp = 0;
128
bpy = 152;
129
intro = 1;
130
chartotal = 0;
131
charpos[0] = -1;
132
charpos[1] = -1;
133
charpos[2] = -1;
134
havechar[0] = 0;
135
havechar[1] = 0;
136
havechar[2] = 0;
137
global.charinstance[0] = 12129292;
138
global.charinstance[1] = 12129292;
139
global.charinstance[2] = 12129292;
140
with (global.charinstance[0])
141
    myself = 0;
142
with (global.charinstance[1])
143
    myself = 1;
144
with (global.charinstance[2])
145
    myself = 2;
146
mmy[0] = 0;
147
mmy[1] = 0;
148
mmy[2] = 0;
149
for (i = 0; i < 3; i += 1)
150
{
151
    if (global.char[i] != 0)
152
        chartotal += 1;
153
    if (global.char[i] == 1)
154
    {
155
        havechar[0] = 1;
156
        charpos[0] = i;
157
        global.charinstance[i] = instance_create(global.heromakex[i], global.heromakey[i], obj_herokris);
158
        global.charinstance[i].myself = i;
159
        global.charinstance[i].char = 1;
160
        global.charinstance[i].depth = 200 - (i * 20);
161
    }
162
    if (global.char[i] == 2)
163
    {
164
        havechar[1] = 1;
165
        charpos[1] = i;
166
        global.charinstance[i] = instance_create(global.heromakex[i], global.heromakey[i], obj_herosusie);
167
        global.charinstance[i].myself = i;
168
        global.charinstance[i].char = 2;
169
        global.charinstance[i].depth = 200 - (i * 20);
170
    }
171
    if (global.char[i] == 3)
172
    {
173
        havechar[2] = 1;
174
        charpos[2] = i;
175
        global.charinstance[i] = instance_create(global.heromakex[i], global.heromakey[i], obj_heroralsei);
176
        global.charinstance[i].myself = i;
177
        global.charinstance[i].char = 3;
178
        global.charinstance[i].depth = 200 - (i * 20);
179
    }
180
}
181
slmxx = 0;
182
slmyy = 0;
183
s_siner = 0;
184
instance_create(0, 0, obj_tensionbar);
185
reset = 0;
186
timeron = 1;
187
noreturn = 0;
188
hpcolor[0] = c_aqua;
189
hpcolor[1] = c_fuchsia;
190
hpcolor[2] = c_lime;