Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_gameover_minigame_Draw_0

(view raw script w/o annotations or w/e)
1
with (obj_chefs_scoretxt)
2
{
3
    if (room == room_board_1 || room == room_board_2)
4
        global.interact = 1;
5
}
6
if (drawblackbg)
7
    draw_sprite_ext(spr_pxwhite, 0, 0, 0, 640, 480, 0, c_black, drawblackbg);
8
if (init == 0)
9
{
10
    instance_deactivate_layer("OBJECTS_MAIN");
11
    global.interact = 1;
12
    init = 1;
13
    if (replayversion == true && quitversion == false && replaywin == true)
14
    {
15
        if (room == room_dw_susiezilla && 
scr_flag_get
scr_flag_get

function
scr_flag_get(arg0)
{ var flag_value = global.flag[arg0]; return flag_value; }
(1220) != 0)
16
        {
17
        }
18
        else
19
        {
20
            minigametext = instance_create(x, y - 150, obj_tenna_enemy_minigametext);
21
            minigametext.mystring = "GAME CLEAR!";
22
            snd_play(snd_crowd_cheer_single);
23
        }
24
    }
25
}
26
if (con == 0)
27
{
28
    timer++;
29
    if (timer == 1)
30
    {
31
        
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; }
("tone_saturation", 1, 0.1, 30, 2, "out");
32
        
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; }
("tone_factor", 0, 0.5, 30, 2, "out");
33
    }
34
    if (timer == 2)
35
        
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; }
("staticalpha", 0, 0.015, 15);
36
    if (timer == 3)
37
        
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; }
("grayalpha", 0, 0.35, 15);
38
    if (timer == 5 && quitversion == false && replayversion == false)
39
    {
40
        tenna = instance_create(camerax() + 320, cameray() + 480 + 280, obj_actor_tenna);
41
        tenna.depth = depth - 10;
42
        tenna.auto_depth = 0;
43
        tenna.dropshadow = true;
44
        tenna.preset = 2;
45
    }
46
    if ((timer == 30 && !i_ex(obj_rhythmgame)) || (timer == 90 && i_ex(obj_rhythmgame)))
47
    {
48
        var gameover_state = 0;
49
        if (room == room_shootout)
50
            gameover_state = 2;
51
        else if (room == room_dw_rhythm)
52
            gameover_state = 1;
53
        else if (room == room_dw_susiezilla)
54
            gameover_state = 3;
55
        else if (room == room_board_1 || room == room_board_2 || room == room_board_3)
56
            gameover_state = 4;
57
        if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
58
        {
59
        }
60
        if (replayversion && replaywin == true)
61
        {
62
            con = 1;
63
            timer = 0;
64
            instance_create(0, 0, obj_round_evaluation);
65
        }
66
        if ((replayversion && quitversion) || (replayversion && replaywin == false))
67
        {
68
            con = 1;
69
            timer = 0;
70
            quitcon = 1;
71
            mus_volume(global.currentsong[1], 0, 30);
72
            
scr_fadeout
scr_fadeout

function
scr_fadeout(arg0)
{ __fadeouter = instance_create(camerax() - 200, cameray() - 200, obj_fadeout); __fadeouter.fadespeed = 1 / arg0; __fadeouter.depth = 3; return __fadeouter; }
(30);
73
            with (obj_fadeout)
74
                depth = -9999;
75
        }
76
        else if (gameover_state == 0)
77
        {
78
            var chef_fail = instance_create_depth(0, 0, 0, obj_gameover_chef);
79
            chef_fail.gameover_sequence = (
scr_flag_get
scr_flag_get

function
scr_flag_get(arg0)
{ var flag_value = global.flag[arg0]; return flag_value; }
(1089) == 1) ? 1 : 2;
80
        }
81
        else if (gameover_state == 1)
82
        {
83
            var band_fail = instance_create(0, 0, obj_gameover_band);
84
            band_fail.gameover_sequence = (
scr_flag_get
scr_flag_get

function
scr_flag_get(arg0)
{ var flag_value = global.flag[arg0]; return flag_value; }
(1096) == 1) ? 1 : 2;
85
        }
86
        else if (gameover_state == 2)
87
        {
88
            instance_create(0, 0, obj_gameover_cowboy);
89
        }
90
        else if (gameover_state == 3)
91
        {
92
            instance_create(0, 0, obj_gameover_susiezilla);
93
        }
94
        else if (gameover_state == 4)
95
        {
96
            with (instance_create(0, 0, obj_gameover_board))
97
                inbattle = other.inbattle;
98
        }
99
    }
100
}
101
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
102
{
103
    if (keyboard_check_pressed(vk_numpad0))
104
    {
105
        con = 1;
106
        timer = 0;
107
    }
108
}
109
if (tenna_arrive)
110
{
111
    tenna_arrive_timer++;
112
    if (tenna_arrive_timer == 1 && replaywin == false)
113
        tenna.gravity = -1.5;
114
    if (tenna_arrive_timer == 19 && replaywin == false)
115
    {
116
        tenna.bounce = 1;
117
        tenna.gravity = 0;
118
        tenna.vspeed = 0;
119
    }
120
    if (tenna_arrive_timer == 30)
121
    {
122
        tenna_arrive = false;
123
        tenna_arrive_timer = 0;
124
    }
125
}
126
if (con == 1 && replayversion && !i_ex(obj_round_evaluation) && quitcon == 0)
127
{
128
    mus_volume(global.currentsong[1], 0, 30);
129
    
scr_fadeout
scr_fadeout

function
scr_fadeout(arg0)
{ __fadeouter = instance_create(camerax() - 200, cameray() - 200, obj_fadeout); __fadeouter.fadespeed = 1 / arg0; __fadeouter.depth = 3; return __fadeouter; }
(30);
130
    with (obj_fadeout)
131
        depth = -9999;
132
    quitcon = 1;
133
}
134
if (con == 1 && !replayversion)
135
{
136
    timer++;
137
    if (timer == 1)
138
    {
139
        if (!boardfail)
140
            
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; }
("staticalpha", staticalpha, 1, 60, 2, "in");
141
    }
