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() //gml_Script_scr_interact { if (distance_to_object(obj_pl) < 20 && obj_pl.state == gml_Script_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() //gml_Script_scr_cutscene_start { global.cutscene = true obj_pl.state = gml_Script_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
            cutscene_advance()
22
        else
23
        {
24
            obj_pl.y = 190
25
            cutscene_advance(4)
26
        }
27
        break
28
    case 3:
29
        if cutscene_wait(0.05)
30
            cutscene_advance(2)
31
        break
32
    case 4:
33
        snap_sound = audio_play_sound(snd_flowey_world_snap, 1, 0)
34
        audio_sound_pitch(snap_sound, random_range(0.8, 1.2))
35
        obj_pl.x -= 20
36
        obj_pl.direction = 0
37
        if (obj_pl.x > 40)
38
            cutscene_advance()
39
        else
40
        {
41
            obj_pl.x = 40
42
            cutscene_advance(6)
43
        }
44
        break
45
    case 5:
46
        if cutscene_wait(0.05)
47
            cutscene_advance(4)
48
        break
49
    case 6:
50
        audio_play_sound(snd_switch, 1, 0)
51
        draw_overlay = true
52
        cutscene_advance()
53
        break
54
    case 7:
55
        cutscene_wait(2)
56
        break
57
    case 8:
58
        draw_overlay = false
59
        audio_resume_sound(obj_flowey_world_controller.cutscene_music)
60
        scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
61
        layer_set_visible("vines_lever", true)
62
        layer_set_visible("Decorations_hidable", false)
63
        cutscene_advance()
64
        break
65
}