Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_barrier_cutscene_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_wait(1.5);
7
        break;
8
    case 1:
9
        with (obj_barrier_container)
10
            image_speed = 1;
11
        audio_play_sound(snd_undertale_appear, 1, 0);
12
        cutscene_advance();
13
        break;
14
    case 2:
15
        if (!instance_exists(obj_barrier_container))
16
            cutscene_wait(1);
17
        break;
18
    case 3:
19
        var all_approached = true;
20
        with (obj_barrier_soul)
21
        {
22
            direction = point_direction(x, y, soul_target_x, soul_target_y);
23
            if (point_distance(x, y, soul_target_x, soul_target_y) > 20)
24
            {
25
                if (speed < 2)
26
                    speed += 0.1;
27
            }
28
            else
29
            {
30
                speed = 0;
31
                x = lerp(x, soul_target_x, 0.1);
32
                y = lerp(y, soul_target_y, 0.1);
33
            }
34
            if (abs(x - soul_target_x) <= 0.1 && abs(y - soul_target_y) <= 0.1)
35
            {
36
                x = soul_target_x;
37
                y = soul_target_y;
38
            }
39
            if (x != soul_target_x || y != soul_target_y)
40
                all_approached = false;
41
        }
42
        if (all_approached)
43
            cutscene_advance();
44
        break;
45
    case 4:
46
        cutscene_wait(1);
47
        break;
48
    case 5:
49
        cutscene_instance_create(obj_pl.x, obj_pl.y, 1168);
50
        break;
51
    case 6:
52
        obj_player_npc.action_sprite = true;
53
        obj_player_npc.sprite_index = spr_pl_up;
54
        obj_player_npc.image_speed = 0.1;
55
        obj_player_npc.vspeed = -0.5;
56
        cutscene_advance();
57
        break;
58
    case 7:
59
        if (obj_player_npc.y < 170)
60
        {
61
            with (obj_barrier_soul)
62
                vspeed = -0.5;
63
        }
64
        if (obj_player_npc.y < 140)
65
        {
66
            obj_player_npc.vspeed = 0;
67
            with (obj_barrier_soul)
68
                vspeed = 0;
69
            cutscene_advance();
70
        }
71
        break;
72
    case 8:
73
        cutscene_wait(0.5);
74
        break;
75
    case 9:
76
        draw_alpha += 0.1;
77
        if (draw_alpha >= 1)
78
            cutscene_advance();
79
        break;
80
    case 10:
81
        cutscene_wait(1);
82
        break;
83
    case 11:
84
        with (obj_barrier_soul)
85
        {
86
            if (soul_color != 16777215)
87
            {
88
                human_alpha += 0.05;
89
                if (human_alpha >= 0.75)
90
                    other.scene = 12;
91
            }
92
        }
93
        break;
94
    case 12:
95
        cutscene_wait(3);
96
        break;
97
    case 13:
98
        cutscene_screen_fade_out(16777215, 0.01);
99
        var cymbal_sound = audio_play_sound(mus_cymbal, 1, 0);
100
        audio_sound_set_track_position(cymbal_sound, 1);
101
        cutscene_advance();
102
        break;
103
    case 14:
104
        if (!audio_is_playing(mus_cymbal))
105
        {
106
            instance_destroy(obj_radio);
107
            audio_stop_all();
108
            room = rm_credits_geno;
109
        }
110
        break;
111
}
112
depth = obj_pl.depth + 1;