OSDN Git Service

Merge pull request #3587 from Slimebreath6078/feature/Refactor_mane_spell_mask
author火炎の飛竜 <87808091+Slimebreath6078@users.noreply.github.com>
Thu, 31 Aug 2023 09:24:16 +0000 (18:24 +0900)
committerGitHub <noreply@github.com>
Thu, 31 Aug 2023 09:24:16 +0000 (18:24 +0900)
ものまねの範囲指定を全部マスクに移した

1  2 
src/cmd-action/cmd-mane.cpp

@@@ -29,6 -29,7 +29,7 @@@
  #include "monster-floor/place-monster-types.h"
  #include "monster-race/monster-race.h"
  #include "monster-race/race-ability-flags.h"
+ #include "monster-race/race-ability-mask.h"
  #include "monster-race/race-flags-resistance.h"
  #include "monster-race/race-flags1.h"
  #include "monster/monster-describer.h"
@@@ -86,12 -87,14 +87,14 @@@ static std::string mane_info(PlayerTyp
  {
      PLAYER_LEVEL plev = player_ptr->lev;
  
-     const auto power_int = enum2i(power);
      using Mat = MonsterAbilityType;
-     EnumClassFlagGroup<Mat> flags{
-         Mat::PSY_SPEAR, Mat::BO_VOID, Mat::BO_ABYSS, Mat::BA_VOID, Mat::BA_ABYSS, Mat::BR_VOID, Mat::BR_ABYSS
-     };
-     if ((power_int > 2 && power_int < 41) || (power_int > 41 && power_int < 59) || flags.has(power)) {
+     const auto flags =
+         (RF_ABILITY_BALL_MASK |
+             RF_ABILITY_BOLT_MASK |
+             RF_ABILITY_BEAM_MASK)
+             .set(
+                 { Mat::MIND_BLAST, Mat::BRAIN_SMASH, Mat::CAUSE_1, Mat::CAUSE_2, Mat::CAUSE_3, Mat::CAUSE_4 });
+     if (flags.has(power)) {
          return format(" %s%d", KWD_DAM, (int)dam);
      }
      switch (power) {
@@@ -695,15 -698,6 +698,15 @@@ static bool use_mane(PlayerType *player
  
          fire_ball(player_ptr, AttributeType::ABYSS, dir, damage, 4);
          break;
 +    case MonsterAbilityType::BA_METEOR:
 +        if (!get_aim_dir(player_ptr, &dir)) {
 +            return false;
 +        } else {
 +            msg_print(_("メテオスウォームの呪文を念じた。", "You cast a meteor swarm."));
 +        }
 +
 +        fire_ball(player_ptr, AttributeType::METEOR, dir, damage, 4);
 +        break;
      case MonsterAbilityType::DRAIN_MANA:
          if (!get_aim_dir(player_ptr, &dir)) {
              return false;
  
          fire_bolt(player_ptr, AttributeType::ABYSS, dir, damage);
          break;
 +    case MonsterAbilityType::BO_METEOR:
 +        if (!get_aim_dir(player_ptr, &dir)) {
 +            return false;
 +        } else {
 +            msg_print(_("メテオストライクの呪文を唱えた。", "You cast a meteor strike."));
 +        }
 +
 +        fire_bolt(player_ptr, AttributeType::METEOR, dir, damage);
 +        break;
      case MonsterAbilityType::MISSILE:
          if (!get_aim_dir(player_ptr, &dir)) {
              return false;