OSDN Git Service

[Refactor] mspell.h をmspell-result.h に改名した
authorHourier <66951241+Hourier@users.noreply.github.com>
Sat, 16 Oct 2021 05:46:55 +0000 (14:46 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Mon, 20 Dec 2021 10:49:35 +0000 (19:49 +0900)
19 files changed:
Hengband/Hengband.sln
Hengband/Hengband/Hengband.vcxproj
Hengband/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/melee/melee-spell.cpp
src/monster-floor/quantum-effect.cpp
src/mspell/assign-monster-spell.cpp
src/mspell/mspell-attack.cpp
src/mspell/mspell-ball.cpp
src/mspell/mspell-bolt.cpp
src/mspell/mspell-breath.cpp
src/mspell/mspell-curse.cpp
src/mspell/mspell-dispel.cpp
src/mspell/mspell-floor.cpp
src/mspell/mspell-particularity.cpp
src/mspell/mspell-result.h [moved from src/mspell/mspell.h with 94% similarity]
src/mspell/mspell-special.cpp
src/mspell/mspell-status.cpp
src/mspell/mspell-summon.cpp

index 77fd6d2..157a870 100644 (file)
@@ -1,7 +1,7 @@
 \r
 Microsoft Visual Studio Solution File, Format Version 12.00\r
-# Visual Studio Version 16\r
-VisualStudioVersion = 16.0.30011.22\r
+# Visual Studio Version 17\r
+VisualStudioVersion = 17.0.31903.59\r
 MinimumVisualStudioVersion = 10.0.40219.1\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Hengband", "Hengband\Hengband.vcxproj", "{C00503B6-18FF-42F1-BAC0-6C94EDE62CB2}"\r
 EndProject\r
index 5ce3156..625aa45 100644 (file)
     <ClInclude Include="..\..\src\load\player-class-specific-data-loader.h" />\r
     <ClInclude Include="..\..\src\load\savedata-old-flag-types.h" />\r
     <ClInclude Include="..\..\src\monster-race\monster-aura-types.h" />\r
-    <ClInclude Include="..\..\src\mspell\mspell.h" />\r
+    <ClInclude Include="..\..\src\mspell\mspell-result.h" />\r
     <ClInclude Include="..\..\src\object-enchant\object-smith.h" />\r
     <ClInclude Include="..\..\src\object-enchant\smith-info.h" />\r
     <ClInclude Include="..\..\src\object-enchant\smith-tables.h" />\r
index 15756b1..30faa67 100644 (file)
     <ClInclude Include="..\..\src\monster-race\monster-aura-types.h">\r
       <Filter>monster-race</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\..\src\mspell\mspell.h">\r
+    <ClInclude Include="..\..\src\mspell\mspell-result.h">\r
       <Filter>mspell</Filter>\r
     </ClInclude>\r
     <ClInclude Include="..\..\src\load\old\load-v1-5-0.h">\r
index e7c4d9a..e8e6c4b 100644 (file)
@@ -524,24 +524,24 @@ hengband_SOURCES = \
        mspell/monster-power-table.cpp mspell/monster-power-table.h \
        mspell/mspell-attack.cpp mspell/mspell-attack.h \
        mspell/mspell-attack-util.cpp mspell/mspell-attack-util.h \
-       mspell/mspell-breath.cpp mspell/mspell-breath.h \
        mspell/mspell-ball.cpp mspell/mspell-ball.h \
        mspell/mspell-bolt.cpp mspell/mspell-bolt.h \
+       mspell/mspell-breath.cpp mspell/mspell-breath.h \
        mspell/mspell-checker.cpp mspell/mspell-checker.h \
        mspell/mspell-curse.cpp mspell/mspell-curse.h \
+       mspell/mspell-damage-calculator.cpp mspell/mspell-damage-calculator.h \
        mspell/mspell-dispel.cpp mspell/mspell-dispel.h \
+       mspell/mspell-floor.cpp mspell/mspell-floor.h \
        mspell/mspell-judgement.cpp mspell/mspell-judgement.h \
-       mspell/mspell-lite.cpp mspell/mspell-lite.h \
-       mspell/mspell-summon.cpp mspell/mspell-summon.h \
-       mspell/mspell-util.cpp mspell/mspell-util.h \
-       mspell/mspell-damage-calculator.cpp mspell/mspell-damage-calculator.h \
        mspell/mspell-learn-checker.cpp mspell/mspell-learn-checker.h \
-       mspell/mspell-floor.cpp mspell/mspell-floor.h \
+       mspell/mspell-lite.cpp mspell/mspell-lite.h \
+       mspell/mspell-particularity.cpp mspell/mspell-particularity.h \
+       mspell/mspell-result.h \
        mspell/mspell-special.cpp mspell/mspell-special.h \
+       mspell/mspell-summon.cpp mspell/mspell-summon.h \
        mspell/mspell-status.cpp mspell/mspell-status.h \
-       mspell/mspell-particularity.cpp mspell/mspell-particularity.h \
        mspell/mspell-selector.cpp mspell/mspell-selector.h \
-       mspell/mspell.h \
+       mspell/mspell-util.cpp mspell/mspell-util.h \
        mspell/smart-mspell-util.cpp mspell/smart-mspell-util.h \
        mspell/specified-summon.cpp mspell/specified-summon.h \
        mspell/summon-checker.cpp mspell/summon-checker.h \
index 41ebedf..47dc268 100644 (file)
@@ -9,8 +9,8 @@
 #include "monster/monster-status.h"
 #include "mspell/assign-monster-spell.h"
 #include "mspell/mspell-checker.h"
+#include "mspell/mspell-result.h"
 #include "mspell/mspell-util.h"
-#include "mspell/mspell.h"
 #include "player-base/player-class.h"
 #include "player-info/mane-data-type.h"
 #include "spell-realm/spells-hex.h"
index 80e5556..b196b47 100644 (file)
@@ -10,7 +10,7 @@
 #include "monster/monster-info.h"
 #include "monster/smart-learn-types.h"
 #include "mspell/assign-monster-spell.h"
-#include "mspell/mspell.h"
+#include "mspell/mspell-result.h"
 #include "effect/attribute-types.h"
 #include "spell-kind/spells-teleport.h"
 #include "system/floor-type-definition.h"
index f27fbcf..560ad48 100644 (file)
 #include "mspell/mspell-floor.h"
 #include "mspell/mspell-learn-checker.h"
 #include "mspell/mspell-particularity.h"
+#include "mspell/mspell-result.h"
 #include "mspell/mspell-special.h"
 #include "mspell/mspell-status.h"
 #include "mspell/mspell-summon.h"
 #include "mspell/mspell-util.h"
-#include "mspell/mspell.h"
+#include "mspell/mspell-result.h"
 #include "effect/attribute-types.h"
 #include "system/player-type-definition.h"
 #include "util/enum-converter.h"
index 682ef1f..06366e5 100644 (file)
@@ -21,9 +21,9 @@
 #include "mspell/mspell-checker.h"
 #include "mspell/mspell-learn-checker.h"
 #include "mspell/mspell-lite.h"
+#include "mspell/mspell-result.h"
 #include "mspell/mspell-selector.h"
 #include "mspell/mspell-util.h"
-#include "mspell/mspell.h"
 #include "player-base/player-class.h"
 #include "player-info/mane-data-type.h"
 #include "player/attack-defense-types.h"
@@ -54,8 +54,7 @@ static void set_no_magic_mask(msa_type *msa_ptr)
 static void check_mspell_stupid(PlayerType *player_ptr, msa_type *msa_ptr)
 {
     floor_type *floor_ptr = player_ptr->current_floor_ptr;
-    msa_ptr->in_no_magic_dungeon = d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::NO_MAGIC) && floor_ptr->dun_level
-        && (!floor_ptr->inside_quest || quest_type::is_fixed(floor_ptr->inside_quest));
+    msa_ptr->in_no_magic_dungeon = d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::NO_MAGIC) && floor_ptr->dun_level && (!floor_ptr->inside_quest || quest_type::is_fixed(floor_ptr->inside_quest));
     if (!msa_ptr->in_no_magic_dungeon || ((msa_ptr->r_ptr->flags2 & RF2_STUPID) != 0))
         return;
 
