• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision955fcd44c4cb6399e8ce81c6343881159dc04638 (tree)
Time2019-05-07 23:00:11
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38993 mon_fight を floor_type の monster_noise に置換.

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -3169,7 +3169,7 @@ static void process_world(void)
31693169 do_cmd_save_game(TRUE);
31703170 }
31713171
3172- if (mon_fight && !ignore_unview)
3172+ if (current_floor_ptr->monster_noise && !ignore_unview)
31733173 {
31743174 msg_print(_("何かが聞こえた。", "You hear noise."));
31753175 }
--- a/src/externs.h
+++ b/src/externs.h
@@ -183,7 +183,6 @@ extern bool write_level;
183183 extern u32b start_time;
184184 extern bool sukekaku;
185185 extern bool new_mane;
186-extern bool mon_fight;
187186 extern bool generate_encounter;
188187 extern concptr screen_dump;
189188
--- a/src/floor.h
+++ b/src/floor.h
@@ -44,6 +44,8 @@ typedef struct {
4444 POSITION redraw_y[REDRAW_MAX];
4545 POSITION redraw_x[REDRAW_MAX];
4646
47+ bool monster_noise;
48+
4749 } floor_type;
4850
4951 #define DUNGEON_MODE_NONE 0
--- a/src/melee1.c
+++ b/src/melee1.c
@@ -4197,7 +4197,7 @@ void mon_take_hit_mon(MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear,
41974197 /* Unseen death by normal attack */
41984198 if (!seen)
41994199 {
4200- mon_fight = TRUE;
4200+ current_floor_ptr->monster_noise = TRUE;
42014201 }
42024202 /* Death by special attack */
42034203 else if (note)
--- a/src/monster-process.c
+++ b/src/monster-process.c
@@ -1292,7 +1292,7 @@ static bool monst_attack_monst(MONSTER_IDX m_idx, MONSTER_IDX t_idx)
12921292
12931293 if (!see_either && known)
12941294 {
1295- mon_fight = TRUE;
1295+ current_floor_ptr->monster_noise = TRUE;
12961296 }
12971297
12981298 if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
@@ -1837,7 +1837,7 @@ static bool monst_attack_monst(MONSTER_IDX m_idx, MONSTER_IDX t_idx)
18371837 }
18381838 else if (known)
18391839 {
1840- mon_fight = TRUE;
1840+ current_floor_ptr->monster_noise = TRUE;
18411841 }
18421842 }
18431843 else
@@ -1848,7 +1848,7 @@ static bool monst_attack_monst(MONSTER_IDX m_idx, MONSTER_IDX t_idx)
18481848 }
18491849 else if (known)
18501850 {
1851- mon_fight = TRUE;
1851+ current_floor_ptr->monster_noise = TRUE;
18521852 }
18531853
18541854 teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
@@ -3145,7 +3145,7 @@ void process_monsters(void)
31453145 SPEED speed;
31463146
31473147 /* Clear monster fighting indicator */
3148- mon_fight = FALSE;
3148+ current_floor_ptr->monster_noise = FALSE;
31493149
31503150 /* Memorize old race */
31513151 old_monster_race_idx = p_ptr->monster_race_idx;
--- a/src/mspells4.c
+++ b/src/mspells4.c
@@ -122,7 +122,7 @@ static void monspell_message_base(MONSTER_IDX m_idx, MONSTER_IDX t_idx, concptr
122122 }
123123
124124 if (mon_to_mon && known && !see_either)
125- mon_fight = TRUE;
125+ current_floor_ptr->monster_noise = TRUE;
126126 }
127127
128128 /*!
@@ -464,7 +464,7 @@ HIT_POINT spell_RF4_BREATH(int GF_TYPE, POSITION y, POSITION x, MONSTER_IDX m_id
464464 }
465465
466466 if (mon_to_mon && known && !see_either)
467- mon_fight = TRUE;
467+ current_floor_ptr->monster_noise = TRUE;
468468
469469 sound(SOUND_BREATH);
470470 breath(y, x, m_idx, GF_TYPE, dam, 0, TRUE, ms_type, TARGET_TYPE);
@@ -946,7 +946,7 @@ void spell_RF5_CAUSE(int GF_TYPE, HIT_POINT dam, POSITION y, POSITION x, MONSTER
946946 }
947947 else
948948 {
949- mon_fight = TRUE;
949+ current_floor_ptr->monster_noise = TRUE;
950950 }
951951 }
952952 breath(y, x, m_idx, GF_TYPE, dam, 0, FALSE, MS_TYPE, TARGET_TYPE);
@@ -1405,7 +1405,7 @@ void spell_badstatus_message(MONSTER_IDX m_idx, MONSTER_IDX t_idx, concptr msg1,
14051405 }
14061406 else
14071407 {
1408- mon_fight = TRUE;
1408+ current_floor_ptr->monster_noise = TRUE;
14091409 }
14101410 }
14111411
@@ -2709,7 +2709,7 @@ void spell_RF6_S_KIN(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_id
27092709 }
27102710
27112711 if (mon_to_mon && known && !see_either)
2712- mon_fight = TRUE;
2712+ current_floor_ptr->monster_noise = TRUE;
27132713 }
27142714
27152715 switch (m_ptr->r_idx)
@@ -2746,7 +2746,7 @@ void spell_RF6_S_KIN(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_id
27462746 msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
27472747
27482748 if (known && !see_monster(t_idx) && count && mon_to_mon)
2749- mon_fight = TRUE;
2749+ current_floor_ptr->monster_noise = TRUE;
27502750 }
27512751
27522752 /*!
@@ -2785,7 +2785,7 @@ void spell_RF6_S_CYBER(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_
27852785 msg_print(_("重厚な足音が近くで聞こえる。", "You hear heavy steps nearby."));
27862786
27872787 if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2788- mon_fight = TRUE;
2788+ current_floor_ptr->monster_noise = TRUE;
27892789 }
27902790
27912791 /*!
@@ -2823,7 +2823,7 @@ void spell_RF6_S_MONSTER(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX
28232823 msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
28242824
28252825 if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2826- mon_fight = TRUE;
2826+ current_floor_ptr->monster_noise = TRUE;
28272827 }
28282828
28292829 /*!
@@ -2861,7 +2861,7 @@ void spell_RF6_S_MONSTERS(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX
28612861 msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
28622862
28632863 if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2864- mon_fight = TRUE;
2864+ current_floor_ptr->monster_noise = TRUE;
28652865 }
28662866
28672867 /*!
@@ -2895,7 +2895,7 @@ void spell_RF6_S_ANT(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_id
28952895 msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
28962896
28972897 if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2898- mon_fight = TRUE;
2898+ current_floor_ptr->monster_noise = TRUE;
28992899 }
29002900
29012901 /*!
@@ -2929,7 +2929,7 @@ void spell_RF6_S_SPIDER(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t
29292929 msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
29302930
29312931 if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2932- mon_fight = TRUE;
2932+ current_floor_ptr->monster_noise = TRUE;
29332933 }
29342934
29352935 /*!
@@ -2963,7 +2963,7 @@ void spell_RF6_S_HOUND(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_
29632963 msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
29642964
29652965 if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
2966- mon_fight = TRUE;
2966+ current_floor_ptr->monster_noise = TRUE;
29672967 }
29682968
29692969 /*!
@@ -2997,7 +2997,7 @@ void spell_RF6_S_HYDRA(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_
29972997 msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
29982998
29992999 if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
3000- mon_fight = TRUE;
3000+ current_floor_ptr->monster_noise = TRUE;
30013001 }
30023002
30033003 /*!
@@ -3046,7 +3046,7 @@ void spell_RF6_S_ANGEL(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_
30463046 }
30473047
30483048 if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
3049- mon_fight = TRUE;
3049+ current_floor_ptr->monster_noise = TRUE;
30503050 }
30513051
30523052 /*!
@@ -3079,7 +3079,7 @@ void spell_RF6_S_DEMON(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_
30793079 msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
30803080
30813081 if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
3082- mon_fight = TRUE;
3082+ current_floor_ptr->monster_noise = TRUE;
30833083 }
30843084
30853085 /*!
@@ -3112,7 +3112,7 @@ void spell_RF6_S_UNDEAD(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t
31123112 msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
31133113
31143114 if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
3115- mon_fight = TRUE;
3115+ current_floor_ptr->monster_noise = TRUE;
31163116 }
31173117
31183118 /*!
@@ -3145,7 +3145,7 @@ void spell_RF6_S_DRAGON(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t
31453145 msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
31463146
31473147 if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
3148- mon_fight = TRUE;
3148+ current_floor_ptr->monster_noise = TRUE;
31493149 }
31503150
31513151 /*!
@@ -3256,7 +3256,7 @@ void spell_RF6_S_HI_UNDEAD(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_ID
32563256 }
32573257
32583258 if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
3259- mon_fight = TRUE;
3259+ current_floor_ptr->monster_noise = TRUE;
32603260 }
32613261
32623262 /*!
@@ -3296,7 +3296,7 @@ void spell_RF6_S_HI_DRAGON(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_ID
32963296 }
32973297
32983298 if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
3299- mon_fight = TRUE;
3299+ current_floor_ptr->monster_noise = TRUE;
33003300 }
33013301
33023302 /*!
@@ -3332,7 +3332,7 @@ void spell_RF6_S_AMBERITES(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_ID
33323332 }
33333333
33343334 if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
3335- mon_fight = TRUE;
3335+ current_floor_ptr->monster_noise = TRUE;
33363336 }
33373337
33383338 /*!
@@ -3384,7 +3384,7 @@ void spell_RF6_S_UNIQUE(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t
33843384 }
33853385
33863386 if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
3387- mon_fight = TRUE;
3387+ current_floor_ptr->monster_noise = TRUE;
33883388 }
33893389
33903390
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -3796,7 +3796,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
37963796 }
37973797 else
37983798 {
3799- mon_fight = TRUE;
3799+ current_floor_ptr->monster_noise = TRUE;
38003800 }
38013801 }
38023802
@@ -3827,7 +3827,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
38273827 }
38283828 else
38293829 {
3830- mon_fight = TRUE;
3830+ current_floor_ptr->monster_noise = TRUE;
38313831 }
38323832
38333833 /* Hack -- handle sleep */
--- a/src/variable.c
+++ b/src/variable.c
@@ -412,8 +412,6 @@ u32b start_time;
412412 bool sukekaku;
413413 bool new_mane;
414414
415-bool mon_fight;
416-
417415 bool generate_encounter;
418416
419417 concptr screen_dump = NULL;
Show on old repository browser