Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dunes_37_couch_interact_Step_0

(view raw script w/o annotations or w/e)
1
if (keyboard_multicheck_pressed(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; } }
())
2
    scene = 1
3
if (scene == 1)
4
{
5
    scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
6
    with (msg)
7
    {
8
        message[0] = "* (It's an empty swing.)"
9
        message[1] = "* (Hop on?)"
10
        ch_msg = 1
11
        ch[1] = "Yes"
12
        ch[2] = "No"
13
        if (outcome == 1)
14
        {
15
            other.npc_clover = instance_create(obj_pl.x, obj_pl.y, obj_player_npc)
16
            with (other.npc_clover)
17
            {
18
                x_dest[0] = 247
19
                y_dest[0] = 145
20
                can_walk = true
21
                depth = 0
22
            }
23
            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 }
()
24
            other.scene = 2
25
        }
26
        if (outcome == 2)
27
        {
28
            other.scene = 0
29
            global.dialogue_open = false
30
        }
31
    }
32
}
33
if (scene == 2)
34
{
35
    if (npc_clover.npc_arrived == true)
36
    {
37
        npc_clover.action_sprite = true
38
        npc_clover.sprite_index = spr_pl_run_down
39
        npc_clover.image_index = 1
40
        npc_clover.image_speed = 0
41
        with (npc_clover)
42
            path_start(pt_clover_jump_swing, 1, path_action_stop, false)
43
        audio_play_sound(snd_playerjump, 1, 0)
44
        scene = 3
45
    }
46
}
47
if (scene > 3 && scene <= 5)
48
    npc_clover.depth = -1000
49
if (scene == 3)
50
{
51
    with (npc_clover)
52
    {
53
        if (path_position >= 0.5)
54
            depth = -1000
55
        if (path_position == 1)
56
        {
57
            sprite_index = spr_pl_up
58
            image_index = 0
59
            image_angle = 270
60
            audio_sound_gain(obj_radio.current_song, 0, 800)
61
            other.scene++
62
        }
63
    }
64
}
65
if (scene == 4)
66
{
67
    if (keyboard_multicheck_pressed(0) || keyboard_multicheck_pressed(0))
68
    {
69
        scene++
70
        npc_clover.sprite_index = spr_pl_run_down
71
        npc_clover.image_index = 1
72
        npc_clover.image_speed = 0
73
        with (npc_clover)
74
            path_start(pt_clover_jump_off_swing, 1, path_action_stop, false)
75
        audio_play_sound(snd_playerjump, 1, 0)
76
    }
77
}
78
if (scene == 5)
79
{
80
    if (npc_clover.path_position == 1)
81
    {
82
        obj_pl.image_alpha = 1
83
        instance_destroy(npc_clover)
84
        audio_sound_gain(obj_radio.current_song, 1, 800)
85
        timer = 15
86
        scene++
87
    }
88
}
89
if (scene == 6)
90
{
91
    if scr_timer
scr_timer

function scr_timer() //gml_Script_scr_timer { if (timer > 0) { timer-- return false; } else return true; }
()
92
    {
93
        scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
94
        scene = 0
95
    }
96
}