Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_chem_05_maze_puzzle_Step_0

related scripts: Alarm_0Alarm_1Alarm_2Alarm_3Alarm_4Alarm_5Create_0Destroy_0Draw_64Other_10Step_0

(view raw script w/o annotations or w/e)
1
if (live_call())
2
    return global.live_result;
3
if (puzzle_is_paused == true)
4
{
5
    if (keyboard_multicheck_pressed(2))
6
    {
7
        puzzle_alpha = 0;
8
        puzzle_is_paused = false;
9
        audio_resume_sound(puzzle_music);
10
        obj_chem_05_maze_puzzle_player.can_move = true;
11
    }
12
    exit;
13
}
14
if (fade_out == true)
15
{
16
    if (draw_alpha > 0.01)
17
        draw_alpha = lerp(draw_alpha, 0, 0.1);
18
    else
19
        instance_destroy();
20
    exit;
21
}
22
if (draw_alpha < 0.99)
23
{
24
    draw_alpha = lerp(draw_alpha, 1, 0.1);
25
}
26
else if (puzzle_draw_guide == true)
27
{
28
    if (keyboard_multicheck_pressed(0) || keyboard_multicheck_pressed(1))
29
        puzzle_draw_guide = false;
30
    exit;
31
}
32
else if (puzzle_start_noloop == false)
33
{
34
    alarm[0]
 = 15;
gml_Object_obj_chem_05_maze_puzzle_Alarm_0.gml

if (live_call()) return global.live_result; countdown_current -= 1; if (countdown_current > 0) { audio_play_sound(snd_chem_countdown, 1, 0); alarm[0]
 = 30;
} else { if (puzzle_music == 0) { puzzle_music = audio_play_sound(mus_mixin_it_up, 1, 1); audio_sound_pitch(puzzle_music, 1); if (global.route == 3) { alarm[4]
 = irandom_range(60, 120);
audio_sound_pitch(puzzle_music, random_range(0.75, 1.25)); } } audio_play_sound(snd_chem_go, 1, 0); draw_puzzle_layer = true; alarm[1]
 = 30;
}
35
    draw_alpha = 1;
36
    puzzle_start_noloop = true;
37
}
38
if (puzzle_game_victory == true)
39
{
40
    if (!alarm[2])
41
        alarm[2]
 = 45;
gml_Object_obj_chem_05_maze_puzzle_Alarm_2.gml

if (live_call()) return global.live_result; fade_out = true;
scr_audio_fade_out(puzzle_music, 750);
42
    puzzle_alpha = 0.5;
43
    exit;
44
}
45
if (puzzle_game_over == true)
46
{
47
    event_user(0);
48
    offset_max = 3;
49
    puzzle_alpha = 0.5;
50
    puzzle_game_over = false;
51
    puzzle_times_died += 1;
52
    screenshake_enabled = true;
53
}
54
if (keyboard_multicheck_pressed(2) && obj_chem_05_maze_puzzle_player.can_move == true)
55
{
56
    puzzle_alpha = 0.75;
57
    puzzle_is_paused = true;
58
    obj_chem_05_maze_puzzle_player.can_move = false;
59
    obj_chem_05_maze_puzzle_player.speed = 0;
60
    audio_pause_sound(puzzle_music);
61
    exit;
62
}
63
if (global.route == 3)
64
{
65
    if (instance_exists(obj_chem_05_maze_puzzle_player) && obj_chem_05_maze_puzzle_player.can_move)
66
    {
67
        if (puzzle_speed_last == 0)
68
            puzzle_speed_last = obj_chem_05_maze_puzzle_player.max_speed;
69
        if (!alarm[5])
70
        {
71
            if (irandom(pseudo_random_number) == 1)
72
            {
73
                pseudo_random_number = pseudo_random_number_max;
74
                puzzle_alpha = random_range(0.25, 0.5);
75
                alarm[5]
 = irandom_range(15, 25);
gml_Object_obj_chem_05_maze_puzzle_Alarm_5.gml

if (instance_exists(obj_chem_05_maze_puzzle_player) && obj_chem_05_maze_puzzle_player.can_move) puzzle_alpha = 0;
76
            }
77
            else if (pseudo_random_number > 20)
78
            {
79
                pseudo_random_number--;
80
            }
81
        }
82
    }
83
}
84
if (screenshake_enabled == true)
85
{
86
    x_offset = random_range(-offset_max, offset_max);
87
    y_offset = random_range(-offset_max, offset_max);
88
    if (offset_max > 0)
89
        offset_max -= 0.2;
90
    else
91
        screenshake_enabled = 0;
92
}