Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_chefs_game_Alarm_0

(view raw script w/o annotations or w/e)
1
with (obj_chefs_scoretxt)
2
    instance_destroy();
3
if (depletionrate < 0.15)
4
    depletionrate += 0.002;
5
if (!gamestart)
6
{
7
    gamestart = 1;
8
    mus_play_ext("minigame_kart.ogg", true);
9
}
10
if (gameover)
11
    exit;
12
timer--;
13
alarm[0]
 = 30;
gml_Object_obj_chefs_game_Alarm_0.gml

with (obj_chefs_scoretxt) instance_destroy(); if (depletionrate < 0.15) depletionrate += 0.002; if (!gamestart) { gamestart = 1; mus_play_ext("minigame_kart.ogg", true); } if (gameover) exit; timer--; alarm[0]
 = 30;
if (timer <= 0 && !i_ex(obj_gameover_minigame)) { audio_sound_get_track_position(global.currentsong[0]); gameover = true; switch (microgame) { case 0: if (win == 0) { if (scorepoints >= 0) { win = 1; snd_play(snd_lancerwhistle); } else { win = -1; } } break; case 1: win = 1; snd_play(snd_lancerwhistle); break; case 2: case 3: var _count = 0; var _hit = 0; if (instance_exists(obj_chefs_evilguest)) { with (obj_chefs_evilguest) { _count++; if (hit || stomped) _hit++; } } if (_hit == _count || !instance_exists(obj_chefs_evilguest)) { snd_play(snd_lancerwhistle); win = 1; } break; case 4: case 5: var _count = 0; var _hit = 0; if (instance_exists(obj_chefs_customer)) { with (obj_chefs_customer) { _count++; if (leaving) _hit++; } } if (_hit == _count || !instance_exists(obj_chefs_customer)) { snd_play(snd_lancerwhistle); win = 1; } else { win = -1; } break; } }
14
if (timer <= 0 && !i_ex(obj_gameover_minigame))
15
{
16
    audio_sound_get_track_position(global.currentsong[0]);
17
    gameover = true;
18
    switch (microgame)
19
    {
20
        case 0:
21
            if (win == 0)
22
            {
23
                if (scorepoints >= 0)
24
                {
25
                    win = 1;
26
                    snd_play(snd_lancerwhistle);
27
                }
28
                else
29
                {
30
                    win = -1;
31
                }
32
            }
33
            break;
34
        case 1:
35
            win = 1;
36
            snd_play(snd_lancerwhistle);
37
            break;
38
        case 2:
39
        case 3:
40
            var _count = 0;
41
            var _hit = 0;
42
            if (instance_exists(obj_chefs_evilguest))
43
            {
44
                with (obj_chefs_evilguest)
45
                {
46
                    _count++;
47
                    if (hit || stomped)
48
                        _hit++;
49
                }
50
            }
51
            if (_hit == _count || !instance_exists(obj_chefs_evilguest))
52
            {
53
                snd_play(snd_lancerwhistle);
54
                win = 1;
55
            }
56
            break;
57
        case 4:
58
        case 5:
59
            var _count = 0;
60
            var _hit = 0;
61
            if (instance_exists(obj_chefs_customer))
62
            {
63
                with (obj_chefs_customer)
64
                {
65
                    _count++;
66
                    if (leaving)
67
                        _hit++;
68
                }
69
            }
70
            if (_hit == _count || !instance_exists(obj_chefs_customer))
71
            {
72
                snd_play(snd_lancerwhistle);
73
                win = 1;
74
            }
75
            else
76
            {
77
                win = -1;
78
            }
79
            break;
80
    }
81
}