Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_quizsequence_Draw_0

(view raw script w/o annotations or w/e)
1
if (init)
2
{
3
    draw_set_alpha(1);
4
    draw_set_color(gameshowblue);
5
    if (board4 && (!i_ex(quizzler) || quizzler.con == 0))
6
        ossafe_fill_rectangle(128, 4, 511, 259, false);
7
    else if (!i_ex(quizzler) || quizzler.con < 4)
8
        ossafe_fill_rectangle(128, 64, 511, 319, false);
9
    draw_set_color(c_white);
10
    draw_set_font(fnt_8bit);
11
    if (con == 0 && (!i_ex(quizzler) || quizzler.con == 0 || con == 6))
12
    {
13
        draw_set_halign(fa_center);
14
        draw_set_valign(fa_middle);
15
        draw_set_color(gameshowblue);
16
        quizstring = stringsetloc(
QUIZ!
"QUIZ!", "obj_quizsequence_slash_Draw_0_gml_43_0"
);
17
        var _tx = 332;
18
        var _ty = board4 ? 140 : 194;
19
        var _scale = 
scr_ease_in
scr_ease_in

function
scr_ease_in(arg0, arg1)
{ if (arg1 < -3 || arg1 > 7) return arg0; switch (arg1) { case -3: return ease_in_bounce(arg0, 0, 1, 1); case -2: return ease_in_elastic(arg0, 0, 1, 1); case -1: var _s = 1.70158; return arg0 * arg0 * (((_s + 1) * arg0) - _s); case 0: return arg0; case 1: return -cos(arg0 * 1.5707963267948966) + 1; case 6: return power(2, 10 * (arg0 - 1)); case 7: return -(sqrt(1 - sqr(arg0)) - 1); default: return power(arg0, arg1); } }
(clamp01(remap(0, 9, 1, 0, timer)), -1) + 1;
20
        draw_text_transformed((1 + _tx) - (6 * _scale), _ty, string_hash_to_newline(quizstring), 3 * _scale, 3 * _scale, 0);
21
        draw_text_transformed(1 + _tx, _ty - (6 * _scale), string_hash_to_newline(quizstring), 3 * _scale, 3 * _scale, 0);
22
        draw_text_transformed(1 + _tx + (6 * _scale), _ty, string_hash_to_newline(quizstring), 3 * _scale, 3 * _scale, 0);
23
        draw_text_transformed(1 + _tx, _ty + (6 * _scale), string_hash_to_newline(quizstring), 3 * _scale, 3 * _scale, 0);
24
        draw_set_color(c_white);
25
        draw_text_transformed(_tx, _ty, string_hash_to_newline(quizstring), 3 * _scale, 3 * _scale, 0);
26
        draw_set_color(gameshowblue);
27
    }
28
    if (board4 && i_ex(quizzler) && quizzler.con == 1)
29
        depth = newdepth;
30
    draw_set_halign(fa_left);
31
    draw_set_valign(fa_top);
32
    if (con == 7)
33
    {
34
        draw_sprite_ext(spr_quiz_results, 0, camerax() + 320, cameray() + 112 + 10, 2, 2, 0, c_white, 1);
35
        drawquestion = 0;
36
        timer++;
37
        if (timer == 1)
38
        {
39
            xloc = 256;
40
            yloc = 242;
41
            if (!i_ex(hurtmarker_su))
42
                hurtmarker_su = 
scr_board_marker
scr_board_marker

function
scr_board_marker()
{ var _thismarker = instance_create(argument0, argument1, obj_board_marker); _thismarker.sprite_index = argument2; _thismarker.image_xscale = 2; _thismarker.image_yscale = 2; if (argument_count >= 4) _thismarker.image_speed = argument3; if (argument_count >= 5) { if (argument4 != -1) _thismarker.depth = argument4; } if (argument_count >= 6) _thismarker.image_xscale = argument5; if (argument_count >= 6) _thismarker.image_yscale = argument5; if (argument_count >= 7) _thismarker.animateonce = argument6; return _thismarker; }
(xloc + 0, yloc, spr_board_susie_walk_down, 0, depth - 5, 2);
43
            if (!i_ex(hurtmarker_kr))
44
                hurtmarker_kr = 
scr_board_marker
scr_board_marker

function
scr_board_marker()
{ var _thismarker = instance_create(argument0, argument1, obj_board_marker); _thismarker.sprite_index = argument2; _thismarker.image_xscale = 2; _thismarker.image_yscale = 2; if (argument_count >= 4) _thismarker.image_speed = argument3; if (argument_count >= 5) { if (argument4 != -1) _thismarker.depth = argument4; } if (argument_count >= 6) _thismarker.image_xscale = argument5; if (argument_count >= 6) _thismarker.image_yscale = argument5; if (argument_count >= 7) _thismarker.animateonce = argument6; return _thismarker; }
(xloc + 48, yloc, spr_board_kris_walk_down, 0, depth - 5, 2);
45
            if (!i_ex(hurtmarker_ra))
46
                hurtmarker_ra = 
scr_board_marker
scr_board_marker

function
scr_board_marker()
{ var _thismarker = instance_create(argument0, argument1, obj_board_marker); _thismarker.sprite_index = argument2; _thismarker.image_xscale = 2; _thismarker.image_yscale = 2; if (argument_count >= 4) _thismarker.image_speed = argument3; if (argument_count >= 5) { if (argument4 != -1) _thismarker.depth = argument4; } if (argument_count >= 6) _thismarker.image_xscale = argument5; if (argument_count >= 6) _thismarker.image_yscale = argument5; if (argument_count >= 7) _thismarker.animateonce = argument6; return _thismarker; }
(xloc + 96, yloc, spr_board_ralsei_walk_down, 0, depth - 5, 2);
47
            mus_fade(global.currentsong[1], 60);
48
            instance_destroy(questionwriter);
49
        }
50
        var hSpace = 22;
51
        var _rate = 8;
52
        var _starttime = 24;
53
        var xloc = 200;
54
        var _so = 8465906;
55
        var _sx = _so;
56
        var _ko = 12566278;
57
        var _kx = _ko;
58
        var _ro = 7328275;
59
        var _rx = _ro;
60
        draw_sprite_ext(spr_whitepx, 0, 0, 168, 640, 22, 0, c_white, 1);
61
        if (timer >= (_starttime + (_rate * 0)))
62
            draw_sprite_ext(spr_quiz_answer_cursor, 18 - su_answer[0], xloc + (hSpace * 0), 170, 2, 2, 0, su_answer[0] ? _so : _sx, 1);
63
        if (timer >= (_starttime + (_rate * 1)))
64
            draw_sprite_ext(spr_quiz_answer_cursor, 18 - kr_answer[0], xloc + (hSpace * 1), 170, 2, 2, 0, kr_answer[0] ? _ko : _kx, 1);
65
        if (timer >= (_starttime + (_rate * 2)))
66
            draw_sprite_ext(spr_quiz_answer_cursor, 18 - ra_answer[0], xloc + (hSpace * 2), 170, 2, 2, 0, ra_answer[0] ? _ro : _rx, 1);
67
        draw_sprite_ext(spr_quiz_answer_cursor, 19, xloc + (hSpace * 3), 170, 2, 2, 0, gameshowblue, 1);
68
        if (timer >= (_starttime + (_rate * 3)))
69
            draw_sprite_ext(spr_quiz_answer_cursor, 18 - su_answer[1], xloc + (hSpace * 4), 170, 2, 2, 0, su_answer[1] ? _so : _sx, 1);
70
        if (timer >= (_starttime + (_rate * 4)))
71
            draw_sprite_ext(spr_quiz_answer_cursor, 18 - kr_answer[1], xloc + (hSpace * 5), 170, 2, 2, 0, kr_answer[1] ? _ko : _kx, 1);
72
        if (timer >= (_starttime + (_rate * 5)))
73
            draw_sprite_ext(spr_quiz_answer_cursor, 18 - ra_answer[1], xloc + (hSpace * 6), 170, 2, 2, 0, ra_answer[1] ? _ro : _rx, 1);
74
        draw_sprite_ext(spr_quiz_answer_cursor, 19, xloc + (hSpace * 7), 170, 2, 2, 0, gameshowblue, 1);
75
        if (timer >= (_starttime + (_rate * 6)))
76
            draw_sprite_ext(spr_quiz_answer_cursor, 18 - su_answer[2], xloc + (hSpace * 8), 170, 2, 2, 0, su_answer[2] ? _so : _sx, 1);
77
        if (timer >= (_starttime + (_rate * 7)))
78
            draw_sprite_ext(spr_quiz_answer_cursor, 18 - kr_answer[2], xloc + (hSpace * 9), 170, 2, 2, 0, kr_answer[2] ? _ko : _kx, 1);
79
        if (timer >= (_starttime + (_rate * 8)))
80
            draw_sprite_ext(spr_quiz_answer_cursor, 18 - ra_answer[2], xloc + (hSpace * 10), 170, 2, 2, 0, ra_answer[2] ? _ro : _rx, 1);
81
        if (timer == (_starttime + (_rate * 0)))
82
        {
83
            if (su_answer[0] == 0)
84
                snd_play(snd_hurt1);
85
            else
86
                snd_play(snd_coin);
87
        }
88
        if (timer == (_starttime + (_rate * 1)))
89
        {
90
            if (kr_answer[0] == 0)
91
                snd_play(snd_hurt1);
92
            else
93
                snd_play(snd_coin);
94
        }
95
        if (timer == (_starttime + (_rate * 2)))
96
        {
97
            if (ra_answer[0] == 0)
98
                snd_play(snd_hurt1);
99
            else
100
                snd_play(snd_coin);
101
        }
102
        if (timer == (_starttime + (_rate * 3)))
103
        {
104
            if (su_answer[1] == 0)
105
                snd_play(snd_hurt1);
106
            else
107
                snd_play(snd_coin);
108
        }
109
        if (timer == (_starttime + (_rate * 4)))
110
        {
111
            if (kr_answer[1] == 0)
112
                snd_play(snd_hurt1);
113
            else
114
                snd_play(snd_coin);
115
        }
116
        if (timer == (_starttime + (_rate * 5)))
117
        {
118
            if (ra_answer[1] == 0)
119
                snd_play(snd_hurt1);
120
            else
121
                snd_play(snd_coin);
122
        }
123
        if (timer == (_starttime + (_rate * 6)))
124
        {
125
            if (su_answer[2] == 0)
126
                snd_play(snd_hurt1);
127
            else
128
                snd_play(snd_coin);
129
        }
130
        if (timer == (_starttime + (_rate * 7)))
131
        {
132
            if (kr_answer[2] == 0)
133
                snd_play(snd_hurt1);
134
            else
135
                snd_play(snd_coin);
136
        }
137
        if (timer == (_starttime + (_rate * 8)))
138
        {
139
            if (ra_answer[2] == 0)
140
                snd_play(snd_hurt1);
141
            else
142
                snd_play(snd_coin);
143
        }
144
        var resultstime = _starttime + (_rate * 9);
145
        if (timer == 1)
146
        {
147
            mus_fade(global.currentsong[1], 30);
148
            correctAnswers = 0;
149
            for (var i = 0; i < quiz_length; i++)
150
            {
151
                result_krcount += kr_answer[i];
152
                result_racount += ra_answer[i];
153
                result_sucount += su_answer[i];
154
            }
155
            correctAnswers = result_krcount + result_racount + result_sucount;
156
            global.flag[1019 quiz_right_answers] = correctAnswers;
157
            bonus_total = 0;
158
            if (correctAnswers < 4)
159
                bonus_total = -1;
160
            else if (correctAnswers == 4)
161
                bonus_total = 0;
162
            else if (correctAnswers == 5)
163
                bonus_total = 25;
164
            else
165
                bonus_total = correctAnswers * 25;
166
            if (correctAnswers == (quiz_length * 3))
167
            {
168
                bonus_total = 300;
169
                perfect = true;
170
            }
171
            if (bonus_total == -1)
172
            {
173
                if (result_krcount == 0)
174
                    hurt_kr = true;
175
                if (result_racount == 0)
176
                    hurt_ra = true;
177
                if (result_sucount == 0)
178
                    hurt_su = true;
179
                if (!hurt_kr && !hurt_ra && !hurt_su)
180
                    bonus_total = 0;
181
            }
182
        }
183
        var resultsdelay = 5 + resultstime;
184
        var resultsrate = 10;
185
        var xxloc = 320;
186
        draw_set_halign(fa_center);
187
        if (timer > (resultsdelay + (resultsrate * 0)))
188
        {
189
            draw_text(xxloc, 198, bonusstring);
190
            var _width = 80;
191
            draw_sprite_ext(spr_whitepx, 0, xxloc - (_width / 2), 214, _width - 2, 2, 0, c_white, 1);
192
        }
193
        if (timer == (resultsdelay + (resultsrate * 0)))
194
            snd_play(snd_drumroll);
195
        if (timer > (resultsdelay + (resultsrate * 3)))
196
        {
197
            var finalbonusString = "+" + string(bonus_total);
198
            if (bonus_total == -1)
199
                finalbonusString = painstring;
200
            draw_text(xxloc, 218, finalbonusString);
201
        }
202
        xloc = 256;
203
        yloc = 242;
204
        if (timer == (resultsdelay + (resultsrate * 5)))
205
        {
206
            if (hurt_su == true)
207
            {
208
                
scr_board_marker
scr_board_marker

function
scr_board_marker()
{ var _thismarker = instance_create(argument0, argument1, obj_board_marker); _thismarker.sprite_index = argument2; _thismarker.image_xscale = 2; _thismarker.image_yscale = 2; if (argument_count >= 4) _thismarker.image_speed = argument3; if (argument_count >= 5) { if (argument4 != -1) _thismarker.depth = argument4; } if (argument_count >= 6) _thismarker.image_xscale = argument5; if (argument_count >= 6) _thismarker.image_yscale = argument5; if (argument_count >= 7) _thismarker.animateonce = argument6; return _thismarker; }
(xloc + 0 + 16, (yloc + 32) - 4, spr_quiz_lightning, 1, depth - 4, 2, 1);
209
                
scr_shakeobj
scr_shakeobj

function
scr_shakeobj()
{ var _shakeobj = instance_create(x, y, obj_shakeobj); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakeamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakereduct = argument2; } with (_shakeobj) event_user(0); }
(hurtmarker_su);
210
                hurtmarker_su.sprite_index = spr_board_susie_hurt;
211
                snd_play(snd_board_playerhurt);
212
                with (obj_mainchara_board)
213
                {
214
                    if (name == "susie")
215
                    {
216
                        myhealth -= 2;
217
                        if (myhealth < 1)
218
                            myhealth = 1;
219
                        with (obj_board_healthbar)
220
                        {
221
                            if (target == other.id)
222
                            {
223
                                
scr_shakeobj
scr_shakeobj

function
scr_shakeobj()
{ var _shakeobj = instance_create(x, y, obj_shakeobj); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakeamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakereduct = argument2; } with (_shakeobj) event_user(0); }
();
224
                                scr_delay_var("mycolor", mycolor, 2);
225
                                mycolor = c_red;
226
                            }
227
                        }
228
                    }
229
                }
230
            }
231
            else
232
            {
233
                timer += resultsrate;
234
            }
235
        }
