Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_hermit_bookshelf_Step_0

(view raw script w/o annotations or w/e)
1
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) && !interacted_with)
2
{
3
    scene = 0;
4
    interacted_with = true;
5
    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; }
();
6
}
7
if (interacted_with)
8
{
9
    if (scene == 0)
10
    {
11
        scr_text
scr_text

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
12
        with (msg)
13
        {
14
            ch_msg = 2;
15
            ch[1] = "Yes";
16
            ch[2] = "No";
17
            message[0] = "* (You examine the#  bookshelf...)\t";
18
            message[1] = "* (A title called \"Mysteries of#  the Underground\" catches your#  eye.)\t";
19
            message[2] = "* (Read it?)";
20
            if (outcome == 1)
21
            {
22
                instance_destroy();
23
                other.scene = 1;
24
                exit;
25
            }
26
            if (outcome == 2)
27
            {
28
                global.dialogue_open = false;
29
                other.interacted_with = false;
30
                scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() { global.cutscene = false; obj_pl.alarm[0] = 1; }
();
31
            }
32
        }
33
    }
34
    if (scene == 1)
35
    {
36
        scr_text
scr_text

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
37
        with (msg)
38
        {
39
            message[0] = "* Chapter One: Blunko's#  Blunder.";
40
            message[1] = "* Located in Oasis Valley, in a#  modern cafe you can't miss,#  lies an arcade cabinet.";
41
            message[2] = "* Painted blue and coated with a#  thick layer of dust, it sits#  there, out of order.";
42
            message[3] = "* Few monsters recall seeing it#  up and running and that might#  be on purpose.";
43
            message[4] = "* On the cabinet, two logos#  reside: Team Y and Blunko#  Industries.";
44
            message[5] = "* The same two human companies#  that created the Mew Mew Love#  Blaster cabinet.";
45
            message[6] = "* Legends say it was playable#  for a time after it was#  recovered from the dump...";
46
            message[7] = "* ...but its contents were#  \"unpleasant\" upon experience.#\t";
47
            message[8] = "* (You flip to the next#  chapter.)";
48
            message[9] = "* (Continue reading?)";
49
            ch_msg = 9;
50
            ch[1] = "Yes";
51
            ch[2] = "No";
52
            if (outcome == 1)
53
            {
54
                global.dialogue_open = false;
55
                instance_destroy();
56
                other.scene = 2;
57
                other.timer = 10;
58
                exit;
59
            }
60
            if (outcome == 2)
61
            {
62
                global.dialogue_open = false;
63
                other.interacted_with = false;
64
                other.scene = 0;
65
                scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() { global.cutscene = false; obj_pl.alarm[0] = 1; }
();
66
            }
67
        }
68
    }
69
    if (scene == 2)
70
    {
71
        if (!scr_timer
scr_timer

function scr_timer() { if (timer > 0) { timer--; return false; } else { return true; } }
())
72
            exit;
73
        scr_text
scr_text

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
74
        with (msg)
75
        {
76
            message[0] = "* Chapter Two: The Path.";
77
            message[1] = "* The Underground is a vast#  place.";
78
            message[2] = "* Throughout it are pathways#  and/or fences to lead monsters#  from place to place.";
79
            message[3] = "* But maybe, just maybe, the#  paths are truly there to keep#  you safe.";
80
            message[4] = "* In a report from 20XX, a#  father recalled fishing with#  his son in the Snowdin forest.";
81
            message[5] = "* As the father prepared his#  line, his son wandered past the#  fence and into the trees.";
82
            message[6] = "* The father didn't notice at#  first but soon began to search#  for the child.\t";
83
            message[7] = "* \"Before I found ____, it felt#  like I was in a daze,\" the#  father recounts.";
84
            message[8] = "* \"Just... nothing out there.\"";
85
            message[9] = "* (You flip to the next#  chapter.)";
86
            message[10] = "* (Continue reading?)";
87
            ch_msg = 10;
88
            ch[1] = "Yes";
89
            ch[2] = "No";
90
            if (outcome == 1)
91
            {
92
                global.dialogue_open = false;
93
                instance_destroy();
94
                other.scene = 3;
95
                other.timer = 10;
96
                exit;
97
            }
98
            if (outcome == 2)
99
            {
100
                global.dialogue_open = false;
101
                other.interacted_with = false;
102
                other.scene = 0;
103
                scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() { global.cutscene = false; obj_pl.alarm[0] = 1; }
();
104
            }
105
        }
106
    }
107
    if (scene == 3)
108
    {
109
        if (!scr_timer
scr_timer

function scr_timer() { if (timer > 0) { timer--; return false; } else { return true; } }
())
110
            exit;
111
        scr_text
scr_text

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
112
        with (msg)
113
        {
114
            message[0] = "* Chapter Three: The Phantom#  SOUL.\t";
115
            message[1] = "* Seven human SOULS are all it#  takes to destroy the barrier#  that intraps us monsters...\t";
116
            message[2] = "* ...and over time, King ASGORE#  and the Royal Guard have#  ensured we reach that goal.\t";
117
            message[3] = "* This process has been#  controversial among some#  residents but...";
118
            message[4] = "* ...\"War is not pleasant\" says#  the head of the Royal Guard.\t";
119
            message[5] = "* Typically, when a human falls#  into our home, they're#  \"collected\" within hours.";
120
            message[6] = "* But one time... it took#  years.\t";
121
            message[7] = "* It was a typical afternoon in#  Snowdin...\t";
122
            message[8] = "* Suddenly, a human was spotted#  in the area before swiftly#  fleeing for Waterfall.\t";
123
            message[9] = "* This, surprisingly, was the#  last time they were seen#  alive.\t";
124
            message[10] = "* Officials at the time said the#  disappearance most likely meant#  the human was hiding.\t";
125
            message[11] = "* However, the human's SOUL was#  later inexplicably found deep#  in Waterfall...\t";
126
            message[12] = "* (...)";
127
            message[13] = "* (You put the book back.)";
128
        }
129
        if (!global.dialogue_open)
130
        {
131
            scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() { global.cutscene = false; obj_pl.alarm[0] = 1; }
();
132
            interacted_with = false;
133
        }
134
    }
135
}