OSDN Git Service

[Refactor] #3325 単数形のMonsterRaceInfo::blow をblows に修正した
authorHourier <66951241+Hourier@users.noreply.github.com>
Sat, 20 May 2023 02:58:06 +0000 (11:58 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Sat, 20 May 2023 13:56:23 +0000 (22:56 +0900)
18 files changed:
src/avatar/avatar-changer.cpp
src/info-reader/race-reader.cpp
src/lore/combat-types-setter.cpp
src/lore/lore-calculator.cpp
src/lore/lore-store.cpp
src/melee/monster-attack-monster.cpp
src/monster-attack/monster-attack-player.cpp
src/monster-floor/monster-death.cpp
src/monster-floor/one-monster-placer.cpp
src/monster-race/monster-race-hook.cpp
src/monster/monster-list.cpp
src/mspell/mspell-damage-calculator.cpp
src/mspell/summon-checker.cpp
src/object/warning.cpp
src/system/monster-race-info.cpp
src/system/monster-race-info.h
src/view/display-lore-attacks.cpp
src/view/display-lore.cpp

index a7e0fe8..a3757b2 100644 (file)
@@ -171,11 +171,11 @@ void AvatarChanger::change_virtue_wild_thief()
     auto innocent = true;
     auto thief = false;
     for (auto i = 0; i < MAX_NUM_BLOWS; i++) {
-        if (r_ptr->blow[i].d_dice != 0) {
+        if (r_ptr->blows[i].d_dice != 0) {
             innocent = false;
         }
 
-        if ((r_ptr->blow[i].effect == RaceBlowEffectType::EAT_ITEM) || (r_ptr->blow[i].effect == RaceBlowEffectType::EAT_GOLD)) {
+        if ((r_ptr->blows[i].effect == RaceBlowEffectType::EAT_ITEM) || (r_ptr->blows[i].effect == RaceBlowEffectType::EAT_GOLD)) {
             thief = true;
         }
     }
index c9e04b7..8b8ab2d 100644 (file)
@@ -229,7 +229,7 @@ errr parse_monraces_info(std::string_view buf, angband_header *)
         // B:blow_type:blow_effect:dice
         size_t i = 0;
         for (; i < 4; i++) {
-            if (r_ptr->blow[i].method == RaceBlowMethodType::NONE) {
+            if (r_ptr->blows[i].method == RaceBlowMethodType::NONE) {
                 break;
             }
         }
@@ -255,16 +255,16 @@ errr parse_monraces_info(std::string_view buf, angband_header *)
             return PARSE_ERROR_INVALID_FLAG;
         }
 
-        r_ptr->blow[i].method = rbm->second;
-        r_ptr->blow[i].effect = rbe->second;
+        r_ptr->blows[i].method = rbm->second;
+        r_ptr->blows[i].effect = rbe->second;
 
         if (tokens.size() < 4) {
             return PARSE_ERROR_NONE;
         }
 
         const auto &dice = str_split(tokens[3], 'd', false, 2);
-        info_set_value(r_ptr->blow[i].d_dice, dice[0]);
-        info_set_value(r_ptr->blow[i].d_side, dice[1]);
+        info_set_value(r_ptr->blows[i].d_dice, dice[0]);
+        info_set_value(r_ptr->blows[i].d_side, dice[1]);
     } else if (tokens[0] == "F") {
         // F:flags
         if (tokens.size() < 2 || tokens[1].size() == 0) {
index b119ed9..0e246fc 100644 (file)
@@ -7,7 +7,7 @@
 
 void set_monster_blow_method(lore_type *lore_ptr, int m)
 {
-    RaceBlowMethodType method = lore_ptr->r_ptr->blow[m].method;
+    RaceBlowMethodType method = lore_ptr->r_ptr->blows[m].method;
     lore_ptr->p = nullptr;
     lore_ptr->pc = TERM_WHITE;
     switch (method) {
@@ -110,7 +110,7 @@ void set_monster_blow_method(lore_type *lore_ptr, int m)
 
 void set_monster_blow_effect(lore_type *lore_ptr, int m)
 {
-    RaceBlowEffectType effect = lore_ptr->r_ptr->blow[m].effect;
+    RaceBlowEffectType effect = lore_ptr->r_ptr->blows[m].effect;
     lore_ptr->q = nullptr;
     lore_ptr->qc = TERM_WHITE;
     switch (effect) {
index 4ae2050..60b74ca 100644 (file)
@@ -96,8 +96,8 @@ bool know_damage(MonsterRaceId r_idx, int i)
     DEPTH level = r_ptr->level;
     int32_t a = r_ptr->r_blows[i];
 
-    int32_t d1 = r_ptr->blow[i].d_dice;
-    int32_t d2 = r_ptr->blow[i].d_side;
+    int32_t d1 = r_ptr->blows[i].d_dice;
+    int32_t d2 = r_ptr->blows[i].d_side;
     int32_t d = d1 * d2;
 
     if (d >= ((4 + level) * MAX_UCHAR) / 80) {
index 722e1da..7dae1b8 100644 (file)
@@ -44,7 +44,7 @@ int lore_do_probe(PlayerType *player_ptr, MonsterRaceId r_idx)
     r_ptr->r_wake = r_ptr->r_ignore = MAX_UCHAR;
 
     for (int i = 0; i < 4; i++) {
-        if (r_ptr->blow[i].effect != RaceBlowEffectType::NONE || r_ptr->blow[i].method != RaceBlowMethodType::NONE) {
+        if (r_ptr->blows[i].effect != RaceBlowEffectType::NONE || r_ptr->blows[i].method != RaceBlowMethodType::NONE) {
             if (r_ptr->r_blows[i] != MAX_UCHAR) {
                 n++;
             }
index 40163e0..714fc00 100644 (file)
@@ -306,10 +306,10 @@ void repeat_melee(PlayerType *player_ptr, mam_type *mam_ptr)
     const auto *m_ptr = mam_ptr->m_ptr;
     auto *r_ptr = &monraces_info[m_ptr->r_idx];
     for (int ap_cnt = 0; ap_cnt < MAX_NUM_BLOWS; ap_cnt++) {
-        mam_ptr->effect = r_ptr->blow[ap_cnt].effect;
-        mam_ptr->method = r_ptr->blow[ap_cnt].method;
-        mam_ptr->d_dice = r_ptr->blow[ap_cnt].d_dice;
-        mam_ptr->d_side = r_ptr->blow[ap_cnt].d_side;
+        mam_ptr->effect = r_ptr->blows[ap_cnt].effect;
+        mam_ptr->method = r_ptr->blows[ap_cnt].method;
+        mam_ptr->d_dice = r_ptr->blows[ap_cnt].d_dice;
+        mam_ptr->d_side = r_ptr->blows[ap_cnt].d_side;
 
         if (!m_ptr->is_valid()) {
             break;
index fd34450..49703dc 100644 (file)
@@ -149,10 +149,10 @@ bool MonsterAttackPlayer::process_monster_blows()
         this->obvious = false;
         this->damage = 0;
         this->act = nullptr;
-        this->effect = r_ptr->blow[ap_cnt].effect;
-        this->method = r_ptr->blow[ap_cnt].method;
-        this->d_dice = r_ptr->blow[ap_cnt].d_dice;
-        this->d_side = r_ptr->blow[ap_cnt].d_side;
+        this->effect = r_ptr->blows[ap_cnt].effect;
+        this->method = r_ptr->blows[ap_cnt].method;
+        this->d_dice = r_ptr->blows[ap_cnt].d_dice;
+        this->d_side = r_ptr->blows[ap_cnt].d_side;
 
         if (!this->check_monster_continuous_attack()) {
             break;
index 6dc7932..08c5252 100644 (file)
@@ -66,14 +66,14 @@ static void write_pet_death(PlayerType *player_ptr, monster_death_type *md_ptr)
 static void on_dead_explosion(PlayerType *player_ptr, monster_death_type *md_ptr)
 {
     for (int i = 0; i < 4; i++) {
-        if (md_ptr->r_ptr->blow[i].method != RaceBlowMethodType::EXPLODE) {
+        if (md_ptr->r_ptr->blows[i].method != RaceBlowMethodType::EXPLODE) {
             continue;
         }
 
         BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
-        AttributeType typ = mbe_info[enum2i(md_ptr->r_ptr->blow[i].effect)].explode_type;
-        DICE_NUMBER d_dice = md_ptr->r_ptr->blow[i].d_dice;
-        DICE_SID d_side = md_ptr->r_ptr->blow[i].d_side;
+        AttributeType typ = mbe_info[enum2i(md_ptr->r_ptr->blows[i].effect)].explode_type;
+        DICE_NUMBER d_dice = md_ptr->r_ptr->blows[i].d_dice;
+        DICE_SID d_side = md_ptr->r_ptr->blows[i].d_side;
         int damage = damroll(d_dice, d_side);
         (void)project(player_ptr, md_ptr->m_idx, 3, md_ptr->md_y, md_ptr->md_x, damage, typ, flg);
         break;
index e6fedb7..c121bed 100644 (file)
@@ -77,7 +77,7 @@ static bool monster_hook_tanuki(PlayerType *player_ptr, MonsterRaceId r_idx)
     }
 
     for (int i = 0; i < 4; i++) {
-        if (r_ptr->blow[i].method == RaceBlowMethodType::EXPLODE) {
+        if (r_ptr->blows[i].method == RaceBlowMethodType::EXPLODE) {
             return false;
         }
     }
index 1be0174..b8cd7f2 100644 (file)
@@ -867,12 +867,12 @@ bool monster_can_entry_arena(PlayerType *player_ptr, MonsterRaceId r_idx)
     }
 
     for (int i = 0; i < 4; i++) {
-        if (r_ptr->blow[i].method == RaceBlowMethodType::EXPLODE) {
+        if (r_ptr->blows[i].method == RaceBlowMethodType::EXPLODE) {
             return false;
         }
 
-        if (r_ptr->blow[i].effect != RaceBlowEffectType::DR_MANA) {
-            dam += r_ptr->blow[i].d_dice;
+        if (r_ptr->blows[i].effect != RaceBlowEffectType::DR_MANA) {
+            dam += r_ptr->blows[i].d_dice;
         }
     }
 
index 43de24f..cf79812 100644 (file)
@@ -227,7 +227,7 @@ static bool monster_hook_chameleon_lord(PlayerType *player_ptr, MonsterRaceId r_
         return false;
     }
 
-    if ((r_ptr->blow[0].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blow[1].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blow[2].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blow[3].method == RaceBlowMethodType::EXPLODE)) {
+    if ((r_ptr->blows[0].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blows[1].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blows[2].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blows[3].method == RaceBlowMethodType::EXPLODE)) {
         return false;
     }
 
@@ -271,7 +271,7 @@ static bool monster_hook_chameleon(PlayerType *player_ptr, MonsterRaceId r_idx)
         return false;
     }
 
-    if ((r_ptr->blow[0].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blow[1].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blow[2].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blow[3].method == RaceBlowMethodType::EXPLODE)) {
+    if ((r_ptr->blows[0].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blows[1].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blows[2].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blows[3].method == RaceBlowMethodType::EXPLODE)) {
         return false;
     }
 
index 13c4790..3c08c91 100644 (file)
@@ -447,11 +447,11 @@ void monspell_shoot_dice(MonsterRaceInfo *r_ptr, int *dd, int *ds)
     int n = 0; /* Number of blows */
     const int max_blows = 4;
     for (int m = 0; m < max_blows; m++) {
-        if (r_ptr->blow[m].method != RaceBlowMethodType::NONE) {
+        if (r_ptr->blows[m].method != RaceBlowMethodType::NONE) {
             n++;
         } /* Count blows */
 
-        if (r_ptr->blow[m].method == RaceBlowMethodType::SHOOT) {
+        if (r_ptr->blows[m].method == RaceBlowMethodType::SHOOT) {
             p = m; /* Remember position */
             break;
         }
@@ -466,8 +466,8 @@ void monspell_shoot_dice(MonsterRaceInfo *r_ptr, int *dd, int *ds)
         (*dd) = 0;
         (*ds) = 0;
     } else {
-        (*dd) = r_ptr->blow[p].d_dice;
-        (*ds) = r_ptr->blow[p].d_side;
+        (*dd) = r_ptr->blows[p].d_dice;
+        (*ds) = r_ptr->blows[p].d_side;
     }
 }
 
index df32388..d6746fb 100644 (file)
@@ -135,7 +135,7 @@ bool check_summon_specific(PlayerType *player_ptr, MonsterRaceId summoner_idx, M
         break;
     case SUMMON_KAMIKAZE:
         for (int i = 0; i < 4; i++) {
-            if (r_ptr->blow[i].method == RaceBlowMethodType::EXPLODE) {
+            if (r_ptr->blows[i].method == RaceBlowMethodType::EXPLODE) {
                 is_match = true;
             }
         }
@@ -143,7 +143,7 @@ bool check_summon_specific(PlayerType *player_ptr, MonsterRaceId summoner_idx, M
         break;
     case SUMMON_KAMIKAZE_LIVING:
         for (int i = 0; i < 4; i++) {
-            if (r_ptr->blow[i].method == RaceBlowMethodType::EXPLODE) {
+            if (r_ptr->blows[i].method == RaceBlowMethodType::EXPLODE) {
                 is_match = true;
             }
         }
index 2e57858..3390080 100644 (file)
@@ -509,13 +509,13 @@ bool process_warning(PlayerType *player_ptr, POSITION xx, POSITION yy)
             int dam_melee = 0;
             for (int m = 0; m < 4; m++) {
                 /* Skip non-attacks */
-                if (r_ptr->blow[m].method == RaceBlowMethodType::NONE || (r_ptr->blow[m].method == RaceBlowMethodType::SHOOT)) {
+                if (r_ptr->blows[m].method == RaceBlowMethodType::NONE || (r_ptr->blows[m].method == RaceBlowMethodType::SHOOT)) {
                     continue;
                 }
 
                 /* Extract the attack info */
-                dam_melee += blow_damcalc(m_ptr, player_ptr, &r_ptr->blow[m]);
-                if (r_ptr->blow[m].method == RaceBlowMethodType::EXPLODE) {
+                dam_melee += blow_damcalc(m_ptr, player_ptr, &r_ptr->blows[m]);
+                if (r_ptr->blows[m].method == RaceBlowMethodType::EXPLODE) {
                     break;
                 }
             }
index d6303d6..3f5ab6d 100644 (file)
@@ -33,7 +33,7 @@ bool MonsterRaceInfo::has_living_flag() const
 
 bool MonsterRaceInfo::is_explodable() const
 {
-    return std::any_of(std::begin(this->blow), std::end(this->blow),
+    return std::any_of(std::begin(this->blows), std::end(this->blows),
         [](const auto &blow) { return blow.method == RaceBlowMethodType::EXPLODE; });
 }
 
index fe780b3..f5daf12 100644 (file)
@@ -90,7 +90,7 @@ public:
     EnumClassFlagGroup<MonsterPopulationType> population_flags; //!< 能力フラグ(出現数関連) / Population Flags
     EnumClassFlagGroup<MonsterSpeakType> speak_flags; //!< 能力フラグ(セリフ) / Speaking Flags
     EnumClassFlagGroup<MonsterBrightnessType> brightness_flags; //!< 能力フラグ(明暗) / Speaking Lite or Dark
-    MonsterBlow blow[MAX_NUM_BLOWS]{}; //!< 打撃能力定義 / Up to four blows per round
+    MonsterBlow blows[MAX_NUM_BLOWS]{}; //!< 打撃能力定義 / Up to four blows per round
 
     //! 指定護衛リスト <モンスター種族ID,護衛数ダイス数,護衛数ダイス面>
     std::vector<std::tuple<MonsterRaceId, DICE_NUMBER, DICE_SID>> reinforces;
index b2a9d6c..272d20d 100644 (file)
@@ -101,8 +101,8 @@ static void display_monster_blow_en(lore_type *lore_ptr, int attack_numbers, int
  */
 void display_monster_blow(lore_type *lore_ptr, int m, int attack_numbers)
 {
-    int d1 = lore_ptr->r_ptr->blow[m].d_dice;
-    int d2 = lore_ptr->r_ptr->blow[m].d_side;
+    int d1 = lore_ptr->r_ptr->blows[m].d_dice;
+    int d2 = lore_ptr->r_ptr->blows[m].d_side;
     void (*display_monster_blows_pf)(lore_type *, int, int, int, int) = _(display_monster_blow_jp, display_monster_blow_en);
     (*display_monster_blows_pf)(lore_ptr, attack_numbers, d1, d2, m);
 }
@@ -115,7 +115,7 @@ void display_monster_blows(lore_type *lore_ptr)
 {
     const int max_attack_numbers = 4;
     for (int m = 0; m < max_attack_numbers; m++) {
-        if (lore_ptr->r_ptr->blow[m].method == RaceBlowMethodType::NONE || (lore_ptr->r_ptr->blow[m].method == RaceBlowMethodType::SHOOT)) {
+        if (lore_ptr->r_ptr->blows[m].method == RaceBlowMethodType::NONE || (lore_ptr->r_ptr->blows[m].method == RaceBlowMethodType::SHOOT)) {
             continue;
         }
 
@@ -126,7 +126,7 @@ void display_monster_blows(lore_type *lore_ptr)
 
     int attack_numbers = 0;
     for (int m = 0; m < max_attack_numbers; m++) {
-        if (lore_ptr->r_ptr->blow[m].method == RaceBlowMethodType::NONE || (lore_ptr->r_ptr->blow[m].method == RaceBlowMethodType::SHOOT) || (((lore_ptr->r_ptr->r_blows[m] == 0) && !lore_ptr->know_everything))) {
+        if (lore_ptr->r_ptr->blows[m].method == RaceBlowMethodType::NONE || (lore_ptr->r_ptr->blows[m].method == RaceBlowMethodType::SHOOT) || (((lore_ptr->r_ptr->r_blows[m] == 0) && !lore_ptr->know_everything))) {
             continue;
         }
 
index 5c5bef3..c4d1269 100644 (file)
@@ -606,11 +606,11 @@ void display_monster_launching(PlayerType *player_ptr, lore_type *lore_ptr)
     int n = 0; /* Number of blows */
     const int max_blows = 4;
     for (int m = 0; m < max_blows; m++) {
-        if (lore_ptr->r_ptr->blow[m].method != RaceBlowMethodType::NONE) {
+        if (lore_ptr->r_ptr->blows[m].method != RaceBlowMethodType::NONE) {
             n++;
         } /* Count blows */
 
-        if (lore_ptr->r_ptr->blow[m].method == RaceBlowMethodType::SHOOT) {
+        if (lore_ptr->r_ptr->blows[m].method == RaceBlowMethodType::SHOOT) {
             p = m; /* Remember position */
             break;
         }
@@ -626,8 +626,8 @@ void display_monster_launching(PlayerType *player_ptr, lore_type *lore_ptr)
     }
 
     if (know_armour(lore_ptr->r_idx, lore_ptr->know_everything)) {
-        strnfmt(lore_ptr->tmp_msg[lore_ptr->vn], sizeof(lore_ptr->tmp_msg[lore_ptr->vn]), _("威力 %dd%d の射撃をする", "fire an arrow (Power:%dd%d)"), lore_ptr->r_ptr->blow[p].d_dice,
-            lore_ptr->r_ptr->blow[p].d_side);
+        strnfmt(lore_ptr->tmp_msg[lore_ptr->vn], sizeof(lore_ptr->tmp_msg[lore_ptr->vn]), _("威力 %dd%d の射撃をする", "fire an arrow (Power:%dd%d)"), lore_ptr->r_ptr->blows[p].d_dice,
+            lore_ptr->r_ptr->blows[p].d_side);
     } else {
         angband_strcpy(lore_ptr->tmp_msg[lore_ptr->vn], _("射撃をする", "fire an arrow"), sizeof(lore_ptr->tmp_msg[lore_ptr->vn]));
     }