OSDN Git Service

[Refactor] ELDRITCH_HORROR を新定義に合わせた
authorSlimebreath6078 <slimebreath6078@yahoo.co.jp>
Sun, 28 Jan 2024 10:46:58 +0000 (19:46 +0900)
committerSlimebreath6078 <slimebreath6078@yahoo.co.jp>
Sat, 3 Feb 2024 09:11:57 +0000 (18:11 +0900)
src/effect/effect-monster-resist-hurt.cpp
src/monster-race/monster-race-hook.cpp
src/monster/monster-update.cpp
src/perception/identification.cpp
src/player/eldritch-horror.cpp
src/view/display-lore.cpp

index 057276e..71b043e 100644 (file)
@@ -758,7 +758,7 @@ ProcessResult effect_monster_abyss(PlayerType *player_ptr, EffectMonster *em_ptr
         }
     }
 
-    if (any_bits(em_ptr->r_ptr->flags2, RF2_ELDRITCH_HORROR) || any_bits(em_ptr->r_ptr->flags2, RF2_EMPTY_MIND)) {
+    if (em_ptr->r_ptr->misc_flags.has(MonsterMiscType::ELDRITCH_HORROR) || any_bits(em_ptr->r_ptr->flags2, RF2_EMPTY_MIND)) {
         return ProcessResult::PROCESS_CONTINUE;
     }
 
index 17e1a0e..b262a43 100644 (file)
@@ -752,7 +752,7 @@ bool vault_aux_cthulhu(PlayerType *player_ptr, MonsterRaceId r_idx)
         return false;
     }
 
-    if (!(r_ptr->flags2 & (RF2_ELDRITCH_HORROR))) {
+    if (r_ptr->misc_flags.has_not(MonsterMiscType::ELDRITCH_HORROR)) {
         return false;
     }
 
@@ -817,7 +817,7 @@ bool monster_hook_human(PlayerType *player_ptr, MonsterRaceId r_idx)
 bool get_nightmare(PlayerType *player_ptr, MonsterRaceId r_idx)
 {
     auto *r_ptr = &monraces_info[r_idx];
-    if (none_bits(r_ptr->flags2, RF2_ELDRITCH_HORROR)) {
+    if (r_ptr->misc_flags.has_not(MonsterMiscType::ELDRITCH_HORROR)) {
         return false;
     }
 
index 5a99ad5..9aebcd2 100644 (file)
@@ -529,7 +529,7 @@ static void update_invisible_monster(PlayerType *player_ptr, um_type *um_ptr, MO
         }
     }
 
-    if (w_ptr->is_loading_now && w_ptr->character_dungeon && !AngbandSystem::get_instance().is_phase_out() && m_ptr->get_appearance_monrace().flags2 & RF2_ELDRITCH_HORROR) {
+    if (w_ptr->is_loading_now && w_ptr->character_dungeon && !AngbandSystem::get_instance().is_phase_out() && m_ptr->get_appearance_monrace().misc_flags.has(MonsterMiscType::ELDRITCH_HORROR)) {
         m_ptr->mflag.set(MonsterTemporaryFlagType::SANITY_BLAST);
     }
 
index ddf68c4..b57eae2 100644 (file)
@@ -102,7 +102,7 @@ bool screen_object(PlayerType *player_ptr, ItemEntity *o_ptr, BIT_FLAGS mode)
         auto *r_ptr = &monraces_info[statue_r_idx];
         if (statue_r_idx == MonsterRaceId::BULLGATES) {
             info[i++] = _("それは部屋に飾ると恥ずかしい。", "It is shameful.");
-        } else if (r_ptr->flags2 & (RF2_ELDRITCH_HORROR)) {
+        } else if (r_ptr->misc_flags.has(MonsterMiscType::ELDRITCH_HORROR)) {
             info[i++] = _("それは部屋に飾ると恐い。", "It is fearful.");
         } else {
             info[i++] = _("それは部屋に飾ると楽しい。", "It is cheerful.");
index 73fccec..6b33b5e 100644 (file)
@@ -49,7 +49,7 @@ static void see_eldritch_horror(std::string_view m_name, MonsterRaceInfo *r_ptr)
 {
     const auto &horror_message = r_ptr->decide_horror_message();
     msg_format(_("%s%sの顔を見てしまった!", "You behold the %s visage of %s!"), horror_message.data(), m_name.data());
-    r_ptr->r_flags2 |= RF2_ELDRITCH_HORROR;
+    r_ptr->r_misc_flags.set(MonsterMiscType::ELDRITCH_HORROR);
 }
 
 /*!
@@ -61,7 +61,7 @@ static void feel_eldritch_horror(std::string_view desc, MonsterRaceInfo *r_ptr)
 {
     const auto &horror_message = r_ptr->decide_horror_message();
     msg_format(_("%s%sの顔を見てしまった!", "You behold the %s visage of %s!"), horror_message.data(), desc.data());
-    r_ptr->r_flags2 |= RF2_ELDRITCH_HORROR;
+    r_ptr->r_misc_flags.set(MonsterMiscType::ELDRITCH_HORROR);
 }
 
 static bool process_mod_hallucination(PlayerType *player_ptr, std::string_view m_name, const MonsterRaceInfo &monrace)
@@ -111,7 +111,7 @@ void sanity_blast(PlayerType *player_ptr, MonsterEntity *m_ptr, bool necro)
             return;
         }
 
-        if (!(r_ptr->flags2 & RF2_ELDRITCH_HORROR)) {
+        if (r_ptr->misc_flags.has_not(MonsterMiscType::ELDRITCH_HORROR)) {
             return;
         }
 
index 295d124..d843253 100644 (file)
@@ -399,7 +399,7 @@ void display_monster_kind(lore_type *lore_ptr)
 
 void display_monster_alignment(lore_type *lore_ptr)
 {
-    if (lore_ptr->flags2 & RF2_ELDRITCH_HORROR) {
+    if (lore_ptr->misc_flags.has(MonsterMiscType::ELDRITCH_HORROR)) {
         hook_c_roff(TERM_VIOLET, _("狂気を誘う", " sanity-blasting"));
     }