236
        if (timer == (resultsdelay + (resultsrate * 6)))
237
        {
238
            if (hurt_kr == true)
239
            {
240
                
scr_board_marker
scr_board_marker

function
scr_board_marker()
{ var _thismarker = instance_create(argument0, argument1, obj_board_marker); _thismarker.sprite_index = argument2; _thismarker.image_xscale = 2; _thismarker.image_yscale = 2; if (argument_count >= 4) _thismarker.image_speed = argument3; if (argument_count >= 5) { if (argument4 != -1) _thismarker.depth = argument4; } if (argument_count >= 6) _thismarker.image_xscale = argument5; if (argument_count >= 6) _thismarker.image_yscale = argument5; if (argument_count >= 7) _thismarker.animateonce = argument6; return _thismarker; }
(xloc + 48 + 16, (yloc + 32) - 4, spr_quiz_lightning, 1, depth - 4, 2, 1);
241
                
scr_shakeobj
scr_shakeobj

function
scr_shakeobj()
{ var _shakeobj = instance_create(x, y, obj_shakeobj); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakeamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakereduct = argument2; } with (_shakeobj) event_user(0); }
(hurtmarker_kr);
242
                hurtmarker_kr.sprite_index = spr_board_kris_hurt;
243
                snd_play(snd_board_playerhurt);
244
                with (obj_mainchara_board)
245
                {
246
                    if (name == "kris")
247
                    {
248
                        myhealth -= 2;
249
                        if (myhealth < 1)
250
                            myhealth = 1;
251
                        with (obj_board_healthbar)
252
                        {
253
                            if (target == other.id)
254
                            {
255
                                
scr_shakeobj
scr_shakeobj

function
scr_shakeobj()
{ var _shakeobj = instance_create(x, y, obj_shakeobj); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakeamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakereduct = argument2; } with (_shakeobj) event_user(0); }
();
256
                                scr_delay_var("mycolor", mycolor, 2);
257
                                mycolor = c_red;
258
                            }
259
                        }
260
                    }
261
                }
