Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_dw_ch3_teevie_quiz_screen_Create_0

(view raw script w/o annotations or w/e)
1
event_inherited();
2
gameshowblue = 15245824;
3
quizstring = "";
4
quiz_timer = 0;
5
quiz_intro = false;
6
quiz_ready = false;
7
quiz_display = false;
8
quiz_result = false;
9
quiz_index = 0;
10
quiz_question_list = [];
11
quiz_question_text = "";
12
quiz_answer_a = "";
13
quiz_answer_b = "";
14
question_visual = "none";
15
result_icon = 2416;
16
result_icon_index = 0;
17
word_scale_timer = 0;
18
word_max_scale = 9;
19
word_siner = false;
20
word_alpha = 1;
21
darkamt = 0;
22
countdown_timer = 0;
23
max_time = 90;
24
_is_paused = false;
25
answer_correct = "";
26
answer_selected = false;
27
answer_color = 16777215;
28
answer = "";
29
susie_select = false;
30
ralsei_select = false;
31
overlay = -4;
32
screen_anim = 0;
33
bullet_mode = false;
34
bullet_timer = 0;
35
bullet_max_time = 180;
36
bullet_screen_sprite = 4886;
37
bullet_screen_index = 0;
38
bullet_finish = false;
39
bullet_screen_list = [];
40
bullet_pos_list = [];
41
bullet_pos_index = 0;
42
bullet_con = 0;
43
shoot_sequence = false;
44
shoot_sequence_timer = 0;
45
current_screen_tile = -4;
46
shooter_list = [];
47
show_static_display = false;
48
image_xscale = 2;
49
image_yscale = 2;
50
tvheight = 40 * image_yscale;
51
tvwidth = 40 * image_xscale;
52
53
init_quiz = function(arg0)
54
{
55
    mode = 1;
56
    tvbasesprite = spr_dw_teevie_tv_base_thin;
57
    quiz_intro = true;
58
    quiz_question_list = 
scr_teevie_quiz
scr_teevie_quiz

function
scr_teevie_quiz(arg0)
{ var quiz_id = arg0; var question_list = []; var question_text = []; var answer_a = []; var answer_b = []; var correct_answer = []; var max_time_limit = []; var question_visual = []; switch (quiz_id) { case "A": question_text[0] = stringsetloc(
WHAT'S THE REWARD FOR C-RANK?
"WHAT'S THE REWARD FOR C-RANK?", "scr_teevie_quiz_slash_scr_teevie_quiz_gml_24_0"
);
answer_a[0] = stringsetloc(
CANDY
"CANDY", "scr_teevie_quiz_slash_scr_teevie_quiz_gml_25_0"
);
answer_b[0] = stringsetloc(
COOLER
"COOLER", "scr_teevie_quiz_slash_scr_teevie_quiz_gml_26_0"
);
correct_answer[0] = "B"; max_time_limit[0] = 240; question_visual[0] = "none"; question_text[1] = stringsetloc(
WHO RUNS THE GREEN ROOM CONCESSIONS?
"WHO RUNS THE GREEN ROOM CONCESSIONS?", "scr_teevie_quiz_slash_scr_teevie_quiz_gml_31_0"
);
answer_a[1] = stringsetloc(
RAMB
"RAMB", "scr_teevie_quiz_slash_scr_teevie_quiz_gml_32_0"
);
answer_b[1] = stringsetloc(
ROMB
"ROMB", "scr_teevie_quiz_slash_scr_teevie_quiz_gml_33_0"
);
correct_answer[1] = "A"; max_time_limit[1] = 240; question_visual[1] = "none"; break; case "B": question_text[0] = stringsetloc(
KRIS'S LAST NAME!?
"KRIS'S LAST NAME!?", "scr_teevie_quiz_slash_scr_teevie_quiz_gml_39_0"
);
answer_a[0] = stringsetloc(
DREEMURR
"DREEMURR", "scr_teevie_quiz_slash_scr_teevie_quiz_gml_40_0"
);
answer_b[0] = stringsetloc(
DREEMURE
"DREEMURE", "scr_teevie_quiz_slash_scr_teevie_quiz_gml_41_0"
);
correct_answer[0] = "A"; max_time_limit[0] = 180; question_visual[0] = "none"; var board_1_flag = 1173; var rank_1_letter =
scr_get_rank_letter(board_1_flag);
var board_2_flag = 1174; var rank_2_letter =
scr_get_rank_letter(board_2_flag);
var fake_answer = (rank_1_letter == rank_2_letter) ? "B" : rank_2_letter; if (fake_answer == rank_1_letter) fake_answer = "C"; question_text[1] = stringsetloc(
WHAT WAS YOUR RANK ON BOARD 1!?
"WHAT WAS YOUR RANK ON BOARD 1!?", "scr_teevie_quiz_slash_scr_teevie_quiz_gml_60_0"
);
answer_a[1] = fake_answer; answer_b[1] = rank_1_letter; correct_answer[1] = "B"; max_time_limit[1] = 180; question_visual[1] = "none"; break; case "C": randomize(); var _question_type = irandom(3); if (_question_type == 0) { _type = (irandom(100) < 50) ? 1 : 2; var _answer_a = irandom(999); var _answer_b = irandom(999); if (_type == 1) { question_text[0] = stringsetloc(
WHICH NUMBER IS BIGGER?
"WHICH NUMBER IS BIGGER?", "scr_teevie_quiz_slash_scr_teevie_quiz_gml_100_0"
);
answer_a[0] = string(_answer_a); answer_b[0] = string(_answer_b); correct_answer[0] = (_answer_a > _answer_b) ? "A" : "B"; max_time_limit[0] = 50; question_visual[0] = "none"; } else { question_text[0] = stringsetloc(
WHICH NUMBER IS SMALLER?
"WHICH NUMBER IS SMALLER?", "scr_teevie_quiz_slash_scr_teevie_quiz_gml_108_0"
);
answer_a[0] = string(_answer_a); answer_b[0] = string(_answer_b); correct_answer[0] = (_answer_a < _answer_b) ? "A" : "B"; max_time_limit[0] = 50; question_visual[0] = "none"; } } else if (_question_type == 1) { _type = (irandom(100) < 50) ? 1 : 2; if (_type == 1) { question_text[0] = stringsetloc(
WHAT LETTER DOES ABSORB BEGIN WITH?
"WHAT LETTER DOES ABSORB BEGIN WITH?", "scr_teevie_quiz_slash_scr_teevie_quiz_gml_121_0"
);
answer_a[0] = ""; answer_b[0] = ""; correct_answer[0] = "A"; max_time_limit[0] = 50; question_visual[0] = "none"; } else { question_text[0] = stringsetloc(
WHAT LETTER DOES BANANA BEGIN WITH?
"WHAT LETTER DOES BANANA BEGIN WITH?", "scr_teevie_quiz_slash_scr_teevie_quiz_gml_129_0"
);
answer_a[0] = ""; answer_b[0] = ""; correct_answer[0] = "B"; max_time_limit[0] = 50; question_visual[0] = "none"; } } else if (_question_type == 2) { _type = (irandom(100) < 50) ? 1 : 2; if (_type == 1) { ...
(arg0);
59
};
60
61
display_next_question = function()
62
{
63
    var _current_question = quiz_question_list[quiz_index];
64
    quiz_question_text = _current_question.question_text;
65
    quiz_answer_a = _current_question.answer_a;
66
    quiz_answer_b = _current_question.answer_b;
67
    answer_correct = _current_question.correct_answer;
68
    max_time = _current_question.max_time_limit;
69
    question_visual = _current_question.question_visual;
70
    quiz_result = false;
71
    answer_selected = false;
72
    countdown_timer = max_time;
73
    answer = "";
74
    answer_color = 16777215;
75
    _is_paused = false;
76
    susie_select = false;
77
    ralsei_select = false;
78
    quiz_ready = true;
79
    quiz_timer = 0;
80
    quiz_index++;
81
};
82
83
can_continue_quiz = function()
84
{
85
    return quiz_index < array_length_1d(quiz_question_list);
86
};
87
88
select_char = function(arg0)
89
{
90
    answer = arg0;
91
    answer_selected = true;
92
    answer_color = 65535;
93
    pause();
94
    alarm[0]
 = 60;
gml_Object_obj_dw_ch3_teevie_quiz_screen_Alarm_0.gml

validate_answer();
95
};
96
97
darken_screen = function()
98
{
99
    overlay = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(camerax() - 40, cameray() - 40, spr_pixel_white);
100
    overlay.image_xscale = 999;
101
    overlay.image_yscale = 999;
102
    overlay.depth = depth + 10;
103
    overlay.image_blend = c_black;
104
    overlay.image_alpha = 0;
105
    scr_lerp_instance_var(overlay, "image_alpha", 0, 0.75, 15);
106
    with (obj_dw_ch3_teevie_floor_light_controller)
107
        pause_lights();
108
};
109
110
hide_overlay = function()
111
{
112
    scr_lerp_instance_var(overlay, "image_alpha", overlay.image_alpha, 0, 15);
113
    
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(overlay, 20);
114
    with (obj_dw_ch3_teevie_floor_light_controller)
115
        unpause_lights();
116
};
117
118
pause = function()
119
{
120
    _is_paused = true;
121
};
122
123
validate_answer = function()
124
{
125
    result_icon = (answer == answer_correct) ? 2416 : 4886;
126
    quiz_result = true;
127
};
128
129
show_static = function()
130
{
131
    snd_stop(snd_tv_static);
132
    snd_play(snd_tv_static);
133
    show_static_display = true;
134
};
135
136
hide_static = function()
137
{
138
    snd_stop(snd_tv_static);
139
    show_static_display = false;
140
};
141
142
end_quiz = function()
143
{
144
    snd_stop(snd_tv_static);
145
    
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("image_alpha", image_alpha, 1, 5);
146
    hide_overlay();
147
    mode = 0;
148
    tvbasesprite = spr_dw_teevie_tv_base;
149
    with (obj_darkcontroller)
150
        charcon = 0;
151
};
152
153
start_bullets = function()
154
{
155
    bullet_mode = true;
156
    bullet_timer = 0;
157
    bullet_finish = false;
158
    shooter_list = [];
159
    bullet_screen_list = [];
160
    for (var i = 0; i < width; i++)
161
    {
162
        for (var j = 0; j < height; j++)
163
            bullet_screen_list[i][j] = 4886;
164
    }
165
};
166
167
generate_faces = function()
168
{
169
    bullet_pos_list = [];
170
    bullet_pos_index = 0;
171
    var face_count = 0;
172
    var max_face_count = 12;
173
    while (face_count < max_face_count)
174
    {
175
        var random_i = floor(random(width));
176
        var random_j = floor(random(height));
177
        var _tile_pos = new Vector2(random_i, random_j);
178
        var _exists = false;
179
        for (var i = 0; i < array_length_1d(bullet_pos_list); i++)
180
        {
181
            if (bullet_pos_list[i].x == _tile_pos.x && bullet_pos_list[i].y == _tile_pos.y)
182
            {
183
                _exists = true;
184
                break;
185
            }
186
        }
187
        if (!_exists)
188
        {
189
            bullet_pos_list[array_length_1d(bullet_pos_list)] = _tile_pos;
190
            face_count++;
191
            if (face_count >= max_face_count)
192
                break;
193
        }
194
    }
195
};
196
197
is_bullet_finished = function()
198
{
199
    return bullet_finish;
200
};