1 |
var main_shop_screen_number = global.main_shop_screen_number |
2 |
var buy_shop_screen_number = global.buy_shop_screen_number |
3 |
script_execute(gml_Script_scr_controls_shop_buy) |
4 |
if key_select |
5 |
{ |
6 |
if (buy_shop_screen_number < 5) |
7 |
{ |
8 |
if (main_shop_screen_number == 1) |
9 |
{ |
10 |
var selected_item = global.shop_item[buy_shop_screen_number] |
11 |
if (scr_determine_item_stealablescr_determine_item_stealablefunction scr_determine_item_stealable() //gml_Script_scr_determine_item_stealable
{
var selection = argument[0]
switch selection
{
case "Wild Revolver":
case "Silver Ammo":
case "Fancy Holster":
case "Honeydew Pin":
if ds_list_empty(global.steal_list)
return true;
for (var i = 0; i < ds_list_size(global.steal_list); i++)
{
if (ds_list_find_value(global.steal_list, i) == selection)
return false;
else if (i == (ds_list_size(global.steal_list) - 1))
return true;
}
break
default:
return true;
}
} (selected_item) == false || global.item_stock[global.shop_stock[buy_shop_screen_number]] <= 0) |
12 |
{ |
13 |
audio_play_sound(snd_fail, 1, 0) |
14 |
return; |
15 |
} |
16 |
audio_play_sound(snd_confirm, 1, 0) |
17 |
instance_create(0, 0, obj_text_buy_confirmation_shop_geno) |
18 |
instance_create((obj_main_screen_shop.x + 229), (obj_main_screen_shop.y + 59), obj_heart_player_response_shop_geno) |
19 |
event_user(0) |
20 |
return; |
21 |
} |
22 |
else if (main_shop_screen_number == 3) |
23 |
{ |
24 |
instance_create(0, 120, obj_talk_screen_shop) |
25 |
instance_create(0, 0, obj_dialogue_talk_shop) |
26 |
event_user(1) |
27 |
event_user(0) |
28 |
return; |
29 |
} |
30 |
} |
31 |
else if (buy_shop_screen_number == 5) |
32 |
{ |
33 |
event_user(2) |
34 |
event_user(0) |
35 |
return; |
36 |
} |
37 |
} |
38 |
if (key_revert && key_select == 0) |
39 |
{ |
40 |
event_user(2) |
41 |
event_user(0) |
42 |
return; |
43 |
} |
44 |
if (key_select == 0 && key_revert == 0) |
45 |
{ |
46 |
if (key_down && key_up == 0) |
47 |
{ |
48 |
audio_play_sound(snd_mainmenu_select, 1, 0) |
49 |
if (buy_shop_screen_number == item_max_count) |
50 |
{ |
51 |
global.buy_shop_screen_number = 5 |
52 |
buy_shop_screen_number = global.buy_shop_screen_number |
53 |
} |
54 |
else if (buy_shop_screen_number == 5) |
55 |
{ |
56 |
global.buy_shop_screen_number = 1 |
57 |
buy_shop_screen_number = global.buy_shop_screen_number |
58 |
} |
59 |
else |
60 |
global.buy_shop_screen_number += 1 |
61 |
} |
62 |
if (key_up && key_down == 0) |
63 |
{ |
64 |
audio_play_sound(snd_mainmenu_select, 1, 0) |
65 |
if (buy_shop_screen_number == 1) |
66 |
{ |
67 |
global.buy_shop_screen_number = 5 |
68 |
buy_shop_screen_number = global.buy_shop_screen_number |
69 |
} |
70 |
else if (buy_shop_screen_number == 5) |
71 |
{ |
72 |
global.buy_shop_screen_number = item_max_count |
73 |
buy_shop_screen_number = global.buy_shop_screen_number |
74 |
} |
75 |
else |
76 |
global.buy_shop_screen_number -= 1 |
77 |
} |
78 |
} |
79 |
buy_shop_screen_number = global.buy_shop_screen_number |
80 |
if (buy_shop_screen_number == 1) |
81 |
{ |
82 |
x = obj_main_screen_shop.x + 19 |
83 |
y = obj_main_screen_shop.y + 19 |
84 |
} |
85 |
else if (buy_shop_screen_number == 2) |
86 |
{ |
87 |
x = obj_main_screen_shop.x + 19 |
88 |
y = obj_main_screen_shop.y + 39 |
89 |
} |
90 |
else if (buy_shop_screen_number == 3) |
91 |
{ |
92 |
x = obj_main_screen_shop.x + 19 |
93 |
y = obj_main_screen_shop.y + 59 |
94 |
} |
95 |
else if (buy_shop_screen_number == 4) |
96 |
{ |
97 |
x = obj_main_screen_shop.x + 19 |
98 |
y = obj_main_screen_shop.y + 79 |
99 |
} |
100 |
else if (buy_shop_screen_number == 5) |
101 |
{ |
102 |
x = obj_main_screen_shop.x + 19 |
103 |
y = obj_main_screen_shop.y + 99 |
104 |
} |