262
            }
263
            else
264
            {
265
                timer += resultsrate;
266
            }
267
        }
268
        if (timer == (resultsdelay + (resultsrate * 7)))
269
        {
270
            if (hurt_ra == true)
271
            {
272
                
scr_board_marker
scr_board_marker

function
scr_board_marker()
{ var _thismarker = instance_create(argument0, argument1, obj_board_marker); _thismarker.sprite_index = argument2; _thismarker.image_xscale = 2; _thismarker.image_yscale = 2; if (argument_count >= 4) _thismarker.image_speed = argument3; if (argument_count >= 5) { if (argument4 != -1) _thismarker.depth = argument4; } if (argument_count >= 6) _thismarker.image_xscale = argument5; if (argument_count >= 6) _thismarker.image_yscale = argument5; if (argument_count >= 7) _thismarker.animateonce = argument6; return _thismarker; }
(xloc + 96 + 16, (yloc + 32) - 4, spr_quiz_lightning, 1, depth - 4, 2, 1);
273
                
scr_shakeobj
scr_shakeobj

function
scr_shakeobj()
{ var _shakeobj = instance_create(x, y, obj_shakeobj); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakeamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakereduct = argument2; } with (_shakeobj) event_user(0); }
(hurtmarker_ra);
274
                hurtmarker_ra.sprite_index = spr_board_ralsei_hurt;
275
                snd_play(snd_board_playerhurt);
276
                with (obj_mainchara_board)
277
                {
278
                    if (name == "ralsei")
279
                    {
280
                        myhealth -= 2;
281
                        if (myhealth < 1)
282
                            myhealth = 1;
283
                        with (obj_board_healthbar)
284
                        {
285
                            if (target == other.id)
286
                            {
287
                                
scr_shakeobj
scr_shakeobj

function
scr_shakeobj()
{ var _shakeobj = instance_create(x, y, obj_shakeobj); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakeamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakereduct = argument2; } with (_shakeobj) event_user(0); }
();
288
                                scr_delay_var("mycolor", mycolor, 2);
289
                                mycolor = c_red;
290
                            }
291
                        }
292
                    }
293
                }
