Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_mansion_kotatsu_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) && obj_pl.direction == 90)
7
        {
8
            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; }
();
9
            instance_create(obj_pl.x, obj_pl.y, obj_player_npc);
10
            cutscene_follower_into_actor();
11
        }
12
        break;
13
    case 1:
14
        cutscene_npc_walk(1164, 130, 200, 2, "y", "up");
15
        break;
16
    case 2:
17
        cutscene_dialogue();
18
        with (msg)
19
        {
20
            talker[0] = 1164;
21
            message[0] = "* This must be where they#  ate their meals...";
22
            prt[0] = 329;
23
        }
24
        break;
25
    case 3:
26
        cutscene_wait(0.5);
27
        break;
28
    case 4:
29
        cutscene_npc_direction(1164, "right");
30
        break;
31
    case 5:
32
        cutscene_npc_walk(1168, 195, 200, 3, "y", "up");
33
        break;
34
    case 6:
35
        cutscene_wait(1);
36
        break;
37
    case 7:
38
        cutscene_instance_create(obj_pl.x, obj_pl.y - 20, 1147);
39
        break;
40
    case 8:
41
        cutscene_wait(1);
42
        break;
43
    case 9:
44
        instance_destroy(obj_cutscene_ex);
45
        cutscene_advance();
46
        break;
47
    case 10:
48
        cutscene_dialogue();
49
        with (msg)
50
        {
51
            talker[0] = 1164;
52
            message[0] = "* What do you see?";
53
            prt[0] = 321;
54
        }
55
        break;
56
    case 11:
57
        cutscene_npc_walk(1168, 160, 200, 3, "x", "up");
58
        break;
59
    case 12:
60
        if (cutscene_wait(0.75))
61
        {
62
            cutscene_camera_freeze();
63
            cutscene_advance(13);
64
        }
65
        break;
66
    case 13:
67
        with (obj_player_npc)
68
        {
69
            if (!variable_instance_exists(1168, "x_original"))
70
            {
71
                x_original = x;
72
                y_original = y;
73
            }
74
            else
75
            {
76
                x = x_original;
77
                y = y_original;
78
                x += random_range(-1, 1);
79
                y += random_range(-1, 1);
80
            }
81
        }
82
        if (cutscene_wait(1))
83
        {
84
            cutscene_camera_reset();
85
            cutscene_advance(14);
86
            with (obj_player_npc)
87
            {
88
                x = x_original;
89
                y = y_original;
90
            }
91
        }
92
        break;
93
    case 14:
94
        cutscene_dialogue();
95
        with (msg)
96
        {
97
            talker[0] = 1164;
98
            message[0] = "* Hey uh...";
99
            prt[0] = 311;
100
        }
101
        break;
102
    case 15:
103
        cutscene_npc_direction(1168, "left");
104
        break;
105
    case 16:
106
        cutscene_wait(0.5);
107
        break;
108
    case 17:
109
        cutscene_dialogue();
110
        with (msg)
111
        {
112
            ch_msg = 0;
113
            ch[1] = "I need your help";
114
            talker[0] = 1164;
115
            message[0] = "* ...";
116
            message[1] = "* You think something's#  under there?";
117
            message[2] = "* Alright then...";
118
            prt[0] = 311;
119
            prt[1] = 321;
120
            prt[2] = 338;
121
        }
122
        break;
123
    case 18:
124
        cutscene_npc_direction(1168, "up");
125
        break;
126
    case 19:
127
        cutscene_npc_walk(1164, 116, 200, 3, "y", "down", -4, 160, 130);
128
        break;
129
    case 20:
130
        cutscene_wait(0.5);
131
        break;
132
    case 21:
133
        if (cutscene_dialogue())
134
        {
135
            if (!audio_is_playing(snd_mansion_kotatsu_move))
136
                audio_play_sound(snd_mansion_kotatsu_move, 1, 0);
137
        }
138
        with (msg)
139
        {
140
            talker[0] = 1164;
141
            message[0] = "* On \"three.\"";
142
            message[1] = "* One...";
143
            message[2] = "* Two...";
144
            message[3] = "* Three!";
145
            prt[0] = 321;
146
            prt[1] = 321;
147
            prt[2] = 321;
148
            prt[3] = 328;
149
        }
