OSDN Git Service

[Refactor] MULTIPLY を新定義に合わせた
authorSlimebreath6078 <slimebreath6078@yahoo.co.jp>
Sun, 28 Jan 2024 10:52:11 +0000 (19:52 +0900)
committerSlimebreath6078 <slimebreath6078@yahoo.co.jp>
Sat, 3 Feb 2024 09:11:57 +0000 (18:11 +0900)
12 files changed:
src/avatar/avatar-changer.cpp
src/floor/floor-changer.cpp
src/market/bounty.cpp
src/monster-floor/monster-death.cpp
src/monster-floor/monster-remover.cpp
src/monster-floor/one-monster-placer.cpp
src/monster-race/monster-race-hook.cpp
src/monster/monster-damage.cpp
src/monster/monster-list.cpp
src/monster/monster-processor.cpp
src/mspell/summon-checker.cpp
src/view/display-lore-status.cpp

index 0713c36..c462dd7 100644 (file)
@@ -48,7 +48,7 @@ void AvatarChanger::change_virtue()
     }
 
     this->change_virtue_revenge();
-    if (any_bits(r_ref.flags2, RF2_MULTIPLY) && (r_ref.r_akills > 1000) && one_in_(10)) {
+    if (r_ref.misc_flags.has(MonsterMiscType::MULTIPLY) && (r_ref.r_akills > 1000) && one_in_(10)) {
         chg_virtue(this->player_ptr, Virtue::VALOUR, -1);
     }
 
index aeb6d9b..fdfa232 100644 (file)
@@ -152,7 +152,7 @@ static void place_pet(PlayerType *player_ptr)
             auto &r_ref = set_pet_params(player_ptr, current_monster, m_idx, cy, cx);
             update_monster(player_ptr, m_idx, true);
             lite_spot(player_ptr, cy, cx);
-            if (any_bits(r_ref.flags2, RF2_MULTIPLY)) {
+            if (r_ref.misc_flags.has(MonsterMiscType::MULTIPLY)) {
                 player_ptr->current_floor_ptr->num_repro++;
             }
         } else {
index 4eb5594..58d3bb0 100644 (file)
@@ -303,7 +303,7 @@ void determine_daily_bounty(PlayerType *player_ptr, bool conv_old)
         if (r_ptr->population_flags.has(MonsterPopulationType::NAZGUL) || r_ptr->population_flags.has(MonsterPopulationType::ONLY_ONE)) {
             continue;
         }
-        if (r_ptr->flags2 & RF2_MULTIPLY) {
+        if (r_ptr->misc_flags.has(MonsterMiscType::MULTIPLY)) {
             continue;
         }
         if (!r_ptr->drop_flags.has_all_of({ MonsterDropType::DROP_CORPSE, MonsterDropType::DROP_SKELETON })) {
index f6b024e..52352cc 100644 (file)
@@ -284,7 +284,7 @@ static int decide_drop_numbers(MonsterDeath *md_ptr, const bool drop_item, const
         drop_numbers = 0;
     }
 
-    if ((md_ptr->r_ptr->flags2 & (RF2_MULTIPLY)) && (md_ptr->r_ptr->r_akills > 1024)) {
+    if (md_ptr->r_ptr->misc_flags.has(MonsterMiscType::MULTIPLY) && (md_ptr->r_ptr->r_akills > 1024)) {
         drop_numbers = 0;
     }
 
index 9c5b03d..c311853 100644 (file)
@@ -37,7 +37,7 @@ void delete_monster_idx(PlayerType *player_ptr, MONSTER_IDX i)
     POSITION x = m_ptr->fx;
 
     m_ptr->get_real_monrace().cur_num--;
-    if (r_ptr->flags2 & (RF2_MULTIPLY)) {
+    if (r_ptr->misc_flags.has(MonsterMiscType::MULTIPLY)) {
         floor_ptr->num_repro--;
     }
 
index e965865..acb3946 100644 (file)
@@ -70,7 +70,7 @@ static bool monster_hook_tanuki(PlayerType *player_ptr, MonsterRaceId r_idx)
 {
     const auto &monrace = monraces_info[r_idx];
     bool unselectable = monrace.kind_flags.has(MonsterKindType::UNIQUE);
-    unselectable |= any_bits(monrace.flags2, RF2_MULTIPLY);
+    unselectable |= monrace.misc_flags.has(MonsterMiscType::MULTIPLY);
     unselectable |= monrace.behavior_flags.has(MonsterBehaviorType::FRIENDLY);
     unselectable |= monrace.feature_flags.has(MonsterFeatureType::AQUATIC);
     unselectable |= monrace.misc_flags.has(MonsterMiscType::CHAMELEON);
@@ -432,7 +432,7 @@ bool place_monster_one(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSI
         m_ptr->get_real_monrace().floor_id = player_ptr->floor_id;
     }
 
-    if (any_bits(r_ptr->flags2, RF2_MULTIPLY)) {
+    if (r_ptr->misc_flags.has(MonsterMiscType::MULTIPLY)) {
         floor.num_repro++;
     }
 
index b262a43..d904bd4 100644 (file)
@@ -103,7 +103,7 @@ bool mon_hook_quest(PlayerType *player_ptr, MonsterRaceId r_idx)
         return false;
     }
 
-    if (any_bits(r_ptr->flags2, RF2_MULTIPLY)) {
+    if (r_ptr->misc_flags.has(MonsterMiscType::MULTIPLY)) {
         return false;
     }
 
@@ -861,7 +861,7 @@ bool monster_can_entry_arena(PlayerType *player_ptr, MonsterRaceId r_idx)
     int dam = 0;
     const auto &monrace = monraces_info[r_idx];
     bool unselectable = monrace.behavior_flags.has(MonsterBehaviorType::NEVER_MOVE);
-    unselectable |= any_bits(monrace.flags2, RF2_MULTIPLY);
+    unselectable |= monrace.misc_flags.has(MonsterMiscType::MULTIPLY);
     unselectable |= monrace.kind_flags.has(MonsterKindType::QUANTUM) && monrace.kind_flags.has_not(MonsterKindType::UNIQUE);
     unselectable |= monrace.feature_flags.has(MonsterFeatureType::AQUATIC);
     unselectable |= monrace.misc_flags.has(MonsterMiscType::CHAMELEON);
index ace5a70..a6f4ad2 100644 (file)
@@ -401,7 +401,7 @@ void MonsterDamageProcessor::get_exp_from_mon(MonsterEntity *m_ptr, int exp_dam)
     s64b_div(&new_exp, &new_exp_frac, div_h, div_l);
 
     /* Special penalty for mutiply-monster */
-    if (any_bits(r_ptr->flags2, RF2_MULTIPLY) || (m_ptr->r_idx == MonsterRaceId::DAWN)) {
+    if (r_ptr->misc_flags.has(MonsterMiscType::MULTIPLY) || (m_ptr->r_idx == MonsterRaceId::DAWN)) {
         int monnum_penarty = r_ptr->r_akills / 400;
         if (monnum_penarty > 8) {
             monnum_penarty = 8;
index 90a1238..7f1563b 100644 (file)
@@ -264,7 +264,7 @@ static bool monster_hook_chameleon(PlayerType *player_ptr, MonsterRaceId r_idx)
     if (r_ptr->kind_flags.has(MonsterKindType::UNIQUE)) {
         return false;
     }
-    if (r_ptr->flags2 & RF2_MULTIPLY) {
+    if (r_ptr->misc_flags.has(MonsterMiscType::MULTIPLY)) {
         return false;
     }
     if (r_ptr->behavior_flags.has(MonsterBehaviorType::FRIENDLY) || (r_ptr->misc_flags.has(MonsterMiscType::CHAMELEON))) {
index 83c6afe..8da9e15 100644 (file)
@@ -444,7 +444,7 @@ bool decide_monster_multiplication(PlayerType *player_ptr, MONSTER_IDX m_idx, PO
 {
     auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
     auto *r_ptr = &m_ptr->get_monrace();
-    if (((r_ptr->flags2 & RF2_MULTIPLY) == 0) || (player_ptr->current_floor_ptr->num_repro >= MAX_REPRODUCTION)) {
+    if (r_ptr->misc_flags.has_not(MonsterMiscType::MULTIPLY) || (player_ptr->current_floor_ptr->num_repro >= MAX_REPRODUCTION)) {
         return false;
     }
 
@@ -469,7 +469,7 @@ bool decide_monster_multiplication(PlayerType *player_ptr, MONSTER_IDX m_idx, PO
     if ((k < 4) && (!k || !randint0(k * chance_reproduction))) {
         if (multiply_monster(player_ptr, m_idx, false, (m_ptr->is_pet() ? PM_FORCE_PET : 0))) {
             if (player_ptr->current_floor_ptr->m_list[hack_m_idx_ii].ml && is_original_ap_and_seen(player_ptr, m_ptr)) {
-                r_ptr->r_flags2 |= RF2_MULTIPLY;
+                r_ptr->r_misc_flags.set(MonsterMiscType::MULTIPLY);
             }
 
             return true;
index ea36fb1..e0d64d0 100644 (file)
@@ -81,7 +81,7 @@ bool check_summon_specific(PlayerType *player_ptr, MonsterRaceId summoner_idx, M
         is_match &= monrace.kind_flags.has_not(MonsterKindType::EVIL);
         is_match &= monrace.kind_flags.has_not(MonsterKindType::UNDEAD);
         is_match &= monrace.kind_flags.has_not(MonsterKindType::DEMON);
-        is_match &= none_bits(monrace.flags2, RF2_MULTIPLY);
+        is_match &= monrace.misc_flags.has_not(MonsterMiscType::MULTIPLY);
         is_match &= monrace.ability_flags.none();
         return is_match;
     }
index c62d19a..6e785e5 100644 (file)
@@ -152,7 +152,7 @@ void display_monster_constitutions(lore_type *lore_ptr)
         hooked_roff(format(_("%s^はまれにテレパシーで感知できる。", "%s^ is rarely detected by telepathy.  "), Who::who(lore_ptr->msex)));
     }
 
-    if (lore_ptr->flags2 & RF2_MULTIPLY) {
+    if (lore_ptr->misc_flags.has(MonsterMiscType::MULTIPLY)) {
         hook_c_roff(TERM_L_UMBER, format(_("%s^は爆発的に増殖する。", "%s^ breeds explosively.  "), Who::who(lore_ptr->msex)));
     }