Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_steamworks_21b_vent_Step_0

(view raw script w/o annotations or w/e)
1
if (scr_interact
scr_interact

function scr_interact() //gml_Script_scr_interact { if (distance_to_object(obj_pl) < 20 && obj_pl.state == gml_Script_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))
2
{
3
    if (switch_no_crawl == false)
4
    {
5
        global.cutscene = true
6
        scene = 1
7
    }
8
    else
9
    {
10
        obj_pl.state = gml_Script_scr_frozen_state
11
        scene = 5
12
    }
13
}
14
if (scene == 1)
15
{
16
    if global.dialogue_open
17
        return;
18
    if (image_speed == 0)
19
    {
20
        audio_play_sound(snd_steamworks_13_vent, 20, 0)
21
        image_speed = (1/3)
22
    }
23
    if (image_index >= (image_number - 1))
24
    {
25
        image_speed = 0
26
        image_index = image_number - 1
27
        scene = 2
28
        scr_audio_fade_out
scr_audio_fade_out

function scr_audio_fade_out(argument0, argument1) //gml_Script_scr_audio_fade_out { var snd = argument0 var fade_len = argument1 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)
29
    }
30
}
31
if (scene == 2)
32
    cutscene_wait(0.5)
33
if (scene == 3)
34
{
35
    if (draw_alpha < 1)
36
        draw_alpha += 0.1
37
    else
38
        cutscene_advance()
39
}
40
if (scene == 4)
41
{
42
    scr_change_room
scr_change_room

function scr_change_room(argument0, argument1, argument2) //gml_Script_scr_change_room { if (!instance_exists(obj_transition)) { trn = instance_create(x, y, obj_transition) trn.newRoom = argument0 if instance_exists(obj_pl) { trn.xx = argument1 trn.yy = argument2 } } }
(170, 100, 150)
43
    instance_create(0, 0, obj_controller_steamworks_20_vent)
44
}
45
if (scene == 5)
46
    cutscene_change_room(170, 100, 150, 0.1)