OSDN Git Service

Merge pull request #733 from iks3/fix-object-basename-has-sharp
authoriks <iks3@users.noreply.github.com>
Wed, 7 Apr 2021 22:18:20 +0000 (07:18 +0900)
committerGitHub <noreply@github.com>
Wed, 7 Apr 2021 22:18:20 +0000 (07:18 +0900)
[Feature] 一部アイテムのベース名表示で#が残らないように変更

12 files changed:
src/birth/game-play-initializer.cpp
src/core/game-play.cpp
src/core/player-processor.cpp
src/dungeon/dungeon-processor.cpp
src/game-option/cheat-options.cpp
src/game-option/cheat-options.h
src/game-option/option-types-table.cpp
src/game-option/option-types-table.h
src/io/signal-handlers.cpp
src/load/option-loader.cpp
src/player/player-damage.cpp
src/save/info-writer.cpp

index 7b6d28c..d919352 100644 (file)
@@ -125,6 +125,7 @@ void player_wipe_without_name(player_type *creature_ptr)
     cheat_save = FALSE;
     cheat_diary_output = FALSE;
     cheat_turn = FALSE;
+    cheat_immortal = FALSE;
 
     current_world_ptr->total_winner = FALSE;
     creature_ptr->timewalk = FALSE;
index af3215a..ac5e8c0 100644 (file)
@@ -425,7 +425,7 @@ void play_game(player_type *player_ptr, bool new_game, bool browsing_movie)
         player_outfit(player_ptr);
 
     init_io(player_ptr);
-    if (player_ptr->chp < 0)
+    if (player_ptr->chp < 0 && !cheat_immortal)
         player_ptr->is_dead = TRUE;
 
     if (player_ptr->prace == RACE_ANDROID)
index 69c0553..671ca9e 100644 (file)
@@ -13,6 +13,7 @@
 #include "floor/wild.h"
 #include "game-option/disturbance-options.h"
 #include "game-option/map-screen-options.h"
+#include "game-option/cheat-options.h"
 #include "grid/grid.h"
 #include "inventory/pack-overflow.h"
 #include "io/cursor.h"
@@ -264,7 +265,7 @@ void process_player(player_type *creature_ptr)
             move_cursor_relative(creature_ptr->y, creature_ptr->x);
             command_cmd = SPECIAL_KEY_BUILDING;
             process_command(creature_ptr);
