Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_snowdin06_lever_overworld_yellow_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
{
3
    if (waiter == 0)
4
    {
5
        if (global.snowdin_flag[2] < 2 && obj_puzzle_water_meter_overworld_yellow.fill < 2)
6
        {
7
            cam = instance_create(obj_pl.x, obj_pl.y, obj_camera)
8
            __view_set((9 << 0), 0, 1120)
9
            direction = 0
10
            obj_pl.state = gml_Script_scr_frozen_state
11
            global.cutscene = true
12
            audio_play_sound(snd_puzzle_start, 1, 0)
13
            global.text_box_open = false
14
            waiter = 1
15
        }
16
        else if (global.snowdin_flag[2] == 2)
17
        {
18
            scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
19
            with (msg)
20
            {
21
                sndfnt = 99
22
                portrait = false
23
                message[0] = "* The switch won't budge anymore."
24
            }
25
            waiter = 5
26
        }
27
    }
28
}
29
if (waiter == 1)
30
{
31
    if (scr_camera_move
scr_camera_move

function scr_camera_move(argument0, argument1, argument2) //gml_Script_scr_camera_move { if (!instance_exists(obj_camera)) { instance_create(__view_get((9 << 0), 0).x, __view_get((9 << 0), 0).y, obj_camera) __view_set((9 << 0), 0, 1120) } else { obj_camera.x = __view_get((9 << 0), 0).x obj_camera.y = __view_get((9 << 0), 0).y __view_set((9 << 0), 0, 1120) } obj_camera.move = true obj_camera.xx = argument0 obj_camera.yy = argument1 obj_camera.spd = argument2 if (abs(argument0 - obj_camera.x) <= argument2 && abs(argument1 - obj_camera.y) <= argument2) return true; else return false; }
(240, 200, 3) == true)
32
        waiter = 3
33
}
34
if (waiter == 2 && cam.x > 260)
35
{
36
    cam.hspeed = 0
37
    waiter = 3
38
}
39
if (waiter == 3)
40
{
41
    obj_puzzle_controller_overworld_yellow.active = true
42
    waiter = 4
43
}
44
if (waiter == 5 && (!instance_exists(obj_dialoguebox)))
45
    waiter = 0
46
if (timer > 0)
47
    timer--
48
else if (timer != -1)
49
{
50
    waiter = 4
51
    timer = -1
52
}