294
            }
295
            else
296
            {
297
                timer += resultsrate;
298
            }
299
        }
300
        draw_set_halign(fa_left);
301
        var finalresultstime = resultsdelay + (resultsrate * 9);
302
        if (timer == (resultsdelay + (resultsrate * 3)))
303
        {
304
            var _start_depth = quizzler.bg.depth;
305
            if (bonus_total > 0)
306
            {
307
                snd_play(snd_cymbal);
308
                var confetti_amount = correctAnswers;
309
                if (perfect)
310
                    confetti_amount += 10;
311
                var _popper = 
scr_confetti
scr_confetti

function
scr_confetti(arg0, arg1, arg2, arg3)
{ var __popper = instance_create(arg0, arg1, obj_confetti_popper); arg3 = floor(arg3); __popper.direction = arg2; __popper.count = arg3; return __popper; } function scr_confetti_ext(arg0, arg1, arg2, arg3, arg4 = 20, arg5 = 200, arg6 = 340, arg7 = 0, arg8 = 0, arg9 = 1000100) { arg3 = floor(arg3); var __i = 0; for (__i = 0; __i < arg3; __i++) { var _d = instance_create(arg0, arg1, obj_confetti_overworld); with (_d) { direction = random_range(arg2 - 20, arg2 + 20); height = arg4; miny = arg5; maxy = arg6; topdrop = arg7; bottomdrop = arg8; maxDepth = arg9; } } } function scr_confetti_preload(arg0, arg1, arg2, arg3, arg4 = 20, arg5 = 200, arg6 = 340, arg7 = 0, arg8 = 0, arg9 = 1000100) { arg3 = floor(arg3); var __i = 0; for (__i = 0; __i < arg3; __i++) { var _d = instance_create(arg0, arg1, obj_confetti_overworld); with (_d) { direction = random_range(arg2 - 20, arg2 + 20); height = arg4; miny = arg5; maxy = arg6; topdrop = arg7; bottomdrop = arg8; maxDepth = arg9; preload = 1; visible = false; } } } function scr_confetti_fire() { with (obj_confetti_overworld) { if (preload) { preload = 0; speed = preload_speed; preload_speed = 0; visible = true; } } }
(camerax() - 10, cameray() + 440, 20, confetti_amount * 3);
312
                _popper.topdrop = 1;
313
                _popper.maxDepth = _start_depth - 10;
314
                _popper.start_depth = _start_depth;
315
                _popper = 
scr_confetti
scr_confetti

function
scr_confetti(arg0, arg1, arg2, arg3)
{ var __popper = instance_create(arg0, arg1, obj_confetti_popper); arg3 = floor(arg3); __popper.direction = arg2; __popper.count = arg3; return __popper; } function scr_confetti_ext(arg0, arg1, arg2, arg3, arg4 = 20, arg5 = 200, arg6 = 340, arg7 = 0, arg8 = 0, arg9 = 1000100) { arg3 = floor(arg3); var __i = 0; for (__i = 0; __i < arg3; __i++) { var _d = instance_create(arg0, arg1, obj_confetti_overworld); with (_d) { direction = random_range(arg2 - 20, arg2 + 20); height = arg4; miny = arg5; maxy = arg6; topdrop = arg7; bottomdrop = arg8; maxDepth = arg9; } } } function scr_confetti_preload(arg0, arg1, arg2, arg3, arg4 = 20, arg5 = 200, arg6 = 340, arg7 = 0, arg8 = 0, arg9 = 1000100) { arg3 = floor(arg3); var __i = 0; for (__i = 0; __i < arg3; __i++) { var _d = instance_create(arg0, arg1, obj_confetti_overworld); with (_d) { direction = random_range(arg2 - 20, arg2 + 20); height = arg4; miny = arg5; maxy = arg6; topdrop = arg7; bottomdrop = arg8; maxDepth = arg9; preload = 1; visible = false; } } } function scr_confetti_fire() { with (obj_confetti_overworld) { if (preload) { preload = 0; speed = preload_speed; preload_speed = 0; visible = true; } } }
(camerax() + 640 + 10, cameray() + 440, 160, confetti_amount * 3);
316
                _popper.topdrop = 1;
317
                _popper.maxDepth = _start_depth - 10;
318
                _popper.start_depth = _start_depth;
319
            }
320
            else
321
            {
322
                snd_play(snd_error);
323
                var _popper;
324
                if (choose(0, 1))
325
                    _popper = 
scr_confetti
scr_confetti

function
scr_confetti(arg0, arg1, arg2, arg3)
{ var __popper = instance_create(arg0, arg1, obj_confetti_popper); arg3 = floor(arg3); __popper.direction = arg2; __popper.count = arg3; return __popper; } function scr_confetti_ext(arg0, arg1, arg2, arg3, arg4 = 20, arg5 = 200, arg6 = 340, arg7 = 0, arg8 = 0, arg9 = 1000100) { arg3 = floor(arg3); var __i = 0; for (__i = 0; __i < arg3; __i++) { var _d = instance_create(arg0, arg1, obj_confetti_overworld); with (_d) { direction = random_range(arg2 - 20, arg2 + 20); height = arg4; miny = arg5; maxy = arg6; topdrop = arg7; bottomdrop = arg8; maxDepth = arg9; } } } function scr_confetti_preload(arg0, arg1, arg2, arg3, arg4 = 20, arg5 = 200, arg6 = 340, arg7 = 0, arg8 = 0, arg9 = 1000100) { arg3 = floor(arg3); var __i = 0; for (__i = 0; __i < arg3; __i++) { var _d = instance_create(arg0, arg1, obj_confetti_overworld); with (_d) { direction = random_range(arg2 - 20, arg2 + 20); height = arg4; miny = arg5; maxy = arg6; topdrop = arg7; bottomdrop = arg8; maxDepth = arg9; preload = 1; visible = false; } } } function scr_confetti_fire() { with (obj_confetti_overworld) { if (preload) { preload = 0; speed = preload_speed; preload_speed = 0; visible = true; } } }
(camerax() - 10, cameray() + 400, 20, 1);
326
                else
327
                    _popper = 
scr_confetti
scr_confetti

function
scr_confetti(arg0, arg1, arg2, arg3)
{ var __popper = instance_create(arg0, arg1, obj_confetti_popper); arg3 = floor(arg3); __popper.direction = arg2; __popper.count = arg3; return __popper; } function scr_confetti_ext(arg0, arg1, arg2, arg3, arg4 = 20, arg5 = 200, arg6 = 340, arg7 = 0, arg8 = 0, arg9 = 1000100) { arg3 = floor(arg3); var __i = 0; for (__i = 0; __i < arg3; __i++) { var _d = instance_create(arg0, arg1, obj_confetti_overworld); with (_d) { direction = random_range(arg2 - 20, arg2 + 20); height = arg4; miny = arg5; maxy = arg6; topdrop = arg7; bottomdrop = arg8; maxDepth = arg9; } } } function scr_confetti_preload(arg0, arg1, arg2, arg3, arg4 = 20, arg5 = 200, arg6 = 340, arg7 = 0, arg8 = 0, arg9 = 1000100) { arg3 = floor(arg3); var __i = 0; for (__i = 0; __i < arg3; __i++) { var _d = instance_create(arg0, arg1, obj_confetti_overworld); with (_d) { direction = random_range(arg2 - 20, arg2 + 20); height = arg4; miny = arg5; maxy = arg6; topdrop = arg7; bottomdrop = arg8; maxDepth = arg9; preload = 1; visible = false; } } } function scr_confetti_fire() { with (obj_confetti_overworld) { if (preload) { preload = 0; speed = preload_speed; preload_speed = 0; visible = true; } } }
(camerax() + 640 + 10, cameray() + 400, 160, 1);
328
                _popper.topdrop = 1;
329
                _popper.maxDepth = _start_depth - 10;
330
                _popper.start_depth = _start_depth;
331
            }
332
        }
