OSDN Git Service

[Refactor] #40256 get_mon_num()に 新しく optionを追加し GMN_ARENA を追加. / Add option argument...
[hengband/hengband.git] / src / bldg.c
index b66095b..bb6ee33 100644 (file)
 #include "term.h"
 
 #include "core.h"
-#include "cmd-dump.h"
-#include "cmd-magiceat.h"
+#include "core/show-file.h"
+#include "io/write-diary.h"
+#include "cmd/cmd-dump.h"
+#include "cmd/cmd-magiceat.h"
 #include "floor.h"
 #include "floor-events.h"
 #include "floor-save.h"
@@ -1341,6 +1343,7 @@ static bool gamble_comm(player_type *player_ptr, int cmd)
                        else if ((roll3 == 2) || (roll3 == 3) || (roll3 == 12))
                                win = FALSE;
                        else
+                       {
                                do
                                {
                                        msg_print(_("なにかキーを押すともう一回振ります。", "Hit any key to roll again"));
@@ -1357,7 +1360,9 @@ static bool gamble_comm(player_type *player_ptr, int cmd)
                                        else if (roll3 == 7)
                                                win = FALSE;
                                } while ((win != TRUE) && (win != FALSE));
-                               break;
+                       }
+                       
+                       break;
 
                case BACT_SPIN_WHEEL:  /* Spin the Wheel Game */
                        win = FALSE;
@@ -1537,7 +1542,6 @@ void update_gambling_monsters(player_type *player_ptr)
        int mon_level;
        int power[4];
        bool tekitou;
-       bool old_inside_battle = player_ptr->phase_out;
 
        for (i = 0; i < current_world_ptr->max_d_idx; i++)
        {
@@ -1568,9 +1572,7 @@ void update_gambling_monsters(player_type *player_ptr)
                        while (TRUE)
                        {
                                get_mon_num_prep(player_ptr, monster_can_entry_arena, NULL);
-                               player_ptr->phase_out = TRUE;
-                               r_idx = get_mon_num(player_ptr, mon_level);
-                               player_ptr->phase_out = old_inside_battle;
+                               r_idx = get_mon_num(player_ptr, mon_level, GMN_ARENA);
                                if (!r_idx) continue;
 
                                if ((r_info[r_idx].flags1 & RF1_UNIQUE) || (r_info[r_idx].flags7 & RF7_UNIQUE2))
@@ -2248,14 +2250,14 @@ static void castle_quest(player_type *player_ptr)
 
        if (q_ptr->r_idx == 0)
        {
-               q_ptr->r_idx = get_mon_num(player_ptr, q_ptr->level + 4 + randint1(6));
+               q_ptr->r_idx = get_mon_num(player_ptr, q_ptr->level + 4 + randint1(6), 0);
        }
 
        monster_race *r_ptr;
        r_ptr = &r_info[q_ptr->r_idx];
        while ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->rarity != 1))
        {
-               q_ptr->r_idx = get_mon_num(player_ptr, q_ptr->level) + 4 + randint1(6);
+               q_ptr->r_idx = get_mon_num(player_ptr, q_ptr->level + 4 + randint1(6), 0);
                r_ptr = &r_info[q_ptr->r_idx];
        }
 
@@ -3012,7 +3014,7 @@ static PRICE repair_broken_weapon_aux(player_type *player_ptr, PRICE bcost)
 
        for (int i = 0; i < TR_FLAG_SIZE; i++) o_ptr->art_flags[i] |= k_ptr->flags[i];
        if (k_ptr->pval) o_ptr->pval = MAX(o_ptr->pval, randint1(k_ptr->pval));
-       if (have_flag(k_ptr->flags, TR_ACTIVATE)) o_ptr->xtra2 = (byte_hack)k_ptr->act_idx;
+       if (have_flag(k_ptr->flags, TR_ACTIVATE)) o_ptr->xtra2 = (byte)k_ptr->act_idx;
 
        if (dd_bonus > 0)
        {
@@ -4024,12 +4026,11 @@ void determine_daily_bounty(player_type *player_ptr, bool conv_old)
                max_dl = MAX(max_dlv[DUNGEON_ANGBAND], 3);
        }
 
-       player_ptr->phase_out = TRUE;
        get_mon_num_prep(player_ptr, NULL, NULL);
 
        while (TRUE)
        {
-               today_mon = get_mon_num(player_ptr, max_dl);
+               today_mon = get_mon_num(player_ptr, max_dl, GMN_ARENA);
                monster_race *r_ptr;
                r_ptr = &r_info[today_mon];
 
@@ -4041,10 +4042,6 @@ void determine_daily_bounty(player_type *player_ptr, bool conv_old)
                if (r_ptr->rarity > 10) continue;
                break;
        }
-
-       player_ptr->today_mon = 0;
-       bool old_inside_battle = player_ptr->phase_out;
-       player_ptr->phase_out = old_inside_battle;
 }
 
 
@@ -4060,7 +4057,7 @@ void determine_bounty_uniques(player_type *player_ptr)
        {
                while (TRUE)
                {
-                       current_world_ptr->bounty_r_idx[i] = get_mon_num(player_ptr, MAX_DEPTH - 1);
+                       current_world_ptr->bounty_r_idx[i] = get_mon_num(player_ptr, MAX_DEPTH - 1, GMN_ARENA);
                        monster_race *r_ptr;
                        r_ptr = &r_info[current_world_ptr->bounty_r_idx[i]];