Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_mail_station_base_Step_0

(view raw script w/o annotations or w/e)
1
var mail_station_blocked = false;
2
if (global.geno_complete[2] == true)
3
    mail_station_blocked = true;
4
if (keyboard_multicheck_pressed(0) && 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; } }
() && scene == 0)
5
{
6
    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; }
();
7
    image_index = 0;
8
    image_speed = 0.2;
9
    audio_play_sound(bell_sound, 1, 0);
10
    scene++;
11
}
12
switch (scene)
13
{
14
    case 1:
15
    case 2:
16
        if (on_animation_end())
17
        {
18
            image_index = 0;
19
            scene++;
20
        }
21
        break;
22
    case 3:
23
        image_speed = 0;
24
        image_index = 0;
25
        if (mail_station_blocked)
26
        {
27
            scr_text
scr_text

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
28
            with (msg)
29
                message[0] = "* But nobody came.";
30
            if (!global.dialogue_open)
31
            {
32
                scene = 0;
33
                scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() { global.cutscene = false; obj_pl.alarm[0] = 1; }
();
34
            }
35
            exit;
36
        }
37
        var x_distance = 64;
38
        while (!place_free(obj_pl.x + x_distance, obj_pl.y))
39
            x_distance -= 1;
40
        instance_create(obj_pl.x + x_distance, camera_get_view_y(view_camera[0]) - 40, obj_mail_whale);
41
        scene = 0;
42
}