OSDN Git Service

[Refactor] #37353 生命の薬の効果をlife_stream()に分離。
[hengband/hengband.git] / src / dungeon.c
index d1a72d2..a9b0b3b 100644 (file)
  */
 
 #include "angband.h"
-
-#define TY_CURSE_CHANCE 200 /*!<太古の怨念の1ターン毎の発動確率(1/n)*/
-#define CHAINSWORD_NOISE 100 /*!<チェンソーの1ターン毎の発動確率(1/n)*/
+#include "cmd-activate.h"
+#include "cmd-eat.h"
+#include "cmd-item.h"
+#include "cmd-magiceat.h"
+#include "cmd-quaff.h"
+#include "cmd-read.h"
+#include "cmd-usestaff.h"
+#include "cmd-zaprod.h"
+#include "cmd-zapwand.h"
+#include "cmd-pet.h"
 
 static bool load = TRUE; /*!<ロード処理中の分岐フラグ*/
 static int wild_regen = 20; /*!<広域マップ移動時の自然回復処理カウンタ(広域マップ1マス毎に20回処理を基本とする)*/
@@ -4568,10 +4575,7 @@ static void process_command(void)
                /* Throw an item */
                case 'v':
                {
-                       if (!p_ptr->wild_mode)
-                       {
-                               do_cmd_throw();
-                       }
+                       if (!p_ptr->wild_mode) do_cmd_throw(1, FALSE, -1);
                        break;
                }
 
@@ -5626,9 +5630,15 @@ static void process_player(void)
 /*!
  * @brief 現在プレイヤーがいるダンジョンの全体処理 / Interact with the current dungeon level.
  * @return なし
- * @note
+ * @details
+ * <p>
+ * この関数から現在の階層を出る、プレイヤーがキャラが死ぬ、
+ * ゲームを終了するかのいずれかまでループする。
+ * </p>
+ * <p>
  * This function will not exit until the level is completed,\n
  * the user dies, or the game is terminated.\n
+ * </p>
  */
 static void dungeon(bool load_game)
 {
@@ -5638,7 +5648,7 @@ static void dungeon(bool load_game)
        base_level = dun_level;
 
        /* Reset various flags */
-       hack_mind = FALSE;
+       is_loading_now = FALSE;
 
        /* Not leaving */
        p_ptr->leaving = FALSE;
@@ -5806,7 +5816,7 @@ static void dungeon(bool load_game)
        /* Reset the object generation level */
        object_level = base_level;
 
-       hack_mind = TRUE;
+       is_loading_now = TRUE;
 
        if (p_ptr->energy_need > 0 && !p_ptr->inside_battle &&
            (dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena))
@@ -6225,6 +6235,9 @@ void play_game(bool new_game)
                /* Open the high score file, for reading/writing */
                highscore_fd = fd_open(buf, O_RDWR);
 
+               /* 町名消失バグ対策(#38205) Init the wilderness */
+               process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x);
+
                /* Handle score, show Top scores */
                success = send_world_score(TRUE);
 
@@ -6607,9 +6620,7 @@ void play_game(bool new_game)
                                        msg_print(_("ウィザードモードに念を送り、死を欺いた。", "You invoke wizard mode and cheat death."));
                                        msg_print(NULL);
 
-                                       /* Restore hit points */
-                                       p_ptr->chp = p_ptr->mhp;
-                                       p_ptr->chp_frac = 0;
+                                       (void)life_stream(FALSE, FALSE);
 
                                        if (p_ptr->pclass == CLASS_MAGIC_EATER)
                                        {
@@ -6623,6 +6634,7 @@ void play_game(bool new_game)
                                                        p_ptr->magic_num1[magic_idx] = 0;
                                                }
                                        }
+
                                        /* Restore spell points */
                                        p_ptr->csp = p_ptr->msp;
                                        p_ptr->csp_frac = 0;
@@ -6653,16 +6665,6 @@ void play_game(bool new_game)
                                        /* Do not die */
                                        p_ptr->is_dead = FALSE;
 
-                                       /* Hack -- Healing */
-                                       (void)set_blind(0);
-                                       (void)set_confused(0);
-                                       (void)set_poisoned(0);
-                                       (void)set_afraid(0);
-                                       (void)set_paralyzed(0);
-                                       (void)set_image(0);
-                                       (void)set_stun(0);
-                                       (void)set_cut(0);
-
                                        /* Hack -- Prevent starvation */
                                        (void)set_food(PY_FOOD_MAX - 1);