Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dustnpc_Step_0

(view raw script w/o annotations or w/e)
1
script_execute(scr_depth, 0, 0, 0, 0, 0);
2
if (instance_exists(obj_dialogue) && talk == true)
3
{
4
    if (obj_dialogue.cutoff == string_length(obj_dialogue.message[obj_dialogue.message_current]))
5
    {
6
        image_speed = 0;
7
        image_index = 0;
8
    }
9
    else
10
    {
11
        image_speed = 0.2;
12
    }
13
}
14
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) || next == true) && talk == 0)
15
{
16
    scr_text
scr_text

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
17
    talk = 1;
18
    switch (global.sideNpc[5])
19
    {
20
        case 0:
21
            with (msg)
22
            {
23
                portrait = false;
24
                sndfnt = 99;
25
                message[0] = "* Oh, are you hiding from#  Dalv too?";
26
                message[1] = "* There isn't much room but#  you're welcome to join me!";
27
                message[2] = "* I know lots of games#  to kill time!";
28
                message[3] = "* How about we play count#  the dust!";
29
                message[4] = "* We see who can count#  the most dust before#  getting bored!";
30
                message[5] = "* Ready? Go!";
31
            }
32
            global.sideNpc[5] = 1;
33
            global.cutscene = true;
34
            break;
35
        case 1:
36
            with (msg)
37
            {
38
                portrait = false;
39
                sndfnt = 99;
40
                message[0] = "* Thirty-three, thirty-four,#  thirty-five...";
41
            }
42
            global.sideNpc[5] = 2;
43
            next = false;
44
            break;
45
        case 2:
46
            with (msg)
47
            {
48
                portrait = false;
49
                sndfnt = 99;
50
                message[0] = "* Seventy-eight, seventy-nine...";
51
            }
52
            global.sideNpc[5] = 3;
53
            next = false;
54
            break;
55
        case 3:
56
            with (msg)
57
            {
58
                portrait = false;
59
                sndfnt = 99;
60
                message[0] = "* ACHOO!";
61
                message[1] = "* Oh dear... I lost#  count...";
62
                message[2] = "* I guess you win then!";
63
            }
64
            global.sideNpc[5] = 4;
65
            next = false;
66
            global.cutscene = false;
67
            break;
68
        case 4:
69
            with (msg)
70
            {
71
                portrait = false;
72
                sndfnt = 99;
73
                message[0] = "* Is it dusty in here#  or is it just me?";
74
            }
75
            break;
76
    }
77
}
78
if (!instance_exists(obj_dialogue) && talk == true)
79
{
80
    talk = false;
81
    if (global.sideNpc[5] < 3)
82
        alarm[0] = 30;
83
    if (global.sideNpc[5] == 3)
84
        alarm[1] = 10;
gml_Object_obj_dustnpc_Alarm_1.gml

sprite_index = spr_dustsneeze; image_speed = 0.2; alarm[0] = 45; alarm[2] = 20;
85
}