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 "dungeon/quest.h"
13 #include "grid/grid.h"
14 #include "info-reader/fixed-map-parser.h"
15 #include "inventory/inventory-object.h"
16 #include "inventory/inventory-slot-types.h"
17 #include "io/input-key-requester.h"
18 #include "market/arena.h"
19 #include "mutation/mutation-investor-remover.h"
20 #include "player-info/self-info.h"
21 #include "player/patron.h"
22 #include "spell-kind/spells-detection.h"
23 #include "spell-kind/spells-perception.h"
24 #include "spell-kind/spells-floor.h"
25 #include "spell-kind/spells-sight.h"
26 #include "spell-kind/spells-teleport.h"
27 #include "spell/spells-object.h"
28 #include "spell/spells-status.h"
29 #include "status/experience.h"
30 #include "system/floor-type-definition.h"
31 #include "util/int-char-converter.h"
32 #include "view/display-messages.h"
33 #include "wizard/wizard-item-modifier.h"
34 #include "wizard/wizard-special-process.h"
35 #include "wizard/wizard-spells.h"
36 #include "wizard/wizard-spoiler.h"
39 * @brief デバッグコマンドを選択する処理のメインルーチン /
40 * Ask for and parse a "debug command"
41 * The "command_arg" may have been set.
42 * @param creature_ptr プレーヤーへの参照ポインタ
45 * 番号を指定するには、それをN及びデバッグコマンドをXとしてとして「0N^aX」とする
46 * a:全状態回復 / Cure all maladies
47 * A:善悪の属性表示 / Know alignment
48 * b:相手をテレポバック / Teleport to target
49 * B:モンスター闘技場のモンスターを更新する / Update gambling monster
50 * c:アイテム生成 / Create any object
51 * C:指定番号の固定アーティファクトを生成する / Create a named artifact
52 * d:全感知 / Detect everything
53 * D:次元の扉 / Dimension_door
54 * e:能力変更 / Edit character
55 * E:全てのスペルをラーニング状態にする / Blue Mage Only
56 * f:*鑑定* / Fully identification
57 * F:地形ID変更 / Create desired feature
58 * g:上質なアイテムを生成 / Good Objects
60 * h:新生 / Hitpoint rerating
61 * H:モンスターの群れ生成 / Generate monster group
62 * i:鑑定 / Identification
64 * j:ダンジョンの指定フロアへテレポート (ウィザードあり) / Jump to dungeon
68 * l:番号指定したアイテムまで鑑定済にする / Learn about objects
70 * m:魔法の地図 / Magic Mapping
71 * M:突然変異 / Mutation / TODO: 指定した突然変異の除外機能を追加したい
72 * n:番号指定したモンスターを生成 / Generate a monster
73 * N:番号指定したペットを生成 / Generate a pet
74 * o:アイテムのtval等を編集する / Edit object
75 * O:現在のオプション設定をダンプ出力 / Output option settings
78 * q:クエストを完了させる / Finish quest
79 * Q:クエストに突入する (ウィザードあり) / Jump to quest
80 * r:カオスパトロンから報酬を貰う / Gain reward from chaos patron
81 * R:クラス変更 / Change class
82 * s:フロア相応のモンスター召喚 / Summon a monster
83 * S:高級品獲得ドロップ / Get a great item
85 * T:プレイ日時変更 / Change time
86 * u:啓蒙 (強制的に忍者以外) / Lite floor without ninja classified
88 * v:特別品獲得ドロップ / Get a special item
89 * V:クラス変更 / Change class / TODO: Rと同じなので何か変えたい
90 * w:啓蒙 (忍者かどうか考慮) / Lite floor with ninja classified
92 * x:経験値を得る / Gain experience
93 * X:アイテムを初期状態に戻す / Return items to the initial ones
96 * z:近隣のモンスター消去 / Zap monsters around
97 * Z:フロア中のモンスター消去 / Zap all monsters in the floor
98 * @:特殊スペルの発動 / Special spell
99 * ":スポイラーのダンプ / Dump spoiler
100 * ?:ヘルプ表示 (通常の?と同じ) / Show help (same as normal help)
102 void do_cmd_debug(player_type *creature_ptr)
105 get_com("Debug Command: ", &cmd, FALSE);
113 wiz_cure_all(creature_ptr);
116 msg_format("Your alignment is %d.", creature_ptr->align);
119 wiz_teleport_back(creature_ptr);
122 update_gambling_monsters(creature_ptr);
125 wiz_create_item(creature_ptr);
128 wiz_create_named_art(creature_ptr);
131 detect_all(creature_ptr, DETECT_RAD_ALL * 3);
134 wiz_dimension_door(creature_ptr);
137 wiz_change_status(creature_ptr);
140 if (creature_ptr->pclass == CLASS_BLUE_MAGE)
141 wiz_learn_blue_magic_all(creature_ptr);
145 identify_fully(creature_ptr, FALSE, 0);
148 wiz_create_feature(creature_ptr);
151 if (command_arg <= 0)
154 acquirement(creature_ptr, creature_ptr->y, creature_ptr->x, command_arg, FALSE, FALSE, TRUE);
157 roll_hitdice(creature_ptr, SPOP_DISPLAY_MES | SPOP_DEBUG);
160 wiz_summon_horde(creature_ptr);
163 (void)ident_spell(creature_ptr, FALSE, 0);
166 wiz_jump_to_dungeon(creature_ptr);
169 self_knowledge(creature_ptr);
172 wiz_learn_items_all(creature_ptr);
175 map_area(creature_ptr, DETECT_RAD_ALL * 3);
178 (void)gain_mutation(creature_ptr, command_arg);
181 wiz_reset_class(creature_ptr);
184 gain_level_reward(creature_ptr, command_arg);
187 wiz_summon_pet(creature_ptr, command_arg);
190 wiz_summon_specific_enemy(creature_ptr, command_arg);
196 wiz_modify_item(creature_ptr);
199 teleport_player(creature_ptr, 10, TELEPORT_SPONTANEOUS);
205 sprintf(ppp, "QuestID (0-%d):", max_q_idx - 1);
206 sprintf(tmp_val, "%d", 0);
208 if (!get_string(ppp, tmp_val, 3))
211 tmp_int = atoi(tmp_val);
212 if ((tmp_int < 0) || (tmp_int >= max_q_idx))
215 creature_ptr->current_floor_ptr->inside_quest = (QUEST_IDX)tmp_int;
216 parse_fixed_map(creature_ptr, "q_info.txt", 0, 0, 0, 0);
217 quest[tmp_int].status = QUEST_STATUS_TAKEN;
218 creature_ptr->current_floor_ptr->inside_quest = 0;
222 if (!creature_ptr->current_floor_ptr->inside_quest) {
223 msg_print("No current quest");
228 if (quest[creature_ptr->current_floor_ptr->inside_quest].status == QUEST_STATUS_TAKEN)
229 complete_quest(creature_ptr, creature_ptr->current_floor_ptr->inside_quest);
233 if (command_arg <= 0)
236 wiz_summon_random_enemy(creature_ptr, command_arg);
239 if (command_arg <= 0)
242 acquirement(creature_ptr, creature_ptr->y, creature_ptr->x, command_arg, TRUE, TRUE, TRUE);
245 teleport_player(creature_ptr, 100, TELEPORT_SPONTANEOUS);
251 for (int y = 0; y < creature_ptr->current_floor_ptr->height; y++)
252 for (int x = 0; x < creature_ptr->current_floor_ptr->width; x++)
253 creature_ptr->current_floor_ptr->grid_array[y][x].info |= CAVE_GLOW | CAVE_MARK;
255 wiz_lite(creature_ptr, FALSE);
258 if (command_arg <= 0)
261 acquirement(creature_ptr, creature_ptr->y, creature_ptr->x, command_arg, TRUE, FALSE, TRUE);
264 wiz_reset_class(creature_ptr);
267 wiz_lite(creature_ptr, (bool)(creature_ptr->pclass == CLASS_NINJA));
270 gain_exp(creature_ptr, command_arg ? command_arg : (creature_ptr->exp + 1));
273 for (INVENTORY_IDX i = INVEN_TOTAL - 1; i >= 0; i--)
274 if (creature_ptr->inventory_list[i].k_idx)
275 drop_from_inventory(creature_ptr, i, 999);
277 player_outfit(creature_ptr);
280 wiz_zap_surrounding_monsters(creature_ptr);
283 wiz_zap_floor_monsters(creature_ptr);
286 probing(creature_ptr);
289 wiz_debug_spell(creature_ptr);
292 exe_output_spoilers(creature_ptr);
295 do_cmd_help(creature_ptr);
298 msg_print("That is not a valid debug command.");