-        } else if (creature_ptr->paralyzed || (creature_ptr->stun >= 100)) {
+        } else if ((creature_ptr->paralyzed || creature_ptr->stun >= 100) && !cheat_immortal) {
             take_turn(creature_ptr, 100);
         } else if (creature_ptr->action == ACTION_REST) {
             if (creature_ptr->resting > 0) {
index 1ae6071..88b4791 100644 (file)
@@ -17,6 +17,7 @@
 #include "floor/floor-save.h"
 #include "game-option/map-screen-options.h"
 #include "game-option/play-record-options.h"
+#include "game-option/cheat-options.h"
 #include "io/cursor.h"
 #include "io/input-key-requester.h"
 #include "io/write-diary.h"
index 4bf1e1b..dbcf4ed 100644 (file)
@@ -10,3 +10,4 @@ bool cheat_save; /* Ask for saving death */
 bool cheat_diary_output; /* Detailed info to diary */
 bool cheat_turn; /* Peek turn */
 bool cheat_sight;
+bool cheat_immortal;
index 2357da5..1f8d1ae 100644 (file)
@@ -12,3 +12,4 @@ extern bool cheat_save;
 extern bool cheat_diary_output;
 extern bool cheat_turn;
 extern bool cheat_sight;
+extern bool cheat_immortal;
index f550e94..d9eb41c 100644 (file)
@@ -319,7 +319,11 @@ const option_type cheat_info[MAX_CHEAT_OPTIONS]
 
           { &cheat_turn, FALSE, 255, 0x81, 0x00, "cheat_turn", _("ゲームメッセージにターン表示を行う", "Put turn in game messages.") },
 
-          { &cheat_sight, FALSE, 255, 0x82, 0x00, "cheat_sight", _("「見る」コマンドを拡張する。", "Expand \"L\"ook command.") } };
+          { &cheat_sight, FALSE, 255, 0x82, 0x00, "cheat_sight", _("「見る」コマンドを拡張する。", "Expand \"L\"ook command.") },
+
+          { &cheat_immortal, FALSE, 255, 0x83, 0x00, "cheat_immortal", _("完全な不滅状態になる。", "Completely immortal.") } };
+
+
 
 /*!
  * 自動セーブオプションテーブル
index 3518237..b2520df 100644 (file)
@@ -24,7 +24,7 @@ struct option_type {
 };
 
 #define MAX_OPTION_INFO 125
-#define MAX_CHEAT_OPTIONS 10
+#define MAX_CHEAT_OPTIONS 11
 #define MAX_AUTOSAVE_INFO 2
 
 extern const std::array<const option_type, MAX_OPTION_INFO> option_info;
index 12ab887..c84039f 100644 (file)
@@ -11,6 +11,7 @@
 #include "floor/floor-events.h"
 #include "io/write-diary.h"
 #include "monster-floor/monster-lite.h"
+#include "game-option/cheat-options.h"
 #include "save/save.h"
 #include "system/system-variables.h"
 #include "term/term-color-types.h"
@@ -78,7 +79,8 @@ static void handle_signal_simple(int sig)
         forget_view(p_ptr->current_floor_ptr);
         clear_mon_lite(p_ptr->current_floor_ptr);
         p_ptr->playing = FALSE;
-        p_ptr->is_dead = TRUE;
+        if (!cheat_immortal)
+            p_ptr->is_dead = TRUE;
         p_ptr->leaving = TRUE;
         close_game(p_ptr);
         quit(_("強制終了", "interrupt"));
index f515345..835ca55 100644 (file)
@@ -56,6 +56,7 @@ void rd_options(void)
     cheat_diary_output = (c & 0x8000) ? TRUE : FALSE;
     cheat_turn = (c & 0x0080) ? TRUE : FALSE;
     cheat_sight = (c & 0x0040) ? TRUE : FALSE;
+    cheat_immortal = (c & 0x0020) ? TRUE : FALSE;
 
     rd_byte((byte *)&autosave_l);
     rd_byte((byte *)&autosave_t);
index 44da0a6..5f05c20 100644 (file)
@@ -327,6 +327,8 @@ int take_hit(player_type *creature_ptr, int damage_type, HIT_POINT damage, concp
     }
 
     creature_ptr->chp -= damage;
+    if (creature_ptr->chp < -9999)
+        creature_ptr->chp = -9999;
     if (damage_type == DAMAGE_GENO && creature_ptr->chp < 0) {
         damage += creature_ptr->chp;
         creature_ptr->chp = 0;
@@ -340,7 +342,7 @@ int take_hit(player_type *creature_ptr, int damage_type, HIT_POINT damage, concp
         chg_virtue(creature_ptr, V_CHANCE, 2);
     }
 
-    if (creature_ptr->chp < 0) {
+    if (creature_ptr->chp < 0 && !cheat_immortal) {
         bool android = (creature_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
 
 #ifdef JP
@@ -353,7 +355,7 @@ int take_hit(player_type *creature_ptr, int damage_type, HIT_POINT damage, concp
         chg_virtue(creature_ptr, V_SACRIFICE, 10);
         handle_stuff(creature_ptr);
         creature_ptr->leaving = TRUE;
-        creature_ptr->is_dead = TRUE;
+        if(!cheat_immortal) creature_ptr->is_dead = TRUE;
         if (creature_ptr->current_floor_ptr->inside_arena) {
             concptr m_name = r_info[arena_info[creature_ptr->arena_number].r_idx].name.c_str();
             msg_format(_("あなたは%sの前に敗れ去った。", "You are beaten by %s."), m_name);
index 5716ace..61f757d 100644 (file)
@@ -90,6 +90,9 @@ void wr_options(save_type type)
     if (cheat_diary_output)
         c |= 0x8000;
 
+    if (cheat_immortal)
+        c |= 0x0020;
+
     if (type == SAVE_TYPE_DEBUG)
         c |= 0xFFFF;