Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_chem_05_door_Step_0

(view raw script w/o annotations or w/e)
1
if (live_call())
2
    return global.live_result;
3
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; } }
())
4
{
5
    scr_text
scr_text

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
6
    with (msg)
7
    {
8
        if (global.route == 3)
9
        {
10
            message[0] = "* (A roadblock.)";
11
        }
12
        else
13
        {
14
            message[0] = "* (A complex lock mechanism#  blocks your exit.)";
15
            message[1] = "* (What could open it up?)";
16
        }
17
    }
18
    door_menu_open = true;
19
}
20
if (!global.dialogue_open && door_menu_open == true)
21
{
22
    instance_create(x, y, obj_item_use_menu);
23
    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; }
();
24
    door_menu_open = false;
25
}
26
if (global.item_used_overworld != undefined)
27
{
28
    scr_text
scr_text

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
29
    with (msg)
30
    {
31
        switch (global.item_used_overworld)
32
        {
33
            default:
34
                message[0] = "* (You can't think of a way to#  make this work.)";
35
                global.cutscene = false;
36
                break;
37
            case "H. Acid":
38
                message[0] = "* (You use the ACID to ACID#  away at the DOOR.)";
39
                other.door_solution = "H. Acid";
40
                break;
41
        }
42
    }
43
    if (!global.dialogue_open)
44
        global.item_used_overworld = undefined;
45
}
46
if (!global.dialogue_open && door_solution != "none")
47
{
48
    switch (door_solution)
49
    {
50
        case "H. Acid":
51
            scene = 1;
52
            scr_item_remove
scr_item_remove

function scr_item_remove(arg0) { for (i = 1; i <= 8; i += 1) { if (global.item_slot[i] == arg0) { while (i < 8) { global.item_slot[i] = global.item_slot[i + 1]; i += 1; } global.item_slot[8] = "Nothing"; return true; break; } else if (i == 8) { return false; } } }
("H. Acid");
53
            break;
54
    }
55
    door_solution = "none";
56
}
57
switch (scene)
58
{
59
    case 1:
60
        image_speed = 1;
61
        cutscene_advance();
62
        break;
63
    case 2:
64
        if (global.route != 3 && global.geno_complete[3] == false)
65
        {
66
            cutscene_instance_create(304, 125, 1166);
67
            obj_axis_npc.depth = 500;
68
            obj_axis_npc.npc_dynamic_depth = false;
69
        }
70
        else
71
        {
72
            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, 500);
73
            cutscene_advance();
74
        }
75
        break;
76
    case 3:
77
        if (image_index == 5)
78
        {
79
            if (!audio_is_playing(snd_puzzle_icemelt))
80
                audio_play_sound(snd_puzzle_icemelt, 1, 0);
81
        }
82
        if (image_index == 16)
83
        {
84
            if (!audio_is_playing(snd_sliding_door_open))
85
                audio_play_sound(snd_sliding_door_open, 1, 0);
86
        }
87
        if (image_index >= (image_number - 1))
88
        {
89
            image_index = image_number - 1;
90
            image_speed = 0;
91
            cutscene_advance();
92
            if (global.geno_complete[3] == true)
93
                cutscene_advance(34);
94
        }
95
        break;
96
    case 4:
97
        cutscene_music_start(219, 150);
98
        break;
99
    case 5:
100
        cutscene_dialogue();
101
        with (msg)
102
        {
103
            talker[0] = 1166;
104
            message[0] = "* HELLO.";
105
            message[1] = "* I HAD TROUBLE LOCATING#  YOU AFTER OUR LAST#  ENCOUNTER.";
106
            message[2] = "* WORRY NO MORE, I HAVE#  LOCATED YOU.";
107
            message[3] = "* MY LAST PLAN DID NOT#  WORK SO I WILL TRY#  SOMETHING NEW.";
108
            prt[0] = 473;
109
            prt[1] = 473;
110
            prt[2] = 473;
111
            prt[3] = 473;
112
        }
113
        break;
114
    case 6:
115
        cutscene_npc_walk(1166, obj_axis_npc.x, 170, 3, "x", "down");
116
        cutscene_advance();
117
        break;
118
    case 7:
119
        cutscene_sfx_play(410, 1);
120
        break;
121
    case 8:
122
        cutscene_instance_create(obj_pl.x, obj_pl.y, 1168);
123
        break;
124
    case 9:
125
        with (obj_player_npc)
126
        {
127
            path_start(pt_steamworks_chem_05_player_knockback, 6, path_action_stop, true);
128
            path_change_point(pt_steamworks_chem_05_player_knockback, 0, obj_pl.x, obj_pl.y, 100);
129
        }
130
        cutscene_advance();
131
        break;
132
    case 10:
133
        cutscene_npc_set_sprites(1166, 488, 487, 3220, 486, 488, 487, 3220, 486);
134
        break;
135
    case 11:
136
        cutscene_wait(1.5);
137
        break;
138
    case 12:
139
        cutscene_dialogue();
140
        with (msg)
141
        {
142
            ch[1] = "No way!";
143
            ch[2] = "Sure!";
144
            talker[0] = 1166;
145
            message[0] = "* I JUST FOUND THIS#  HIGHLY-CORROSIVE#  CONCOCTION.";
146
            message[1] = "* I WOULD LIKE TO APPLY#  IT ON YOUR SKIN.";
147
            message[2] = "* WILL YOU BE MY TEST#  SUBJECT?";
148
            prt[0] = 473;
149
            prt[1] = 473;
150
            prt[2] = 473;
151
            ch_msg = 2;
152
            if (outcome == 1)
153
            {
154
                message[3] = "* WONDERFUL.";
155
                prt[3] = 473;
156
            }
157
            else if (outcome == 2)
158
            {
159
                message[3] = "* CORRECT DECISION.";
160
                prt[3] = 473;
161
            }
162
            message[4] = "* ALLOW ME TO TERMINATE#  THE CORK FIRST.";
163
            prt[4] = 473;
164
        }
