2 * @brief ゲーム属性を変更するデバッグコマンド
6 #include "wizard/wizard-game-modifier.h"
7 #include "core/asking-player.h"
8 #include "dungeon/quest.h"
9 #include "info-reader/fixed-map-parser.h"
10 #include "io/input-key-requester.h"
11 #include "market/arena.h"
12 #include "monster-race/monster-race.h"
13 #include "monster-race/race-flags1.h"
14 #include "monster-race/race-flags7.h"
15 #include "player-info/self-info.h"
16 #include "system/floor-type-definition.h"
17 #include "system/monster-race-definition.h"
18 #include "system/player-type-definition.h"
19 #include "system/system-variables.h"
20 #include "term/screen-processor.h"
21 #include "util/bit-flags-calculator.h"
22 #include "util/int-char-converter.h"
23 #include "view/display-messages.h"
24 #include "wizard/wizard-special-process.h"
29 void wiz_enter_quest(player_type *creature_ptr);
30 void wiz_complete_quest(player_type *creature_ptr);
31 void wiz_restore_monster_max_num();
36 std::vector<std::vector<std::string>> wizard_game_modifier_menu_table = {
37 { "t", _("プレイ時間変更", "Modify played time") },
38 { "q", _("現在のクエストを完了", "Complete current quest") },
39 { "Q", _("クエストに突入", "Enter quest") },
40 { "u", _("ユニーク/ナズグルの生存数を復元", "Restore living info of unique/nazgul") },
41 { "g", _("モンスター闘技場出場者更新", "Update gambling monster") },
45 * @brief ゲーム設定コマンドの一覧を表示する
47 void display_wizard_game_modifier_menu()
49 for (int y = 1; y < 6; y++)
50 term_erase(14, y, 64);
54 int sz = wizard_game_modifier_menu_table.size();
55 for (int i = 0; i < sz; i++) {
57 ss << wizard_game_modifier_menu_table[i][0] << ") " << wizard_game_modifier_menu_table[i][1];
58 put_str(ss.str().c_str(), r++, c);
63 * @brief ゲーム設定コマンドの入力を受け付ける
64 * @param creature_ptr プレイヤーの情報へのポインタ
66 void wizard_game_modifier(player_type *creature_ptr)
69 display_wizard_game_modifier_menu();
72 get_com("Player Command: ", &cmd, false);
82 update_gambling_monsters(creature_ptr);
85 wiz_complete_quest(creature_ptr);
88 wiz_enter_quest(creature_ptr);
91 wiz_restore_monster_max_num();
100 * @brief 指定したクエストに突入する
101 * @param プレイヤーの情報へのポインタ
103 void wiz_enter_quest(player_type* creature_ptr)
108 sprintf(ppp, "QuestID (0-%d):", max_q_idx - 1);
109 sprintf(tmp_val, "%d", 0);
111 if (!get_string(ppp, tmp_val, 3))
114 tmp_int = atoi(tmp_val);
115 if ((tmp_int < 0) || (tmp_int >= max_q_idx))
118 init_flags = static_cast<init_flags_type>(INIT_SHOW_TEXT | INIT_ASSIGN);
119 creature_ptr->current_floor_ptr->inside_quest = (QUEST_IDX)tmp_int;
120 parse_fixed_map(creature_ptr, "q_info.txt", 0, 0, 0, 0);
121 quest[tmp_int].status = QUEST_STATUS_TAKEN;
122 if (quest[tmp_int].dungeon == 0)
123 exe_enter_quest(creature_ptr, (QUEST_IDX)tmp_int);
127 * @brief 指定したクエストを完了させる
128 * @param プレイヤーの情報へのポインタ
130 void wiz_complete_quest(player_type *creature_ptr)
132 if (!creature_ptr->current_floor_ptr->inside_quest) {
133 msg_print("No current quest");
138 if (quest[creature_ptr->current_floor_ptr->inside_quest].status == QUEST_STATUS_TAKEN)
139 complete_quest(creature_ptr, creature_ptr->current_floor_ptr->inside_quest);
142 void wiz_restore_monster_max_num()
144 MONRACE_IDX r_idx = command_arg;
146 std::stringstream ss;
147 ss << "Monster race (1-" << max_r_idx << "): ";
149 char tmp_val[160] = "\0";
150 if (!get_string(ss.str().c_str(), tmp_val, 5))
153 r_idx = (MONRACE_IDX)atoi(tmp_val);
154 if (r_idx <= 0 || r_idx >= max_r_idx)
158 monster_race *r_ptr = &r_info[r_idx];
159 if (r_ptr->name.empty()) {
160 msg_print("そのモンスターは存在しません。");
165 MONSTER_NUMBER n = 0;
166 if (any_bits(r_ptr->flags1, RF1_UNIQUE))
168 else if (any_bits(r_ptr->flags7, RF7_NAZGUL))
172 msg_print("出現数に制限がないモンスターです。");
181 std::stringstream ss;
182 ss << r_ptr->name << _("の出現数を復元しました。", " can appear again now.");
183 msg_print(ss.str().c_str());