Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_newhome_01_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
        image_speed = 1;
7
        if (image_index >= (image_number - 1))
8
        {
9
            image_index = image_number - 1;
10
            image_speed = 0;
11
            scene++;
12
        }
13
        break;
14
    case 1:
15
        obj_player_npc.image_alpha += 0.2;
16
        if (obj_player_npc.image_alpha >= 1)
17
            scene++;
18
        break;
19
    case 2:
20
        if (cutscene_npc_walk(1168, obj_player_npc.x, 150, 3, "y", "down"))
21
        {
22
            if (global.party_member != -4)
23
                scene = 3;
24
            else
25
                scene = 5;
26
        }
27
        break;
28
    case 3:
29
        obj_martlet_npc.image_alpha += 0.2;
30
        if (obj_martlet_npc.image_alpha >= 1)
31
            scene++;
32
        break;
33
    case 4:
34
        cutscene_npc_walk(1164, obj_player_npc.x, 130, 3, "y", "down");
35
        break;
36
    case 5:
37
        obj_pl.direction = 270;
38
        cutscene_actor_into_follower();
39
        break;
40
    case 6:
41
        image_speed = -1;
42
        if (image_index <= 1)
43
        {
44
            image_index = 0;
45
            image_speed = 0;
46
            scene++;
47
        }
48
        break;
49
    case 7:
50
        instance_destroy(obj_player_npc);
51
        scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() { global.cutscene = false; obj_pl.alarm[0] = 1; }
();
52
        scene = 8;
53
        break;
54
}
55
switch (scene)
56
{
57
    case 8:
58
        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))
59
        {
60
            image_speed = 1;
61
            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; }
();
62
            cutscene_advance();
63
        }
64
        break;
65
    case 9:
66
        if (image_index > (image_number - 1))
67
        {
68
            image_speed = 0;
69
            image_index = image_number - 1;
70
            cutscene_advance();
71
        }
72
        break;
73
    case 10:
74
        if (global.party_member != -4)
75
        {
76
            cutscene_follower_into_actor();
77
            obj_martlet_npc.x_dest = 0;
78
            obj_martlet_npc.y_dest = 0;
79
            obj_martlet_npc.x_dest[0] = 0;
80
            obj_martlet_npc.y_dest[0] = 0;
81
            obj_martlet_npc.can_walk = false;
82
        }
83
        instance_create(obj_pl.x, obj_pl.y, obj_player_npc);
84
        cutscene_advance();
85
        break;
86
    case 11:
87
        if (cutscene_npc_walk(1168, 457, 100, 3, "x", "down"))
88
        {
89
            if (global.party_member != -4)
90
                scene = 12;
91
            else
92
                scene = 13;
93
        }
94
        if (obj_player_npc.y < 140 && obj_player_npc.image_alpha > 0)
95
            obj_player_npc.image_alpha -= 0.2;
96
        break;
97
    case 12:
98
        show_debug_message(obj_martlet_npc.x_dest[0]);
99
        cutscene_npc_walk(1164, obj_player_npc.x, 120, 3, "x", "down");
100
        if (obj_martlet_npc.y < 140 && obj_martlet_npc.image_alpha > 0)
101
            obj_martlet_npc.image_alpha -= 0.2;
102
        break;
103
    case 13:
104
        cutscene_change_room(259, 160, 220, 0.1);
105
        break;
106
}
107
if (image_index == 0 && image_speed == 1)
108
{
109
    if (!audio_is_playing(snd_sliding_door_open))
110
        audio_play_sound(snd_sliding_door_open, 1, 0);
111
}