OSDN Git Service

[Refactor] ESCORT を新定義に合わせた
authorSlimebreath6078 <slimebreath6078@yahoo.co.jp>
Sun, 28 Jan 2024 09:37:47 +0000 (18:37 +0900)
committerSlimebreath6078 <slimebreath6078@yahoo.co.jp>
Sat, 3 Feb 2024 09:11:51 +0000 (18:11 +0900)
src/lore/monster-lore.cpp
src/monster-floor/monster-generator.cpp
src/view/display-lore.cpp

index a7ceffc..4a5e3f1 100644 (file)
@@ -52,8 +52,8 @@ static void set_flags1(lore_type *lore_ptr)
         lore_ptr->misc_flags.set(MonsterMiscType::HAS_FRIENDS);
     }
 
-    if (lore_ptr->r_ptr->flags1 & RF1_ESCORT) {
-        lore_ptr->flags1 |= (RF1_ESCORT);
+    if (lore_ptr->r_ptr->misc_flags.has(MonsterMiscType::ESCORT)) {
+        lore_ptr->misc_flags.set(MonsterMiscType::ESCORT);
     }
 
     if (lore_ptr->r_ptr->flags1 & RF1_ESCORTS) {
index 81b14b8..cd5c971 100644 (file)
@@ -334,7 +334,7 @@ bool place_specific_monster(PlayerType *player_ptr, MONSTER_IDX who, POSITION y,
         (void)place_monster_group(player_ptr, who, y, x, r_idx, mode);
     }
 
-    if (!(r_ptr->flags1 & (RF1_ESCORT))) {
+    if (r_ptr->misc_flags.has_not(MonsterMiscType::ESCORT)) {
         return true;
     }
 
index 5e5c7b3..69cf20c 100644 (file)
@@ -530,7 +530,7 @@ static void display_monster_escort_contents(lore_type *lore_ptr)
     }
 
     hooked_roff(_("護衛の構成は", "These escorts"));
-    if ((lore_ptr->flags1 & RF1_ESCORT) || (lore_ptr->flags1 & RF1_ESCORTS)) {
+    if (lore_ptr->misc_flags.has(MonsterMiscType::ESCORT) || (lore_ptr->flags1 & RF1_ESCORTS)) {
         hooked_roff(_("少なくとも", " at the least"));
     }
 
@@ -578,7 +578,7 @@ static void display_monster_escort_contents(lore_type *lore_ptr)
 
 void display_monster_collective(lore_type *lore_ptr)
 {
-    if ((lore_ptr->flags1 & RF1_ESCORT) || (lore_ptr->flags1 & RF1_ESCORTS) || lore_ptr->reinforce) {
+    if (lore_ptr->misc_flags.has(MonsterMiscType::ESCORT) || (lore_ptr->flags1 & RF1_ESCORTS) || lore_ptr->reinforce) {
         hooked_roff(format(_("%s^は通常護衛を伴って現れる。", "%s^ usually appears with escorts.  "), Who::who(lore_ptr->msex)));
         display_monster_escort_contents(lore_ptr);
     } else if (lore_ptr->misc_flags.has(MonsterMiscType::HAS_FRIENDS)) {