150
        break;
151
    case 22:
152
        cutscene_screen_fade_out(0, 0.1);
153
        scr_audio_fade_out
scr_audio_fade_out

function scr_audio_fade_out(arg0, arg1) { var snd = arg0; var fade_len = arg1; if (!audio_is_playing(snd)) return false; audio_sound_gain(snd, 0, fade_len); if (instance_exists(obj_audio_fade_helper)) { with (obj_audio_fade_helper) { if (audio_to_fade == snd) return false; } } with (instance_create(0, 0, obj_audio_fade_helper)) audio_to_fade = snd; }
(obj_radio.current_song, 1000);
154
        break;
155
    case 23:
156
        if (!audio_is_playing(snd_mansion_kotatsu_move))
157
            cutscene_wait(1.5);
158
        break;
159
    case 24:
160
        global.dunes_flag[42] = 1;
161
        sprite_index = spr_mansion_kotatsu_moved;
162
        x = 199;
163
        y = 171;
164
        obj_player_npc.x = 140;
165
        obj_player_npc.y = 200;
166
        obj_martlet_npc.x = 180;
167
        obj_martlet_npc.y = 200;
168
        obj_martlet_npc.npc_direction = "up";
169
        obj_player_npc.npc_direction = "up";
170
        layer_set_visible("chairs", false);
171
        instance_destroy(106768);
172
        instance_destroy(106767);
173
        cutscene_advance();
174
        break;
175
    case 25:
176
        cutscene_dialogue();
177
        with (msg)
178
        {
179
            talker[0] = 1164;
180
            message[0] = "* Whoa...";
181
            prt[0] = 333;
182
        }
183
        break;
184
    case 26:
185
        cutscene_screen_fade_in(0.1);
186
        break;
187
    case 27:
188
        cutscene_wait(0.5);
189
        break;
190
    case 28:
191
        cutscene_npc_direction(1164, "left");
192
        break;
193
    case 29:
194
        cutscene_dialogue();
195
        with (msg)
196
        {
197
            talker[0] = 1164;
198
            message[0] = "* Good eye, Clover.";
199
            prt[0] = 312;
200
        }
201
        break;
202
    case 30:
203
        cutscene_npc_direction(1164, "up");
204
        break;
205
    case 31:
206
        cutscene_wait(0.5);
207
        break;
208
    case 32:
209
        cutscene_npc_walk(1168, 160, 190, 3, "y", "up");
210
        break;
211
    case 33:
212
        if (cutscene_wait(1))
213
            audio_play_sound(snd_mansion_trapdoor_open, 1, 0);
214
        break;
215
    case 34:
216
        with (obj_mansion_trapdoor)
217
        {
218
            image_speed = 1;
219
            if (image_index >= (image_number - 1))
220
            {
221
                other.scene++;
222
                image_index = image_number - 1;
223
                image_speed = 0;
224
            }
225
        }
226
        break;
227
    case 35:
228
        cutscene_wait(1);
229
        break;
230
    case 36:
231
        cutscene_npc_direction(1168, "down");
232
        break;
233
    case 37:
234
        cutscene_dialogue();
235
        with (msg)
236
        {
237
            talker[0] = 1164;
238
            message[0] = "* Spooky...";
239
            message[1] = "* Well, uh... After you.";
240
            prt[0] = 321;
241
            prt[1] = 320;
242
        }
243
        break;
244
    case 38:
245
        cutscene_npc_direction(1168, "up");
246
        break;
247
    case 39:
248
        cutscene_npc_walk(1164, obj_player_npc.x, obj_player_npc.y + 20, 3, "y", "up");
249
        break;
250
    case 40:
251
        var doorway = instance_create(136, 150, obj_doorway_secret_study);
252
        with (doorway)
253
        {
254
            image_xscale = 2.8125;
255
            image_yscale = 2.3125;
256
            xx = 135;
257
            yy = 420;
258
            nextroom = 250;
259
        }
260
        scr_radio_restart
scr_radio_restart

function scr_radio_restart() { with (obj_radio) event_user(0); }
();
261
        instance_destroy(obj_player_npc);
262
        cutscene_actor_into_follower();
263
        scr_cutscene_end
scr_cutscene_end

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