Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_steamworks_chem_07_id_reader_Step_0

(view raw script w/o annotations or w/e)
1
if (live_call())
2
    return global.live_result;
3
switch (scene)
4
{
5
    case 0:
6
        if (scr_interact
scr_interact

function scr_interact() { if (distance_to_object(obj_pl) < 20 && obj_pl.state == scr_normal_state) { var pl_dir = obj_pl.direction; var pl_x = 0; var pl_y = 0; var check_distance_x = 0; var check_distance_y = 0; switch (pl_dir) { case 0: pl_x = obj_pl.bbox_right; pl_y = obj_pl.bbox_top + 1; check_distance_x = 20; break; case 180: pl_x = obj_pl.bbox_left; pl_y = obj_pl.bbox_top + 1; check_distance_x = -20; break; case 90: pl_x = obj_pl.x; pl_y = obj_pl.bbox_top; check_distance_y = -20; break; case 270: pl_x = obj_pl.x; pl_y = obj_pl.bbox_bottom; check_distance_y = 20; break; } if (collision_line_first(pl_x, pl_y, pl_x + check_distance_x, pl_y + check_distance_y, id, false, false)) return true; } }
() && keyboard_multicheck_pressed(0))
7
        {
8
            if (global.sworks_flag[55] == 0)
9
            {
10
                scr_cutscene_start
scr_cutscene_start

function scr_cutscene_start() { global.cutscene = true; obj_pl.state = scr_frozen_state; obj_pl.image_index = 0; obj_pl.image_speed = 0; }
();
11
                cutscene_advance();
12
            }
13
            else
14
            {
15
                scr_text
scr_text

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
16
                with (msg)
17
                    message[0] = "* (The door is already#  open.)";
18
            }
19
        }
20
        break;
21
    case 1:
22
        cutscene_dialogue();
23
        with (msg)
24
        {
25
            message[0] = "* (Swipe your ID?)";
26
            ch_msg = 0;
27
            ch[1] = "Yes";
28
            ch[2] = "No";
29
            if (outcome == 1)
30
            {
31
                other.scene++;
32
            }
33
            else if (outcome == 2)
34
            {
35
                audio_play_sound(snd_fail, 1, 0);
36
                other.scene = 0;
37
                scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() { global.cutscene = false; obj_pl.alarm[0] = 1; }
();
38
            }
39
        }
40
        break;
41
    case 2:
42
        instance_create_depth(0, 0, -999, obj_sworks_id);
43
        obj_sworks_id.end_cutscene = false;
44
        cutscene_advance();
45
        break;
46
    case 3:
47
        if (!instance_exists(obj_sworks_id))
48
            cutscene_advance();
49
        break;
50
    case 4:
51
        cutscene_wait(0.5);
52
        break;
53
    case 5:
54
        cutscene_advance();
55
        break;
56
    case 6:
57
        cutscene_wait(0.5);
58
        break;
59
    case 7:
60
        obj_pl.direction = 270;
61
        audio_sound_gain(obj_radio.current_song, 0.25, 1000);
62
        cutscene_advance();
63
        break;
64
    case 8:
65
        cutscene_wait(0.5);
66
        break;
67
    case 9:
68
        with (obj_steamworks_chem_07_door)
69
        {
70
            image_speed = 0.5;
71
            image_index = 0;
72
        }
73
        audio_play_sound(snd_rumble, 1, 1);
74
        cutscene_advance();
75
        break;
76
    case 10:
77
        if (obj_steamworks_chem_07_door.image_index >= (obj_steamworks_chem_07_door.image_number - 1))
78
        {
79
            obj_steamworks_chem_07_door.image_index = obj_steamworks_chem_07_door.image_number - 1;
80
            obj_steamworks_chem_07_door.image_speed = 0;
81
            obj_steamworks_chem_07_door.solid = false;
82
            audio_stop_sound(snd_rumble);
83
            audio_play_sound(snd_mart_impact_3, 1, 0);
84
            cutscene_advance();
85
        }
86
        break;
87
    case 11:
88
        cutscene_screenshake(0.5, 2);
89
        break;
90
    case 12:
91
        cutscene_wait(0.5);
92
        break;
93
    case 13:
94
        audio_sound_gain(obj_radio.current_song, 1, 1000);
95
        global.sworks_flag[55] = 1;
96
        scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() { global.cutscene = false; obj_pl.alarm[0] = 1; }
();
97
        scene = 0;
98
        break;
99
}