OSDN Git Service

[Refactor] #38993 num_repro を floor_type に取り込む。 / Move num_repro to floor_type structure.
authordeskull <deskull@users.sourceforge.jp>
Tue, 26 Feb 2019 17:04:35 +0000 (02:04 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 26 Feb 2019 17:04:35 +0000 (02:04 +0900)
src/externs.h
src/floor-save.c
src/load.c
src/monster-process.c
src/monster2.c
src/mutation.c
src/realm-life.c
src/save.c
src/types.h
src/variable.c

index 968f39a..a212293 100644 (file)
@@ -159,7 +159,6 @@ extern s16b command_new;
 extern bool msg_flag;
 extern s16b running;
 extern GAME_TURN resting;
-extern MONSTER_NUMBER num_repro;
 extern DEPTH object_level;
 extern DEPTH monster_level;
 extern bool invoking_midnight_curse;
index c2a51eb..9f0d77a 100644 (file)
@@ -584,7 +584,7 @@ static void place_pet(void)
                        /* r_ptr->cur_num++; */
 
                        /* Hack -- Count the number of "reproducers" */
-                       if (r_ptr->flags2 & RF2_MULTIPLY) num_repro++;
+                       if (r_ptr->flags2 & RF2_MULTIPLY) current_floor_ptr->num_repro++;
 
                        /* Hack -- Notice new multi-hued monsters */
                        {
index 70a83ea..768b919 100644 (file)
@@ -2572,7 +2572,7 @@ static errr rd_dungeon_old(void)
        current_floor_ptr->base_level = (DEPTH)tmp16s;
 
        rd_s16b(&tmp16s);
-       num_repro = (MONSTER_NUMBER)tmp16s;
+       current_floor_ptr->num_repro = (MONSTER_NUMBER)tmp16s;
        rd_s16b(&tmp16s);
        p_ptr->y = (POSITION)tmp16s;
        rd_s16b(&tmp16s);
@@ -3031,7 +3031,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
        rd_s16b(&tmp16s);
        current_floor_ptr->base_level = (DEPTH)tmp16s;
        rd_s16b(&tmp16s);
-       num_repro = (MONSTER_NUMBER)tmp16s;
+       current_floor_ptr->num_repro = (MONSTER_NUMBER)tmp16s;
 
        rd_u16b(&tmp16u);
        p_ptr->y = (POSITION)tmp16u;
index f623d6d..2c9ff58 100644 (file)
@@ -2332,7 +2332,7 @@ void process_monster(MONSTER_IDX m_idx)
        ox = m_ptr->fx;
 
        /* Attempt to "multiply" if able and allowed */
-       if ((r_ptr->flags2 & RF2_MULTIPLY) && (num_repro < MAX_REPRO))
+       if ((r_ptr->flags2 & RF2_MULTIPLY) && (current_floor_ptr->num_repro < MAX_REPRO))
        {
                int k;
                POSITION y, x;
index 2f4cf03..ce5321f 100644 (file)
@@ -246,7 +246,7 @@ void delete_monster_idx(MONSTER_IDX i)
        real_r_ptr(m_ptr)->cur_num--;
 
        /* Hack -- count the number of "reproducers" */
-       if (r_ptr->flags2 & (RF2_MULTIPLY)) num_repro--;
+       if (r_ptr->flags2 & (RF2_MULTIPLY)) current_floor_ptr->num_repro--;
 
        if (MON_CSLEEP(m_ptr)) (void)set_monster_csleep(i, 0);
        if (MON_FAST(m_ptr)) (void)set_monster_fast(i, 0);
@@ -567,7 +567,7 @@ void wipe_m_list(void)
        for (i = 0; i < MAX_MTIMED; i++) mproc_max[i] = 0;
 
        /* Hack -- reset "reproducer" count */
-       num_repro = 0;
+       current_floor_ptr->num_repro = 0;
 
        /* Hack -- no more target */
        target_who = 0;
@@ -3232,7 +3232,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
                real_r_ptr(m_ptr)->floor_id = p_ptr->floor_id;
 
        /* Hack -- Count the number of "reproducers" */
-       if (r_ptr->flags2 & RF2_MULTIPLY) num_repro++;
+       if (r_ptr->flags2 & RF2_MULTIPLY) current_floor_ptr->num_repro++;
 
        /* Hack -- Notice new multi-hued monsters */
        {
index 592fc10..681d0f4 100644 (file)
@@ -2256,7 +2256,7 @@ bool mutation_power_aux(int power)
                case MUT1_STERILITY:
                        msg_print(_("突然頭が痛くなった!", "You suddenly have a headache!"));
                        take_hit(DAMAGE_LOSELIFE, randint1(17) + 17, _("禁欲を強いた疲労", "the strain of forcing abstinence"), -1);
-                       num_repro += MAX_REPRO;
+                       current_floor_ptr->num_repro += MAX_REPRO;
                        break;
 
                case MUT1_PANIC_HIT:
index 2496739..80c0c87 100644 (file)
@@ -369,7 +369,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               num_repro += MAX_REPRO;
+                               current_floor_ptr->num_repro += MAX_REPRO;
                        }
                }
                break;
index 7719d33..eac56ff 100644 (file)
@@ -940,7 +940,7 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
        }
 
        wr_u16b((u16b)current_floor_ptr->base_level);
-       wr_u16b((s16b)num_repro);
+       wr_u16b((s16b)current_floor_ptr->num_repro);
        wr_u16b((u16b)p_ptr->y);
        wr_u16b((u16b)p_ptr->x);
        wr_u16b((u16b)current_floor_ptr->height);
index c92f065..41d477d 100644 (file)
@@ -1880,4 +1880,5 @@ typedef struct {
        DEPTH base_level;
        POSITION width;                 /* Current dungeon width */
        POSITION height;                /* Current dungeon height */
+       MONSTER_NUMBER num_repro; /*!< Current reproducer count */
 } floor_type;
\ No newline at end of file
index 8670d32..2a42c73 100644 (file)
@@ -111,7 +111,6 @@ bool msg_flag;                      /* Used in msg_print() for "buffering" */
 s16b running;                  /* Current counter for running, if any */
 GAME_TURN resting;                     /* Current counter for resting, if any */
 
-MONSTER_NUMBER num_repro; /*!< Current reproducer count */
 DEPTH object_level;            /*!< アイテムの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current object creation level */
 DEPTH monster_level;   /*!< モンスターの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current monster creation level */
 bool invoking_midnight_curse; /*!< 悪夢モード時の真夜中太古の呪い発生処理フラグ */