1 #include "store/store-key-processor.h"
2 #include "autopick/autopick-pref-processor.h"
3 #include "cmd-action/cmd-mind.h"
4 #include "cmd-action/cmd-spell.h"
5 #include "cmd-io/cmd-diary.h"
6 #include "cmd-io/cmd-dump.h"
7 #include "cmd-io/cmd-gameoption.h"
8 #include "cmd-io/cmd-help.h"
9 #include "cmd-io/cmd-knowledge.h"
10 #include "cmd-io/cmd-process-screen.h"
11 #include "cmd-item/cmd-destroy.h"
12 #include "cmd-item/cmd-item.h"
13 #include "cmd-item/cmd-magiceat.h"
14 #include "cmd-io/cmd-lore.h"
15 #include "cmd-io/cmd-macro.h"
16 #include "cmd-item/cmd-equipment.h"
17 #include "cmd-item/cmd-smith.h"
18 #include "cmd-visual/cmd-draw.h"
19 #include "cmd-visual/cmd-visuals.h"
20 #include "game-option/birth-options.h"
21 #include "game-option/input-options.h"
22 #include "io/command-repeater.h"
23 #include "io/input-key-requester.h"
24 #include "mind/mind-elementalist.h"
25 #include "mind/mind-sniper.h"
26 #include "store/home.h"
27 #include "store/museum.h"
28 #include "store/purchase-order.h"
29 #include "store/sell-order.h"
30 #include "store/store-util.h"
31 #include "store/store.h"
32 #include "system/player-type-definition.h"
33 #include "util/int-char-converter.h"
34 #include "view/display-messages.h"
35 #include "view/display-store.h"
36 #include "window/display-sub-windows.h"
38 /* Set this to leave the store */
39 bool leave_store = FALSE;
42 * @brief 店舗処理コマンド選択のメインルーチン /
43 * Process a command in a store
44 * @param client_ptr 顧客となるクリーチャーの参照ポインタ
48 * Note that we must allow the use of a few "special" commands
49 * in the stores which are not allowed in the dungeon, and we
50 * must disable some commands which are allowed in the dungeon
51 * but not in the stores, to prevent chaos.
54 void store_process_command(player_type *client_ptr)
57 if (rogue_like_commands && (command_cmd == 'l'))
60 switch (command_cmd) {
67 /* 1 ページ戻るコマンド: 我が家のページ数が多いので重宝するはず By BUG */
68 if (st_ptr->stock_num <= store_bottom) {
69 msg_print(_("これで全部です。", "Entire inventory is shown."));
71 store_top -= store_bottom;
73 store_top = ((st_ptr->stock_num - 1) / store_bottom) * store_bottom;
75 if ((cur_store_num == STORE_HOME) && (powerup_home == FALSE))
76 if (store_top >= store_bottom)
77 store_top = store_bottom;
79 display_store_inventory(client_ptr);
85 if (st_ptr->stock_num <= store_bottom) {
86 msg_print(_("これで全部です。", "Entire inventory is shown."));
88 store_top += store_bottom;
91 * 隠しオプション(powerup_home)がセットされていないときは
92 * 我が家では 2 ページまでしか表示しない
94 auto inven_max = store_get_stock_max(STORE_HOME, powerup_home);
95 if (store_top >= st_ptr->stock_num || store_top >= inven_max)
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_ELEMENTALIST)
156 do_cmd_element_browse(client_ptr);
157 else if (client_ptr->pclass == CLASS_SMITH)
158 do_cmd_kaji(client_ptr, TRUE);
159 else if (client_ptr->pclass == CLASS_MAGIC_EATER)
160 do_cmd_magic_eater(client_ptr, TRUE, FALSE);
161 else if (client_ptr->pclass == CLASS_SNIPER)
162 do_cmd_snipe_browse(client_ptr);
164 do_cmd_browse(client_ptr);
169 do_cmd_inscribe(client_ptr);
173 do_cmd_uninscribe(client_ptr);
177 do_cmd_help(client_ptr);
181 do_cmd_query_symbol(client_ptr);
185 client_ptr->town_num = old_town_num;
186 do_cmd_player_status(client_ptr);
187 client_ptr->town_num = inner_town_num;
188 display_store(client_ptr);
196 client_ptr->town_num = old_town_num;
197 do_cmd_pref(client_ptr);
198 client_ptr->town_num = inner_town_num;
202 client_ptr->town_num = old_town_num;
203 do_cmd_macros(client_ptr);
204 client_ptr->town_num = inner_town_num;
208 client_ptr->town_num = old_town_num;
209 do_cmd_visuals(client_ptr);
210 client_ptr->town_num = inner_town_num;
214 client_ptr->town_num = old_town_num;
215 do_cmd_colors(client_ptr);
216 client_ptr->town_num = inner_town_num;
220 do_cmd_options(client_ptr);
221 (void)combine_and_reorder_home(client_ptr, STORE_HOME);
222 do_cmd_redraw(client_ptr);
223 display_store(client_ptr);
235 do_cmd_feeling(client_ptr);
239 do_cmd_message_one();
247 do_cmd_diary(client_ptr);
251 do_cmd_knowledge(client_ptr);
255 do_cmd_load_screen();
259 do_cmd_save_screen(client_ptr);
263 if ((cur_store_num == STORE_MUSEUM) && (command_cmd == 'r')) {
264 museum_remove_object(client_ptr);
266 msg_print(_("そのコマンドは店の中では使えません。", "That command does not work in stores."));