165
        break;
166
    case 13:
167
        cutscene_wait(0.1);
168
        break;
169
    case 14:
170
        cutscene_npc_action_sprite(1166, 3707, 6, true, 0);
171
        break;
172
    case 15:
173
        cutscene_npc_action_sprite(1166, 3105, 1, true, 1);
174
        cutscene_advance();
175
        break;
176
    case 16:
177
        cutscene_wait(1.5);
178
        break;
179
    case 17:
180
        cutscene_dialogue();
181
        with (msg)
182
        {
183
            talker[0] = 1166;
184
            message[0] = "* IT IS TOUGH TO OPEN#  CONTAINERS...";
185
            message[1] = "* ...WHEN MY ONLY POINT#  OF FORCE IS AT THE BACK#  OF MY HANDS.";
186
            prt[0] = 473;
187
            prt[1] = 473;
188
        }
189
        break;
190
    case 18:
191
        cutscene_npc_action_sprite(1166, 174, 1, true, 1, 72, 0);
192
        cutscene_advance();
193
        break;
194
    case 19:
195
        cutscene_wait(1.5);
196
        break;
197
    case 20:
198
        cutscene_dialogue();
199
        with (msg)
200
        {
201
            talker[0] = 1166;
202
            message[0] = "* ALMOST HAVE IT.";
203
            prt[0] = 473;
204
        }
205
        break;
206
    case 21:
207
        audio_stop_sound(cutscene_music);
208
        cutscene_npc_action_sprite(1166, 3304, 1, true, 0, 30, 0);
209
        break;
210
    case 22:
211
        cutscene_wait(1.5);
212
        break;
213
    case 23:
214
        cutscene_dialogue();
215
        with (msg)
216
        {
217
            talker[0] = 1166;
218
            message[0] = "* [Shoot]";
219
            message[1] = "* DO NOT FRET, I WILL#  RETRIEVE ANOTHER TUBE-";
220
            prt[0] = 473;
221
            prt[1] = 473;
222
        }
223
        break;
224
    case 24:
225
        cutscene_instance_create(obj_axis_npc.x, obj_axis_npc.y, 289);
226
        audio_play_sound(snd_chem_05_axis_acid_melt_ground, 1, 0);
227
        break;
228
    case 25:
229
        obj_axis_npc.sprite_index = spr_axis_acid_6;
230
        cutscene_advance(26);
231
    case 26:
232
        cutscene_wait(1.5);
233
        break;
234
    case 27:
235
        cutscene_dialogue();
236
        with (msg)
237
        {
238
            talker[0] = 1166;
239
            message[0] = "* HUH.";
240
            message[1] = "* HOW THE TABLES TURN.";
241
            prt[0] = 473;
242
            prt[1] = 473;
243
        }
244
        break;
245
    case 28:
246
        obj_axis_npc.action_sprite = false;
247
        obj_axis_npc.npc_dynamic_depth = false;
248
        obj_axis_npc.down_sprite_idle = 484;
249
        obj_axis_npc.depth = obj_chem_05_floor_melt.depth - 1;
250
        instance_create_depth(obj_axis_npc.x, obj_axis_npc.y - 3, obj_chem_05_floor_melt.depth - 2, obj_chem_05_floor_melt_front);
251
        cutscene_advance(29);
252
        break;
253
    case 29:
254
        with (obj_axis_npc)
255
        {
256
            if (image_xscale > 0.85)
257
                image_xscale -= 0.65;
258
            if (image_yscale < 1.15)
259
                image_yscale += 0.65;
260
            y -= 0.1;
261
            if (image_xscale <= 0.85 && image_yscale >= 1.15)
262
            {
263
                audio_play_sound(snd_chem_05_axis_fall, 1, 0);
264
                other.scene++;
265
            }
266
            y_previous = y;
267
        }
268
        break;
269
    case 30:
270
        with (obj_axis_npc)
271
        {
272
            if (image_xscale < 1.15)
273
                image_xscale -= 0.02;
274
            if (image_yscale > 0.95)
275
                image_yscale -= 0.02;
276
            y += 10;
277
            if (y > (y_previous + 65))
278
            {
279
                instance_destroy();
280
                other.scene++;
281
            }
282
        }
283
        break;
284
    case 31:
285
        cutscene_wait(2);
286
        break;
287
    case 32:
288
        cutscene_sfx_play(384, 0.5);
289
        break;
290
    case 33:
291
        cutscene_screenshake(1, 1);
292
        break;
293
    case 34:
294
        scr_radio_restart
scr_radio_restart

function scr_radio_restart() { with (obj_radio) event_user(0); }
();
295
        audio_sound_gain(obj_radio.current_song, 1, 500);
296
        instance_destroy(obj_player_npc);
297
        instance_destroy(obj_chem_05_floor_melt_front);
298
        scr_radio_restart
scr_radio_restart

function scr_radio_restart() { with (obj_radio) event_user(0); }
();
299
        scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() { global.cutscene = false; obj_pl.alarm[0] = 1; }
();
300
        instance_activate_object(inst_105566);
301
        solid = false;
302
        if (global.route == 3 || global.geno_complete[3] == true)
303
            global.sworks_flag[25] = 5;
304
        else
305
            global.sworks_flag[25] = 6;
306
        cutscene_advance();
307
        break;
308
}