OSDN Git Service

[Fix] #1901 ウィザードモード廃止による不具合
authorHabu <habu1010+github@gmail.com>
Tue, 7 Dec 2021 14:46:44 +0000 (23:46 +0900)
committerHabu <habu1010+github@gmail.com>
Tue, 7 Dec 2021 14:46:56 +0000 (23:46 +0900)
#1534 でウィザードモード廃止が行われたが、これが原因で「デバッグ/詐欺オプションを許可
する」をはいにした時にいろいろおかしな現象が発生している。
検証が不十分であるとみなし、該当のPRをRevertする。

Revert "Merge pull request #1534 from Hourier/experiment/Remove-Wizard-Mode"

This reverts commit 8b6a67f6b373f50ae8908ed24ad80eb960021a86, reversing
changes made to 87bea841a59925a45ca1949441b496f78a37443f.

36 files changed:
lib/help/joption.txt
lib/help/jversion.txt
lib/help/option.txt
lib/help/version.txt
lib/pref/pref-opt.prf
src/artifact/random-art-generator.cpp
src/birth/game-play-initializer.cpp
src/cmd-io/cmd-gameoption.cpp
src/core/game-play.cpp
src/floor/floor-object.cpp
src/floor/pattern-walk.cpp
src/game-option/game-play-options.cpp
src/game-option/game-play-options.h
src/game-option/option-types-table.cpp
src/io/input-key-processor.cpp
src/io/input-key-processor.h
src/io/interpret-pref-file.cpp
src/knowledge/knowledge-features.cpp
src/knowledge/knowledge-items.cpp
src/knowledge/knowledge-monsters.cpp
src/knowledge/knowledge-quests.cpp
src/load/option-loader.cpp
src/mind/monk-attack.cpp
src/monster-floor/monster-death.cpp
src/monster/monster-damage.cpp
src/realm/realm-hex.cpp
src/save/info-writer.cpp
src/spell-kind/spells-teleport.cpp
src/spell-kind/spells-world.cpp
src/spell/spell-info.cpp
src/target/target-describer.cpp
src/view/display-lore.cpp
src/window/main-window-left-frame.cpp
src/window/main-window-stat-poster.cpp
src/wizard/wizard-item-modifier.cpp
src/world/world.h

index 8c2afc0..ed12b9f 100644 (file)
@@ -462,12 +462,12 @@ MPが足りなくても魔法に挑戦する  [over_exert]
     スコアサーバーに登録する事ができます。登録をしたいときはこのオプショ
     ンを有効にしてください。
 
-***** <allow_debug_options>
-デバッグ/詐欺オプションを許可する  [allow_debug_options]
+***** <allow_debug_opts>
+デバッグ/詐欺オプションを許可する  [allow_debug_opts]
     デバッグコマンド(^A)、ウィザードモード(^W)、各種詐欺オプション(オ
     プション画面の'C'の項目)は一度でも使用するとスコアの登録が出来なく
     なる為、操作を間違って使用してしまわないように使用制限が付けられて
-    います。allow_debug_optionsを有効にするとこの使用制限を解除します。
+    います。allow_debug_optsを有効にするとこの使用制限を解除します。
 
 
 ***** <Disturbance>
index 17151f6..0892775 100644 (file)
 
   オプション追加/削除
   - disturb_high 追加:レベルの高いモンスターが動いたら行動中止する
-  - allow_debug_options 追加:デバッグ/詐欺オプションの使用を許可/禁止する 
+  - allow_debug_opts 追加:デバッグ/詐欺オプションの使用を許可/禁止する 
   - 初期オプション munchkin_death は詐欺オプションに cheat_save に変更。
   - 初期オプション terrain_streamsとstupid_monsters 廃止。
 
index 446315e..1089609 100644 (file)
@@ -439,12 +439,12 @@ Send score dump to the world score server    [send_score]
     record of your character to the world score board on the Internet
     when your character dies.
 
-***** <allow_debug_options>
-Allow use of debug/cheat options  [allow_debug_options]
+***** <allow_debug_opts>
+Allow use of debug/cheat options  [allow_debug_opts]
     Since use of debug command(^A), wizard mode(^W), and Cheating
     options ('C' in options panel) mark the player as a "Cheater"
     who can't register their score, these debug/cheat options are
-    forbidden to use on default.  The allow_debug_options option removes
+    forbidden to use on default.  The allow_debug_opts option removes
     these restrictions, and allow the player to become a "Cheater".
 
 
index 2a6dff6..75e2d38 100644 (file)
@@ -213,7 +213,7 @@ Implemented 'Saved Floors':
 - Tuned interface to list stack of items in the look command with easy_floor.
 - Added new service of buildings in town which evaluate effects of your AC.
 - Added disturb_high: disturb whenever high-level monster moves
-- Added allow_debug_options: allow use of debug/cheat options
+- Added allow_debug_opts: allow use of debug/cheat options
 - Changed 'munchkin_death' into a cheat option 'cheat_save'.
 - Removed terrain_streams and stupid_monsters.
 - Fixed typos and grammar errors on English. (Thanks to John Mikula)
