Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_flowey_world_lever_fake_old_Step_0

(view raw script w/o annotations or w/e)
1
if (scene == 0 && 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))
2
{
3
    audio_play_sound(snd_switch, 1, 0);
4
    image_index = 1;
5
    audio_pause_sound(obj_flowey_world_controller.cutscene_music);
6
    scene = 1;
7
    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; }
();
8
}
9
switch (scene)
10
{
11
    case 1:
12
        pl_xstart = obj_pl.x;
13
        cutscene_wait(3);
14
        break;
15
    case 2:
16
        var snap_sound = audio_play_sound(snd_flowey_world_snap, 1, 0);
17
        audio_sound_pitch(snap_sound, random_range(0.8, 1.2));
18
        obj_pl.y += 20;
19
        obj_pl.direction = 90;
20
        if (obj_pl.y < 190)
21
        {
22
            cutscene_advance();
23
        }
24
        else
25
        {
26
            obj_pl.y = 190;
27
            cutscene_advance(4);
28
        }
29
        break;
30
    case 3:
31
        if (cutscene_wait(0.05))
32
            cutscene_advance(2);
33
        break;
34
    case 4:
35
        var snap_sound = audio_play_sound(snd_flowey_world_snap, 1, 0);
36
        audio_sound_pitch(snap_sound, random_range(0.8, 1.2));
37
        obj_pl.x -= 20;
38
        obj_pl.direction = 0;
39
        if (obj_pl.x > 40)
40
        {
41
            cutscene_advance();
42
        }
43
        else
44
        {
45
            obj_pl.x = 40;
46
            cutscene_advance(6);
47
        }
48
        break;
49
    case 5:
50
        if (cutscene_wait(0.05))
51
            cutscene_advance(4);
52
        break;
53
    case 6:
54
        audio_play_sound(snd_switch, 1, 0);
55
        draw_overlay = true;
56
        cutscene_advance();
57
        break;
58
    case 7:
59
        cutscene_wait(2);
60
        break;
61
    case 8:
62
        draw_overlay = false;
63
        audio_resume_sound(obj_flowey_world_controller.cutscene_music);
64
        scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() { global.cutscene = false; obj_pl.alarm[0] = 1; }
();
65
        layer_set_visible("vines_lever", true);
66
        layer_set_visible("Decorations_hidable", false);
67
        cutscene_advance();
68
        break;
69
}