Undertale script viewer

← back to main script listing

gml_Object_obj_overworldcontroller_Draw_0

(view raw script w/o annotations or w/e)
1
buffer += 1;
2
if (global.interact == 5)
3
{
4
    currentmenu = global.menuno;
5
    if (global.menuno < 6)
6
        currentspot = global.menucoord[global.menuno];
7
    xx = view_xview[view_current];
8
    yy = view_yview[view_current] + 10;
9
    moveyy = yy;
10
    if (obj_mainchara.y > (yy + 120))
11
        moveyy += 135;
12
    if (global.menuno != 4)
13
    {
14
        draw_set_color(c_white);
15
        ossafe_fill_rectangle(16 + xx, 16 + moveyy, 86 + xx, 70 + moveyy);
16
        ossafe_fill_rectangle(16 + xx, 74 + yy, 86 + xx, 147 + yy);
17
        if (global.menuno == 1 || global.menuno == 5 || global.menuno == 6)
18
            ossafe_fill_rectangle(94 + xx, 16 + yy, 266 + xx, 196 + yy);
19
        if (global.menuno == 2)
20
        {
21
            var xend = 266;
22
            if (global.language == "ja")
23
                xend += 9;
24
            ossafe_fill_rectangle(94 + xx, 16 + yy, xend + xx, 224 + yy);
25
        }
26
        if (global.menuno == 3)
27
            ossafe_fill_rectangle(94 + xx, 16 + yy, 266 + xx, 150 + yy);
28
        if (global.menuno == 7)
29
            ossafe_fill_rectangle(94 + xx, 16 + yy, 266 + xx, 216 + yy);
30
        draw_set_color(c_black);
31
        ossafe_fill_rectangle(19 + xx, 19 + moveyy, 83 + xx, 67 + moveyy);
32
        ossafe_fill_rectangle(19 + xx, 77 + yy, 83 + xx, 144 + yy);
33
        if (global.menuno == 1 || global.menuno == 5 || global.menuno == 6)
34
            ossafe_fill_rectangle(97 + xx, 19 + yy, 263 + xx, 193 + yy);
35
        if (global.menuno == 2)
36
        {
37
            var xend = 263;
38
            if (global.language == "ja")
39
                xend += 9;
40
            ossafe_fill_rectangle(97 + xx, 19 + yy, xend + xx, 221 + yy);
41
        }
42
        if (global.menuno == 3)
43
            ossafe_fill_rectangle(97 + xx, 19 + yy, 263 + xx, 147 + yy);
44
        if (global.menuno == 7)
45
            ossafe_fill_rectangle(97 + xx, 19 + yy, 263 + xx, 213 + yy);
46
        draw_set_color(c_white);
47
        scr_setfont
scr_setfont

var newfont = argument0; if (global.language == "ja") { if (newfont == fnt_main) newfont = fnt_ja_main; if (newfont == fnt_maintext) newfont = fnt_ja_maintext; if (newfont == fnt_plain) newfont = fnt_ja_plain; } draw_set_font(newfont);
(fnt_small);
48
        var numpos = 23 + xx + string_width("LV  ");
49
        draw_text(23 + xx, 40 + moveyy, "LV");
50
        draw_text(numpos, 40 + moveyy, string(global.lv));
51
        draw_text(23 + xx, 49 + moveyy, "HP");
52
        draw_text(numpos, 49 + moveyy, string(global.hp) + "/" + string(global.maxhp));
53
        draw_text(23 + xx, 58 + moveyy, "G");
54
        draw_text(numpos, 58 + moveyy, string(global.gold));
55
        scr_setfont
scr_setfont

var newfont = argument0; if (global.language == "ja") { if (newfont == fnt_main) newfont = fnt_ja_main; if (newfont == fnt_maintext) newfont = fnt_ja_maintext; if (newfont == fnt_plain) newfont = fnt_ja_plain; } draw_set_font(newfont);
(fnt_maintext);
56
        var name0_x = 23 + xx;
57
        var name0_y = 20 + moveyy;
58
        var name0_scale = 1;
59
        if (global.language == "ja")
60
        {
61
            draw_set_font(fnt_ja_curs);
62
            name0_y += 4;
63
            name0_scale = 0.5;
64
        }
65
        draw_text_transformed(name0_x, name0_y, global.charname, name0_scale, name0_scale, 0);
66
        scr_setfont
scr_setfont

var newfont = argument0; if (global.language == "ja") { if (newfont == fnt_main) newfont = fnt_ja_main; if (newfont == fnt_maintext) newfont = fnt_ja_maintext; if (newfont == fnt_plain) newfont = fnt_ja_plain; } draw_set_font(newfont);
(fnt_maintext);
67
        var xx0 = xx;
68
        if (global.language == "ja")
69
            xx0 -= 2;
70
        if (global.item[0] == 0)
71
            draw_set_color(c_gray);
72
        if (global.menuchoice[0] == 1)
73
            draw_text(42 + xx0, 84 + yy, 
ITEM
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("field_menu_item")
);
74
        draw_set_color(c_white);
75
        if (global.menuchoice[1] == 1)
76
            draw_text(42 + xx, 102 + yy, 
STAT
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("field_menu_stat")
);
77
        if (global.menuchoice[2] == 1)
78
            draw_text(42 + xx, 120 + yy, 
CELL
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("field_menu_cell")
);
79
        if (global.menuno == 1 || global.menuno == 5)
80
        {
81
            for (i = 0; i < 8; i += 1)
82
                draw_text(116 + xx, 30 + yy + (i * 16), global.itemname[i]);
83
            draw_text(116 + xx, 170 + yy, 
USE
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("item_menu_use")
);
84
            draw_text(116 + xx + 48, 170 + yy, 
INFO
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("item_menu_info")
);
85
            draw_text(116 + xx + 105, 170 + yy, 
DROP
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("item_menu_drop")
);
86
        }
87
    }
88
    if (global.menuno == 3)
89
    {
90
        for (i = 0; i < 7; i += 1)
91
            draw_text(116 + xx, 30 + yy + (i * 16), global.phonename[i]);
92
    }
93
    if (global.menuno == 6)
94
    {
95
        scr_itemname
scr_itemname

for (i = 0; i < 8; i += 1) { itemid = global.item[i]; scr_itemnamelist(); }
();
96
        for (i = 0; i < 8; i += 1)
97
            draw_text(116 + xx, 30 + yy + (i * 16), global.itemname[i]);
98
    }
99
    if (global.menuno == 7)
100
    {
101
        scr_storagename
scr_storagename

for (i = argument0; i < (argument0 + 11); i += 1) global.itemname[i - argument0] = " "; for (i = 0; i < 11; i += 1) { itemid = global.flag[argument0 + i]; scr_itemnamelist(); }
(300);
102
        for (i = 0; i < 10; i += 1)
103
            draw_text(116 + xx, 30 + yy + (i * 16), global.itemname[i]);
104
    }
105
    if (global.menuno == 2)
106
    {
107
        var stat_x = 108 + xx;
108
        if (global.language == "ja")
109
            stat_x -= 3;
110
        var exp_x = stat_x + 84;
111
        var kills_x = exp_x;
112
        var name_y = 32 + yy;
113
        var lv_y = 62 + yy;
114
        var hp_y = 78 + yy;
115
        var at_y = 110 + yy;
116
        var df_y = 126 + yy;
117
        var weapon_y = 156 + yy;
118
        var armor_y = 172 + yy;
119
        var gold_y = 192 + yy;
120
        var kills_y = 192 + yy;
121
        if (global.language == "ja")
122
        {
123
            weapon_y -= 2;
124
            gold_y += 2;
125
            kills_y += 2;
126
        }
127
        draw_text(stat_x, name_y, 
"\[C]"
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("stat_menu_name")
);
128
        draw_text(stat_x, lv_y, scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("stat_menu_lv", string(global.lv)));
129
        draw_text(stat_x, hp_y, scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("stat_menu_hp", string(global.hp), string(global.maxhp)));
130
        draw_text(stat_x, at_y, scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("stat_menu_at", string(global.at - 10), string(global.wstrength)));
131
        draw_text(stat_x, df_y, scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("stat_menu_df", string(global.df - 10), string(global.adef)));
132
        draw_text(stat_x, weapon_y, scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("stat_menu_weapon", scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("item_name_" + string(global.weapon))));
133
        var armorname = scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("item_name_" + string(global.armor));
134
        if (global.armor == 64)
135
            armorname = 
Temmie Armor
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("stat_armor_temmie")
;
136
        draw_text(stat_x, armor_y, scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("stat_menu_armor", armorname));
137
        draw_text(stat_x, gold_y, 
GOLD: \[G]
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("stat_menu_gold")
);
138
        if (global.kills > 20)
139
            draw_text(kills_x, kills_y, scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("stat_menu_kills", string(global.kills)));
140
        if (string_length(global.charname) >= 7)
141
        {
142
            var x2 = 192 + xx;
143
            var y2 = 32 + yy;
144
            var scale = 1;
145
            if (global.language == "ja")
146
            {
147
                x2 += 16;
148
                y2 += 20;
149
                scale = 0.5;
150
            }
151
            draw_text_transformed(x2, y2, 
Easy to#change,#huh?
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("stat_menu_namehack")
, scale, scale, 0);
152
        }
153
        draw_text(exp_x, at_y, scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("stat_menu_exp", string(global.xp)));
154
        if (global.lv == 1)
155
            nextlevel = 10 - global.xp;
156
        if (global.lv == 2)
157
            nextlevel = 30 - global.xp;
158
        if (global.lv == 3)
159
            nextlevel = 70 - global.xp;
160
        if (global.lv == 4)
161
            nextlevel = 120 - global.xp;
162
        if (global.lv == 5)
163
            nextlevel = 200 - global.xp;
164
        if (global.lv == 6)
165
            nextlevel = 300 - global.xp;
166
        if (global.lv == 7)
167
            nextlevel = 500 - global.xp;
168
        if (global.lv == 8)
169
            nextlevel = 800 - global.xp;
170
        if (global.lv == 9)
171
            nextlevel = 1200 - global.xp;
172
        if (global.lv == 10)
173
            nextlevel = 1700 - global.xp;
174
        if (global.lv == 11)
175
            nextlevel = 2500 - global.xp;
176
        if (global.lv == 12)
177
            nextlevel = 3500 - global.xp;
178
        if (global.lv == 13)
179
            nextlevel = 5000 - global.xp;
180
        if (global.lv == 14)
181
            nextlevel = 7000 - global.xp;
182
        if (global.lv == 15)
183
            nextlevel = 10000 - global.xp;
184
        if (global.lv == 16)
185
            nextlevel = 15000 - global.xp;
186
        if (global.lv == 17)
187
            nextlevel = 25000 - global.xp;
188
        if (global.lv == 18)
189
            nextlevel = 50000 - global.xp;
190
        if (global.lv == 19)
191
            nextlevel = 99999 - global.xp;
192
        if (global.lv >= 20)
193
            nextlevel = 0;
194
        draw_text(exp_x, df_y, scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("stat_menu_next", string(nextlevel)));
195
    }
196
    if (global.menuno == 4)
197
    {
198
        iniread = ossafe_ini_open("undertale.ini");
199
        name = ini_read_string("General", "Name", 
EMPTY
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("save_menu_empty")
);
200
        love = ini_read_real("General", "Love", 0);
201
        time = ini_read_real("General", "Time", 1);
202
        kills = ini_read_real("General", "Kills", 0);
203
        roome = ini_read_real("General", "Room", 0);
204
        ossafe_ini_close();
205
        scr_setfont
scr_setfont

var newfont = argument0; if (global.language == "ja") { if (newfont == fnt_main) newfont = fnt_ja_main; if (newfont == fnt_maintext) newfont = fnt_ja_maintext; if (newfont == fnt_plain) newfont = fnt_ja_plain; } draw_set_font(newfont);
(fnt_maintext);
206
        draw_set_color(c_white);
207
        ossafe_fill_rectangle(54 + xx, 49 + yy, 265 + xx, 135 + yy);
208
        draw_set_color(c_black);
209
        ossafe_fill_rectangle(57 + xx, 52 + yy, 262 + xx, 132 + yy);
210
        draw_set_color(c_white);
211
        if (global.menucoord[4] == 2)
212
            draw_set_color(c_yellow);
213
        minutes = floor(time / 1800);
214
        seconds = round(((time / 1800) - minutes) * 60);
215
        if (seconds == 60)
216
            seconds = 59;
217
        if (seconds < 10)
218
            seconds = "0" + string(seconds);
219
        var roomname = scr_roomname
scr_roomname

if (argument0 == 0) return
--
scr_gettext("roomname_0")
; var roomid = room_get_name(argument0); if (substr(roomid, 1, 5) == "room_") { var roomname = scr_gettext("roomname_" + substr(roomid, 6)); if (roomname != "") return roomname; } return " ";
(roome);
220
        var lvtext = scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("save_menu_lv", string(love));
221
        var timetext = scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("save_menu_time", string(minutes), string(seconds));
222
        var namesize = string_width(substr(name, 1, 6));
223
        var lvsize = string_width(lvtext);
224
        var timesize = string_width(timetext);
225
        var x_center = xx + 160;
226
        var lvpos = round((x_center + (namesize / 2)) - (timesize / 2) - (lvsize / 2));
227
        var namepos = 70 + xx;
228
        var timepos = 250 + xx;
229
        if (global.language == "ja")
230
        {
231
            namepos -= 6;
232
            timepos += 6;
233
        }
234
        draw_text(namepos, 60 + yy, name);
235
        draw_text(lvpos, 60 + yy, lvtext);
236
        draw_text(timepos - timesize, 60 + yy, timetext);
237
        if (global.language == "ja")
238
            scr_drawtext_centered
scr_drawtext_centered

var xx = argument0; var yy = argument1; var text = argument2; scr_drawtext_centered_scaled(xx, yy, text, 1, 1);
(x_center, 80 + yy, roomname);
239
        else
240
            draw_text(namepos, 80 + yy, roomname);
241
        var savepos = xx + 71;
242
        var returnpos = xx + 161;
243
        if (global.language == "ja")
244
        {
245
            savepos = xx + 78;
246
            returnpos = xx + 173;
247
        }
248
        if (global.menucoord[4] == 0)
249
            draw_sprite(spr_heartsmall, 0, savepos, yy + 113);
250
        if (global.menucoord[4] == 1)
251
            draw_sprite(spr_heartsmall, 0, returnpos, yy + 113);
252
        if (global.menucoord[4] < 2)
253
        {
254
            draw_text(savepos + 14, yy + 110, 
Save
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("save_menu_save")
);
255
            draw_text(returnpos + 14, yy + 110, 
Return
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("save_menu_return")
);
256
        }
257
        else
258
        {
259
            draw_text(xx + 85, yy + 110, 
File saved.
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("save_menu_saved")
);
260
            if (control_check_pressed(0))
261
            {
262
                global.menuno = -1;
263
                global.interact = 0;
264
                global.menucoord[4] = 0;
265
                control_clear(0);
266
            }
267
        }
268
        if (keyboard_check_pressed(vk_left) || keyboard_check_pressed(vk_right))
269
        {
270
            if (global.menucoord[4] < 2)
271
            {
272
                if (global.menucoord[4] == 1)
273
                    global.menucoord[4] = 0;
274
                else
275
                    global.menucoord[4] = 1;
276
                keyboard_clear(vk_left);
277
                keyboard_clear(vk_right);
278
            }
279
        }
280
        if (control_check_pressed(0) && global.menucoord[4] == 0)
281
        {
282
            snd_play(snd_save);
283
            script_execute(scr_save);
284
            global.menucoord[4] = 2;
285
            control_clear(0);
286
        }
287
        if (control_check_pressed(0) && global.menucoord[4] == 1)
288
        {
289
            global.menuno = -1;
290
            global.interact = 0;
291
            global.menucoord[4] = 0;
292
            control_clear(0);
293
        }
294
        if (control_check_pressed(1))
295
        {
296
            global.menuno = -1;
297
            global.interact = 0;
298
            global.menucoord[4] = 0;
299
            control_clear(1);
300
        }
301
    }
302
    if (global.menuno == 0)
303
    {
304
        var heart_y = 88;
305
        if (global.language == "ja")
306
            heart_y -= 1;
307
        draw_sprite(spr_heartsmall, 0, 28 + xx, heart_y + yy + (18 * global.menucoord[0]));
308
    }
309
    if (global.menuno == 1)
310
    {
311
        var heart_y = 34;
312
        if (global.language == "ja")
313
            heart_y -= 1;
314
        draw_sprite(spr_heartsmall, 0, 104 + xx, heart_y + yy + (16 * global.menucoord[1]));
315
    }
316
    if (global.menuno == 3)
317
    {
318
        var heart_y = 34;
319
        if (global.language == "ja")
320
            heart_y -= 1;
321
        draw_sprite(spr_heartsmall, 0, 104 + xx, heart_y + yy + (16 * global.menucoord[3]));
322
    }
323
    if (global.menuno == 6)
324
    {
325
        var heart_y = 34;
326
        if (global.language == "ja")
327
            heart_y -= 1;
328
        draw_sprite(spr_heartsmall, 0, 104 + xx, heart_y + yy + (16 * global.menucoord[6]));
329
    }
330
    if (global.menuno == 7)
331
    {
332
        var heart_y = 34;
333
        if (global.language == "ja")
334
            heart_y -= 1;
335
        draw_sprite(spr_heartsmall, 0, 104 + xx, heart_y + yy + (16 * global.menucoord[7]));
336
    }
337
    if (global.menuno == 5)
338
    {
339
        var heart_y = 174;
340
        if (global.language == "ja")
341
            heart_y -= 1;
342
        if (global.menucoord[5] == 0)
343
            draw_sprite(spr_heartsmall, 0, 104 + xx + (45 * global.menucoord[5]), heart_y + yy);
344
        if (global.menucoord[5] == 1)
345
            draw_sprite(spr_heartsmall, 0, 104 + xx + ((45 * global.menucoord[5]) + 3), heart_y + yy);
346
        if (global.menucoord[5] == 2)
347
            draw_sprite(spr_heartsmall, 0, 104 + xx + ((45 * global.menucoord[5]) + 15), heart_y + yy);
348
    }
349
    if (control_check_pressed(0))
350
    {
351
        if (global.menuno == 5)
352
        {
353
            if (global.menucoord[5] == 0)
354
            {
355
                global.menuno = 9;
356
                script_execute(scr_itemuseb, global.menucoord[1], global.item[global.menucoord[1]]);
357
            }
358
            if (global.menucoord[5] == 1)
359
            {
360
                global.menuno = 9;
361
                script_execute(scr_itemdesc, global.item[global.menucoord[1]]);
362
                script_execute(scr_writetext, 0, "x", 0, 0);
363
            }
364
            if (global.menucoord[5] == 2)
365
            {
366
                global.menuno = 9;
367
                dontthrow = 0;
368
                if (global.item[global.menucoord[1]] != 23 && global.item[global.menucoord[1]] != 27 && global.item[global.menucoord[1]] != 54 && global.item[global.menucoord[1]] != 56 && global.item[global.menucoord[1]] != 57)
369
                {
370
                    script_execute(scr_writetext, 12, "x", 0, 0);
371
                }
372
                else
373
                {
374
                    if (global.item[global.menucoord[1]] == 23)
375
                        script_execute(scr_writetext, 23, "x", 0, 0);
376
                    if (global.item[global.menucoord[1]] == 27)
377
                    {
378
                        script_execute(scr_writetext, 0, 
* (You put the dog on the
ground.)Wait for inputClose MessageClose Message
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("item_drop_27")
, 0, 0);
379
                        if (instance_exists(obj_rarependant))
380
                        {
381
                            with (obj_rarependant)
382
                                con = 1;
383
                        }
384
                    }
385
                    if (global.item[global.menucoord[1]] == 54)
386
                    {
387
                        script_execute(scr_writetext, 0, 
* (You threw the Bad Memory
away.)Delay 11
* (But it came back.)Wait for inputClose MessageClose Message
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("item_drop_54")
, 0, 0);
388
                        dontthrow = 1;
389
                    }
390
                    if (global.item[global.menucoord[1]] == 56)
391
                    {
392
                        if (!instance_exists(obj_undyne_friendc))
393
                        {
394
                            script_execute(scr_writetext, 0, 
* (Despite what seems like
common sense,Delay 11 you threw
away the letter.)Wait for inputClose MessageClose Message
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("item_drop_56")
, 0, 0);
395
                            global.flag[494 status_undyne_letter] = 1;
396
                        }
397
                        else
398
                        {
399
                            global.faceemotion = 1;
400
                            script_execute(scr_writetext, 0, 
* Hey!Delay 11 Don't throw that
away!Delay 11 Just deliver it!Wait for inputClose MessageClose Message
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("item_drop_56_undyne")
, 5, 37);
401
                            dontthrow = 1;
402
                        }
403
                    }
404
                    if (global.item[global.menucoord[1]] == 57)
405
                    {
406
                        script_execute(scr_writetext, 0, 
* (The letter is too powerful to
throw away.)Delay 11
* (It gets the better of you.)Wait for inputClose MessageClose Message
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("item_drop_57")
, 0, 0);
407
                        dontthrow = 1;
408
                    }
409
                }
410
                if (dontthrow == 0)
411
                    script_execute(scr_itemshift, global.menucoord[1], 0);
412
            }
413
        }
414
        if (global.menuno == 3)
415
        {
416
            global.menuno = 9;
417
            script_execute(scr_itemuseb, global.menucoord[3], global.phone[global.menucoord[3]]);
418
        }
419
        if (global.menuno == 6)
420
        {
421
            global.menuno = 9;
422
            script_execute(scr_storageget, global.item[global.menucoord[6]], 300);
423
            if (noroom == 0)
424
            {
425
                script_execute(scr_writetext, 16, "x", 0, 0);
426
                script_execute(scr_itemshift, global.menucoord[6], 0);
427
            }
428
            else
429
            {
430
                script_execute(scr_writetext, 19, "x", 0, 0);
431
            }
432
        }
433
        if (global.menuno == 7)
434
        {
435
            global.menuno = 9;
436
            script_execute(scr_itemget, global.flag[global.menucoord[7] + 300]);
437
            if (noroom == 0)
438
            {
439
                script_execute(scr_writetext, 17, "x", 0, 0);
440
                scr_storageshift
scr_storageshift

global.flag[argument2 + 10] = argument1; for (i = argument0; i < 10; i += 1) global.flag[i + argument2] = global.flag[i + argument2 + 1]; script_execute(scr_itemnameb); script_execute(scr_storagename, 300);
(global.menucoord[7], 0, 300);
441
            }
442
            else
443
            {
444
                script_execute(scr_writetext, 18, "x", 0, 0);
445
            }
446
        }
447
        if (global.menuno == 1)
448
        {
449
            global.menuno = 5;
450
            global.menucoord[5] = 0;
451
        }
452
        if (global.menuno == 0)
453
            global.menuno += (global.menucoord[0] + 1);
454
        if (global.menuno == 3)
455
        {
456
            script_execute(scr_phonename);
457
            global.menucoord[3] = 0;
458
        }
459
        if (global.menuno == 1)
460
        {
461
            if (global.item[0] != 0)
462
            {
463
                global.menucoord[1] = 0;
464
                script_execute(scr_itemname);
465
            }
466
            else
467
            {
468
                global.menuno = 0;
469
            }
470
        }
471
    }
472
    if (keyboard_check_pressed(vk_up))
473
    {
474
        if (global.menuno == 0)
475
        {
476
            if (global.menucoord[0] != 0)
477
                global.menucoord[0] -= 1;
478
        }
479
        if (global.menuno == 1)
480
        {
481
            if (global.menucoord[1] != 0)
482
                global.menucoord[1] -= 1;
483
        }
484
        if (global.menuno == 3)
485
        {
486
            if (global.menucoord[3] != 0)
487
                global.menucoord[3] -= 1;
488
        }
489
        if (global.menuno == 6)
490
        {
491
            if (global.menucoord[6] != 0)
492
                global.menucoord[6] -= 1;
493
        }
494
        if (global.menuno == 7)
495
        {
496
            if (global.menucoord[7] != 0)
497
                global.menucoord[7] -= 1;
498
        }
499
    }
500
    if (keyboard_check_pressed(vk_down))
501
    {
502
        if (global.menuno == 0)
503
        {
504
            if (global.menucoord[0] != 2)
505
            {
506
                if (global.menuchoice[global.menucoord[0] + 1] != 0)
507
                    global.menucoord[0] += 1;
508
            }
509
        }
510
        if (global.menuno == 1)
511
        {
512
            if (global.menucoord[1] != 7)
513
            {
514
                if (global.item[global.menucoord[1] + 1] != 0)
515
                    global.menucoord[1] += 1;
516
            }
517
        }
518
        if (global.menuno == 3)
519
        {
520
            if (global.menucoord[3] != 7)
521
            {
522
                if (global.phone[global.menucoord[3] + 1] != 0)
523
                    global.menucoord[3] += 1;
524
            }
525
        }
526
        if (global.menuno == 6)
527
        {
528
            if (global.menucoord[6] != 7)
529
            {
530
                if (global.item[global.menucoord[6] + 1] != 0)
531
                    global.menucoord[6] += 1;
532
            }
533
        }
534
        if (global.menuno == 7)
535
        {
536
            if (global.menucoord[7] != 9)
537
            {
538
                if (global.flag[global.menucoord[7] + 301] != 0)
539
                    global.menucoord[7] += 1;
540
            }
541
        }
542
    }
543
    if (control_check_pressed(1) && buffer >= 0)
544
    {
545
        if (global.menuno == 0)
546
        {
547
            global.menuno = -1;
548
            global.interact = 0;
549
        }
550
        else if (global.menuno <= 3)
551
        {
552
            global.menuno = 0;
553
        }
554
        if (global.menuno == 5)
555
            global.menuno = 1;
556
    }
557
    if (keyboard_check_pressed(vk_right))
558
    {
559
        if (global.menuno == 5)
560
        {
561
            if (global.menucoord[5] != 2)
562
                global.menucoord[5] += 1;
563
        }
564
    }
565
    if (keyboard_check_pressed(vk_left))
566
    {
567
        if (global.menuno == 5)
568
        {
569
            if (global.menucoord[5] != 0)
570
                global.menucoord[5] -= 1;
571
        }
572
    }
573
    if (control_check_pressed(2))
574
    {
575
        if (global.menuno == 0)
576
        {
577
            global.menuno = -1;
578
            global.interact = 0;
579
        }
580
    }
581
    if (currentmenu < global.menuno && global.menuno != 9)
582
    {
583
        snd_play(snd_select);
584
    }
585
    else if (global.menuno >= 0 && global.menuno < 6)
586
    {
587
        if (currentspot != global.menucoord[global.menuno])
588
            snd_play(snd_squeak);
589
    }
590
}
591
if (global.menuno == 9 && instance_exists(obj_dialoguer) == 0)
592
{
593
    global.menuno = -1;
594
    global.interact = 0;
595
}