333
        if (timer > finalresultstime)
334
        {
335
            total_correct = scorrect + kcorrect + rcorrect;
336
            result_string = result_notbad;
337
            if (bonus_total > 25)
338
                result_string = result_decent;
339
            if (bonus_total == 25)
340
                result_string = result_notbad;
341
            if (bonus_total == 0)
342
                result_string = result_notgreat;
343
            if (bonus_total == -1)
344
                result_string = (correctAnswers == 0) ? result_worst : result_terrible;
345
            if (perfect)
346
                result_string = result_perfect;
347
            if (timer >= 75 && (timer % 30) >= 15)
348
            {
349
                draw_set_font(
scr_84_get_font
scr_84_get_font

function
scr_84_get_font(arg0)
{ if (!variable_global_exists("chemg_last_get_font")) global.chemg_last_get_font = ""; if (arg0 != global.chemg_last_get_font) global.chemg_last_get_font = arg0; return ds_map_find_value(global.font_map, arg0); }
("8bit"));
350
                draw_set_halign(fa_center);
351
                draw_text(320, 282, result_string);
352
                draw_set_halign(fa_left);
353
            }
354
        }
355
        if (timer == finalresultstime)
356
        {
357
            if (bonus_total > 0)
358
                
scr_board_score
scr_board_score

function
scr_board_score(arg0)
{ var scoreadder = instance_create(x, y, obj_board_scoreAdder); scoreadder.scoreamount = arg0; if (argument_count == 2) scoreadder.mysnd = argument1; } function scr_board_score_set(arg0) { global.flag[1044 points] = arg0; }
(bonus_total);
359
            snd_free_all();
360
            if (bonus_total > 0)
361
            {
362
                global.currentsong[0] = snd_init("baci_perugina.ogg");
363
            }
364
            else
365
            {
366
                global.currentsong[0] = snd_init("tv_results_screen.ogg");
367
                if (i_ex(grandaddy))
368
                    grandaddy.completed = false;
369
            }
370
            global.currentsong[1] = mus_loop(global.currentsong[0]);
371
        }
