From: deskull Date: Tue, 26 Feb 2019 17:04:35 +0000 (+0900) Subject: [Refactor] #38993 num_repro を floor_type に取り込む。 / Move num_repro to floor_type structure. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=46b908c51c2db2caaa72afdadb6891add3971169;p=hengband%2Fhengband.git [Refactor] #38993 num_repro を floor_type に取り込む。 / Move num_repro to floor_type structure. --- diff --git a/src/externs.h b/src/externs.h index 968f39a73..a212293a5 100644 --- a/src/externs.h +++ b/src/externs.h @@ -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; diff --git a/src/floor-save.c b/src/floor-save.c index c2a51eb2c..9f0d77a10 100644 --- a/src/floor-save.c +++ b/src/floor-save.c @@ -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 */ { diff --git a/src/load.c b/src/load.c index 70a83ea4f..768b91958 100644 --- a/src/load.c +++ b/src/load.c @@ -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; diff --git a/src/monster-process.c b/src/monster-process.c index f623d6d0b..2c9ff589b 100644 --- a/src/monster-process.c +++ b/src/monster-process.c @@ -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; diff --git a/src/monster2.c b/src/monster2.c index 2f4cf0370..ce5321fd4 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -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 */ { diff --git a/src/mutation.c b/src/mutation.c index 592fc104a..681d0f4a2 100644 --- a/src/mutation.c +++ b/src/mutation.c @@ -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: diff --git a/src/realm-life.c b/src/realm-life.c index 24967391e..80c0c876f 100644 --- a/src/realm-life.c +++ b/src/realm-life.c @@ -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; diff --git a/src/save.c b/src/save.c index 7719d332b..eac56fff8 100644 --- a/src/save.c +++ b/src/save.c @@ -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); diff --git a/src/types.h b/src/types.h index c92f06559..41d477d45 100644 --- a/src/types.h +++ b/src/types.h @@ -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 diff --git a/src/variable.c b/src/variable.c index 8670d3248..2a42c73f5 100644 --- a/src/variable.c +++ b/src/variable.c @@ -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; /*!< 悪夢モード時の真夜中太古の呪い発生処理フラグ */