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() { 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; } }
())
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(e__VW.Object, 0, obj_camera);
9
            direction = 0;
10
            obj_pl.state = 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() { 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(arg0, arg1, arg2) { if (!instance_exists(obj_camera)) { instance_create(__view_get(e__VW.Object, 0).x, __view_get(e__VW.Object, 0).y, obj_camera); __view_set(e__VW.Object, 0, obj_camera); } else { obj_camera.x = __view_get(e__VW.Object, 0).x; obj_camera.y = __view_get(e__VW.Object, 0).y; __view_set(e__VW.Object, 0, obj_camera); } obj_camera.move = true; obj_camera.xx = arg0; obj_camera.yy = arg1; obj_camera.spd = arg2; if (abs(arg0 - obj_camera.x) <= arg2 && abs(arg1 - obj_camera.y) <= arg2) return true; else return false; } enum e__VW { XView, YView, WView, HView, Angle, HBorder, VBorder, HSpeed, VSpeed, Object, Visible, XPort, YPort, WPort, HPort, Camera, SurfaceID }
(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
{
48
    timer--;
49
}
50
else if (timer != -1)
51
{
52
    waiter = 4;
53
    timer = -1;
54
}
55
56
enum e__VW
57
{
58
    XView,
59
    YView,
60
    WView,
61
    HView,
62
    Angle,
63
    HBorder,
64
    VBorder,
65
    HSpeed,
66
    VSpeed,
67
    Object,
68
    Visible,
69
    XPort,
70
    YPort,
71
    WPort,
72
    HPort,
73
    Camera,
74
    SurfaceID
75
}