372
        if (timer == (finalresultstime + 120) || (timer > (finalresultstime + 10) && button1_p() && resultsskip == 0))
373
        {
374
            resultsskip = 1;
375
            timer = finalresultstime + 120;
376
            quizzler.con++;
377
        }
378
        if (timer == (finalresultstime + 130))
379
        {
380
            timer = 0;
381
            con = 8;
382
        }
383
        draw_set_halign(fa_left);
384
    }
385
    if ((con >= 3 && con <= 6) || timer_delay > 0)
386
    {
387
        if (con == 3 || con == 4 || timer_delay > 0)
388
        {
389
            draw_set_alpha(1);
390
            if (countdown <= 75)
391
                draw_set_color(c_red);
392
            else if (countdown <= 150)
393
                draw_set_color(c_yellow);
394
            else
395
                draw_set_color(c_white);
396
            var cx = camerax();
397
            var cy = cameray();
398
            var _barx = 160;
399
            ossafe_fill_rectangle(cx + _barx, cy + 300, cx + _barx + (round((countdown / timelimit) * 173) * 2), cy + 320, false);
400
            draw_sprite_ext(spr_quiz_bottomtimebar, 1, camerax() + _barx, cameray() + 300, 2, 2, 0, gameshowblue, 1);
401
            draw_sprite_ext(spr_quiz_bottomtimebar, 0, camerax() + _barx, cameray() + 300, 2, 2, 0, c_white, 1);
402
            var clockx = 132;
403
            var clocky = (cameray() + 300) - 10;
404
            var _clock_time = countdown;
405
            if (timer_delay > 0)
406
            {
407
                var _clockease = 
scr_ease_out
scr_ease_out

function
scr_ease_out(arg0, arg1)
{ if (arg1 < -3 || arg1 > 7) return arg0; switch (arg1) { case -3: return ease_out_bounce(arg0, 0, 1, 1); case -2: return ease_out_elastic(arg0, 0, 1, 1); case -1: return ease_out_back(arg0, 0, 1, 1); case 0: return arg0; case 1: return sin(arg0 * 1.5707963267948966); case 2: return -arg0 * (arg0 - 2); case 6: return -power(2, -10 * arg0) + 1; case 7: arg0--; return sqrt(1 - (arg0 * arg0)); default: arg0--; if (arg1 == 4) { return -1 * (power(arg0, arg1) - 1); break; } return power(arg0, arg1) + 1; } }
(1 - clamp01(timer_delay / 20), 4);
408
                clockx = lerp(280, 132, _clockease);
409
                clocky = cameray() + lerp(190, 290, _clockease);
410
                if (timer_delay <= 15)
411
                    _clock_time = 0;
412
                else
413
                    _clock_time = (1 - ((timer_delay - 15) / 15)) * timelimit;
414
                timer_delay--;
415
            }
416
            var bouncer = round(abs(sin(_clock_time / 4) * 2)) * 2;
417
            if (timelimit < 200)
418
                bouncer = round(abs(sin(_clock_time / 2) * 2)) * 2;
419
            draw_sprite_ext(spr_whitepx, 0, clockx + 10, (clocky - 10) + bouncer + 4, 8, 2, 0, c_white, 1);
420
            draw_sprite_ext(spr_quiz_hud_timer, 28 - ((_clock_time / timelimit) * 28), clockx, clocky, 2, 2, 0, c_white, 1);
421
            if (paused)
422
                draw_sprite_ext(spr_quiz_hud_timer_pause, 0, clockx, clocky, 2, 2, 0, c_white, 1);
423
        }
424
        if (con >= 3 && con <= 6 && timer_delay <= 0)
425
        {
426
            draw_set_blend_mode(bm_normal);
427
            var _coordOffset = 0;
428
            var _iconyoff = 0;
429
            if (global.lang == "ja")
430
                _iconyoff = 4;
431
            draw_set_blend_mode((paused || con >= 4 || myanswer >= 0) ? bm_add : bm_normal);
432
            draw_sprite_ext(spr_quiz_selectionicons, 0, 200, 190 + (menucoord[menu] * 26) + _iconyoff, 2, 2, 0, c_white, 1);
433
            if (menucoord[menu] == susiecoord)
434
                _coordOffset = -20;
435
            draw_set_blend_mode(ssel ? bm_add : bm_normal);
436
            draw_sprite_ext(spr_quiz_selectionicons, 1, 200 + _coordOffset, 190 + (susiecoord * 26) + _iconyoff, 2, 2, 0, c_white, 1);
437
            _coordOffset = 0;
438
            if (menucoord[menu] == ralseicoord)
439
                _coordOffset = -20;
440
            if (ralseicoord == susiecoord)
441
                _coordOffset += -20;
442
            draw_set_blend_mode(rsel ? bm_add : bm_normal);
443
            draw_sprite_ext(spr_quiz_selectionicons, 2, 200 + _coordOffset, 190 + (ralseicoord * 26) + _iconyoff, 2, 2, 0, c_white, 1);
444
            draw_set_blend_mode(bm_normal);
445
            if (subcon >= 1)
446
                draw_sprite_ext(spr_quiz_answer_cursor, (rsel && rresult) ? 0 : 1, 200 + _coordOffset, 190 + (ralseicoord * 26) + _iconyoff, 2, 2, 0, c_white, 1);
447
            if (menucoord[menu] == susiecoord)
448
                _coordOffset = -20;
449
            else
450
                _coordOffset = 0;
451
            if (subcon >= 2)
452
                draw_sprite_ext(spr_quiz_answer_cursor, (ssel && sresult) ? 0 : 1, 200 + _coordOffset, 190 + (susiecoord * 26) + _iconyoff, 2, 2, 0, c_white, 1);
453
            if (subcon >= 3)
454
                draw_sprite_ext(spr_quiz_answer_cursor, (myanswer > -1 && correct) ? 0 : 1, 200, 190 + (menucoord[menu] * 26) + _iconyoff, 2, 2, 0, c_white, 1);
455
        }
456
        if (con == 5 && timer <= 72)
457
        {
458
            flashtimer += 1;
459
            if (flashtimer >= 24)
460
                flashtimer = 0;
461
        }
462
        if (menu == 0)
463
        {
464
            draw_set_font(
scr_84_get_font
scr_84_get_font

function
scr_84_get_font(arg0)
{ if (!variable_global_exists("chemg_last_get_font")) global.chemg_last_get_font = ""; if (arg0 != global.chemg_last_get_font) global.chemg_last_get_font = arg0; return ds_map_find_value(global.font_map, arg0); }
("8bit_mixed"));
465
            var _xscale = 1;
466
            var _yscale = 1;
467
            for (var i = 0; i < 4; i += 1)
468
            {
469
                _xscale = 1;
470
                _yscale = 1;
471
                var _answeroption;
472
                if (string_char_at(answeroption[i], 1) == "~")
473
                {
474
                    if (string_char_at(answeroption[i], 2) == "~")
475
                    {
476
                        _yscale = 0.5;
477
                        _answeroption = substr(answeroption[i], 3);
478
                    }
479
                    else
480
                    {
481
                        _answeroption = substr(answeroption[i], 2);
482
                    }
483
                    _xscale = 0.5;
484
                }
485
                else
486
                {
487
                    _answeroption = answeroption[i];
488
                }
489
                draw_set_color(c_white);
490
                if (con == 5)
491
                {
492
                    if (i == myanswer || (rsel && i == ralseicoord) || (ssel && i == susiecoord))
493
                    {
494
                        if (correctanswer == 4)
495
                            draw_set_color(c_yellow);
496
                        else
497
                            draw_set_color(c_red);
498
                    }
499
                    if (quizid == "whattime")
500
                    {
501
                        if (i != 3)
502
                            draw_set_color(c_yellow);
503
                    }
504
                    else if (quizid == "ralseiplush")
505
                    {
506
                        if (i == 0 || i == 3)
507
                            draw_set_color(c_yellow);
508
                    }
509
                    else if (i == correctanswer)
510
                    {
511
                        draw_set_color(c_yellow);
512
                    }
513
                    if (flashtimer < 12)
514
                        draw_text_transformed(224, 192 + (i * 26), string_hash_to_newline(_answeroption), _xscale, _yscale, 0);
515
                }
516
                else
517
                {
518
                    draw_text_transformed(224, 192 + (i * 26), string_hash_to_newline(_answeroption), _xscale, _yscale, 0);
519
                }
520
            }
521
        }
522
    }
