5 * @details 通常のコマンドではないのでcmd-xxx/ ではなくwizard/ 以下に置く
8 #include "wizard/cmd-wizard.h"
9 #include "birth/inventory-initializer.h"
10 #include "cmd-io/cmd-help.h"
11 #include "core/asking-player.h"
12 #include "inventory/inventory-object.h"
13 #include "inventory/inventory-slot-types.h"
14 #include "io/input-key-requester.h"
15 #include "mutation/mutation-investor-remover.h"
16 #include "player/patron.h"
17 #include "spell-kind/spells-detection.h"
18 #include "spell-kind/spells-floor.h"
19 #include "spell-kind/spells-perception.h"
20 #include "spell-kind/spells-sight.h"
21 #include "spell-kind/spells-teleport.h"
22 #include "spell/spells-status.h"
23 #include "status/experience.h"
24 #include "system/floor-type-definition.h"
25 #include "system/grid-type-definition.h"
26 #include "system/object-type-definition.h"
27 #include "system/player-type-definition.h"
28 #include "term/screen-processor.h"
29 #include "util/int-char-converter.h"
30 #include "view/display-messages.h"
31 #include "wizard/wizard-game-modifier.h"
32 #include "wizard/wizard-item-modifier.h"
33 #include "wizard/wizard-player-modifier.h"
34 #include "wizard/wizard-special-process.h"
35 #include "wizard/wizard-spells.h"
36 #include "wizard/wizard-spoiler.h"
44 * 空き: A,B,E,I,J,k,K,L,M,q,Q,R,T,U,V,W,y,Y
46 std::vector<std::vector<std::string>> debug_menu_table = {
47 { "a", _("全状態回復", "Restore all status") },
48 { "b", _("現在のターゲットを引き寄せる", "Teleport target back") },
49 { "c", _("オブジェクト生成", "Create object") },
50 { "C", _("固定アーティファクト生成", "Create fixed artifact") },
51 { "d", _("全感知", "Detection all") },
52 { "D", _("次元の扉", "Dimension door") },
53 { "e", _("能力値変更", "Modify player status") },
54 { "E", _("青魔法を全取得", "Make all blue magic learned") },
55 { "f", _("*鑑定*", "*Idenfity*") },
56 { "F", _("地形ID変更", "Modify feature type under player") },
57 { "G", _("ゲーム設定コマンドメニュー", "Modify game configurations") },
58 { "H", _("モンスターの群れ生成", "Summon monsters") },
59 { "i", _("鑑定", "Idenfity") },
60 { "I", _("アイテム設定コマンドメニュー", "Modify item configurations") },
61 { "j", _("指定ダンジョン階にワープ", "Jump to floor depth of target dungeon") },
62 { "k", _("指定ダメージ・半径0の指定属性のボールを自分に放つ", "Fire a zero ball to self") },
63 { "m", _("魔法の地図", "Magic mapping") },
64 { "n", _("指定モンスター生成", "Summon target monster") },
65 { "N", _("指定モンスターをペットとして生成", "Summon target monster as pet") },
66 { "o", _("オブジェクトの能力変更", "Modift object abilities") },
67 { "O", _("オプション設定をダンプ", "Dump current options") },
68 { "p", _("ショート・テレポート", "Phase door") },
69 { "P", _("プレイヤー設定変更メニュー", "Modify player configurations") },
70 { "r", _("カオスパトロンの報酬", "Get reward of chaos patron") },
71 { "s", _("フロア相当のモンスター召喚", "Summon monster which be in target depth") },
72 { "t", _("テレポート", "Teleport self") },
73 { "u", _("啓蒙(忍者以外)", "Wiz-lite all floor except Ninja") },
74 { "w", _("啓蒙(忍者配慮)", "Wiz-lite all floor") },
75 { "x", _("経験値を得る(指定可)", "Get experience") },
76 { "X", _("所持品を初期状態に戻す", "Return inventory to initial") },
77 { "y", _("ダメージ100万・半径0の射撃のボールを放つ", "Cast missile ball had power a million") },
78 { "Y", _("指定ダメージ・半径0の指定属性のボールを放つ", "Cast zero ball had power a thousand") },
79 { "z", _("近隣のモンスター消去", "Terminate near monsters") },
80 { "Z", _("フロアの全モンスター消去", "Terminate all monsters in floor") },
81 { "@", _("特殊スペルの発動", "Activate specified spells") },
82 { "\"", _("スポイラーのダンプ", "Dump spoiler") },
83 { "?", _("ヘルプ表示", "Help") },
87 * @brief デバグコマンドの一覧を表示する
89 * @param max_page ページ数
90 * @param page_size 1ページ行数
91 * @param max_line コマンド数
93 void display_debug_menu(int page, int max_page, int page_size, int max_line)
95 for (int y = 1; y < page_size + 3; y++)
96 term_erase(14, y, 64);
100 for (int i = 0; i < page_size; i++) {
101 int pos = page * page_size + i;
105 std::stringstream ss;
106 ss << debug_menu_table[pos][0] << ") " << debug_menu_table[pos][1];
107 put_str(ss.str().c_str(), r++, c);
110 put_str("-- more --", r++, c);
114 * @brief デバッグコマンド選択処理への分岐
115 * @param creature_ptr プレーヤーへの参照ポインタ
117 * @return コマンド終了ならTRUE、ページ送りならFALSE
119 bool exe_cmd_debug(player_type *creature_ptr, char cmd)
132 wiz_cure_all(creature_ptr);
135 wiz_teleport_back(creature_ptr);
138 wiz_create_item(creature_ptr);
141 wiz_create_named_art(creature_ptr, command_arg);
144 detect_all(creature_ptr, DETECT_RAD_ALL * 3);
147 wiz_dimension_door(creature_ptr);
150 wiz_change_status(creature_ptr);
153 if (creature_ptr->pclass == CLASS_BLUE_MAGE)
154 wiz_learn_blue_magic_all(creature_ptr);
158 identify_fully(creature_ptr, false);
161 wiz_create_feature(creature_ptr);
164 wizard_game_modifier(creature_ptr);
167 wiz_summon_horde(creature_ptr);
170 (void)ident_spell(creature_ptr, false);
173 wizard_item_modifier(creature_ptr);
176 wiz_jump_to_dungeon(creature_ptr);
179 wiz_kill_me(creature_ptr, 0, command_arg);
182 map_area(creature_ptr, DETECT_RAD_ALL * 3);
185 gain_level_reward(creature_ptr, command_arg);
188 wiz_summon_pet(creature_ptr, command_arg);
191 wiz_summon_specific_enemy(creature_ptr, command_arg);
197 wiz_modify_item(creature_ptr);
200 teleport_player(creature_ptr, 10, TELEPORT_SPONTANEOUS);
203 wizard_player_modifier(creature_ptr);
206 if (command_arg <= 0)
209 wiz_summon_random_enemy(creature_ptr, command_arg);
212 teleport_player(creature_ptr, 100, TELEPORT_SPONTANEOUS);
215 for (int y = 0; y < creature_ptr->current_floor_ptr->height; y++)
216 for (int x = 0; x < creature_ptr->current_floor_ptr->width; x++)
217 creature_ptr->current_floor_ptr->grid_array[y][x].info |= CAVE_GLOW | CAVE_MARK;
219 wiz_lite(creature_ptr, false);
222 wiz_lite(creature_ptr, (bool)(creature_ptr->pclass == CLASS_NINJA));
225 gain_exp(creature_ptr, command_arg ? command_arg : (creature_ptr->exp + 1));
228 for (INVENTORY_IDX i = INVEN_TOTAL - 1; i >= 0; i--)
229 if (creature_ptr->inventory_list[i].k_idx)
230 drop_from_inventory(creature_ptr, i, 999);
232 player_outfit(creature_ptr);
235 wiz_kill_enemy(creature_ptr);
238 wiz_kill_enemy(creature_ptr, 0, command_arg);
241 wiz_zap_surrounding_monsters(creature_ptr);
244 wiz_zap_floor_monsters(creature_ptr);
247 probing(creature_ptr);
250 wiz_debug_spell(creature_ptr);
253 exe_output_spoilers();
256 do_cmd_help(creature_ptr);
259 msg_print("That is not a valid debug command.");
267 * @brief デバッグコマンドを選択する処理のメインルーチン /
268 * Ask for and parse a "debug command"
269 * The "command_arg" may have been set.
270 * @param creature_ptr プレーヤーへの参照ポインタ
272 * 番号を指定するには、それをN及びデバッグコマンドをXとしてとして「0N^aX」とする
274 void do_cmd_debug(player_type *creature_ptr)
277 term_get_size(&wid, &hgt);
279 size_t max_line = debug_menu_table.size();
280 int page_size = hgt - 5;
281 int max_page = max_line / page_size + 1;
287 display_debug_menu(page, max_page, page_size, max_line);
288 get_com("Debug Command: ", &cmd, false);
291 if (exe_cmd_debug(creature_ptr, cmd))
294 page = (page + 1) % max_page;