1 #include "io/store-key-processor.h"
2 #include "autopick/autopick-pref-processor.h"
3 #include "cmd-action/cmd-spell.h"
4 #include "cmd-io/cmd-diary.h"
5 #include "cmd-io/cmd-dump.h"
6 #include "cmd-io/cmd-gameoption.h"
7 #include "cmd-io/cmd-help.h"
8 #include "cmd-io/cmd-knowledge.h"
9 #include "cmd-io/cmd-process-screen.h"
10 #include "cmd-item/cmd-item.h"
11 #include "cmd-item/cmd-magiceat.h"
12 #include "cmd-io/cmd-lore.h"
13 #include "cmd-io/cmd-macro.h"
14 #include "cmd-item/cmd-smith.h"
15 #include "cmd-visual/cmd-draw.h"
16 #include "cmd-visual/cmd-visuals.h"
17 #include "game-option/birth-options.h"
18 #include "game-option/input-options.h"
19 #include "io/command-repeater.h"
20 #include "io/input-key-requester.h"
21 #include "mind/mind-sniper.h"
22 #include "mind/mind.h"
23 #include "store/home.h"
24 #include "store/museum.h"
25 #include "store/purchase-order.h"
26 #include "store/sell-order.h"
27 #include "store/store-util.h"
28 #include "store/store.h"
29 #include "util/int-char-converter.h"
30 #include "view/display-messages.h"
31 #include "view/display-store.h"
32 #include "window/display-sub-windows.h"
34 /* Set this to leave the store */
35 bool leave_store = FALSE;
38 * @brief 店舗処理コマンド選択のメインルーチン /
39 * Process a command in a store
40 * @param client_ptr 顧客となるクリーチャーの参照ポインタ
44 * Note that we must allow the use of a few "special" commands
45 * in the stores which are not allowed in the dungeon, and we
46 * must disable some commands which are allowed in the dungeon
47 * but not in the stores, to prevent chaos.
50 void store_process_command(player_type *client_ptr)
53 if (rogue_like_commands && (command_cmd == 'l'))
56 switch (command_cmd) {
63 /* 1 ページ戻るコマンド: 我が家のページ数が多いので重宝するはず By BUG */
64 if (st_ptr->stock_num <= store_bottom) {
65 msg_print(_("これで全部です。", "Entire inventory is shown."));
67 store_top -= store_bottom;
69 store_top = ((st_ptr->stock_num - 1) / store_bottom) * store_bottom;
71 if ((cur_store_num == STORE_HOME) && (powerup_home == FALSE))
72 if (store_top >= store_bottom)
73 store_top = store_bottom;
75 display_store_inventory(client_ptr);
81 if (st_ptr->stock_num <= store_bottom) {
82 msg_print(_("これで全部です。", "Entire inventory is shown."));
84 store_top += store_bottom;
86 * 隠しオプション(powerup_home)がセットされていないときは
87 * 我が家では 2 ページまでしか表示しない
89 if ((cur_store_num == STORE_HOME) && (powerup_home == FALSE) && (st_ptr->stock_num >= STORE_INVEN_MAX)) {
90 if (store_top >= (STORE_INVEN_MAX - 1)) {
94 if (store_top >= st_ptr->stock_num)
98 display_store_inventory(client_ptr);
104 do_cmd_redraw(client_ptr);
105 display_store(client_ptr);
109 store_purchase(client_ptr);
113 store_sell(client_ptr);
117 store_examine(client_ptr);
124 do_cmd_wield(client_ptr);
128 do_cmd_takeoff(client_ptr);
132 do_cmd_destroy(client_ptr);
136 do_cmd_equip(client_ptr);
140 do_cmd_inven(client_ptr);
144 do_cmd_observe(client_ptr);
148 toggle_inventory_equipment(client_ptr);
152 if ((client_ptr->pclass == CLASS_MINDCRAFTER) || (client_ptr->pclass == CLASS_BERSERKER) || (client_ptr->pclass == CLASS_NINJA)
153 || (client_ptr->pclass == CLASS_MIRROR_MASTER))
154 do_cmd_mind_browse(client_ptr);
155 else if (client_ptr->pclass == CLASS_SMITH)
156 do_cmd_kaji(client_ptr, TRUE);
157 else if (client_ptr->pclass == CLASS_MAGIC_EATER)
158 do_cmd_magic_eater(client_ptr, TRUE, FALSE);
159 else if (client_ptr->pclass == CLASS_SNIPER)
160 do_cmd_snipe_browse(client_ptr);
162 do_cmd_browse(client_ptr);
167 do_cmd_inscribe(client_ptr);
171 do_cmd_uninscribe(client_ptr);
175 do_cmd_help(client_ptr);
179 do_cmd_query_symbol(client_ptr);
183 client_ptr->town_num = old_town_num;
184 do_cmd_player_status(client_ptr);
185 client_ptr->town_num = inner_town_num;
186 display_store(client_ptr);
194 client_ptr->town_num = old_town_num;
195 do_cmd_pref(client_ptr);
196 client_ptr->town_num = inner_town_num;
200 client_ptr->town_num = old_town_num;
201 do_cmd_macros(client_ptr, process_autopick_file_command);
202 client_ptr->town_num = inner_town_num;
206 client_ptr->town_num = old_town_num;
207 do_cmd_visuals(client_ptr, process_autopick_file_command);
208 client_ptr->town_num = inner_town_num;
212 client_ptr->town_num = old_town_num;
213 do_cmd_colors(client_ptr, process_autopick_file_command);
214 client_ptr->town_num = inner_town_num;
218 do_cmd_options(client_ptr);
219 (void)combine_and_reorder_home(client_ptr, STORE_HOME);
220 do_cmd_redraw(client_ptr);
221 display_store(client_ptr);
233 do_cmd_feeling(client_ptr);
237 do_cmd_message_one();
245 do_cmd_diary(client_ptr);
249 do_cmd_knowledge(client_ptr);
253 do_cmd_load_screen();
257 do_cmd_save_screen(client_ptr, process_autopick_file_command);
261 if ((cur_store_num == STORE_MUSEUM) && (command_cmd == 'r')) {
262 museum_remove_object(client_ptr);
264 msg_print(_("そのコマンドは店の中では使えません。", "That command does not work in stores."));