Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_broom_Step_0

related scripts: Create_0Step_0

(view raw script w/o annotations or w/e)
1
if (live_call())
2
    return global.live_result;
3
if (global.flag[17 Dalv fate] == 1)
4
{
5
    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; } }
() == true) && (waiter == 0 && !instance_exists(obj_dialogue)))
6
        waiter = 1;
7
    if (waiter == 1)
8
    {
9
        
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; }
();
10
        if (global.interaction_count_broom == 0)
11
        {
12
            obj_dalv2.destination_x_dalv = 230;
13
            obj_dalv2.destination_y_dalv = 130;
14
        }
15
        else
16
        {
17
            obj_dalv2.destination_x_dalv = obj_dalv2.default_x_dalvroomhall;
18
            obj_dalv2.destination_y_dalv = obj_dalv2.default_y_dalvroomhall;
19
        }
20
        if (obj_dalv2.x == obj_dalv2.destination_x_dalv && obj_dalv2.y == obj_dalv2.destination_y_dalv)
21
            waiter++;
22
    }
23
    if (waiter == 2)
24
    {
25
        
scr_text
scr_text

function
scr_text()
{ if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
26
        with (msg)
27
        {
28
            if (global.interaction_count_broom == 0)
29
            {
30
                portrait = true;
31
                sndfnt = 100;
32
                message[0] = "* Be careful with that.";
33
                message[1] = "* That broom has been like#  my best friend.";
34
                message[2] = "* I never thought he'd be#  replaced by a real#  friend!";
35
                prt[0] = 1764;
36
                prt[1] = 1756;
37
                prt[2] = 1770;
38
            }
39
            else
40
            {
41
                portrait = true;
42
                sndfnt = 100;
43
                message[0] = "* ...";
44
                prt[0] = 1756;
45
            }
46
        }
47
        waiter++;
48
    }
49
    if (waiter == 3 && !instance_exists(obj_dialogue))
50
    {
51
        if (global.interaction_count_broom == 0)
52
        {
53
            global.interaction_count_broom++;
54
            waiter++;
55
        }
56
        else
57
        {
58
            waiter = 4;
59
        }
60
    }
61
    if (waiter >= 4 && waiter <= 5 && !instance_exists(obj_dialogue))
62
    {
63
        obj_dalv2.destination_x_dalv = obj_dalv2.default_x_dalvroomhall;
64
        obj_dalv2.destination_y_dalv = obj_dalv2.default_y_dalvroomhall;
65
        if (obj_dalv2.x == obj_dalv2.default_x_dalvroomhall && obj_dalv2.y == obj_dalv2.default_y_dalvroomhall)
66
            waiter++;
67
    }
68
    if (waiter == 6)
69
    {
70
        global.cutscene = false;
71
        waiter = 0;
72
        obj_pl.alarm[0] = 1;
73
    }
74
}
75
else if (global.flag[17 Dalv fate] != 1 && global.route != 3)
76
{
77
    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; } }
() == true) && (waiter == 0 && !instance_exists(obj_dialogue)))
78
        waiter = 1;
79
    if (waiter == 1)
80
    {
81
        
scr_text
scr_text

function
scr_text()
{ if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
82
        with (msg)
83
        {
84
            portrait = false;
85
            sndfnt = 99;
86
            message[0] = "* (It's a well worn broom.)";
87
            obj_broom.waiter = 2;
88
        }
89
    }
90
    if (waiter == 2 && !instance_exists(obj_dialogue))
91
    {
92
        global.cutscene = false;
93
        waiter = 0;
94
        obj_pl.alarm[0] = 1;
95
    }
96
}
97
else if (global.route == 3)
98
{
99
    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; } }
() == true) && (waiter == 0 && !instance_exists(obj_dialogue)))
100
        waiter = 1;
101
    if (waiter == 1)
102
    {
103
        
scr_text
scr_text

function
scr_text()
{ if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
104
        with (msg)
105
        {
106
            portrait = false;
107
            sndfnt = 99;
108
            message[0] = "* (A broom.)";
109
            message[1] = "* (The wood is splintered.)";
110
            obj_broom.waiter = 2;
111
        }
112
    }
113
    if (waiter == 2 && !instance_exists(obj_dialogue))
114
    {
115
        global.cutscene = false;
116
        waiter = 0;
117
        obj_pl.alarm[0] = 1;
118
    }
119
}