• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision46b908c51c2db2caaa72afdadb6891add3971169 (tree)
Time2019-02-27 02:04:35
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38993 num_repro を floor_type に取り込む。 / Move num_repro to floor_type structure.

Change Summary

Incremental Difference

--- a/src/externs.h
+++ b/src/externs.h
@@ -159,7 +159,6 @@ extern s16b command_new;
159159 extern bool msg_flag;
160160 extern s16b running;
161161 extern GAME_TURN resting;
162-extern MONSTER_NUMBER num_repro;
163162 extern DEPTH object_level;
164163 extern DEPTH monster_level;
165164 extern bool invoking_midnight_curse;
--- a/src/floor-save.c
+++ b/src/floor-save.c
@@ -584,7 +584,7 @@ static void place_pet(void)
584584 /* r_ptr->cur_num++; */
585585
586586 /* Hack -- Count the number of "reproducers" */
587- if (r_ptr->flags2 & RF2_MULTIPLY) num_repro++;
587+ if (r_ptr->flags2 & RF2_MULTIPLY) current_floor_ptr->num_repro++;
588588
589589 /* Hack -- Notice new multi-hued monsters */
590590 {
--- a/src/load.c
+++ b/src/load.c
@@ -2572,7 +2572,7 @@ static errr rd_dungeon_old(void)
25722572 current_floor_ptr->base_level = (DEPTH)tmp16s;
25732573
25742574 rd_s16b(&tmp16s);
2575- num_repro = (MONSTER_NUMBER)tmp16s;
2575+ current_floor_ptr->num_repro = (MONSTER_NUMBER)tmp16s;
25762576 rd_s16b(&tmp16s);
25772577 p_ptr->y = (POSITION)tmp16s;
25782578 rd_s16b(&tmp16s);
@@ -3031,7 +3031,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
30313031 rd_s16b(&tmp16s);
30323032 current_floor_ptr->base_level = (DEPTH)tmp16s;
30333033 rd_s16b(&tmp16s);
3034- num_repro = (MONSTER_NUMBER)tmp16s;
3034+ current_floor_ptr->num_repro = (MONSTER_NUMBER)tmp16s;
30353035
30363036 rd_u16b(&tmp16u);
30373037 p_ptr->y = (POSITION)tmp16u;
--- a/src/monster-process.c
+++ b/src/monster-process.c
@@ -2332,7 +2332,7 @@ void process_monster(MONSTER_IDX m_idx)
23322332 ox = m_ptr->fx;
23332333
23342334 /* Attempt to "multiply" if able and allowed */
2335- if ((r_ptr->flags2 & RF2_MULTIPLY) && (num_repro < MAX_REPRO))
2335+ if ((r_ptr->flags2 & RF2_MULTIPLY) && (current_floor_ptr->num_repro < MAX_REPRO))
23362336 {
23372337 int k;
23382338 POSITION y, x;
--- a/src/monster2.c
+++ b/src/monster2.c
@@ -246,7 +246,7 @@ void delete_monster_idx(MONSTER_IDX i)
246246 real_r_ptr(m_ptr)->cur_num--;
247247
248248 /* Hack -- count the number of "reproducers" */
249- if (r_ptr->flags2 & (RF2_MULTIPLY)) num_repro--;
249+ if (r_ptr->flags2 & (RF2_MULTIPLY)) current_floor_ptr->num_repro--;
250250
251251 if (MON_CSLEEP(m_ptr)) (void)set_monster_csleep(i, 0);
252252 if (MON_FAST(m_ptr)) (void)set_monster_fast(i, 0);
@@ -567,7 +567,7 @@ void wipe_m_list(void)
567567 for (i = 0; i < MAX_MTIMED; i++) mproc_max[i] = 0;
568568
569569 /* Hack -- reset "reproducer" count */
570- num_repro = 0;
570+ current_floor_ptr->num_repro = 0;
571571
572572 /* Hack -- no more target */
573573 target_who = 0;
@@ -3232,7 +3232,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
32323232 real_r_ptr(m_ptr)->floor_id = p_ptr->floor_id;
32333233
32343234 /* Hack -- Count the number of "reproducers" */
3235- if (r_ptr->flags2 & RF2_MULTIPLY) num_repro++;
3235+ if (r_ptr->flags2 & RF2_MULTIPLY) current_floor_ptr->num_repro++;
32363236
32373237 /* Hack -- Notice new multi-hued monsters */
32383238 {
--- a/src/mutation.c
+++ b/src/mutation.c
@@ -2256,7 +2256,7 @@ bool mutation_power_aux(int power)
22562256 case MUT1_STERILITY:
22572257 msg_print(_("突然頭が痛くなった!", "You suddenly have a headache!"));
22582258 take_hit(DAMAGE_LOSELIFE, randint1(17) + 17, _("禁欲を強いた疲労", "the strain of forcing abstinence"), -1);
2259- num_repro += MAX_REPRO;
2259+ current_floor_ptr->num_repro += MAX_REPRO;
22602260 break;
22612261
22622262 case MUT1_PANIC_HIT:
--- a/src/realm-life.c
+++ b/src/realm-life.c
@@ -369,7 +369,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
369369 {
370370 if (cast)
371371 {
372- num_repro += MAX_REPRO;
372+ current_floor_ptr->num_repro += MAX_REPRO;
373373 }
374374 }
375375 break;
--- a/src/save.c
+++ b/src/save.c
@@ -940,7 +940,7 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
940940 }
941941
942942 wr_u16b((u16b)current_floor_ptr->base_level);
943- wr_u16b((s16b)num_repro);
943+ wr_u16b((s16b)current_floor_ptr->num_repro);
944944 wr_u16b((u16b)p_ptr->y);
945945 wr_u16b((u16b)p_ptr->x);
946946 wr_u16b((u16b)current_floor_ptr->height);
--- a/src/types.h
+++ b/src/types.h
@@ -1880,4 +1880,5 @@ typedef struct {
18801880 DEPTH base_level;
18811881 POSITION width; /* Current dungeon width */
18821882 POSITION height; /* Current dungeon height */
1883+ MONSTER_NUMBER num_repro; /*!< Current reproducer count */
18831884 } floor_type;
\ No newline at end of file
--- a/src/variable.c
+++ b/src/variable.c
@@ -111,7 +111,6 @@ bool msg_flag; /* Used in msg_print() for "buffering" */
111111 s16b running; /* Current counter for running, if any */
112112 GAME_TURN resting; /* Current counter for resting, if any */
113113
114-MONSTER_NUMBER num_repro; /*!< Current reproducer count */
115114 DEPTH object_level; /*!< アイテムの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current object creation level */
116115 DEPTH monster_level; /*!< モンスターの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current monster creation level */
117116 bool invoking_midnight_curse; /*!< 悪夢モード時の真夜中太古の呪い発生処理フラグ */
Show on old repository browser