Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_chem_05_trashcan_Step_0

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

function scr_text() { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue); }
();
4
    if (global.sworks_flag[24] == 0)
5
    {
6
        with (msg)
7
        {
8
            if (global.route == 3)
9
            {
10
                message[0] = "* (A page of rambly writings#  wastes away in the can.)";
11
                message[1] = "* (You take it.)";
12
            }
13
            else
14
            {
15
                message[0] = "* (You reach into the trash#  can...) \t";
16
                message[1] = "* (You pull out a crumpled up#  essay titled \"Mixin' It Up!\")\t";
17
                message[2] = "* (It's typed in size 13 font to#  better reach the minimum page#  requirement... of 1.)\t";
18
                message[3] = "* (You stash the essay in your#  mail bag.)";
19
            }
20
        }
21
        scr_mail_add
scr_mail_add

function scr_mail_add(arg0) { ds_list_add(global.mail_list, arg0); if (irandom(global.spam_mail_chance) == 1) { show_debug_message("success"); ds_list_add(global.mail_list, choose("Spam Letter 1", "Spam Letter 2", "Spam Letter 3", "Spam Letter 4", "Spam Letter 5", "Spam Letter 6", "Spam Letter 7", "Spam Letter 8", "Spam Letter 9")); global.spam_mail_chance = 30; } else { global.spam_mail_chance = clamp(global.spam_mail_chance - 1, 1, 999); } scr_mail_sort(); }
("Mixin' It Up! (Essay)");
22
        global.sworks_flag[24] = 1;
23
    }
24
    else
25
    {
26
        with (msg)
27
            message[0] = "* (Nothing useful here.)";
28
    }
29
}