Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_newhome_03_elevator_Step_0

(view raw script w/o annotations or w/e)
1
if (live_call())
2
    return global.live_result;
3
if (global.route != 3 && global.hotland_flag[10] == 0)
4
{
5
    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))
6
    {
7
        scr_text
scr_text

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
8
        with (msg)
9
        {
10
            sndfnt = 102;
11
            message[0] = "* I think this elevator#  goes to the Castle.";
12
            message[1] = "* Probably the last place#  Ceroba would run to.";
13
            message[2] = "* Let's keep searching#  this area for now.";
14
            prt[0] = 338;
15
            prt[1] = 315;
16
            prt[2] = 321;
17
        }
18
    }
19
}
20
else
21
{
22
    switch (scene)
23
    {
24
        case 0:
25
            image_speed = 1;
26
            if (image_index >= (image_number - 1))
27
            {
28
                image_index = image_number - 1;
29
                image_speed = 0;
30
                scene++;
31
            }
32
            break;
33
        case 1:
34
            obj_player_npc.image_alpha += 0.2;
35
            if (obj_player_npc.image_alpha >= 1)
36
                scene++;
37
            break;
38
        case 2:
39
            if (cutscene_npc_walk(1168, obj_player_npc.x, 140, 3, "y", "down"))
40
            {
41
                if (global.party_member != -4)
42
                    scene = 3;
43
                else
44
                    scene = 6;
45
            }
46
            break;
47
        case 3:
48
            obj_martlet_npc.image_alpha += 0.2;
49
            if (obj_martlet_npc.image_alpha >= 1)
50
                scene++;
51
            break;
52
        case 4:
53
            cutscene_npc_walk(1164, obj_player_npc.x, obj_pl.y - 1, 3, "y", "down");
54
            break;
55
        case 5:
56
            obj_pl.direction = 270;
57
            cutscene_actor_into_follower();
58
            break;
59
        case 6:
60
            image_speed = -1;
61
            if (image_index <= 1)
62
            {
63
                image_index = 0;
64
                image_speed = 0;
65
                scene++;
66
            }
67
            break;
68
        case 7:
69
            instance_destroy(obj_player_npc);
70
            scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() { global.cutscene = false; obj_pl.alarm[0] = 1; }
();
71
            scene = 8;
72
            break;
73
    }
74
    switch (scene)
75
    {
76
        case 8:
77
            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))
78
            {
79
                audio_play_sound(snd_sliding_door_open, 1, 0);
80
                image_speed = 1;
81
                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; }
();
82
                cutscene_advance();
83
            }
84
            break;
85
        case 9:
86
            if (image_index > (image_number - 1))
87
            {
88
                image_speed = 0;
89
                image_index = image_number - 1;
90
                cutscene_advance();
91
            }
92
            break;
93
        case 10:
94
            instance_create(obj_pl.x, obj_pl.y, obj_player_npc);
95
            if (global.party_member != -4)
96
            {
97
                cutscene_follower_into_actor();
98
                obj_martlet_npc.x_dest = 0;
99
                obj_martlet_npc.y_dest = 0;
100
                obj_martlet_npc.x_dest[0] = 0;
101
                obj_martlet_npc.y_dest[0] = 0;
102
                obj_martlet_npc.can_walk = false;
103
            }
104
            else
105
            {
106
                cutscene_advance();
107
            }
108
            break;
109
        case 11:
110
            if (cutscene_npc_walk(1168, 260, 100, 3, "x", "down"))
111
            {
112
                if (global.party_member != -4)
113
                    scene = 12;
114
                else
115
                    scene = 13;
116
            }
117
            if (obj_player_npc.y < 120 && obj_player_npc.image_alpha > 0)
118
                obj_player_npc.image_alpha -= 0.2;
119
            break;
120
        case 12:
121
            cutscene_npc_walk(1164, obj_player_npc.x, 135, 3, "x", "up");
122
            if (obj_martlet_npc.y < 140 && obj_martlet_npc.image_alpha > 0)
123
                obj_martlet_npc.image_alpha -= 0.2;
124
            break;
125
        case 13:
126
            cutscene_change_room(259, 160, 220, 0.1);
127
            break;
128
    }
129
}