Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_tenna_enemy_Other_10

(view raw script w/o annotations or w/e)
1
var _minigamecount = 1;
2
var _minigametype = "battle";
3
var _difficulty = 0;
4
var _i = 0;
5
if (!minigameactivated)
6
    phaseturn++;
7
if ((global.monsterhp[myself] <= (global.monstermaxhp[myself] * 0.2) || obj_tenna_enemy_bg.myscore >= 1000) && haveusedultimate == false)
8
    minigameinsanity = true;
9
if (testsharpshoot == true)
10
{
11
    phaseturn = 99;
12
    myattackchoice = 21;
13
    exit;
14
}
15
if (testlightemup == true)
16
    phaseturn = 18;
17
if (phaseturn == 1)
18
    myattackchoice = 0;
19
if (phaseturn == 2)
20
    myattackchoice = 1;
21
if (phaseturn == 3)
22
{
23
    myattackchoice = 2;
24
    phaseturn = 0;
25
}
26
if (global.monsterhp[myself] <= (global.monstermaxhp[myself] * 0.5))
27
{
28
    myattackchoice = 3;
29
    minigamecount++;
30
    minigameactivated = true;
31
}
32
if (minigameactivated && minigamecount <= 5)
33
{
34
    myattackchoice = 3;
35
    minigamecount++;
36
}
37
if (minigameactivated && minigamecount >= 6)
38
{
39
    myattackchoice = 3;
40
    minigamecount++;
41
    _minigamecount = 2;
42
}
43
if (minigameinsanity == true)
44
{
45
    minigameactivated = true;
46
    myattackchoice = 3;
47
}
48
if (phaseturn == 18)
49
{
50
    haveusedultimate = true;
51
    myattackchoice = 3;
52
    minigametype = "battle";
53
    difficulty = 3;
54
    exit;
55
}
56
if (phaseturn == 19)
57
{
58
    haveusedultimate = true;
59
    myattackchoice = 3;
60
    minigametype = "battle";
61
    difficulty = 3;
62
    exit;
63
}
64
if (myattackchoice == 3)
65
{
66
    repeat (_minigamecount)
67
    {
68
        global.tempflag[91]++;
69
        if (global.tempflag[91] == 1)
70
        {
71
            _minigametype = "cooking";
72
            _difficulty = 0;
73
        }
74
        if (global.tempflag[91] == 2)
75
        {
76
            _minigametype = "music";
77
            _difficulty = 0;
78
        }
79
        if (global.tempflag[91] == 3)
80
        {
81
            _minigametype = "battle";
82
            _difficulty = 1;
83
        }
84
        if (global.tempflag[91] == 4)
85
        {
86
            _minigametype = "cowboy";
87
            _difficulty = 0;
88
        }
89
        if (global.tempflag[91] == 5)
90
        {
91
            _minigametype = "music";
92
            _difficulty = 0;
93
        }
94
        if (global.tempflag[91] == 6)
95
            global.tempflag[91] = 7;
96
        if (global.tempflag[91] == 7)
97
        {
98
            if (global.flag[1197 suziezilla_best_score] > 0)
99
            {
100
                _minigametype = "susiezilla";
101
                _difficulty = 2;
102
            }
103
            else
104
            {
105
                _minigametype = "battle";
106
                _difficulty = 2;
107
            }
108
        }
109
        if (global.tempflag[91] == 8)
110
        {
111
            _minigametype = "cowboy";
112
            _difficulty = 1;
113
        }
114
        if (global.tempflag[91] == 9)
115
        {
116
            _minigametype = "music";
117
            _difficulty = 0;
118
        }
119
        if (global.tempflag[91] == 10)
120
        {
121
            _minigametype = "cowboy";
122
            _difficulty = 0;
123
        }
124
        if (global.tempflag[91] == 11)
125
            global.tempflag[91] = 12;
126
        if (global.tempflag[91] == 12)
127
        {
128
            _minigametype = "battle";
129
            _difficulty = 2;
130
        }
131
        if (global.tempflag[91] == 13)
132
        {
133
            _minigametype = "music";
134
            _difficulty = 0;
135
        }
136
        if (global.tempflag[91] == 14)
137
        {
138
            _minigametype = "cooking";
139
            _difficulty = 0;
140
        }
141
        if (global.tempflag[91] == 15)
142
        {
143
            if (global.flag[1197 suziezilla_best_score] > 0)
144
            {
145
                _minigametype = "susiezilla";
146
                _difficulty = 3;
147
            }
148
            else
149
            {
150
                _minigametype = "battle";
151
                _difficulty = 1;
152
            }
153
        }
154
        if (global.tempflag[91] == 16)
155
        {
156
            _minigametype = "cowboy";
157
            _difficulty = 1;
158
        }
159
        if (global.tempflag[91] > 16)
160
        {
161
            var randomchosen = choose(0, 0, 0, 1, 2, 3, 4, 5);
162
            if (global.flag[1197 suziezilla_best_score] > 0)
163
                randomchosen = choose(0, 0, 0, 1, 3, 4, 5, 6, 7);
164
            repeat (3)
165
            {
166
                if (randomchosen == randomchosenprev1 || randomchosen == randomchosenprev2)
167
                    randomchosen += 2;
168
                if (global.flag[1197 suziezilla_best_score] == 0 && randomchosen > 5)
169
                    randomchosen -= 5;
170
                if (global.flag[1197 suziezilla_best_score] > 0 && randomchosen > 7)
171
                    randomchosen -= 7;
172
            }
173
            if (extravar == 0)
174
                randomchosenprev1 = randomchosen;
175
            if (extravar == 1)
176
                randomchosenprev2 = randomchosen;
177
            extravar++;
178
            if (extravar == 1)
179
                extravar = 0;
180
            if (randomchosen == 0)
181
                _minigametype = "music";
182
            if (randomchosen == 1)
183
            {
184
                _minigametype = "cooking";
185
                _difficulty = 0;
186
            }
187
            if (randomchosen == 2)
188
            {
189
                _minigametype = "cowboy";
190
                _difficulty = 0;
191
            }
192
            if (randomchosen == 3)
193
            {
194
                _minigametype = "cowboy";
195
                _difficulty = 1;
196
            }
197
            if (randomchosen == 4)
198
            {
199
                _minigametype = "battle";
200
                _difficulty = 1;
201
            }
202
            if (randomchosen == 5)
203
            {
204
                _minigametype = "battle";
205
                _difficulty = 2;
206
            }
207
            if (randomchosen == 6)
208
            {
209
                _minigametype = "susiezilla";
210
                _difficulty = 2;
211
            }
212
            if (randomchosen == 7)
213
            {
214
                _minigametype = "susiezilla";
215
                _difficulty = 4;
216
            }
217
        }
218
        if (_i == 0)
219
        {
220
            minigametype = _minigametype;
221
            difficulty = _difficulty;
222
        }
223
        if (_i == 1)
224
        {
225
            minigametype2 = _minigametype;
226
            difficulty2 = _difficulty;
227
        }
228
        if (_i == 2)
229
        {
230
            minigametype3 = _minigametype;
231
            difficulty3 = _difficulty;
232
        }
233
        _i++;
234
    }
235
    if (minigameinsanity == 1)
236
    {
237
        minigametype = "music";
238
        difficulty = 0;
239
    }
240
}