@@ -95,13 +94,11 @@ static bool check_mspell_non_stupid(PlayerType *player_ptr, msa_type *msa_ptr)
     if (!player_ptr->csp)
         msa_ptr->ability_flags.reset(MonsterAbilityType::DRAIN_MANA);
 
-    if (msa_ptr->ability_flags.has_any_of(RF_ABILITY_BOLT_MASK)
-        && !clean_shot(player_ptr, msa_ptr->m_ptr->fy, msa_ptr->m_ptr->fx, player_ptr->y, player_ptr->x, false)) {
+    if (msa_ptr->ability_flags.has_any_of(RF_ABILITY_BOLT_MASK) && !clean_shot(player_ptr, msa_ptr->m_ptr->fy, msa_ptr->m_ptr->fx, player_ptr->y, player_ptr->x, false)) {
         msa_ptr->ability_flags.reset(RF_ABILITY_BOLT_MASK);
     }
 
-    if (msa_ptr->ability_flags.has_any_of(RF_ABILITY_SUMMON_MASK)
-        && !(summon_possible(player_ptr, msa_ptr->y, msa_ptr->x))) {
+    if (msa_ptr->ability_flags.has_any_of(RF_ABILITY_SUMMON_MASK) && !(summon_possible(player_ptr, msa_ptr->y, msa_ptr->x))) {
         msa_ptr->ability_flags.reset(RF_ABILITY_SUMMON_MASK);
     }
 
@@ -185,8 +182,7 @@ static bool check_mspell_unexploded(PlayerType *player_ptr, msa_type *msa_ptr)
     if (msa_ptr->r_ptr->flags2 & RF2_STUPID)
         fail_rate = 0;
 
-    if (!spell_is_inate(msa_ptr->thrown_spell)
-        && (msa_ptr->in_no_magic_dungeon || (monster_stunned_remaining(msa_ptr->m_ptr) && one_in_(2)) || (randint0(100) < fail_rate))) {
+    if (!spell_is_inate(msa_ptr->thrown_spell) && (msa_ptr->in_no_magic_dungeon || (monster_stunned_remaining(msa_ptr->m_ptr) && one_in_(2)) || (randint0(100) < fail_rate))) {
         disturb(player_ptr, true, true);
         msg_format(_("%^sは呪文を唱えようとしたが失敗した。", "%^s tries to cast a spell, but fails."), msa_ptr->m_name);
         return true;
@@ -304,8 +300,7 @@ bool make_attack_spell(PlayerType *player_ptr, MONSTER_IDX m_idx)
         return false;
     }
 
-    if (msa_ptr->m_ptr->mflag.has(MonsterTemporaryFlagType::PREVENT_MAGIC) || !is_hostile(msa_ptr->m_ptr)
-        || ((msa_ptr->m_ptr->cdis > get_max_range(player_ptr)) && !msa_ptr->m_ptr->target_y))
+    if (msa_ptr->m_ptr->mflag.has(MonsterTemporaryFlagType::PREVENT_MAGIC) || !is_hostile(msa_ptr->m_ptr) || ((msa_ptr->m_ptr->cdis > get_max_range(player_ptr)) && !msa_ptr->m_ptr->target_y))
         return false;
 
     decide_lite_range(player_ptr, msa_ptr);
index 6e83c71..8c04987 100644 (file)
@@ -9,8 +9,9 @@
 #include "monster/monster-update.h"
 #include "mspell/mspell-checker.h"
 #include "mspell/mspell-damage-calculator.h"
+#include "mspell/mspell-result.h"
 #include "mspell/mspell-util.h"
-#include "mspell/mspell.h"
+#include "mspell/mspell-result.h"
 #include "effect/attribute-types.h"
 #include "system/floor-type-definition.h"
 #include "system/monster-type-definition.h"
index 8d4e370..04358cc 100644 (file)
@@ -8,8 +8,9 @@
 #include "monster/monster-update.h"
 #include "mspell/mspell-checker.h"
 #include "mspell/mspell-damage-calculator.h"
+#include "mspell/mspell-result.h"
 #include "mspell/mspell-util.h"
-#include "mspell/mspell.h"
+#include "mspell/mspell-result.h"
 #include "effect/attribute-types.h"
 #include "system/floor-type-definition.h"
 #include "system/player-type-definition.h"
index 02fef1f..72e1435 100644 (file)
@@ -10,8 +10,9 @@
 #include "monster/monster-update.h"
 #include "mspell/mspell-checker.h"
 #include "mspell/mspell-damage-calculator.h"
+#include "mspell/mspell-result.h"
 #include "mspell/mspell-util.h"
-#include "mspell/mspell.h"
+#include "mspell/mspell-result.h"
 #include "effect/attribute-types.h"
 #include "system/floor-type-definition.h"
 #include "system/monster-type-definition.h"
@@ -34,7 +35,7 @@ static bool spell_RF4_BREATH_special_message(MONSTER_IDX r_idx, AttributeType GF
         msg_format(_("%^s「ボ帝ビルカッター!!!」", "%^s shouts, 'Boty-Build cutter!!!'"), m_name);
         return true;
     }
-    if (r_idx == MON_RAOU && GF_TYPE == AttributeType::FORCE) {
+    if (r_idx == MON_RAOU && (GF_TYPE == AttributeType::FORCE)) {
         if (one_in_(2))
             msg_format(_("%^s「北斗剛掌波!!」", "%^s says, 'Hokuto Goh-Sho-Ha!!'"), m_name);
         else
index 5f6c773..9cfad78 100644 (file)
@@ -6,8 +6,10 @@
 #include "monster/monster-list.h"
 #include "mspell/mspell-checker.h"
 #include "mspell/mspell-damage-calculator.h"
+#include "mspell/mspell-result.h"
 #include "mspell/mspell-util.h"
-#include "mspell/mspell.h"
+#include "mspell/mspell-result.h"
+#include "effect/attribute-types.h"
 #include "system/floor-type-definition.h"
 #include "system/player-type-definition.h"
 #include "view/display-messages.h"
index c2b80b3..347b749 100644 (file)
@@ -10,8 +10,8 @@
 #include "monster/monster-info.h"
 #include "monster/monster-status-setter.h"
 #include "monster/monster-status.h"
+#include "mspell/mspell-result.h"
 #include "mspell/mspell-util.h"
-#include "mspell/mspell.h"
 #include "player-info/race-info.h"
 #include "player/attack-defense-types.h"
 #include "player/player-status.h"
index b13d294..ea76291 100644 (file)
@@ -22,9 +22,9 @@
 #include "monster/monster-status-setter.h"
 #include "monster/monster-status.h"
 #include "monster/monster-update.h"
+#include "mspell/mspell-result.h"
 #include "mspell/mspell-status.h"
 #include "mspell/mspell-util.h"
-#include "mspell/mspell.h"
 #include "player/player-personality-types.h"
 #include "player/player-status-flags.h"
 #include "player/player-status.h"
index 64187fd..10e2f94 100644 (file)
@@ -15,8 +15,9 @@
 #include "monster/monster-update.h"
 #include "mspell/mspell-checker.h"
 #include "mspell/mspell-damage-calculator.h"
+#include "mspell/mspell-result.h"
 #include "mspell/mspell-util.h"
-#include "mspell/mspell.h"
+#include "mspell/mspell-result.h"
 #include "effect/attribute-types.h"
 #include "system/player-type-definition.h"
 
similarity index 94%
rename from src/mspell/mspell.h
rename to src/mspell/mspell-result.h
index c3318eb..3bf3c75 100644 (file)
@@ -5,7 +5,8 @@
 struct MonsterSpellResult {
 private:
     explicit MonsterSpellResult(const bool valid, const HIT_POINT dam = 0)
-        : valid(valid), dam(dam)
+        : valid(valid)
+        , dam(dam)
     {
     }
 
index 7755e52..a21b1ec 100644 (file)
@@ -24,8 +24,8 @@
 #include "monster/monster-info.h"
 #include "monster/monster-util.h"
 #include "mspell/mspell-checker.h"
+#include "mspell/mspell-result.h"
 #include "mspell/mspell-util.h"
-#include "mspell/mspell.h"
 #include "player/player-damage.h"
 #include "spell-kind/spells-teleport.h"
 #include "spell-realm/spells-crusade.h"
index 99f46ce..5e547eb 100644 (file)
@@ -24,8 +24,8 @@
 #include "monster/monster-update.h"
 #include "mspell/mspell-checker.h"
 #include "mspell/mspell-damage-calculator.h"
+#include "mspell/mspell-result.h"
 #include "mspell/mspell-util.h"
-#include "mspell/mspell.h"
 #include "player/player-personality-types.h"
 #include "player/player-status-flags.h"
 #include "effect/attribute-types.h"
 #include "view/display-messages.h"
 
 mspell_cast_msg_bad_status_to_player::mspell_cast_msg_bad_status_to_player(concptr blind, concptr not_blind, concptr resist, concptr saved_throw)
-    :   blind(blind)
-    ,   not_blind(not_blind)
-    ,   resist(resist)
-    ,   saved_throw(saved_throw)
-{}
+    : blind(blind)
+    , not_blind(not_blind)
+    , resist(resist)
+    , saved_throw(saved_throw)
+{
+}
 
 mspell_cast_msg_bad_status_to_monster::mspell_cast_msg_bad_status_to_monster(concptr default_msg, concptr resist, concptr saved_throw, concptr success)
-    :   default_msg(default_msg)
-    ,   resist(resist)
-    ,   saved_throw(saved_throw)
-    ,   success(success)
-{}
+    : default_msg(default_msg)
+    , resist(resist)
+    , saved_throw(saved_throw)
+    , success(success)
+{
+}
 
 /*!
  * @brief 状態異常呪文のメッセージ処理関数。 /
@@ -255,7 +257,7 @@ MonsterSpellResult spell_RF5_SCARE(MONSTER_IDX m_idx, PlayerType *player_ptr, MO
     if (TARGET_TYPE == MONSTER_TO_PLAYER) {
         resist = (has_resist_fear(player_ptr) != 0);
         saving_throw = (randint0(100 + rlev / 2) < player_ptr->skill_sav);
-        
+
         mspell_cast_msg_bad_status_to_player msg(_("%^sが何かをつぶやくと、恐ろしげな音が聞こえた。", "%^s mumbles, and you hear scary noises."),
             _("%^sが恐ろしげな幻覚を作り出した。", "%^s casts a fearful illusion."), _("しかし恐怖に侵されなかった。", "You refuse to be frightened."),
             _("しかし恐怖に侵されなかった。", "You refuse to be frightened."));
@@ -279,7 +281,7 @@ MonsterSpellResult spell_RF5_SCARE(MONSTER_IDX m_idx, PlayerType *player_ptr, MO
     mspell_cast_msg_bad_status_to_monster msg(_("%^sが恐ろしげな幻覚を作り出した。", "%^s casts a fearful illusion in front of %s."),
         _("%^sは恐怖を感じない。", "%^s refuses to be frightened."), _("%^sは恐怖を感じない。", "%^s refuses to be frightened."),
         _("%^sは恐怖して逃げ出した!", "%^s flees in terror!"));
-    
+
     spell_badstatus_message_to_mons(player_ptr, m_idx, t_idx, msg, resist, saving_throw);
 
     if (!resist && !saving_throw) {
@@ -315,7 +317,7 @@ MonsterSpellResult spell_RF5_BLIND(MONSTER_IDX m_idx, PlayerType *player_ptr, MO
         mspell_cast_msg_bad_status_to_player msg(_("%^sが何かをつぶやいた。", "%^s mumbles."),
             _("%^sが呪文を唱えてあなたの目をくらました!", "%^s casts a spell, burning your eyes!"), _("しかし効果がなかった!", "You are unaffected!"),
             _("しかし効力を跳ね返した!", "You resist the effects!"));
-       
+
         spell_badstatus_message_to_player(player_ptr, m_idx, msg, resist, saving_throw);
 
         if (!resist && !saving_throw) {
@@ -376,12 +378,12 @@ MonsterSpellResult spell_RF5_CONF(MONSTER_IDX m_idx, PlayerType *player_ptr, MON
     if (TARGET_TYPE == MONSTER_TO_PLAYER) {
         resist = (has_resist_conf(player_ptr) != 0);
         saving_throw = (randint0(100 + rlev / 2) < player_ptr->skill_sav);
-        
+
         mspell_cast_msg_bad_status_to_player msg(_("%^sが何かをつぶやくと、頭を悩ます音がした。", "%^s mumbles, and you hear puzzling noises."),
             _("%^sが誘惑的な幻覚を作り出した。", "%^s creates a mesmerising illusion."),
             _("しかし幻覚にはだまされなかった。", "You disbelieve the feeble spell."),
             _("しかし幻覚にはだまされなかった。", "You disbelieve the feeble spell."));
-        
+
         spell_badstatus_message_to_player(player_ptr, m_idx, msg, resist, saving_throw);
 
         if (!resist && !saving_throw) {
@@ -433,11 +435,11 @@ MonsterSpellResult spell_RF5_HOLD(MONSTER_IDX m_idx, PlayerType *player_ptr, MON
     if (TARGET_TYPE == MONSTER_TO_PLAYER) {
         resist = (player_ptr->free_act != 0);
         saving_throw = (randint0(100 + rlev / 2) < player_ptr->skill_sav);
-        
+
         mspell_cast_msg_bad_status_to_player msg(_("%^sが何かをつぶやいた。", "%^s mumbles."),
             _("%^sがあなたの目をじっと見つめた!", "%^s stares deep into your eyes!"), _("しかし効果がなかった!", "You are unaffected!"),
             _("しかし効力を跳ね返した!", "You resist the effects!"));
-        
+
         spell_badstatus_message_to_player(player_ptr, m_idx, msg, (bool)resist, saving_throw);
 
         if (!resist && !saving_throw) {
@@ -521,11 +523,11 @@ MonsterSpellResult spell_RF5_SLOW(MONSTER_IDX m_idx, PlayerType *player_ptr, MON
     if (TARGET_TYPE == MONSTER_TO_PLAYER) {
         resist = (has_resist_conf(player_ptr) != 0);
         saving_throw = (randint0(100 + rlev / 2) < player_ptr->skill_sav);
-        
+
         mspell_cast_msg_bad_status_to_player msg(_("%^sがあなたの筋力を吸い取ろうとした!", "%^s drains power from your muscles!"),
             _("%^sがあなたの筋力を吸い取ろうとした!", "%^s drains power from your muscles!"), _("しかし効果がなかった!", "You are unaffected!"),
             _("しかし効力を跳ね返した!", "You resist the effects!"));
-        
+
         spell_badstatus_message_to_player(player_ptr, m_idx, msg, resist, saving_throw);
 
         if (!resist && !saving_throw) {
index 85b68d0..6bf0016 100644 (file)
@@ -13,8 +13,8 @@
 #include "monster/monster-description-types.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status.h"
+#include "mspell/mspell-result.h"
 #include "mspell/mspell-util.h"
-#include "mspell/mspell.h"
 #include "mspell/specified-summon.h"
 #include "spell-kind/spells-launcher.h"
 #include "effect/attribute-types.h"