Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_mail_claim

(view raw script w/o annotations or w/e)
1
function scr_mail_claim
scr_mail_claim

function scr_mail_claim() { var old_list = global.mail_unclaimed_list; for (var i = 0; i < ds_list_size(old_list); i++) { scr_mail_add(ds_list_find_value(old_list, i)); global.mail_count += 1; } ds_list_clear(global.mail_unclaimed_list); }
()
2
{
3
    var old_list = global.mail_unclaimed_list;
4
    for (var i = 0; i < ds_list_size(old_list); i++)
5
    {
6
        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(); }
(ds_list_find_value(old_list, i));
7
        global.mail_count += 1;
8
    }
9
    ds_list_clear(global.mail_unclaimed_list);
10
}