523
    if (i_ex(questionwriter))
524
        draw_sprite_ext(spr_quiz_questionbox, 0, camerax() + board_tilex(0) + 2, cameray() + board_tiley(0) + 2, 2, 2, 0, c_white, 1);
525
    if (sprite != -4 && con >= 2)
526
    {
527
        if (sprite_timer > 0)
528
            sprite_timer--;
529
        if (quizid == "cable")
530
        {
531
            draw_sprite_ext(sprite, (con >= 3) ? 1 : 0, camerax() + board_tilex(0) + spritex, cameray() + board_tiley(0) + spritey, 2, 2, 0, c_white, 1);
532
        }
533
        else if (quizid == "pippins")
534
        {
535
            draw_sprite_ext(sprite, timer / 2, camerax() + board_tilex(0) + spritex, cameray() + board_tiley(0) + spritey, 2, 2, 0, c_white, 1);
536
        }
537
        else if (quizid == "button")
538
        {
539
            draw_set_font(fnt_8bit);
540
            var powerstring = stringsetloc(
OFF
"OFF", "obj_quizsequence_slash_Draw_0_gml_503_0"
);
541
            draw_set_halign(fa_right);
542
            var xloc = camerax() + 336;
543
            yloc = cameray() + 138;
544
            var bgcol = 2237064;
545
            var swid = 
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(string_width(powerstring));
546
            var shei = 
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(string_height(powerstring));
547
            var bord = 8;
548
            draw_sprite_ext(spr_pxwhite, 0, xloc - swid - bord, yloc - 2, swid + bord + 4, shei, 0, bgcol, 1);
549
            draw_set_color(#FFE42C);
550
            draw_text(xloc, yloc, powerstring);
551
            draw_set_halign(fa_left);
552
            draw_set_color(c_white);
553
            draw_sprite_ext(sprite, timer / 2, camerax() + board_tilex(0) + spritex, cameray() + board_tiley(0) + spritey, 2, 2, 0, c_white, 1);
554
        }
555
        else
556
        {
557
            draw_sprite_ext(sprite, 0, camerax() + board_tilex(0) + spritex + sprite_timer, cameray() + board_tiley(0) + spritey, 2, 2, 0, c_white, 1);
558
        }
559
    }
560
    if (i_ex(extra_obj) && quizid == "thrash" && con >= 2)
561
    {
562
        with (extra_obj)
563
            event_user(0);
564
    }
565
    with (questionwriter)
566
        event_user(0);
567
    if (paused)
568
    {
569
        draw_set_color(c_black);
570
        draw_set_alpha(0.5);
571
        ossafe_fill_rectangle(camerax(), cameray(), camerax() + 600, cameray() + 400, false);
572
        draw_set_color(c_white);
573
        draw_set_alpha(1);
574
    }
575
}
576
var yloc = board_tiley(3);
577
var space = 10;