Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_npc_mailwhale_break1_Step_0

(view raw script w/o annotations or w/e)
1
interact = 0;
2
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; } }
() == true)
3
    interact = 1;
4
if (scene < 7)
5
{
6
    if (instance_exists(obj_dialogue) && is_talking == true)
7
    {
8
        if (obj_dialogue.cutoff == string_length(obj_dialogue.message[obj_dialogue.message_current]))
9
        {
10
            image_speed = 0;
11
            image_index = 0;
12
        }
13
        else
14
        {
15
            image_speed = 0.2;
16
        }
17
    }
18
    else
19
    {
20
        image_speed = 0;
21
        is_talking = false;
22
    }
23
    depth = -y;
24
}
25
switch (scene)
26
{
27
    case 0:
28
        if (interact)
29
        {
30
            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; }
();
31
            cutscene_advance();
32
        }
33
        break;
34
    case 1:
35
        cutscene_dialogue();
36
        with (msg)
37
        {
38
            talker[0] = other.object_index;
39
            if (global.mail_count < 2)
40
            {
41
                message[0] = "* Oh hey, I recognize you!";
42
                message[1] = "* Ummm... wait, don't tell me!#  It's... Uh...";
43
                message[2] = "* Clover! ";
44
                message[3] = "* Yeah, I remember you! ";
45
                message[4] = "* I delivered your intro letter!";
46
            }
47
            else if (global.mail_count >= 2 && global.mail_count < 5)
48
            {
49
                message[0] = "* You're Clover? Am I right? ";
50
                message[1] = "* Your name has come up once or#  twice!";
51
            }
52
            else
53
            {
54
                message[0] = "* Clover, right? Your name comes#  up all the time!";
55
                message[1] = "* You must be real popular!";
56
            }
57
        }
58
        break;
59
    case 2:
60
        cutscene_dialogue();
61
        with (msg)
62
        {
63
            talker[0] = other.object_index;
64
            message[0] = "* Hm? You look confused...";
65
            message[1] = "* Oh right, I'm not rhyming!";
66
            message[2] = "* Yeah, that's just a company#  policy.";
67
            message[3] = "* It gets a little tiresome#  sometimes.";
68
            message[4] = "* But other than that, I have no#  complaints!";
69
            message[5] = "* It's a great job! Wouldn't#  trade it for the world!";
70
            message[6] = "* I'm a little worried, though.";
71
            message[7] = "* These days, those fancy \"cell#  phones\" are all the rage!";
72
            message[8] = "* I don't know how long the mail#  service will-";
73
        }
74
        break;
75
    case 3:
76
        cutscene_audio_fade(obj_radio.current_song, 0, 200, 0.1, false);
77
        break;
78
    case 4:
79
        cutscene_sfx_play(342, 0.75);
80
        break;
81
    case 5:
82
        cutscene_wait(2);
83
        break;
84
    case 6:
85
        if (cutscene_dialogue())
86
            y -= 10;
87
        with (msg)
88
        {
89
            talker[0] = other.object_index;
90
            message[0] = "* Oh me! Oh my! My break's come#  to an end!";
91
            message[1] = "* See you next time there's#  letters to send!";
92
        }
93
        break;
94
    case 7:
95
        cutscene_sfx_play(309, 0.75);
96
        break;
97
    case 8:
98
        depth = -room_height;
99
        if (sprite_index != spr_mail_whale_yellow)
100
            sprite_index = spr_mail_whale_yellow;
101
        image_speed = 0.2;
102
        if (vspeed > -2)
103
            vspeed -= 0.1;
104
        if (y < 20)
105
            cutscene_advance();
106
        break;
107
    case 9:
108
        global.dunes_flag_ext[5] = 1;
109
        cutscene_audio_fade(obj_radio.current_song, 1, 300, 0, true);
110
        instance_destroy();
111
        scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() { global.cutscene = false; obj_pl.alarm[0] = 1; }
();
112
        break;
113
}