142
    if (timer == 8)
143
    {
144
        if (!boardfail)
145
        {
146
            if (replayversion == false)
147
                tenna.gravity = 1.5;
148
            
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; }
("blackalpha", 0, 1, 30);
149
        }
150
    }
151
    if (boardfail && timer == 37)
152
        obj_board_deathevent.con = 9999;
153
    if (timer == 38)
154
    {
155
        if (boardfail)
156
        {
157
            instance_destroy();
158
        }
159
        else
160
        {
161
            countdown = true;
162
            countdown_timer = 0;
163
            countdown_text = 3;
164
            if (room == room_dw_chef)
165
                countdown_text = 0;
166
            else
167
                snd_play_pitch(snd_orchhit, 1);
168
        }
169
    }
170
}
171
if (sprite_exists(global.screenshot))
172
{
173
    var lightColor = 13088418;
174
    var darkColor = 6242121;
175
    var is_rhythm_replaywin = room == room_dw_rhythm && replaywin;
176
    if (!quitversion && !replaywin)
177
        tone_on(tone_saturation, tone_brightness, tone_factor, darkColor, lightColor);
178
    if (!is_rhythm_replaywin)
179
        draw_sprite_ext(global.screenshot, 0, camerax(), cameray(), 1, 1, 0, c_white, 1);
180
    if (!quitversion && !replaywin)
181
        tone_off();
182
    if (!quitversion && !replaywin)
183
    {
184
        draw_set_alpha(grayalpha);
185
        draw_set_color(c_gray);
186
        ossafe_fill_rectangle(camerax(), cameray(), camerax() + 640, cameray() + 480, 0);
187
        draw_set_color(c_white);
188
        draw_set_alpha(1);
189
        staticindex += 0.25;
190
        draw_sprite_tiled_ext(spr_static_effect, staticindex - 0.5, 0, 0, 2, 2, c_white, staticalpha);
191
        draw_sprite_tiled_ext(spr_static_effect, staticindex, 0, 0, 2, 2, c_white, staticalpha);
192
        draw_set_alpha(blackalpha);
193
        draw_set_color(c_black);
194
        ossafe_fill_rectangle(camerax(), cameray(), camerax() + 640, cameray() + 480, 0);
195
        draw_set_color(c_white);
196
        draw_set_alpha(1);
197
    }
198
    if (countdown)
199
    {
200
        countdown_timer++;
201
        if ((countdown_timer % 30) == 0)
202
        {
203
            countdown_text--;
204
            if (countdown_text <= 0)
205
            {
206
                if (room != room_dw_chef)
207
                    snd_play(snd_bell);
208
                countdown = false;
209
                retry_game = true;
210
                exit;
211
            }
212
            else
213
            {
214
                snd_play_pitch(snd_orchhit, 1 + (orchhit_pitch / 16));
215
                orchhit_pitch++;
216
            }
217
        }
218
        draw_set_halign(fa_center);
219
        if (room != room_dw_chef)
220
            draw_text_ext_transformed(camerax() + (view_wport[0] / 2), (cameray() + (view_hport[0] / 2)) - 50, string(countdown_text), 4, 9999, 6, 6, 0);
221
        draw_set_halign(fa_left);
222
    }
223
    if (retry_game)
224
    {
225
        retry_timer++;
226
        if (retry_timer >= 30)
227
        {
228
            room_restart();
229
            global.interact = 0;
230
            instance_destroy();
231
            exit;
232
        }
233
    }
234
}
235
if (quitcon == 1)
236
{
237
    quittimer++;
238
    var timetoquit = 32;
239
    if (os_type == os_macosx)
240
    {
241
        if (quittimer >= (timetoquit - 2))
242
            
scr_marker_ext
scr_marker_ext

function
scr_marker_ext(arg0, arg1, arg2, arg3 = 1, arg4 = 1, arg5 = 0, arg6 = 0, arg7 = 16777215, arg8 = depth, arg9 = false, arg10 = -1, arg11 = 1)
{ var thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { depth = arg8; sprite_index = arg2; image_speed = arg5; image_xscale = arg3; image_yscale = arg4; image_index = arg6; image_blend = arg7; image_alpha = arg11; if (arg9)
scr_depth();
} if (arg10 > 0)
scr_doom(thismarker, arg10);
return thismarker; }
(0, 0, spr_pxwhite, room_width, room_height, undefined, undefined, c_black, -99999);
243
    }
244
    if (quittimer == timetoquit)
245
    {
246
        snd_free_all();
247
        inst = instance_create(0, 0, obj_persistentfadein);
248
        global.interact = 3;
249
        global.facing = 0;
250
        if (room == room_dw_susiezilla)
251
            global.entrance = 2;
252
        if (room == room_dw_chef)
253
            global.entrance = 3;
254
        if (room == room_dw_rhythm)
255
            global.entrance = 4;
256
        room_goto(room_dw_ranking_a);
257
    }
258
}