Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gerson_table_Draw_0

(view raw script w/o annotations or w/e)
1
depth = 5000;
2
if (!is_interacting)
3
    exit;
4
if (global.interact == 0)
5
    global.interact = 1;
6
if (is_talking)
7
{
8
    if (!d_ex())
9
        is_talking = false;
10
    else
11
        exit;
12
}
13
else if (d_ex())
14
{
15
    exit;
16
}
17
if (menu_display_type == 0)
18
{
19
    if (shopcharx > -20)
20
        shopcharx -= 4;
21
    if (shopcharx > -40)
22
        shopcharx -= 4;
23
    if (shopcharx > -80)
24
        shopcharx -= 4;
25
    if (shopcharx <= -80)
26
        shopcharx = -80;
27
}
28
else
29
{
30
    if (shopcharx < -50)
31
        shopcharx += 4;
32
    if (shopcharx < -30)
33
        shopcharx += 4;
34
    if (shopcharx < 0)
35
        shopcharx += 4;
36
    if (shopcharx > 0)
37
        shopcharx = 0;
38
}
39
talkbuffer -= 1;
40
draw_set_color(c_black);
41
scr_shopmenu
scr_shopmenu

function
scr_shopmenu(arg0)
{ if (arg0 == 0) { if (menu == 1 || menu == 2) {
scr_darkbox_black(camerax() + 400, cameray() + minimenuy, camerax() + 640, cameray() + 255);
draw_set_color(c_white);
scr_84_set_draw_font("mainbig");
if (menuc[1] == 0) draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[0])); if (menuc[1] == 1) draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[1])); if (menuc[1] == 2) draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[2])); if (menuc[1] == 3) draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[3]));
scr_84_set_draw_font("dotumche");
if (itemtype[menuc[1]] == "weapon" || itemtype[menuc[1]] == "armor") { for (i = 0; i < 3; i += 1) { can_index = 0; facetype = spr_headkris; which = global.char[i]; if (global.char[i] == 1) facetype = spr_headkris; if (global.char[i] == 2) facetype = spr_headsusie; if (global.char[i] == 3) facetype = spr_headralsei; if (which != 0) { if (i == 0) { locx = 0; locy = 0; } if (i == 1) { locx = 100; locy = 0; } if (i == 2) { locx = 0; locy = 45; } if (canequip[menuc[1]][which] == 0) can_index = 8; draw_sprite(facetype, can_index, camerax() + 426 + locx, cameray() + minimenuy + 140 + locy); if (itemtype[menuc[1]] == "weapon" && can_index != 8) { draw_set_color(c_white); sum[0] = itematk[menuc[1]] - global.itemat[which][0]; sum[1] = itemmagic[menuc[1]] - global.itemmag[which][0]; for (j = 0; j < 2; j += 1) { dcolor = c_white; addt = ""; draw_set_color(c_white); if (sum[j] > 0) { draw_set_color(c_yellow); addt = "+"; } if (sum[j] < 0) draw_set_color(c_aqua); draw_sprite_ext(spr_shopicon, j, camerax() + 470 + locx, cameray() + minimenuy + locy + 135 + (20 * j), 1, 1, 0, dcolor, 1); draw_text(camerax() + 490 + locx, cameray() + minimenuy + locy + 135 + (20 * j), string_hash_to_newline(addt + string(sum[j]))); } } if (itemtype[menuc[1]] == "armor" && can_index != 8) { sum[0] = itemdef[menuc[1]] - global.itemdf[which][1]; sum[1] = itemdef[menuc[1]] - global.itemdf[which][2]; for (j = 0; j < 2; j += 1) { dcolor = c_white; addt = ""; draw_set_color(c_white); if (sum[j] > 0) { draw_set_color(c_yellow); addt = "+"; } if (sum[j] < 0) draw_set_color(c_aqua); draw_sprite_ext(spr_shopicon, 2 + j, camerax() + 470 + locx, cameray() + minimenuy + locy + 135 + (20 * j), 1, 1, 0, dcolor, 1); draw_text(camerax() + 490 + locx, cameray() + minimenuy + 135 + (20 * j) + locy, string_hash_to_newline(addt + string(sum[j]))); } } } } } } } if (arg0 == 4) { if (menu == 11 || menu == 15) { ...
(0);
42
if (menu_display_type == 0)
43
{
44
    
scr_darkbox_black
scr_darkbox_black

function
scr_darkbox_black(arg0, arg1, arg2, arg3)
{ draw_set_color(c_black); ossafe_fill_rectangle(arg0 + 20, arg1 + 20, arg2 - 20, arg3 - 20, false);
scr_darkbox(arg0, arg1, arg2, arg3);
}
(camerax(), cameray() + 240, camerax() + 415, cameray() + 480);
45
    
scr_darkbox_black
scr_darkbox_black

function
scr_darkbox_black(arg0, arg1, arg2, arg3)
{ draw_set_color(c_black); ossafe_fill_rectangle(arg0 + 20, arg1 + 20, arg2 - 20, arg3 - 20, false);
scr_darkbox(arg0, arg1, arg2, arg3);
}
(camerax() + 400, cameray() + 240, camerax() + 640, cameray() + 480);
46
}
47
else if (menu_display_type == 1)
48
{
49
    
scr_darkbox_black
scr_darkbox_black

function
scr_darkbox_black(arg0, arg1, arg2, arg3)
{ draw_set_color(c_black); ossafe_fill_rectangle(arg0 + 20, arg1 + 20, arg2 - 20, arg3 - 20, false);
scr_darkbox(arg0, arg1, arg2, arg3);
}
(camerax(), cameray() + 240, camerax() + 640, cameray() + 480);
50
}
51
if (menu == 0)
52
{
53
    sidemessage = 0;
54
    menuc[1] = 0;
55
    menuc[2] = 0;
56
    menuc[3] = 0;
57
    menuc[4] = 0;
58
    menu_display_type = 0;
59
    if (instance_exists(obj_writer) == false)
60
    {
61
        global.typer = 6;
62
        global.msg[0] = default_text;
63
        instance_create(camerax() + 30, cameray() + 270, obj_writer);
64
    }
65
    menumax = array_length(menu_list) - 1;
66
    draw_set_color(c_white);
67
    
scr_84_set_draw_font
scr_84_set_draw_font

function
scr_84_set_draw_font(arg0)
{ global.chemg_font = arg0; draw_set_font(
scr_84_get_font(arg0));
}
("mainbig");
68
    for (var i = 0; i < array_length(menu_list); i++)
69
        draw_text(camerax() + 480, cameray() + ((130 + (i * 20)) * 2), string_hash_to_newline(menu_list[i].option_text));
70
    draw_sprite(spr_heart, 0, camerax() + 450, cameray() + ((135 + (menuc[0] * 20)) * 2));
71
    if (button1_p() && onebuffer < 0)
72
    {
73
        onebuffer = 2;
74
        mainmessage = 1;
75
        with (obj_writer)
76
            instance_destroy();
77
        menu = menu_list[menuc[0]].menu_type;
78
        if (menu == 99)
79
        {
80
            alarm[10]
 = 1;
gml_Object_obj_gerson_table_Alarm_10.gml

is_interacting = false; sell = 0; selling = 0; sidemessage = 0; menuc[0] = 0; menuc[1] = 0; menuc[2] = 0; menuc[3] = 0; menuc[4] = 0; menu = 0; submenu = 0; global.interact = 0; instance_destroy();
81
            exit;
82
        }
83
        else
84
        {
85
            menu_list[menuc[0]].times_selected++;
86
            menu_display_type = 0;
87
            if (menu == 4 || menu == 6)
88
            {
89
                menu_talk_flag = menu_list[menuc[0]].talk_flag;
90
                menu_talk_style = menu_list[menuc[0]].talk_style;
91
                menu_display_type = 1;
92
                menu_talk_con = 0;
93
            }
94
        }
95
    }
96
}
97
if (menu == 1 || menu == 2)
98
{
99
    draw_set_color(c_white);
100
    
scr_84_set_draw_font
scr_84_set_draw_font

function
scr_84_set_draw_font(arg0)
{ global.chemg_font = arg0; draw_set_font(
scr_84_get_font(arg0));
}
("mainbig");
101
    var sold_out_text = stringsetloc(
SOLD OUT
"SOLD OUT", "obj_shop_vending_slash_Draw_0_gml_153_0"
);
102
    for (var i = 0; i < itemtotal; i += 1)
103
    {
104
        if (itemtype[i] == "key")
105
        {
106
            var sold_value = stringsetsubloc("~1 PTs", string(buyvalue[i]), "obj_shop_vending_slash_Draw_0_gml_122_0");
107
            var sold_out = false;
108
            if (
scr_keyitemcheck
scr_keyitemcheck

function
scr_keyitemcheck(arg0)
{ haveit = 0; itemcount = 0; for (i = 0; i < 12; i += 1) { if (global.keyitem[i] == arg0) haveit = 1; if (global.keyitem[i] == arg0) itemcount += 1; } return haveit; }
(item[i]))
109
                sold_out = true;
110
            if (sold_out)
111
            {
112
                draw_set_color(c_gray);
113
                sold_value = sold_out_text;
114
            }
115
            draw_text(camerax() + 60, cameray() + 260 + (i * 40), string_hash_to_newline(shopitemname[i]));
116
            draw_text(camerax() + 300, cameray() + 260 + (i * 40), string_hash_to_newline(sold_value));
117
            draw_set_color(c_white);
118
        }
119
        else if (itemtype[i] == "event")
120
        {
121
            var sold_out = false;
122
            if (array_length(sold_flag[i]) > 0)
123
            {
124
                var _flag = sold_flag[i][0];
125
                var _min_value = sold_flag[i][1];
126
                sold_out = 
scr_flag_get
scr_flag_get

function
scr_flag_get(arg0)
{ var flag_value = global.flag[arg0]; return flag_value; } function scr_flag_name_get(arg0) { if (!global.is_console) { var v = global.flagname[arg0]; return is_undefined(v) ? "*unknown flag*" : v; } else { return ""; } } function scr_getflag(arg0) { return
scr_flag_get(arg0);
}
(_flag) >= _min_value;
127
            }
128
            if (sold_out)
129
            {
130
                draw_set_color(c_gray);
131
                draw_text(camerax() + 60, cameray() + 260 + (i * 40), sold_out_text);
132
                draw_set_color(c_white);
133
            }
134
            else
135
            {
136
                draw_text(camerax() + 60, cameray() + 260 + (i * 40), string_hash_to_newline(shopitemname[i]));
137
                draw_text(camerax() + 300, cameray() + 260 + (i * 40), string_hash_to_newline(price_label[i]));
138
            }
139
        }
140
        else
141
        {
142
            draw_text(camerax() + 60, cameray() + 260 + (i * 40), string_hash_to_newline(shopitemname[i]));
143
            draw_text(camerax() + 300, cameray() + 260 + (i * 40), string_hash_to_newline(stringsetsubloc("$~1", string(buyvalue[i]), "obj_shop_vending_slash_Draw_0_gml_149_0")));
144
        }
145
    }
146
    draw_text(camerax() + 60, cameray() + 260 + (itemtotal * 40), string_hash_to_newline(stringsetloc(
Exit
"Exit", "obj_shop1_slash_Draw_0_gml_139_0"
)));
147
    if (menu == 1)
148
    {
149
        menumax = itemtotal;
150
        if (instance_exists(obj_writer) == false)
151
        {
152
            if (gerson_mode)
153
                
scr_speaker
scr_speaker

function
scr_speaker(arg0)
{ _speaker = arg0; global.typer = 5; if (global.darkzone == 1) global.typer = 6; if (global.fighting == 1) global.typer = 4; global.fc = 0; global.fe = 0; if (_speaker == "silent" && global.darkzone == 0) global.typer = 2; if (_speaker == "silent" && global.darkzone == 1) global.typer = 36; if (_speaker == "balloon" || _speaker == "enemy") global.typer = 50; if (_speaker == "sans") { global.typer = 14; global.fc = 6; } if (_speaker == "undyne" || _speaker == "und") { global.typer = 17; global.fc = 9; } if (_speaker == "temmie" || _speaker == "tem") global.typer = 21; if (_speaker == "jevil") global.typer = 35; if (_speaker == "catti") global.fc = 13; if (_speaker == "jockington" || _speaker == "joc") global.fc = 14; if (_speaker == "catty" || _speaker == "caddy") global.fc = 16; if (_speaker == "bratty" || _speaker == "bra") global.fc = 17; if (_speaker == "rouxls" || _speaker == "rou") global.fc = 18; if (_speaker == "burgerpants" || _speaker == "bur") global.fc = 19; if (_speaker == "spamton") { if (global.fighting == 0) global.typer = 66; else global.typer = 68; } if (_speaker == "sneo") global.typer = 67; if (_speaker == "gerson" || _speaker == "ger" || _speaker == "gers") global.typer = 85; if (_speaker == "susie" || _speaker == "sus") { global.fc = 1; global.typer = 10; if (global.darkzone == 1) { global.typer = 30; if (global.fighting == 1) global.typer = 47; } } if (_speaker == "ralsei" || _speaker == "ral") { global.fc = 2; global.typer = 31; if (global.fighting == 1) global.typer = 45; if (global.flag[30 ralsei_hat_state] == 1) global.typer = 6; } if (_speaker == "noelle" || _speaker == "noe") { global.fc = 3; if (global.darkzone == 0) global.typer = 12; else global.typer = 56; if (global.fighting == 1) global.typer = 59; } if (_speaker == "toriel" || _speaker == "tor") { global.fc = 4; global.typer = 7; } if (_speaker == "asgore" || _speaker == "asg") { global.fc = 10; global.typer = 18; } if (_speaker == "king" || _speaker == "kin") { global.fc = 20; global.typer = 33; if (global.chapter == 1) { if (global.plot < 235) global.typer = 36; ...
("gerson");
154
            else
155
                
scr_speaker
scr_speaker

function
scr_speaker(arg0)
{ _speaker = arg0; global.typer = 5; if (global.darkzone == 1) global.typer = 6; if (global.fighting == 1) global.typer = 4; global.fc = 0; global.fe = 0; if (_speaker == "silent" && global.darkzone == 0) global.typer = 2; if (_speaker == "silent" && global.darkzone == 1) global.typer = 36; if (_speaker == "balloon" || _speaker == "enemy") global.typer = 50; if (_speaker == "sans") { global.typer = 14; global.fc = 6; } if (_speaker == "undyne" || _speaker == "und") { global.typer = 17; global.fc = 9; } if (_speaker == "temmie" || _speaker == "tem") global.typer = 21; if (_speaker == "jevil") global.typer = 35; if (_speaker == "catti") global.fc = 13; if (_speaker == "jockington" || _speaker == "joc") global.fc = 14; if (_speaker == "catty" || _speaker == "caddy") global.fc = 16; if (_speaker == "bratty" || _speaker == "bra") global.fc = 17; if (_speaker == "rouxls" || _speaker == "rou") global.fc = 18; if (_speaker == "burgerpants" || _speaker == "bur") global.fc = 19; if (_speaker == "spamton") { if (global.fighting == 0) global.typer = 66; else global.typer = 68; } if (_speaker == "sneo") global.typer = 67; if (_speaker == "gerson" || _speaker == "ger" || _speaker == "gers") global.typer = 85; if (_speaker == "susie" || _speaker == "sus") { global.fc = 1; global.typer = 10; if (global.darkzone == 1) { global.typer = 30; if (global.fighting == 1) global.typer = 47; } } if (_speaker == "ralsei" || _speaker == "ral") { global.fc = 2; global.typer = 31; if (global.fighting == 1) global.typer = 45; if (global.flag[30 ralsei_hat_state] == 1) global.typer = 6; } if (_speaker == "noelle" || _speaker == "noe") { global.fc = 3; if (global.darkzone == 0) global.typer = 12; else global.typer = 56; if (global.fighting == 1) global.typer = 59; } if (_speaker == "toriel" || _speaker == "tor") { global.fc = 4; global.typer = 7; } if (_speaker == "asgore" || _speaker == "asg") { global.fc = 10; global.typer = 18; } if (_speaker == "king" || _speaker == "kin") { global.fc = 20; global.typer = 33; if (global.chapter == 1) { if (global.plot < 235) global.typer = 36; ...
("ralsei");
156
            msgset(0, sidemessage_list[sidemessage]);
157
            instance_create(camerax() + 450, cameray() + 260, obj_writer);
158
        }
159
        draw_sprite(spr_heart, 0, camerax() + 30, cameray() + 270 + (menuc[1] * 40));
160
        var can_buy = true;
161
        if (itemtype[menuc[1]] == "key")
162
        {
163
            if (
scr_keyitemcheck
scr_keyitemcheck

function
scr_keyitemcheck(arg0)
{ haveit = 0; itemcount = 0; for (i = 0; i < 12; i += 1) { if (global.keyitem[i] == arg0) haveit = 1; if (global.keyitem[i] == arg0) itemcount += 1; } return haveit; }
(item[menuc[1]]))
164
                can_buy = false;
165
        }
166
        else if (itemtype[menuc[1]] == "event")
167
        {
168
            if (array_length(sold_flag[menuc[1]]) > 0)
169
            {
170
                var _flag = sold_flag[menuc[1]][0];
171
                var _min_value = sold_flag[menuc[1]][1];
172
                can_buy = 
scr_flag_get
scr_flag_get

function
scr_flag_get(arg0)
{ var flag_value = global.flag[arg0]; return flag_value; } function scr_flag_name_get(arg0) { if (!global.is_console) { var v = global.flagname[arg0]; return is_undefined(v) ? "*unknown flag*" : v; } else { return ""; } } function scr_getflag(arg0) { return
scr_flag_get(arg0);
}
(_flag) < _min_value;
173
                if (!can_buy)
174
                    shopdesc[menuc[1]] = "";
175
            }
176
        }
177
        if (can_buy && button1_p() && onebuffer < 0)
178
        {
179
            menu = 2;
180
            onebuffer = 2;
181
            with (obj_writer)
182
                instance_destroy();
183
            if (menuc[1] == menumax)
184
            {
185
                alarm[10]
 = 1;
gml_Object_obj_gerson_table_Alarm_10.gml

is_interacting = false; sell = 0; selling = 0; sidemessage = 0; menuc[0] = 0; menuc[1] = 0; menuc[2] = 0; menuc[3] = 0; menuc[4] = 0; menu = 0; submenu = 0; global.interact = 0; instance_destroy();
186
                exit;
187
            }
188
        }
189
        if (button2_p() && twobuffer < 0 && onebuffer < 2)
190
        {
191
            with (obj_writer)
192
                instance_destroy();
193
            alarm[10]
 = 1;
gml_Object_obj_gerson_table_Alarm_10.gml

is_interacting = false; sell = 0; selling = 0; sidemessage = 0; menuc[0] = 0; menuc[1] = 0; menuc[2] = 0; menuc[3] = 0; menuc[4] = 0; menu = 0; submenu = 0; global.interact = 0; instance_destroy();
194
            exit;
195
        }
196
        menuc[2] = 0;
197
    }
198
    if (menu == 2)
199
    {
200
        menumax = 1;
201
        draw_set_color(c_white);
202
        
scr_84_set_draw_font
scr_84_set_draw_font

function
scr_84_set_draw_font(arg0)
{ global.chemg_font = arg0; draw_set_font(
scr_84_get_font(arg0));
}
("mainbig");
203
        var y1_off = langopt(260, 290);
204
        var y2_off = langopt(290, 260);
205
        draw_text(camerax() + 460, cameray() + y1_off, string_hash_to_newline(stringsetloc(
Buy it for
"Buy it for", "obj_shop_vending_slash_Draw_0_gml_223_0"
)));
206
        draw_text(camerax() + 460, cameray() + y2_off, string_hash_to_newline(stringsetsubloc("$~1 ?", string(buyvalue[menuc[1]]), "obj_shop_vending_slash_Draw_0_gml_196_0")));
207
        draw_text(camerax() + 480, cameray() + 340, string_hash_to_newline(stringsetloc(
Yes
"Yes", "obj_shop_vending_slash_Draw_0_gml_225_0"
)));
208
        draw_text(camerax() + 480, cameray() + 370, string_hash_to_newline(stringsetloc(
No
"No", "obj_shop_vending_slash_Draw_0_gml_226_0"
)));
209
        draw_sprite(spr_heart, 0, camerax() + 450, cameray() + 350 + (menuc[2] * 30));
210
        if (button2_p() && twobuffer < 0)
211
        {
212
            menu = 1;
213
            sidemessage = 0;
214
            twobuffer = 2;
215
            onebuffer = 2;
216
        }
217
        if (button1_p() && onebuffer < 0 && twobuffer < 0)
218
        {
219
            if (menuc[2] == 0)
220
            {
221
                if (itemtype[menuc[1]] == "event")
222
                {
223
                    if (button1_p() && onebuffer < 0)
224
                    {
225
                        event_active = true;
226
                        sidemessage = 0;
227
                        menu = 1;
228
                        exit;
229
                    }
230
                }
231
                else
232
                {
233
                    afford = 0;
234
                    if (menu_dollar)
235
                    {
236
                        if (global.gold >= buyvalue[menuc[1]])
237
                            afford = 1;
238
                    }
239
                    else if (global.flag[1044 points] >= buyvalue[menuc[1]])
240
                    {
241
                        afford = 1;
242
                    }
243
                    if (afford == 1)
244
                    {
245
                        _pocketed = 0;
246
                        if (itemtype[menuc[1]] == "item")
247
                            
scr_itemget
scr_itemget

function
scr_itemget(arg0)
{ var __i = 0; var loop = 1; noroom = 0; _pocketed = 0; _noroominventory = 0; global.item[12] = 999; while (loop == 1) { if (global.item[__i] == 0) { global.item[__i] = arg0; break; } if (__i == 12) { _noroominventory = 1; noroom = 1; for (var __j = 0; __j < global.flag[64 storage_size]; __j++) { if (global.pocketitem[__j] == 0) { debug_message("Placed in pocket :" + string(__j)); global.pocketitem[__j] = arg0; _pocketed = 1; noroom = 0; break; } } break; } __i += 1; } script_execute(scr_iteminfo_all); debug_message("noroom=" + string(noroom)); debug_message("_pocketed=" + string(_pocketed)); debug_message("_noroominventory=" + string(_noroominventory)); }
(item[menuc[1]]);
248
                        if (itemtype[menuc[1]] == "weapon")
249
                            
scr_weaponget
scr_weaponget

function
scr_weaponget(arg0)
{ noroom = 0; var legacy = 0; var __i = 0; if (legacy == 0) { var __itemcount = 0; __weapon[0] = arg0; for (__i = 0; __i < 48; __i++) { if (global.weapon[__i] != 0) { __weapon[__itemcount + 1] = global.weapon[__i]; __itemcount++; } } if (__itemcount >= 48) { noroom = 1; } else { for (__i = 0; __i < 48; __i++) { if (__i <= __itemcount) global.weapon[__i] = __weapon[__i]; else global.weapon[__i] = 0; } } } else if (legacy) { loop = 1; global.weapon[48] = 999; while (loop == 1) { if (global.weapon[__i] == 0) { global.weapon[__i] = arg0; break; } if (__i == 48) { noroom = 1; break; } __i += 1; } } script_execute(scr_weaponinfo_all); }
(item[menuc[1]]);
250
                        if (itemtype[menuc[1]] == "armor")
251
                            
scr_armorget
scr_armorget

function
scr_armorget(arg0)
{ noroom = 0; var legacy = 0; var __i = 0; if (legacy == 0) { var __itemcount = 0; __armor[0] = arg0; for (__i = 0; __i < 48; __i++) { if (global.armor[__i] != 0) { __armor[__itemcount + 1] = global.armor[__i]; __itemcount++; } } if (__itemcount >= 48) { noroom = 1; } else { for (__i = 0; __i < 48; __i++) { if (__i <= __itemcount) global.armor[__i] = __armor[__i]; else global.armor[__i] = 0; } } } else if (legacy) { loop = 1; global.armor[48] = 999; while (loop == 1) { if (global.armor[__i] == 0) { global.armor[__i] = arg0; break; } if (__i == 48) { noroom = 1; break; } __i += 1; } } script_execute(scr_armorinfo_all); }
(item[menuc[1]]);
252
                        if (itemtype[menuc[1]] == "key")
253
                            
scr_keyitemget
scr_keyitemget

function
scr_keyitemget(arg0)
{ i = 0; loop = 1; noroom = 0; global.item[12] = 999; while (loop == 1) { if (global.keyitem[i] == 0) { global.keyitem[i] = arg0; break; } if (i == 12) { noroom = 1; break; } i += 1; } script_execute(scr_keyiteminfo_all); }
(item[menuc[1]]);
254
                        if (menu_dollar)
255
                        {
256
                            if (noroom == 0)
257
                            {
258
                                global.gold -= buyvalue[menuc[1]];
259
                                snd_play(snd_locker);
260
                                if (_pocketed == 1)
261
                                    sidemessage = 4;
262
                                else
263
                                    sidemessage = 1;
264
                            }
265
                        }
266
                        else if (noroom == 0)
267
                        {
268
                            global.flag[1044 points] -= buyvalue[menuc[1]];
269
                            snd_play(snd_locker);
270
                            if (_pocketed == 1)
271
                                sidemessage = 4;
272
                            else
273
                                sidemessage = 1;
274
                        }
275
                        if (noroom == 1)
276
                            sidemessage = 3;
277
                    }
278
                    else
279
                    {
280
                        sidemessage = 2;
281
                    }
282
                }
283
            }
284
            if (menuc[2] == 1)
285
                sidemessage = 0;
286
            menu = 1;
287
        }
288
    }
289
    if (menuc[1] != itemtotal)
290
    {
291
        if (minimenuy <= 20)
292
            minimenuy = 20;
293
        if (minimenuy > 20)
294
            minimenuy -= 5;
295
        if (minimenuy > 50)
296
            minimenuy -= 5;
297
        if (minimenuy > 100)
298
            minimenuy -= 8;
299
        if (minimenuy > 150)
300
            minimenuy -= 10;
301
        if (itemtype[menuc[1]] == "event")
302
        {
303
            if (array_length(sold_flag[menuc[1]]) > 0)
304
            {
305
                var _flag = sold_flag[menuc[1]][0];
306
                var _min_value = sold_flag[menuc[1]][1];
307
                var can_buy = 
scr_flag_get
scr_flag_get

function
scr_flag_get(arg0)
{ var flag_value = global.flag[arg0]; return flag_value; } function scr_flag_name_get(arg0) { if (!global.is_console) { var v = global.flagname[arg0]; return is_undefined(v) ? "*unknown flag*" : v; } else { return ""; } } function scr_getflag(arg0) { return
scr_flag_get(arg0);
}
(_flag) < _min_value;
308
                if (!can_buy)
309
                {
310
                    if (minimenuy < 200)
311
                        minimenuy += 40;
312
                    if (minimenuy >= 200)
313
                        minimenuy = 200;
314
                }
315
            }
316
        }
317
    }
318
    else
319
    {
320
        if (minimenuy < 200)
321
            minimenuy += 40;
322
        if (minimenuy >= 200)
323
            minimenuy = 200;
324
    }
325
}
326
if (menu == 4 || menu == 6)
327
{
328
    if (instance_exists(obj_writer) == false && menu_talk_con == 0)
329
    {
330
        talk_counter = menu_list[menuc[0]].times_selected;
331
        event_user(2);
332
        if (menu_talk_style == 1)
333
            d_make();
334
        else if (menu_talk_style == 2)
335
            alarm[10]
 = 1;
gml_Object_obj_gerson_table_Alarm_10.gml

is_interacting = false; sell = 0; selling = 0; sidemessage = 0; menuc[0] = 0; menuc[1] = 0; menuc[2] = 0; menuc[3] = 0; menuc[4] = 0; menu = 0; submenu = 0; global.interact = 0; instance_destroy();
336
        else
337
            instance_create(camerax() + 30, cameray() + 270, obj_writer);
338
        is_talking = true;
339
        menu_talk_con = 1;
340
    }
341
    if (menu_talk_con == 1 && instance_exists(obj_writer) == false)
342
    {
343
        if (event_active)
344
        {
345
            event_active = false;
346
            event_con = 0;
347
        }
348
        if (menu == 4)
349
        {
350
            menu = 0;
351
            menu_talk_con = 0;
352
        }
353
        if (menu == 6)
354
        {
355
            menu_display_type = 99;
356
            if (!d_ex())
357
            {
358
                menu = 0;
359
                menu_talk_con = 0;
360
                alarm[10]
 = 1;
gml_Object_obj_gerson_table_Alarm_10.gml

is_interacting = false; sell = 0; selling = 0; sidemessage = 0; menuc[0] = 0; menuc[1] = 0; menuc[2] = 0; menuc[3] = 0; menuc[4] = 0; menu = 0; submenu = 0; global.interact = 0; instance_destroy();
361
                exit;
362
            }
363
        }
364
    }
365
}
366
scr_shopmenu
scr_shopmenu

function
scr_shopmenu(arg0)
{ if (arg0 == 0) { if (menu == 1 || menu == 2) {
scr_darkbox_black(camerax() + 400, cameray() + minimenuy, camerax() + 640, cameray() + 255);
draw_set_color(c_white);
scr_84_set_draw_font("mainbig");
if (menuc[1] == 0) draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[0])); if (menuc[1] == 1) draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[1])); if (menuc[1] == 2) draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[2])); if (menuc[1] == 3) draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[3]));
scr_84_set_draw_font("dotumche");
if (itemtype[menuc[1]] == "weapon" || itemtype[menuc[1]] == "armor") { for (i = 0; i < 3; i += 1) { can_index = 0; facetype = spr_headkris; which = global.char[i]; if (global.char[i] == 1) facetype = spr_headkris; if (global.char[i] == 2) facetype = spr_headsusie; if (global.char[i] == 3) facetype = spr_headralsei; if (which != 0) { if (i == 0) { locx = 0; locy = 0; } if (i == 1) { locx = 100; locy = 0; } if (i == 2) { locx = 0; locy = 45; } if (canequip[menuc[1]][which] == 0) can_index = 8; draw_sprite(facetype, can_index, camerax() + 426 + locx, cameray() + minimenuy + 140 + locy); if (itemtype[menuc[1]] == "weapon" && can_index != 8) { draw_set_color(c_white); sum[0] = itematk[menuc[1]] - global.itemat[which][0]; sum[1] = itemmagic[menuc[1]] - global.itemmag[which][0]; for (j = 0; j < 2; j += 1) { dcolor = c_white; addt = ""; draw_set_color(c_white); if (sum[j] > 0) { draw_set_color(c_yellow); addt = "+"; } if (sum[j] < 0) draw_set_color(c_aqua); draw_sprite_ext(spr_shopicon, j, camerax() + 470 + locx, cameray() + minimenuy + locy + 135 + (20 * j), 1, 1, 0, dcolor, 1); draw_text(camerax() + 490 + locx, cameray() + minimenuy + locy + 135 + (20 * j), string_hash_to_newline(addt + string(sum[j]))); } } if (itemtype[menuc[1]] == "armor" && can_index != 8) { sum[0] = itemdef[menuc[1]] - global.itemdf[which][1]; sum[1] = itemdef[menuc[1]] - global.itemdf[which][2]; for (j = 0; j < 2; j += 1) { dcolor = c_white; addt = ""; draw_set_color(c_white); if (sum[j] > 0) { draw_set_color(c_yellow); addt = "+"; } if (sum[j] < 0) draw_set_color(c_aqua); draw_sprite_ext(spr_shopicon, 2 + j, camerax() + 470 + locx, cameray() + minimenuy + locy + 135 + (20 * j), 1, 1, 0, dcolor, 1); draw_text(camerax() + 490 + locx, cameray() + minimenuy + 135 + (20 * j) + locy, string_hash_to_newline(addt + string(sum[j]))); } } } } } } } if (arg0 == 4) { if (menu == 11 || menu == 15) { ...
(4);
367
scr_shopmenu
scr_shopmenu

function
scr_shopmenu(arg0)
{ if (arg0 == 0) { if (menu == 1 || menu == 2) {
scr_darkbox_black(camerax() + 400, cameray() + minimenuy, camerax() + 640, cameray() + 255);
draw_set_color(c_white);
scr_84_set_draw_font("mainbig");
if (menuc[1] == 0) draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[0])); if (menuc[1] == 1) draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[1])); if (menuc[1] == 2) draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[2])); if (menuc[1] == 3) draw_text(camerax() + 440, cameray() + minimenuy + 28, string_hash_to_newline(shopdesc[3]));
scr_84_set_draw_font("dotumche");
if (itemtype[menuc[1]] == "weapon" || itemtype[menuc[1]] == "armor") { for (i = 0; i < 3; i += 1) { can_index = 0; facetype = spr_headkris; which = global.char[i]; if (global.char[i] == 1) facetype = spr_headkris; if (global.char[i] == 2) facetype = spr_headsusie; if (global.char[i] == 3) facetype = spr_headralsei; if (which != 0) { if (i == 0) { locx = 0; locy = 0; } if (i == 1) { locx = 100; locy = 0; } if (i == 2) { locx = 0; locy = 45; } if (canequip[menuc[1]][which] == 0) can_index = 8; draw_sprite(facetype, can_index, camerax() + 426 + locx, cameray() + minimenuy + 140 + locy); if (itemtype[menuc[1]] == "weapon" && can_index != 8) { draw_set_color(c_white); sum[0] = itematk[menuc[1]] - global.itemat[which][0]; sum[1] = itemmagic[menuc[1]] - global.itemmag[which][0]; for (j = 0; j < 2; j += 1) { dcolor = c_white; addt = ""; draw_set_color(c_white); if (sum[j] > 0) { draw_set_color(c_yellow); addt = "+"; } if (sum[j] < 0) draw_set_color(c_aqua); draw_sprite_ext(spr_shopicon, j, camerax() + 470 + locx, cameray() + minimenuy + locy + 135 + (20 * j), 1, 1, 0, dcolor, 1); draw_text(camerax() + 490 + locx, cameray() + minimenuy + locy + 135 + (20 * j), string_hash_to_newline(addt + string(sum[j]))); } } if (itemtype[menuc[1]] == "armor" && can_index != 8) { sum[0] = itemdef[menuc[1]] - global.itemdf[which][1]; sum[1] = itemdef[menuc[1]] - global.itemdf[which][2]; for (j = 0; j < 2; j += 1) { dcolor = c_white; addt = ""; draw_set_color(c_white); if (sum[j] > 0) { draw_set_color(c_yellow); addt = "+"; } if (sum[j] < 0) draw_set_color(c_aqua); draw_sprite_ext(spr_shopicon, 2 + j, camerax() + 470 + locx, cameray() + minimenuy + locy + 135 + (20 * j), 1, 1, 0, dcolor, 1); draw_text(camerax() + 490 + locx, cameray() + minimenuy + 135 + (20 * j) + locy, string_hash_to_newline(addt + string(sum[j]))); } } } } } } } if (arg0 == 4) { if (menu == 11 || menu == 15) { ...
(5);
368
if (down_p())
369
{
370
    if (menu != 11 && menu != 12 && menu != 13)
371
    {
372
        menuc[menu] += 1;
373
        if (menuc[menu] > menumax)
374
            menuc[menu] = 0;
375
    }
376
}
377
if (up_p())
378
{
379
    if (menu != 11 && menu != 12 && menu != 13)
380
    {
381
        menuc[menu] -= 1;
382
        if (menuc[menu] < 0)
383
            menuc[menu] = menumax;
384
    }
385
}
386
if (menu < itemtotal || menu >= 10)
387
{
388
    if (menu >= 10 && menu < 18)
389
        draw_text(camerax() + 440, cameray() + 420, "$" + string_hash_to_newline(string(global.gold)));
390
    else
391
        draw_text(camerax() + 440, cameray() + 420, string_hash_to_newline("$" + string(global.gold)));
392
    if (itemtype[menuc[1]] != "key" && itemtype[menuc[1]] != "event")
393
    {
394
        if (menu == 1 || menu == 2)
395
        {
396
            if (menuc[1] < itemtotal)
397
            {
398
                var item_index = menuc[1];
399
                
scr_shop_space_display
scr_shop_space_display

function
scr_shop_space_display(arg0, arg1 = 545, arg2 = 398)
{ var item_id = item[arg0]; var __cx = camerax(); var __cy = cameray(); if (itemtype[arg0] == "item") {
scr_itemcheck(0);
var inventory_space = 12 - itemcount; var inventory_amount = "00"; if (inventory_space < 10) inventory_amount = "0" + string(inventory_space); else inventory_amount = string(inventory_space); var y_offset = (global.lang == "ja") ? 4 : 0; var base_y_pos = __cy + arg2 + y_offset; var line_height = 12; draw_sprite_ext(
scr_84_get_sprite("spr_shop_space_ui"), 0, __cx + arg1, base_y_pos, 1, 1, 0, c_white, 1);
draw_set_font(fnt_8bit); draw_text_ext_transformed(__cx + arg1 + 1, base_y_pos + line_height + 4, inventory_amount + "/12", 1, 999, 0.5, 0.5, 0); draw_set_font(fnt_main); draw_sprite_ext(
scr_84_get_sprite("spr_shop_space_ui"), 2, __cx + arg1, base_y_pos + (line_height * 2) + 8, 1, 1, 0, c_white, 1);
scr_itemcheck_pocket(0);
var storage_space = global.flag[64 storage_size] - itemcount; var storage_amount = "00"; if (storage_space < 10) storage_amount = "0" + string(storage_space); else storage_amount = string(storage_space); draw_set_font(fnt_8bit); draw_text_ext_transformed(__cx + arg1 + 1, base_y_pos + (line_height * 3) + 12, storage_amount + "/" + string(global.flag[64 storage_size]), 1, 999, 0.5, 0.5, 0); draw_set_font(fnt_main); } else { var inventory_space = 0; if (itemtype[arg0] == "weapon") {
scr_weaponcheck_inventory(0);
inventory_space = 48 - itemcount; } else {
scr_armorcheck_inventory(0);
inventory_space = 48 - itemcount; } var inventory_amount = "00"; if (inventory_space < 10) inventory_amount = "0" + string(inventory_space); else inventory_amount = string(inventory_space); var base_y_pos = (__cy + arg2 + 20) - 8; var line_height = 12; var header_index = (itemtype[arg0] == "weapon") ? 3 : 4; var header_y_pos = langopt(base_y_pos, base_y_pos + line_height); draw_sprite_ext(
scr_84_get_sprite("spr_shop_space_ui"), header_index, __cx + arg1, header_y_pos, 1, 1, 0, c_white, 1);
var inventory_y_pos = langopt(base_y_pos + line_height, base_y_pos); var inventory_index = (global.lang == "ja") ? 1 : 0; draw_sprite_ext(
scr_84_get_sprite("spr_shop_space_ui"), inventory_index, __cx + arg1, inventory_y_pos, 1, 1, 0, c_white, 1);
draw_set_font(fnt_8bit); draw_text_ext_transformed(__cx + arg1 + 1, base_y_pos + (line_height * 2) + 4, inventory_amount + "/48", 1, 999, 0.5, 0.5, 0); draw_set_font(fnt_main); } } function scr_shopspace_displaybox(arg0 = "item", arg1 = 413, arg2 = 161, arg3 = true, arg4 = false) { var cx = camerax(); var cy = cameray(); var xpos = cx + (arg1 - 8); var ypos = cy + (arg2 - 8); var wid = 211; var hei = 97; if (arg3) { draw_sprite_ext(spr_pxwhite, 0, xpos + 18, ypos + 18, wid - 36, hei - 36, 0, c_black, 1);
scr_darkbox(xpos, ypos, xpos + wid, ypos + hei);
if (arg4) draw_sprite_ext(spr_pxwhite, 0, xpos + 22, (ypos - 2) + 8, 168, 2, 0, #9DA2C4, 1); } draw_set_color(c_white); draw_set_font(fnt_mainbig); draw_text(xpos + 39 + 8, ypos + 24 + 8, "$" + string(global.gold)); item = [0]; itemtype = [arg0];
scr_shop_space_display(0, (xpos - cx) + 131, (ypos - cy) + 21);
}
(item_index);
400
            }
401
        }
402
    }
403
}
404
onebuffer -= 1;
405
twobuffer -= 1;