Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_new_home_elevator_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
        cutscene_instance_create(160, 220, obj_player_npc)
7
        obj_player_npc.npc_direction = "up"
8
        obj_player_npc.image_alpha = 0
9
        break
10
    case 1:
11
        obj_player_npc.image_alpha += 0.2
12
        if (obj_player_npc.image_alpha >= 1)
13
            scene++
14
        break
15
    case 2:
16
        if (global.party_member == -4)
17
            cutscene_npc_walk(1168, 160, 140, 3, "y", "down")
18
        else
19
            cutscene_npc_walk(1168, 180, 140, 3, "y", "down")
20
        break
21
    case 3:
22
        if (global.party_member == -4)
23
        {
24
            scene = 6
25
            return;
26
        }
27
        cutscene_instance_create(160, 220, obj_martlet_npc)
28
        obj_martlet_npc.npc_direction = "up"
29
        obj_martlet_npc.image_alpha = 0
30
        break
31
    case 4:
32
        obj_martlet_npc.image_alpha += 0.2
33
        if (obj_martlet_npc.image_alpha >= 1)
34
            scene++
35
        break
36
    case 5:
37
        if cutscene_npc_walk(1164, 140, 140, 3, "y", "down")
38
            scene = 6
39
        break
40
    case 6:
41
        cutscene_wait(0.5)
42
        break
43
    case 7:
44
        audio_play_sound(snd_electric_flash, 1, 0)
45
        layer_enable_fx("effect_dark_overlay", false)
46
        scene++
47
        break
48
    case 8:
49
        cutscene_wait(1)
50
        break
51
    case 9:
52
        audio_play_sound(snd_ring, 1, 0)
53
        cutscene_advance()
54
        break
55
    case 10:
56
        if (door_closed_amount < 1)
57
            door_closed_amount += 0.05
58
        else
59
            cutscene_sfx_play(snd_elevator_door_shut, 1)
60
        break
61
    case 11:
62
        cutscene_wait(1)
63
        break
64
    case 12:
65
        cutscene_advance()
66
        break
67
    case 13:
68
        elevator_sound = audio_play_sound(snd_elevator_long, 1, 0)
69
        cutscene_advance()
70
        break
71
    case 14:
72
        var audio_pos = audio_sound_get_track_position(elevator_sound)
73
        if (audio_pos > 6 && audio_pos < 12)
74
            audio_sound_set_track_position(elevator_sound, 12)
75
        if (!audio_is_playing(snd_elevator_long))
76
            cutscene_advance()
77
        break
78
    case 15:
79
        cutscene_sfx_play(snd_sliding_door_open, 1)
80
        break
81
    case 16:
82
        if (door_closed_amount > 0)
83
            door_closed_amount -= 0.05
84
        else
85
            cutscene_advance()
86
        break
87
    case 17:
88
        cutscene_wait(1.5)
89
        break
90
    case 18:
91
        cutscene_npc_walk(1168, 160, 220, 3, "x", "down")
92
        break
93
    case 19:
94
        if (global.party_member != -4)
95
            cutscene_npc_walk(1164, 160, 220, 3, "x", "down")
96
        else
97
            cutscene_advance()
98
        break
99
    case 20:
100
        if (global.last_room_overworld == "rm_hotland_complex_1")
101
            cutscene_change_room(253, 456, 120, 0.1)
102
        else if (global.last_room_overworld == "rm_newhome_01")
103
            cutscene_change_room(217, 380, 220, 0.1)
104
        else if (global.last_room_overworld == "rm_newhome_02b")
105
            cutscene_change_room(263, 2000, 138, 0.1)
106
        else if (global.last_room_overworld == "rm_castle_01")
107
            cutscene_change_room(257, 260, 100, 0.1)
108
        break
109
}
110
111
if (scene > 17)
112
{
113
    if (obj_player_npc.y > 200 && obj_player_npc.image_alpha > 0)
114
        obj_player_npc.image_alpha -= 0.2
115
    if (instance_exists(obj_martlet_npc) && obj_martlet_npc.y > 200 && obj_martlet_npc.image_alpha > 0)
116
        obj_martlet_npc.image_alpha -= 0.2
117
}
118
if (scene > 13 && scene < 15)
119
{
120
    if (screenshake_intensity < 1)
121
        screenshake_intensity += 0.05
122
}
123
else if (screenshake_intensity > 0)
124
    screenshake_intensity -= 0.15
125
camera_set_view_pos(view_camera[0], 0, 0)
126
camera_set_view_pos(view_camera[0], random_range((-screenshake_intensity), screenshake_intensity), random_range(screenshake_intensity, screenshake_intensity))