index 3e75bac..2f985ca 100644 (file)
@@ -86,7 +86,7 @@ Y:bound_walls_perm
 Y:last_words
 X:auto_dump
 Y:send_score
-X:allow_debug_options
+X:allow_debug_opts
 
 ##### Disturbance #####
 
index dfa3c4a..36920b1 100644 (file)
@@ -19,7 +19,6 @@
 #include "core/window-redrawer.h"
 #include "flavor/object-flavor.h"
 #include "game-option/cheat-types.h"
-#include "game-option/game-play-options.h"
 #include "object-enchant/special-object-flags.h"
 #include "object-enchant/tr-types.h"
 #include "object-hook/hook-armor.h"
@@ -38,6 +37,7 @@
 #include "view/display-messages.h"
 #include "wizard/artifact-bias-table.h"
 #include "wizard/wizard-messages.h"
+#include "world/world.h"
 
 static bool weakening_artifact(object_type *o_ptr)
 {
@@ -223,7 +223,7 @@ static void invest_powers(PlayerType *player_ptr, object_type *o_ptr, int *power
             random_slay(o_ptr);
             break;
         default:
-            if (allow_debug_options)
+            if (w_ptr->wizard)
                 msg_print("Switch error in become_random_artifact!");
 
             (*powers)++;
index d043d06..9f512b8 100644 (file)
@@ -129,6 +129,7 @@ void player_wipe_without_name(PlayerType *player_ptr)
     player_ptr->panic_save = 0;
 
     w_ptr->noscore = 0;
+    w_ptr->wizard = false;
     player_ptr->wait_report_score = false;
     player_ptr->pet_follow_distance = PET_FOLLOW_DIST;
     player_ptr->pet_extra_flags = (PF_TELEPORT | PF_ATTACK_SPELL | PF_SUMMON_SPELL);
index e8414bd..e9cd45a 100644 (file)
@@ -430,7 +430,7 @@ void do_cmd_options(PlayerType *player_ptr)
     screen_save();
     while (true) {
         int n = OPT_NUM;
-        if (!w_ptr->noscore && !allow_debug_options)
+        if (!w_ptr->noscore && !allow_debug_opts)
             n--;
 
         term_clear();
@@ -515,19 +515,20 @@ void do_cmd_options(PlayerType *player_ptr)
         case 'B':
         case 'b': {
             do_cmd_options_aux(player_ptr, OPT_PAGE_BIRTH,
-                allow_debug_options ? _("初期オプション((*)はスコアに影響)", "Birth Options ((*)) affect score")
-                                    : _("初期オプション(参照のみ)", "Birth Options(browse only)"));
+                (!w_ptr->wizard || !allow_debug_opts) ? _("初期オプション(参照のみ)", "Birth Options(browse only)")
+                                                                  : _("初期オプション((*)はスコアに影響)", "Birth Options ((*)) affect score"));
             break;
         }
         case 'C':
-        case 'c':
-            if (!w_ptr->noscore && !allow_debug_options) {
+        case 'c': {
+            if (!w_ptr->noscore && !allow_debug_opts) {
                 bell();
                 break;
             }
 
             do_cmd_options_cheat(player_ptr, _("詐欺師は決して勝利できない!", "Cheaters never win"));
             break;
+        }
         case 'a':
         case 'A': {
             do_cmd_options_autosave(player_ptr, _("自動セーブ", "Autosave"));
@@ -623,7 +624,8 @@ void do_cmd_options_aux(PlayerType *player_ptr, game_option_types page, concptr
     int i, k = 0, n = 0, l;
     int opt[24];
     char buf[80];
-    bool browse_only = (page == OPT_PAGE_BIRTH) && w_ptr->character_generated && !allow_debug_options;
+    bool browse_only = (page == OPT_PAGE_BIRTH) && w_ptr->character_generated && (!w_ptr->wizard || !allow_debug_opts);
+
     for (i = 0; i < 24; i++)
         opt[i] = 0;
 
index 0bf2229..db71d14 100644 (file)
@@ -319,9 +319,8 @@ static void decide_arena_death(PlayerType *player_ptr)
 
     floor_type *floor_ptr = player_ptr->current_floor_ptr;
     if (!floor_ptr->inside_arena) {
-        if (cheat_live && !get_check(_("死にますか? ", "Die? "))) {
+        if ((w_ptr->wizard || cheat_live) && !get_check(_("死にますか? ", "Die? ")))
             cheat_death(player_ptr);
-        }
 
         return;
     }
index cce6eb1..0ebbb3e 100644 (file)
@@ -345,14 +345,15 @@ OBJECT_IDX drop_near(PlayerType *player_ptr, object_type *j_ptr, PERCENTAGE chan
     bool plural = (j_ptr->number != 1);
 #endif
     describe_flavor(player_ptr, o_name, j_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
-
-    // 破損.
     if (!j_ptr->is_artifact() && (randint0(100) < chance)) {
 #ifdef JP
         msg_format("%sは消えた。", o_name);
 #else
         msg_format("The %s disappear%s.", o_name, (plural ? "" : "s"));
 #endif
+        if (w_ptr->wizard)
+            msg_print(_("(破損)", "(breakage)"));
+
         return 0;
     }
 
@@ -413,13 +414,15 @@ OBJECT_IDX drop_near(PlayerType *player_ptr, object_type *j_ptr, PERCENTAGE chan
         }
     }
 
-    // ドロップグリッド確保不能.
     if (!flag && !j_ptr->is_artifact()) {
 #ifdef JP
         msg_format("%sは消えた。", o_name);
 #else
         msg_format("The %s disappear%s.", o_name, (plural ? "" : "s"));
 #endif
+        if (w_ptr->wizard)
+            msg_print(_("(床スペースがない)", "(no floor space)"));
+
         return 0;
     }
 
@@ -448,13 +451,16 @@ OBJECT_IDX drop_near(PlayerType *player_ptr, object_type *j_ptr, PERCENTAGE chan
             }
         }
 
-        // ドロップグリッド確保不能.
         if (!candidates) {
 #ifdef JP
             msg_format("%sは消えた。", o_name);
 #else
             msg_format("The %s disappear%s.", o_name, (plural ? "" : "s"));
 #endif
+
+            if (w_ptr->wizard)
+                msg_print(_("(床スペースがない)", "(no floor space)"));
+
             if (preserve_mode) {
                 if (j_ptr->is_fixed_artifact() && !j_ptr->is_known()) {
                     a_info[j_ptr->name1].cur_num = 0;
@@ -496,13 +502,15 @@ OBJECT_IDX drop_near(PlayerType *player_ptr, object_type *j_ptr, PERCENTAGE chan
     if (!done)
         o_idx = o_pop(floor_ptr);
 
-    // アイテム多過.
     if (!done && !o_idx) {
 #ifdef JP
         msg_format("%sは消えた。", o_name);
 #else
         msg_format("The %s disappear%s.", o_name, (plural ? "" : "s"));
 #endif
+        if (w_ptr->wizard)
+            msg_print(_("(アイテムが多過ぎる)", "(too many objects)"));
+
         if (j_ptr->is_fixed_artifact()) {
             a_info[j_ptr->name1].cur_num = 0;
         }
index e261993..cc1fa95 100644 (file)
@@ -29,6 +29,7 @@
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
 #include "world/world-movement-processor.h"
+#include "world/world.h"
 
 /*!
  * @brief パターン終点到達時のテレポート処理を行う
@@ -239,8 +240,8 @@ bool pattern_seq(PlayerType *player_ptr, POSITION c_y, POSITION c_x, POSITION n_
         ok_move = PATTERN_TILE_1;
         break;
     default:
-        msg_format(_("おかしなパターン歩行、%d。", "Funny Pattern walking, %d."), pattern_type_cur);
-        msg_print(_("不具合の可能性があります。開発者に連絡して下さい。", "There may be some problem. Please contact developers."));
+        if (w_ptr->wizard)
+            msg_format(_("おかしなパターン歩行、%d。", "Funny Pattern walking, %d."), pattern_type_cur);
         return true;
     }
 
index 38d8acb..6b05332 100644 (file)
@@ -11,4 +11,4 @@ bool last_words; /* Leave last words when your character dies */
 bool auto_dump; /* Dump a character record automatically */
 bool auto_debug_save; /* Dump a debug savedata every key input */
 bool send_score; /* Send score dump to the world score server */
-bool allow_debug_options; /* Allow use of debug/cheat options */
+bool allow_debug_opts; /* Allow use of debug/cheat options */
index ce21bf5..9884a15 100644 (file)
@@ -13,4 +13,4 @@ extern bool last_words; /* Leave last words when your character dies */
 extern bool auto_dump; /* Dump a character record automatically */
 extern bool auto_debug_save; /* Dump a debug savedata every key input */
 extern bool send_score; /* Send score dump to the world score server */
-extern bool allow_debug_options; /* Allow use of debug/cheat options */
+extern bool allow_debug_opts; /* Allow use of debug/cheat options */
index 05d82d8..846dcf2 100644 (file)
@@ -164,7 +164,7 @@ const std::vector<option_type> option_info = {
 
     { &auto_debug_save, true, OPT_PAGE_GAMEPLAY, 4, 7, "auto_debug_save", _("デバッグ用セーブデータを自動生成する", "Create a debug save automatically") },
 
-    { &allow_debug_options, false, OPT_PAGE_GAMEPLAY, 6, 11, "allow_debug_options", _("デバッグ/詐欺オプションを許可する", "Allow use of debug/cheat options") },
+    { &allow_debug_opts, false, OPT_PAGE_GAMEPLAY, 6, 11, "allow_debug_opts", _("デバッグ/詐欺オプションを許可する", "Allow use of debug/cheat options") },
 
     /*** Disturbance ***/
 
index a1675a9..defd6ea 100644 (file)
 #include "world/world.h"
 
 /*!
+ * @brief ウィザードモードへの導入処理
+ * / Verify use of "wizard" mode
+ * @param player_ptr プレイヤーへの参照ポインタ
+ * @return 実際にウィザードモードへ移行したらTRUEを返す。
+ */
+bool enter_wizard_mode(PlayerType *player_ptr)
+{
+    if (!w_ptr->noscore) {
+        if (!allow_debug_opts) {
+            msg_print(_("ウィザードモードは許可されていません。 ", "Wizard mode is not permitted."));
+            return false;
+        }
+
+        msg_print(_("ウィザードモードはデバッグと実験のためのモードです。 ", "Wizard mode is for debugging and experimenting."));
+        msg_print(_("一度ウィザードモードに入るとスコアは記録されません。", "The game will not be scored if you enter wizard mode."));
+        msg_print(nullptr);
+        if (!get_check(_("本当にウィザードモードに入りたいのですか? ", "Are you sure you want to enter wizard mode? "))) {
+            return false;
+        }
+
+        exe_write_diary(
+            player_ptr, DIARY_DESCRIPTION, 0, _("ウィザードモードに突入してスコアを残せなくなった。", "gave up recording score to enter wizard mode."));
+        w_ptr->noscore |= 0x0002;
+    }
+
+    return true;
+}
+
+/*!
  * @brief デバッグコマンドへの導入処理
  * / Verify use of "debug" commands
  * @param player_ptr プレイヤーへの参照ポインタ
 static bool enter_debug_mode(PlayerType *player_ptr)
 {
     if (!w_ptr->noscore) {
-        if (!allow_debug_options) {
+        if (!allow_debug_opts) {
             msg_print(_("デバッグコマンドは許可されていません。 ", "Use of debug command is not permitted."));
             return false;
         }
@@ -149,6 +178,19 @@ void process_command(PlayerType *player_ptr)
         /* Ignore */
         break;
     }
+    case KTRL('W'): {
+        if (w_ptr->wizard) {
+            w_ptr->wizard = false;
+            msg_print(_("ウィザードモード解除。", "Wizard mode off."));
+        } else if (enter_wizard_mode(player_ptr)) {
+            w_ptr->wizard = true;
+            msg_print(_("ウィザードモード突入。", "Wizard mode on."));
+        }
+
+        player_ptr->update |= (PU_MONSTERS);
+        player_ptr->redraw |= (PR_TITLE);
+        break;
+    }
     case KTRL('A'): {
         if (enter_debug_mode(player_ptr)) {
             do_cmd_debug(player_ptr);
index bf318f5..d7df89a 100644 (file)
@@ -1,4 +1,5 @@
 #pragma once
 
 class PlayerType;
+bool enter_wizard_mode(PlayerType *player_ptr);
 void process_command(PlayerType* player_ptr);
index 882fc5a..3807977 100644 (file)
@@ -7,7 +7,6 @@
 #include "io/interpret-pref-file.h"
 #include "birth/character-builder.h"
 #include "cmd-io/macro-util.h"
-#include "game-option/game-play-options.h"
 #include "game-option/option-flags.h"
 #include "game-option/option-types-table.h"
 #include "grid/feature.h"
@@ -303,7 +302,7 @@ static errr interpret_xy_token(PlayerType *player_ptr, char *buf)
         int os = option_info[i].o_set;
         int ob = option_info[i].o_bit;
 
-        if ((player_ptr->playing || w_ptr->character_xtra) && (OPT_PAGE_BIRTH == option_info[i].o_page) && !allow_debug_options) {
+        if ((player_ptr->playing || w_ptr->character_xtra) && (OPT_PAGE_BIRTH == option_info[i].o_page) && !w_ptr->wizard) {
             msg_format(_("初期オプションは変更できません! '%s'", "Birth options can not be changed! '%s'"), buf);
             msg_print(nullptr);
             return 0;
index c4ce053..7a23bc8 100644 (file)
@@ -7,7 +7,6 @@
 #include "knowledge/knowledge-features.h"
 #include "core/show-file.h"
 #include "dungeon/dungeon.h"
-#include "game-option/game-play-options.h"
 #include "game-option/special-options.h"
 #include "io-dump/dump-util.h"
 #include "io/input-key-acceptor.h"
@@ -67,9 +66,9 @@ static void display_feature_list(int col, int row, int per_page, FEAT_IDX *feat_
         if (per_page == 1) {
             c_prt(attr, format("(%s)", lighting_level_str[lighting_level]), row_i, col + 1 + f_ptr->name.size());
             c_prt(attr, format("%02x/%02x", f_ptr->x_attr[lighting_level], (unsigned char)f_ptr->x_char[lighting_level]), row_i,
-                f_idx_col - ((allow_debug_options || visual_only) ? 6 : 2));
+                f_idx_col - ((w_ptr->wizard || visual_only) ? 6 : 2));
         }
-        if (allow_debug_options || visual_only) {
+        if (w_ptr->wizard || visual_only) {
             c_prt(attr, format("%d", f_idx), row_i, f_idx_col);
         }
 
@@ -165,11 +164,11 @@ void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX direct_f
                 prt(_("グループ", "Group"), 4, 0);
             prt(_("名前", "Name"), 4, max + 3);
             if (use_bigtile) {
-                if (allow_debug_options || visual_only)
+                if (w_ptr->wizard || visual_only)
                     prt("Idx", 4, 62);
                 prt(_("文字 ( l/ d)", "Sym ( l/ d)"), 4, 66);
             } else {
-                if (allow_debug_options || visual_only)
+                if (w_ptr->wizard || visual_only)
                     prt("Idx", 4, 64);
                 prt(_("文字 (l/d)", "Sym (l/d)"), 4, 68);
             }
index e220993..5be3cf6 100644 (file)
@@ -10,7 +10,6 @@
 #include "flavor/flavor-describer.h"
 #include "flavor/object-flavor-types.h"
 #include "flavor/object-flavor.h"
-#include "game-option/game-play-options.h"
 #include "game-option/special-options.h"
 #include "inventory/inventory-slot-types.h"
 #include "io-dump/dump-util.h"
@@ -31,6 +30,7 @@
 #include "util/int-char-converter.h"
 #include "util/sort.h"
 #include "view/display-messages.h"
+#include "world/world.h"
 
 #include <numeric>
 
@@ -134,7 +134,7 @@ static KIND_OBJECT_IDX collect_objects(int grp_cur, KIND_OBJECT_IDX object_idx[]
             continue;
 
         if (!(mode & 0x02)) {
-            if (!allow_debug_options) {
+            if (!w_ptr->wizard) {
                 if (!k_ref.flavor)
                     continue;
                 if (!k_ref.aware)
@@ -194,10 +194,10 @@ static void display_object_list(int col, int row, int per_page, IDX object_idx[]
 
         c_prt(attr, o_name, row + i, col);
         if (per_page == 1) {
-            c_prt(attr, format("%02x/%02x", flavor_k_ptr->x_attr, flavor_k_ptr->x_char), row + i, (allow_debug_options || visual_only) ? 64 : 68);
+            c_prt(attr, format("%02x/%02x", flavor_k_ptr->x_attr, flavor_k_ptr->x_char), row + i, (w_ptr->wizard || visual_only) ? 64 : 68);
         }
 
-        if (allow_debug_options || visual_only) {
+        if (w_ptr->wizard || visual_only) {
             c_prt(attr, format("%d", k_idx), row + i, 70);
         }
 
@@ -308,7 +308,7 @@ void do_cmd_knowledge_objects(PlayerType *player_ptr, bool *need_redraw, bool vi
             if (direct_k_idx < 0)
                 prt("グループ", 4, 0);
             prt("名前", 4, max + 3);
-            if (allow_debug_options || visual_only)
+            if (w_ptr->wizard || visual_only)
                 prt("Idx", 4, 70);
             prt("文字", 4, 74);
 #else
@@ -316,7 +316,7 @@ void do_cmd_knowledge_objects(PlayerType *player_ptr, bool *need_redraw, bool vi
             if (direct_k_idx < 0)
                 prt("Group", 4, 0);
             prt("Name", 4, max + 3);
-            if (allow_debug_options || visual_only)
+            if (w_ptr->wizard || visual_only)
                 prt("Idx", 4, 70);
             prt("Sym", 4, 75);
 #endif
index 15bf301..798cbb2 100644 (file)
@@ -10,7 +10,6 @@
 #include "core/show-file.h"
 #include "core/stuff-handler.h"
 #include "game-option/cheat-options.h"
-#include "game-option/game-play-options.h"
 #include "game-option/special-options.h"
 #include "io-dump/dump-util.h"
 #include "io/input-key-acceptor.h"
@@ -258,9 +257,9 @@ static void display_monster_list(int col, int row, int per_page, int16_t mon_idx
         attr = ((i + mon_top == mon_cur) ? TERM_L_BLUE : TERM_WHITE);
         c_prt(attr, (r_ptr->name.c_str()), row + i, col);
         if (per_page == 1)
-            c_prt(attr, format("%02x/%02x", r_ptr->x_attr, r_ptr->x_char), row + i, (allow_debug_options || visual_only) ? 56 : 61);
+            c_prt(attr, format("%02x/%02x", r_ptr->x_attr, r_ptr->x_char), row + i, (w_ptr->wizard || visual_only) ? 56 : 61);
 
-        if (allow_debug_options || visual_only)
+        if (w_ptr->wizard || visual_only)
             c_prt(attr, format("%d", r_idx), row + i, 62);
 
         term_erase(69, row + i, 255);
@@ -341,7 +340,7 @@ void do_cmd_knowledge_monsters(PlayerType *player_ptr, bool *need_redraw, bool v
             if (direct_r_idx < 0)
                 prt(_("グループ", "Group"), 4, 0);
             prt(_("名前", "Name"), 4, max + 3);
-            if (allow_debug_options || visual_only)
+            if (w_ptr->wizard || visual_only)
                 prt("Idx", 4, 62);
             prt(_("文字", "Sym"), 4, 67);
             if (!visual_only)
index 0c1c5fb..5e3e0cd 100644 (file)
@@ -10,7 +10,6 @@
 #include "dungeon/quest.h"
 #include "flavor/flavor-describer.h"
 #include "flavor/object-flavor-types.h"
-#include "game-option/game-play-options.h"
 #include "info-reader/fixed-map-parser.h"
 #include "io-dump/dump-util.h"
 #include "locale/english.h"
@@ -24,6 +23,8 @@
 #include "term/screen-processor.h"
 #include "util/angband-files.h"
 #include "util/sort.h"
+#include "world/world.h"
+
 #include <numeric>
 
 /*!
@@ -307,7 +308,7 @@ void do_cmd_knowledge_quests(PlayerType *player_ptr)
     do_cmd_knowledge_quests_completed(player_ptr, fff, quest_num.data());
     fputc('\n', fff);
     do_cmd_knowledge_quests_failed(player_ptr, fff, quest_num.data());
-    if (allow_debug_options) {
+    if (w_ptr->wizard) {
         fputc('\n', fff);
         do_cmd_knowledge_quests_wiz_random(fff);
     }
index 202a32a..78e0d45 100644 (file)
@@ -43,6 +43,9 @@ void rd_options(void)
 
     auto c = rd_u16b();
 
+    if (c & 0x0002)
+        w_ptr->wizard = true;
+
     cheat_peek = any_bits(c, 0x0100);
     cheat_hear = any_bits(c, 0x0200);
     cheat_room = any_bits(c, 0x0400);
index 9bcda04..16708eb 100644 (file)
@@ -112,7 +112,7 @@ static int select_blow(PlayerType *player_ptr, player_attack_type *pa_ptr, int m
         }
 
         old_ptr = pa_ptr->ma_ptr;
-        if (cheat_xtra)
+        if (w_ptr->wizard && cheat_xtra)
             msg_print(_("攻撃を再選択しました。", "Attack re-selected."));
     }
 
index 58c1350..19d9276 100644 (file)
@@ -9,7 +9,6 @@
 #include "effect/effect-processor.h"
 #include "floor/floor-object.h"
 #include "game-option/birth-options.h"
-#include "game-option/game-play-options.h"
 #include "game-option/play-record-options.h"
 #include "io/write-diary.h"
 #include "lore/lore-store.h"
@@ -157,13 +156,8 @@ static ARTIFACT_IDX drop_artifact_index(PlayerType *player_ptr, monster_death_ty
 
         a_idx = md_ptr->r_ptr->artifact_id[i];
         chance = md_ptr->r_ptr->artifact_percent[i];
-        if (allow_debug_options) {
-            // continue process.
-            // @todo ここより下の処理は関数分割で何とかしたい.
-            // 処理を送るだけのif文は気持ち悪い.
-        } else if (randint0(100) >= chance) {
+        if ((randint0(100) >= chance) && !w_ptr->wizard)
             continue;
-        }
 
         if (drop_single_artifact(player_ptr, md_ptr, a_idx))
             break;
index 7e0b0e0..aa6563a 100644 (file)
@@ -12,7 +12,6 @@
 #include "core/speed-table.h"
 #include "core/stuff-handler.h"
 #include "game-option/birth-options.h"
-#include "game-option/game-play-options.h"
 #include "game-option/play-record-options.h"
 #include "io/files-util.h"
 #include "io/report.h"
@@ -108,7 +107,7 @@ bool MonsterDamageProcessor::mon_take_hit(concptr note)
         m_ptr->dealt_damage = m_ptr->max_maxhp * 100;
     }
 
-    if (allow_debug_options) {
+    if (w_ptr->wizard) {
         msg_format(_("合計%d/%dのダメージを与えた。", "You do %d (out of %d) damage."), m_ptr->dealt_damage, m_ptr->maxhp);
     }
 
index 37770a7..dcce248 100644 (file)
@@ -18,7 +18,6 @@
 #include "floor/cave.h"
 #include "floor/floor-object.h"
 #include "floor/geometry.h"
-#include "game-option/game-play-options.h"
 #include "inventory/inventory-slot-types.h"
 #include "io/input-key-requester.h"
 #include "monster-race/monster-race.h"
@@ -52,6 +51,7 @@
 #include "term/screen-processor.h"
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
+#include "world/world.h"
 
 #ifdef JP
 #else
@@ -287,7 +287,7 @@ concptr do_hex_spell(PlayerType *player_ptr, spell_hex_type spell, SpellProcessT
                     project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, power, AttributeType::HELL_FIRE, (PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL));
                 }
 
-                if (allow_debug_options) {
+                if (w_ptr->wizard) {
                     msg_format(_("%d点のダメージを返した。", "You return %d damage."), power);
                 }
 
@@ -857,7 +857,7 @@ concptr do_hex_spell(PlayerType *player_ptr, spell_hex_type spell, SpellProcessT
 
                     fire_ball(player_ptr, AttributeType::HELL_FIRE, dir, power, 1);
 
-                    if (allow_debug_options) {
+                    if (w_ptr->wizard) {
                         msg_format(_("%d点のダメージを返した。", "You return %d damage."), power);
                     }
                 } else {
index 97818e7..919fa8c 100644 (file)
@@ -61,6 +61,9 @@ void wr_options(save_type type)
 
     /*** Cheating options ***/
     uint16_t c = 0;
+    if (w_ptr->wizard)
+        c |= 0x0002;
+
     if (cheat_sight)
         c |= 0x0040;
 
index 73e9259..14d11ad 100644 (file)
@@ -13,7 +13,6 @@
 #include "floor/cave.h"
 #include "floor/geometry.h"
 #include "floor/line-of-sight.h"
-#include "game-option/game-play-options.h"
 #include "grid/grid.h"
 #include "inventory/inventory-slot-types.h"
 #include "main/sound-definitions-table.h"
@@ -473,7 +472,7 @@ void teleport_player_to(PlayerType *player_ptr, POSITION ny, POSITION nx, telepo
                 break;
         }
 
-        bool is_anywhere = allow_debug_options;
+        bool is_anywhere = w_ptr->wizard;
         is_anywhere &= (mode & TELEPORT_PASSIVE) == 0;
         is_anywhere
             &= (player_ptr->current_floor_ptr->grid_array[y][x].m_idx > 0) || player_ptr->current_floor_ptr->grid_array[y][x].m_idx == player_ptr->riding;
index dc98529..4f605fa 100644 (file)
@@ -11,7 +11,6 @@
 #include "floor/geometry.h"
 #include "floor/wild.h"
 #include "game-option/birth-options.h"
-#include "game-option/game-play-options.h"
 #include "game-option/play-record-options.h"
 #include "game-option/special-options.h"
 #include "io/input-key-acceptor.h"
@@ -95,7 +94,7 @@ void teleport_level(PlayerType *player_ptr, MONSTER_IDX m_idx)
     else
         go_up = false;
 
-    if ((m_idx <= 0) && allow_debug_options) {
+    if ((m_idx <= 0) && w_ptr->wizard) {
         if (get_check("Force to go up? "))
             go_up = true;
         else if (get_check("Force to go down? "))
index c4a3fdc..0208b4c 100644 (file)
@@ -1,5 +1,4 @@
 #include "spell/spell-info.h"
-#include "game-option/game-play-options.h"
 #include "io/input-key-requester.h"
 #include "monster-race/monster-race.h"
 #include "player-info/class-info.h"
@@ -20,6 +19,7 @@
 #include "util/bit-flags-calculator.h"
 #include "util/int-char-converter.h"
 #include "view/display-messages.h"
+#include "world/world.h"
 
 // 5%
 static const int extra_min_magic_fail_rate = 2;
@@ -204,7 +204,7 @@ PERCENTAGE spell_chance(PlayerType *player_ptr, SPELL_IDX spell, int16_t use_rea
  */
 void print_spells(PlayerType *player_ptr, SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y, TERM_LEN x, int16_t use_realm)
 {
-    if (((use_realm <= REALM_NONE) || (use_realm > MAX_REALM)) && allow_debug_options)
+    if (((use_realm <= REALM_NONE) || (use_realm > MAX_REALM)) && w_ptr->wizard)
         msg_print(_("警告! print_spell が領域なしに呼ばれた", "Warning! print_spells called with null realm"));
 
     prt("", y, x);
index ddd2d44..4a07879 100644 (file)
@@ -9,7 +9,6 @@
 #include "floor/floor-town.h"
 #include "floor/geometry.h"
 #include "floor/object-scanner.h"
-#include "game-option/game-play-options.h"
 #include "game-option/input-options.h"
 #include "grid/feature.h"
 #include "grid/grid.h"
@@ -42,6 +41,7 @@
 #include "view/display-messages.h"
 #include "view/display-monster-status.h"
 #include "window/display-sub-windows.h"
+#include "world/world.h"
 
 static const int16_t CONTINUOUS_DESCRIPTION = 256;
 
@@ -103,7 +103,7 @@ static void evaluate_monster_exp(PlayerType *player_ptr, char *buf, monster_type
     }
 
     if (!ap_r_ptr->r_tkills || m_ptr->mflag2.has(MonsterConstantFlagType::KAGE)) {
-        if (!allow_debug_options) {
+        if (!w_ptr->wizard) {
             sprintf(buf, "??");
             return;
         }
@@ -464,7 +464,7 @@ static concptr decide_target_floor(PlayerType *player_ptr, eg_type *eg_ptr)
 
 static void describe_grid_monster_all(eg_type *eg_ptr)
 {
-    if (!allow_debug_options) {
+    if (!w_ptr->wizard) {
 #ifdef JP
         sprintf(eg_ptr->out_val, "%s%s%s%s[%s]", eg_ptr->s1, eg_ptr->name, eg_ptr->s2, eg_ptr->s3, eg_ptr->info);
 #else
index 08109db..94e9b9a 100644 (file)
@@ -57,7 +57,7 @@ void roff_top(MONRACE_IDX r_idx)
     }
 #endif
 
-    if (cheat_know) {
+    if (w_ptr->wizard || cheat_know) {
         term_addstr(-1, TERM_WHITE, "[");
         term_addstr(-1, TERM_L_BLUE, format("%d", r_idx));
         term_addstr(-1, TERM_WHITE, "] ");
index d745073..6ae117d 100644 (file)
@@ -26,7 +26,9 @@ void print_title(PlayerType *player_ptr)
 {
     GAME_TEXT str[14];
     concptr p = "";
-    if (w_ptr->total_winner) {
+    if (w_ptr->wizard) {
+        p = _("[ウィザード]", "[=-WIZARD-=]");
+    } else if (w_ptr->total_winner) {
         if (player_ptr->is_true_winner()) {
             p = _("*真・勝利者*", "*TRUEWINNER*");
         } else {
@@ -304,7 +306,7 @@ void health_redraw(PlayerType *player_ptr, bool riding)
     monster_type *m_ptr;
     m_ptr = &player_ptr->current_floor_ptr->m_list[health_who];
 
-    if (player_ptr->phase_out) {
+    if (w_ptr->wizard && player_ptr->phase_out) {
         row = ROW_INFO - 1;
         col = COL_INFO + 2;
 
index 80dab88..a6c0b58 100644 (file)
@@ -1,5 +1,4 @@
 #include "window/main-window-stat-poster.h"
-#include "game-option/game-play-options.h"
 #include "io/input-key-requester.h"
 #include "mind/stances-table.h"
 #include "monster/monster-status.h"
@@ -28,6 +27,7 @@
 #include "timed-effect/timed-effects.h"
 #include "view/status-bars-table.h"
 #include "window/main-window-row-column.h"
+#include "world/world.h"
 
 /*!
  * @brief 32ビット変数配列の指定位置のビットフラグを1にする。
@@ -107,7 +107,7 @@ void print_stun(PlayerType *player_ptr)
  */
 void print_hunger(PlayerType *player_ptr)
 {
-    if (allow_debug_options && player_ptr->current_floor_ptr->inside_arena)
+    if (w_ptr->wizard && player_ptr->current_floor_ptr->inside_arena)
         return;
 
     if (player_ptr->food < PY_FOOD_FAINT) {
index 7bc6864..d78b907 100644 (file)
@@ -966,7 +966,7 @@ WishResultType do_cmd_wishing(PlayerType *player_ptr, int prob, bool allow_art,
         }
     }
 
-    if ((a_ids.size() > 1) || (e_ids.size() > 1)) {
+    if (w_ptr->wizard && (a_ids.size() > 1 || e_ids.size() > 1)) {
         msg_print(_("候補が多すぎる!", "Too many matches!"));
         return WishResultType::FAIL;
     }
@@ -975,10 +975,11 @@ WishResultType do_cmd_wishing(PlayerType *player_ptr, int prob, bool allow_art,
         ARTIFACT_IDX a_idx = a_ids.back();
         if (must || (ok_art && !a_info[a_idx].cur_num)) {
             create_named_art(player_ptr, a_idx, player_ptr->y, player_ptr->x);
-            a_info[a_idx].cur_num = 1;
-        } else {
-            wishing_puff_of_smoke();
+            if (!w_ptr->wizard)
+                a_info[a_idx].cur_num = 1;
         }
+        else
+            wishing_puff_of_smoke();
 
         return WishResultType::ARTIFACT;
     }
@@ -1007,10 +1008,11 @@ WishResultType do_cmd_wishing(PlayerType *player_ptr, int prob, bool allow_art,
             a_ptr = &a_info[a_idx];
             if (must || (ok_art && !a_ptr->cur_num)) {
                 create_named_art(player_ptr, a_idx, player_ptr->y, player_ptr->x);
-                a_info[a_idx].cur_num = 1;    
-            } else {
-                wishing_puff_of_smoke();
+                if (!w_ptr->wizard)
+                    a_info[a_idx].cur_num = 1;
             }
+            else
+                wishing_puff_of_smoke();
 
             return WishResultType::ARTIFACT;
         }
index 391377a..299affc 100644 (file)
@@ -62,6 +62,8 @@ struct world_type {
 
     bool creating_savefile{}; /* New savefile is currently created */
 
+    bool wizard{}; /* This world under wizard mode */
+
     OBJECT_IDX max_o_idx{}; /*!< Maximum number of objects in the level */
     MONSTER_IDX max_m_idx{}; /*!< Maximum number of monsters in the level */
 };