OSDN Git Service

整形
authorSlimebreath6078 <slimebreath6078@yahoo.co.jp>
Sat, 5 Feb 2022 10:19:33 +0000 (19:19 +0900)
committerSlimebreath6078 <slimebreath6078@yahoo.co.jp>
Sat, 5 Feb 2022 11:47:53 +0000 (20:47 +0900)
35 files changed:
src/action/movement-execution.cpp
src/dungeon/quest.cpp
src/effect/effect-monster-resist-hurt.cpp
src/info-reader/race-info-tokens-table.cpp
src/load/floor-loader.cpp
src/load/item/item-loader-factory.cpp
src/load/load.cpp
src/lore/lore-calculator.cpp
src/lore/lore-store.cpp
src/lore/lore-util.cpp
src/lore/lore-util.h
src/melee/melee-spell-flags-checker.cpp
src/melee/monster-attack-monster.cpp
src/monster-attack/monster-attack-player.cpp
src/monster-attack/monster-attack-processor.cpp
src/monster-floor/monster-direction.cpp
src/monster-floor/monster-generator.cpp
src/monster-floor/monster-move.cpp
src/monster-floor/monster-object.cpp
src/monster-floor/monster-sweep-grid.cpp
src/monster-floor/one-monster-placer.cpp
src/monster-race/monster-race-hook.cpp
src/monster/monster-info.cpp
src/monster/monster-list.cpp
src/monster/monster-processor-util.cpp
src/monster/monster-processor-util.h
src/monster/monster-update.cpp
src/monster/monster-util.cpp
src/mspell/mspell-lite.cpp
src/mspell/mspell-selector.cpp
src/player/player-status-flags.cpp
src/room/rooms-pit-nest.cpp
src/spell-kind/spells-lite.cpp
src/system/angband-version.h
src/target/target-getter.cpp

index b5de58e..68fafbe 100644 (file)
@@ -208,8 +208,7 @@ void exe_movement(PlayerType *player_ptr, DIRECTION dir, bool do_pickup, bool br
             /* Allow moving */
         } else if (f_ptr->flags.has(FloorFeatureType::CAN_SWIM) && (riding_r_ptr->flags7 & RF7_CAN_SWIM)) {
             /* Allow moving */
-        } else if (f_ptr->flags.has(FloorFeatureType::WATER) && !(riding_r_ptr->flags7 & RF7_AQUATIC)
-            && (f_ptr->flags.has(FloorFeatureType::DEEP) || riding_r_ptr->aura_flags.has(MonsterAuraType::FIRE))) {
+        } else if (f_ptr->flags.has(FloorFeatureType::WATER) && !(riding_r_ptr->flags7 & RF7_AQUATIC) && (f_ptr->flags.has(FloorFeatureType::DEEP) || riding_r_ptr->aura_flags.has(MonsterAuraType::FIRE))) {
             msg_format(_("%sの上に行けない。", "Can't swim."), f_info[g_ptr->get_feat_mimic()].name.c_str());
             energy.reset_player_turn();
             can_move = false;
index c096946..be34885 100644 (file)
@@ -1,4 +1,4 @@
-#include "dungeon/quest.h"
+#include "dungeon/quest.h"
 #include "cmd-io/cmd-dump.h"
 #include "core/asking-player.h"
 #include "core/player-update-types.h"
@@ -225,8 +225,7 @@ QUEST_IDX quest_number(PlayerType *player_ptr, DEPTH level)
         if (quest[i].status != QuestStatusType::TAKEN)
             continue;
 
-        if ((quest[i].type == QuestKindType::KILL_LEVEL) && !(quest[i].flags & QUEST_FLAG_PRESET) && (quest[i].level == level)
-            && (quest[i].dungeon == player_ptr->dungeon_idx))
+        if ((quest[i].type == QuestKindType::KILL_LEVEL) && !(quest[i].flags & QUEST_FLAG_PRESET) && (quest[i].level == level) && (quest[i].dungeon == player_ptr->dungeon_idx))
             return i;
     }
 
@@ -245,8 +244,7 @@ QUEST_IDX random_quest_number(PlayerType *player_ptr, DEPTH level)
         return 0;
 
     for (QUEST_IDX i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++) {
-        if ((quest[i].type == QuestKindType::RANDOM) && (quest[i].status == QuestStatusType::TAKEN) && (quest[i].level == level)
-            && (quest[i].dungeon == DUNGEON_ANGBAND)) {
+        if ((quest[i].type == QuestKindType::RANDOM) && (quest[i].status == QuestStatusType::TAKEN) && (quest[i].level == level) && (quest[i].dungeon == DUNGEON_ANGBAND)) {
             return i;
         }
     }
@@ -319,7 +317,7 @@ void leave_tower_check(PlayerType *player_ptr)
     quest[QUEST_TOWER1].comptime = w_ptr->play_time;
 }
 
-/*! 
+/*!
  * @brief Player enters a new quest
  */
 void exe_enter_quest(PlayerType *player_ptr, QUEST_IDX quest_idx)
index a4a2cbc..9915d88 100644 (file)
@@ -582,7 +582,7 @@ process_result effect_monster_icee_bolt(PlayerType *player_ptr, effect_monster_t
  * @details
  * 量子生物に倍打、壁抜けに1.5倍打、テレポート耐性が耐性
  */
-process_result effect_monster_void(PlayerType* player_ptr, effect_monster_type* em_ptr)
+process_result effect_monster_void(PlayerType *player_ptr, effect_monster_type *em_ptr)
 {
     if (em_ptr->seen)
         em_ptr->obvious = true;
index 6ea9027..93c5510 100644 (file)
@@ -1,38 +1,38 @@
-#include "info-reader/race-info-tokens-table.h"
+#include "info-reader/race-info-tokens-table.h"
 #include "monster-attack/monster-attack-effect.h"
 #include "monster-attack/monster-attack-types.h"
 #include "monster-race/race-ability-flags.h"
 
 /*!
 * モンスターの打撃手段トークンの定義 /
 * Monster Blow Methods
 */
+ * モンスターの打撃手段トークンの定義 /
+ * Monster Blow Methods
+ */
 const std::unordered_map<std::string_view, RaceBlowMethodType> r_info_blow_method = {
-       { "HIT", RaceBlowMethodType::HIT },
-       { "TOUCH", RaceBlowMethodType::TOUCH },
-       { "PUNCH", RaceBlowMethodType::PUNCH },
-       { "KICK", RaceBlowMethodType::KICK },
-       { "CLAW", RaceBlowMethodType::CLAW },
-       { "BITE", RaceBlowMethodType::BITE },
-       { "STING", RaceBlowMethodType::STING },
-       { "SLASH", RaceBlowMethodType::SLASH },
-       { "BUTT", RaceBlowMethodType::BUTT },
-       { "CRUSH", RaceBlowMethodType::CRUSH },
-       { "ENGULF", RaceBlowMethodType::ENGULF },
-       { "CHARGE", RaceBlowMethodType::CHARGE },
-       { "CRAWL", RaceBlowMethodType::CRAWL },
-       { "DROOL", RaceBlowMethodType::DROOL },
-       { "SPIT", RaceBlowMethodType::SPIT },
-       { "EXPLODE", RaceBlowMethodType::EXPLODE },
-       { "GAZE", RaceBlowMethodType::GAZE },
-       { "WAIL", RaceBlowMethodType::WAIL },
-       { "SPORE", RaceBlowMethodType::SPORE },
-       { "XXX4", RaceBlowMethodType::XXX4 },
-       { "BEG", RaceBlowMethodType::BEG },
-       { "INSULT", RaceBlowMethodType::INSULT },
-       { "MOAN", RaceBlowMethodType::MOAN },
-       { "SHOW", RaceBlowMethodType::SHOW },
-       { "SHOOT", RaceBlowMethodType::SHOOT },
+    { "HIT", RaceBlowMethodType::HIT },
+    { "TOUCH", RaceBlowMethodType::TOUCH },
+    { "PUNCH", RaceBlowMethodType::PUNCH },
+    { "KICK", RaceBlowMethodType::KICK },
+    { "CLAW", RaceBlowMethodType::CLAW },
+    { "BITE", RaceBlowMethodType::BITE },
+    { "STING", RaceBlowMethodType::STING },
+    { "SLASH", RaceBlowMethodType::SLASH },
+    { "BUTT", RaceBlowMethodType::BUTT },
+    { "CRUSH", RaceBlowMethodType::CRUSH },
+    { "ENGULF", RaceBlowMethodType::ENGULF },
+    { "CHARGE", RaceBlowMethodType::CHARGE },
+    { "CRAWL", RaceBlowMethodType::CRAWL },
+    { "DROOL", RaceBlowMethodType::DROOL },
+    { "SPIT", RaceBlowMethodType::SPIT },
+    { "EXPLODE", RaceBlowMethodType::EXPLODE },
+    { "GAZE", RaceBlowMethodType::GAZE },
+    { "WAIL", RaceBlowMethodType::WAIL },
+    { "SPORE", RaceBlowMethodType::SPORE },
+    { "XXX4", RaceBlowMethodType::XXX4 },
+    { "BEG", RaceBlowMethodType::BEG },
+    { "INSULT", RaceBlowMethodType::INSULT },
+    { "MOAN", RaceBlowMethodType::MOAN },
+    { "SHOW", RaceBlowMethodType::SHOW },
+    { "SHOOT", RaceBlowMethodType::SHOOT },
 };
 
 /*!
@@ -40,40 +40,40 @@ const std::unordered_map<std::string_view, RaceBlowMethodType> r_info_blow_metho
  * Monster Blow Effects
  */
 const std::unordered_map<std::string_view, RaceBlowEffectType> r_info_blow_effect = {
-       { "HURT", RaceBlowEffectType::HURT },
-       { "POISON", RaceBlowEffectType::POISON },
-       { "UN_BONUS", RaceBlowEffectType::UN_BONUS },
-       { "UN_POWER", RaceBlowEffectType::UN_POWER },
-       { "EAT_GOLD", RaceBlowEffectType::EAT_GOLD },
-       { "EAT_ITEM", RaceBlowEffectType::EAT_ITEM },
-       { "EAT_FOOD", RaceBlowEffectType::EAT_FOOD },
-       { "EAT_LITE", RaceBlowEffectType::EAT_LITE },
-       { "ACID", RaceBlowEffectType::ACID },
-       { "ELEC", RaceBlowEffectType::ELEC },
-       { "FIRE", RaceBlowEffectType::FIRE },
-       { "COLD", RaceBlowEffectType::COLD },
-       { "BLIND", RaceBlowEffectType::BLIND },
-       { "CONFUSE", RaceBlowEffectType::CONFUSE },
-       { "TERRIFY", RaceBlowEffectType::TERRIFY },
-       { "PARALYZE", RaceBlowEffectType::PARALYZE },
-       { "LOSE_STR", RaceBlowEffectType::LOSE_STR },
-       { "LOSE_INT", RaceBlowEffectType::LOSE_INT },
-       { "LOSE_WIS", RaceBlowEffectType::LOSE_WIS },
-       { "LOSE_DEX", RaceBlowEffectType::LOSE_DEX },
-       { "LOSE_CON", RaceBlowEffectType::LOSE_CON },
-       { "LOSE_CHR", RaceBlowEffectType::LOSE_CHR },
-       { "LOSE_ALL", RaceBlowEffectType::LOSE_ALL },
-       { "SHATTER", RaceBlowEffectType::SHATTER },
-       { "EXP_10", RaceBlowEffectType::EXP_10 },
-       { "EXP_20", RaceBlowEffectType::EXP_20 },
-       { "EXP_40", RaceBlowEffectType::EXP_40 },
-       { "EXP_80", RaceBlowEffectType::EXP_80 },
-       { "DISEASE", RaceBlowEffectType::DISEASE },
-       { "TIME", RaceBlowEffectType::TIME },
-       { "EXP_VAMP", RaceBlowEffectType::DR_LIFE },
-       { "DR_MANA", RaceBlowEffectType::DR_MANA },
-       { "SUPERHURT", RaceBlowEffectType::SUPERHURT },
-       { "INERTIA", RaceBlowEffectType::INERTIA },
+    { "HURT", RaceBlowEffectType::HURT },
+    { "POISON", RaceBlowEffectType::POISON },
+    { "UN_BONUS", RaceBlowEffectType::UN_BONUS },
+    { "UN_POWER", RaceBlowEffectType::UN_POWER },
+    { "EAT_GOLD", RaceBlowEffectType::EAT_GOLD },
+    { "EAT_ITEM", RaceBlowEffectType::EAT_ITEM },
+    { "EAT_FOOD", RaceBlowEffectType::EAT_FOOD },
+    { "EAT_LITE", RaceBlowEffectType::EAT_LITE },
+    { "ACID", RaceBlowEffectType::ACID },
+    { "ELEC", RaceBlowEffectType::ELEC },
+    { "FIRE", RaceBlowEffectType::FIRE },
+    { "COLD", RaceBlowEffectType::COLD },
+    { "BLIND", RaceBlowEffectType::BLIND },
+    { "CONFUSE", RaceBlowEffectType::CONFUSE },
+    { "TERRIFY", RaceBlowEffectType::TERRIFY },
+    { "PARALYZE", RaceBlowEffectType::PARALYZE },
+    { "LOSE_STR", RaceBlowEffectType::LOSE_STR },
+    { "LOSE_INT", RaceBlowEffectType::LOSE_INT },
+    { "LOSE_WIS", RaceBlowEffectType::LOSE_WIS },
+    { "LOSE_DEX", RaceBlowEffectType::LOSE_DEX },
+    { "LOSE_CON", RaceBlowEffectType::LOSE_CON },
+    { "LOSE_CHR", RaceBlowEffectType::LOSE_CHR },
+    { "LOSE_ALL", RaceBlowEffectType::LOSE_ALL },
+    { "SHATTER", RaceBlowEffectType::SHATTER },
+    { "EXP_10", RaceBlowEffectType::EXP_10 },
+    { "EXP_20", RaceBlowEffectType::EXP_20 },
+    { "EXP_40", RaceBlowEffectType::EXP_40 },
+    { "EXP_80", RaceBlowEffectType::EXP_80 },
+    { "DISEASE", RaceBlowEffectType::DISEASE },
+    { "TIME", RaceBlowEffectType::TIME },
+    { "EXP_VAMP", RaceBlowEffectType::DR_LIFE },
+    { "DR_MANA", RaceBlowEffectType::DR_MANA },
+    { "SUPERHURT", RaceBlowEffectType::SUPERHURT },
+    { "INERTIA", RaceBlowEffectType::INERTIA },
     { "STUN", RaceBlowEffectType::STUN },
     { "HUNGRY", RaceBlowEffectType::HUNGRY },
     { "FLAVOR", RaceBlowEffectType::FLAVOR },
@@ -141,27 +141,27 @@ const std::unordered_map<std::string_view, race_flags2> r_info_flags2 = {
  * Monster race flags
  */
 const std::unordered_map<std::string_view, race_flags3> r_info_flags3 = {
-       { "ORC", RF3_ORC },
-       { "TROLL", RF3_TROLL },
-       { "GIANT", RF3_GIANT },
-       { "DRAGON", RF3_DRAGON },
-       { "DEMON", RF3_DEMON },
-       { "UNDEAD", RF3_UNDEAD },
-       { "EVIL", RF3_EVIL },
-       { "ANIMAL", RF3_ANIMAL },
-       { "AMBERITE", RF3_AMBERITE },
-       { "GOOD", RF3_GOOD },
-       { "FLAGS3_XX10", RF3_XX10 },
-       { "NONLIVING", RF3_NONLIVING },
-       { "HURT_LITE", RF3_HURT_LITE },
-       { "HURT_ROCK", RF3_HURT_ROCK },
-       { "HURT_FIRE", RF3_HURT_FIRE },
-       { "HURT_COLD", RF3_HURT_COLD },
-       { "ANGEL", RF3_ANGEL },
-       { "NO_FEAR", RF3_NO_FEAR },
-       { "NO_STUN", RF3_NO_STUN },
-       { "NO_CONF", RF3_NO_CONF },
-       { "NO_SLEEP", RF3_NO_SLEEP }
+    { "ORC", RF3_ORC },
+    { "TROLL", RF3_TROLL },
+    { "GIANT", RF3_GIANT },
+    { "DRAGON", RF3_DRAGON },
+    { "DEMON", RF3_DEMON },
+    { "UNDEAD", RF3_UNDEAD },
+    { "EVIL", RF3_EVIL },
+    { "ANIMAL", RF3_ANIMAL },
+    { "AMBERITE", RF3_AMBERITE },
+    { "GOOD", RF3_GOOD },
+    { "FLAGS3_XX10", RF3_XX10 },
+    { "NONLIVING", RF3_NONLIVING },
+    { "HURT_LITE", RF3_HURT_LITE },
+    { "HURT_ROCK", RF3_HURT_ROCK },
+    { "HURT_FIRE", RF3_HURT_FIRE },
+    { "HURT_COLD", RF3_HURT_COLD },
+    { "ANGEL", RF3_ANGEL },
+    { "NO_FEAR", RF3_NO_FEAR },
+    { "NO_STUN", RF3_NO_STUN },
+    { "NO_CONF", RF3_NO_CONF },
+    { "NO_SLEEP", RF3_NO_SLEEP }
 };
 
 /*!
@@ -301,18 +301,18 @@ const std::unordered_map<std::string_view, race_flags7> r_info_flags7 = {
  * Monster race flags
  */
 const std::unordered_map<std::string_view, race_flags8> r_info_flags8 = {
-       { "WILD_ONLY", RF8_WILD_ONLY },
-       { "WILD_TOWN", RF8_WILD_TOWN },
+    { "WILD_ONLY", RF8_WILD_ONLY },
+    { "WILD_TOWN", RF8_WILD_TOWN },
     { "NO_QUEST", RF8_NO_QUEST },
     { "WILD_SHORE", RF8_WILD_SHORE },
-       { "WILD_OCEAN", RF8_WILD_OCEAN },
-       { "WILD_WASTE", RF8_WILD_WASTE },
-       { "WILD_WOOD", RF8_WILD_WOOD },
-       { "WILD_VOLCANO", RF8_WILD_VOLCANO },
-       { "WILD_MOUNTAIN", RF8_WILD_MOUNTAIN },
-       { "WILD_GRASS", RF8_WILD_GRASS },
-       { "WILD_SWAMP", RF8_WILD_SWAMP },
-       { "WILD_ALL", RF8_WILD_ALL },
+    { "WILD_OCEAN", RF8_WILD_OCEAN },
+    { "WILD_WASTE", RF8_WILD_WASTE },
+    { "WILD_WOOD", RF8_WILD_WOOD },
+    { "WILD_VOLCANO", RF8_WILD_VOLCANO },
+    { "WILD_MOUNTAIN", RF8_WILD_MOUNTAIN },
+    { "WILD_GRASS", RF8_WILD_GRASS },
+    { "WILD_SWAMP", RF8_WILD_SWAMP },
+    { "WILD_ALL", RF8_WILD_ALL },
 };
 
 /*!
@@ -320,39 +320,39 @@ const std::unordered_map<std::string_view, race_flags8> r_info_flags8 = {
  * Monster race flags
  */
 const std::unordered_map<std::string_view, race_flags9> r_info_flags9 = {
-       { "DROP_CORPSE", RF9_DROP_CORPSE },
-       { "DROP_SKELETON", RF9_DROP_SKELETON },
-       { "EAT_BLIND", RF9_EAT_BLIND },
-       { "EAT_CONF", RF9_EAT_CONF },
-       { "EAT_MANA", RF9_EAT_MANA },
-       { "EAT_NEXUS", RF9_EAT_NEXUS },
-       // { "EAT_BLINK", RF9_EAT_BLINK }, //<! @note フラグ未定義
-       { "EAT_SLEEP", RF9_EAT_SLEEP },
-       { "EAT_BERSERKER", RF9_EAT_BERSERKER },
-       { "EAT_ACIDIC", RF9_EAT_ACIDIC },
-       { "EAT_SPEED", RF9_EAT_SPEED },
-       { "EAT_CURE", RF9_EAT_CURE },
-       { "EAT_FIRE_RES", RF9_EAT_FIRE_RES },
-       { "EAT_COLD_RES", RF9_EAT_COLD_RES },
-       { "EAT_ACID_RES", RF9_EAT_ACID_RES },
-       { "EAT_ELEC_RES", RF9_EAT_ELEC_RES },
-       { "EAT_POIS_RES", RF9_EAT_POIS_RES },
-       { "EAT_INSANITY", RF9_EAT_INSANITY },
-       { "EAT_DRAIN_EXP", RF9_EAT_DRAIN_EXP },
-       { "EAT_POISONOUS", RF9_EAT_POISONOUS },
-       { "EAT_GIVE_STR", RF9_EAT_GIVE_STR },
-       { "EAT_GIVE_INT", RF9_EAT_GIVE_INT },
-       { "EAT_GIVE_WIS", RF9_EAT_GIVE_WIS },
-       { "EAT_GIVE_DEX", RF9_EAT_GIVE_DEX },
-       { "EAT_GIVE_CON", RF9_EAT_GIVE_CON },
-       { "EAT_GIVE_CHR", RF9_EAT_GIVE_CHR },
-       { "EAT_LOSE_STR", RF9_EAT_LOSE_STR },
-       { "EAT_LOSE_INT", RF9_EAT_LOSE_INT },
-       { "EAT_LOSE_WIS", RF9_EAT_LOSE_WIS },
-       { "EAT_LOSE_DEX", RF9_EAT_LOSE_DEX },
-       { "EAT_LOSE_CON", RF9_EAT_LOSE_CON },
-       { "EAT_LOSE_CHR", RF9_EAT_LOSE_CHR },
-       { "EAT_DRAIN_MANA", RF9_EAT_DRAIN_MANA },
+    { "DROP_CORPSE", RF9_DROP_CORPSE },
+    { "DROP_SKELETON", RF9_DROP_SKELETON },
+    { "EAT_BLIND", RF9_EAT_BLIND },
+    { "EAT_CONF", RF9_EAT_CONF },
+    { "EAT_MANA", RF9_EAT_MANA },
+    { "EAT_NEXUS", RF9_EAT_NEXUS },
+    // { "EAT_BLINK", RF9_EAT_BLINK }, //<! @note フラグ未定義
+    { "EAT_SLEEP", RF9_EAT_SLEEP },
+    { "EAT_BERSERKER", RF9_EAT_BERSERKER },
+    { "EAT_ACIDIC", RF9_EAT_ACIDIC },
+    { "EAT_SPEED", RF9_EAT_SPEED },
+    { "EAT_CURE", RF9_EAT_CURE },
+    { "EAT_FIRE_RES", RF9_EAT_FIRE_RES },
+    { "EAT_COLD_RES", RF9_EAT_COLD_RES },
+    { "EAT_ACID_RES", RF9_EAT_ACID_RES },
+    { "EAT_ELEC_RES", RF9_EAT_ELEC_RES },
+    { "EAT_POIS_RES", RF9_EAT_POIS_RES },
+    { "EAT_INSANITY", RF9_EAT_INSANITY },
+    { "EAT_DRAIN_EXP", RF9_EAT_DRAIN_EXP },
+    { "EAT_POISONOUS", RF9_EAT_POISONOUS },
+    { "EAT_GIVE_STR", RF9_EAT_GIVE_STR },
+    { "EAT_GIVE_INT", RF9_EAT_GIVE_INT },
+    { "EAT_GIVE_WIS", RF9_EAT_GIVE_WIS },
+    { "EAT_GIVE_DEX", RF9_EAT_GIVE_DEX },
+    { "EAT_GIVE_CON", RF9_EAT_GIVE_CON },
+    { "EAT_GIVE_CHR", RF9_EAT_GIVE_CHR },
+    { "EAT_LOSE_STR", RF9_EAT_LOSE_STR },
+    { "EAT_LOSE_INT", RF9_EAT_LOSE_INT },
+    { "EAT_LOSE_WIS", RF9_EAT_LOSE_WIS },
+    { "EAT_LOSE_DEX", RF9_EAT_LOSE_DEX },
+    { "EAT_LOSE_CON", RF9_EAT_LOSE_CON },
+    { "EAT_LOSE_CHR", RF9_EAT_LOSE_CHR },
+    { "EAT_DRAIN_MANA", RF9_EAT_DRAIN_MANA },
 };
 
 /*!
@@ -360,27 +360,27 @@ const std::unordered_map<std::string_view, race_flags9> r_info_flags9 = {
  * Monster race flags
  */
 const std::unordered_map<std::string_view, race_flags_resistance> r_info_flagsr = {
-       { "IM_ACID", RFR_IM_ACID },
-       { "IM_ELEC", RFR_IM_ELEC },
-       { "IM_FIRE", RFR_IM_FIRE },
-       { "IM_COLD", RFR_IM_COLD },
-       { "IM_POIS", RFR_IM_POIS },
-       { "RES_LITE", RFR_RES_LITE },
-       { "RES_DARK", RFR_RES_DARK },
-       { "RES_NETH", RFR_RES_NETH },
-       { "RES_WATE", RFR_RES_WATE },
-       { "RES_PLAS", RFR_RES_PLAS },
-       { "RES_SHAR", RFR_RES_SHAR },
-       { "RES_SOUN", RFR_RES_SOUN },
-       { "RES_CHAO", RFR_RES_CHAO },
-       { "RES_NEXU", RFR_RES_NEXU },
-       { "RES_DISE", RFR_RES_DISE },
-       { "RES_WALL", RFR_RES_WALL },
-       { "RES_INER", RFR_RES_INER },
-       { "RES_TIME", RFR_RES_TIME },
-       { "RES_GRAV", RFR_RES_GRAV },
-       { "RES_ALL", RFR_RES_ALL },
-       { "RES_TELE", RFR_RES_TELE },
+    { "IM_ACID", RFR_IM_ACID },
+    { "IM_ELEC", RFR_IM_ELEC },
+    { "IM_FIRE", RFR_IM_FIRE },
+    { "IM_COLD", RFR_IM_COLD },
+    { "IM_POIS", RFR_IM_POIS },
+    { "RES_LITE", RFR_RES_LITE },
+    { "RES_DARK", RFR_RES_DARK },
+    { "RES_NETH", RFR_RES_NETH },
+    { "RES_WATE", RFR_RES_WATE },
+    { "RES_PLAS", RFR_RES_PLAS },
+    { "RES_SHAR", RFR_RES_SHAR },
+    { "RES_SOUN", RFR_RES_SOUN },
+    { "RES_CHAO", RFR_RES_CHAO },
+    { "RES_NEXU", RFR_RES_NEXU },
+    { "RES_DISE", RFR_RES_DISE },
+    { "RES_WALL", RFR_RES_WALL },
+    { "RES_INER", RFR_RES_INER },
+    { "RES_TIME", RFR_RES_TIME },
+    { "RES_GRAV", RFR_RES_GRAV },
+    { "RES_ALL", RFR_RES_ALL },
+    { "RES_TELE", RFR_RES_TELE },
 };
 
 const std::unordered_map<std::string_view, MonsterAuraType> r_info_aura_flags = {
index 9411be8..6f49851 100644 (file)
@@ -1,4 +1,4 @@
-#include "load/floor-loader.h"
+#include "load/floor-loader.h"
 #include "floor/floor-generator.h"
 #include "floor/floor-object.h"
 #include "floor/floor-save-util.h"
@@ -10,8 +10,8 @@
 #include "load/angband-version-comparer.h"
 #include "load/item/item-loader-factory.h"
 #include "load/load-util.h"
-#include "load/old-feature-types.h"
 #include "load/monster/monster-loader-factory.h"
+#include "load/old-feature-types.h"
 #include "load/old/item-loader-savefile50.h"
 #include "load/old/load-v1-5-0.h"
 #include "load/old/monster-loader-savefile50.h"
index e7039d2..5bb8868 100644 (file)
@@ -1,4 +1,4 @@
-/*!
+/*!
  * @brief アイテム情報をセーブデータから読み込むクラスを選択するファクトリクラス
  * @date 2021/10/16
  * @author Hourier
@@ -33,7 +33,7 @@ std::shared_ptr<ItemLoaderBase> ItemLoaderFactory::create_loader()
  * @brief ItemLoaderのバージョン切り替え.
  * @return セーブファイルバージョン群の中で互換性のある最古のバージョン.
  * @details (備忘録)例えばバージョン15で更に変更された場合、以下のように書き換えること.
- * 
+ *
  * if (loading_savefile_version_is_older_than(15)) {
  *   return ItemLoaderVersionType::LOAD11;
  * } else if (loading_savefile_version_is_older_than(11)) {
index e5d5b89..795c26a 100644 (file)
@@ -1,4 +1,4 @@
-/*!
+/*!
  * @brief セーブファイル読み込み処理 / Purpose: support for loading savefiles -BEN-
  * @date 2014/07/07
  * @author
@@ -64,7 +64,7 @@ static errr load_town_quest(PlayerType *player_ptr)
     if (load_town_result != 0) {
         return load_town_result;
     }
-    
+
     uint16_t max_quests_load;
     byte max_rquests_load;
     auto load_quest_result = load_quest_info(&max_quests_load, &max_rquests_load);
@@ -92,7 +92,7 @@ static void rd_total_play_time()
     if (loading_savefile_version_is_older_than(4)) {
         return;
     }
-    
+
     w_ptr->sf_play_time = rd_u32b();
 }
 
index 06ed984..a965c5b 100644 (file)
@@ -135,9 +135,7 @@ void set_drop_flags(lore_type *lore_ptr)
     if (!lore_ptr->know_everything)
         return;
 
-    lore_ptr->drop_gold = lore_ptr->drop_item = (((lore_ptr->r_ptr->flags1 & RF1_DROP_4D2) ? 8 : 0) + ((lore_ptr->r_ptr->flags1 & RF1_DROP_3D2) ? 6 : 0)
-        + ((lore_ptr->r_ptr->flags1 & RF1_DROP_2D2) ? 4 : 0) + ((lore_ptr->r_ptr->flags1 & RF1_DROP_1D2) ? 2 : 0)
-        + ((lore_ptr->r_ptr->flags1 & RF1_DROP_90) ? 1 : 0) + ((lore_ptr->r_ptr->flags1 & RF1_DROP_60) ? 1 : 0));
+    lore_ptr->drop_gold = lore_ptr->drop_item = (((lore_ptr->r_ptr->flags1 & RF1_DROP_4D2) ? 8 : 0) + ((lore_ptr->r_ptr->flags1 & RF1_DROP_3D2) ? 6 : 0) + ((lore_ptr->r_ptr->flags1 & RF1_DROP_2D2) ? 4 : 0) + ((lore_ptr->r_ptr->flags1 & RF1_DROP_1D2) ? 2 : 0) + ((lore_ptr->r_ptr->flags1 & RF1_DROP_90) ? 1 : 0) + ((lore_ptr->r_ptr->flags1 & RF1_DROP_60) ? 1 : 0));
 
     if (lore_ptr->r_ptr->flags1 & RF1_ONLY_GOLD)
         lore_ptr->drop_item = 0;
index fbbe1b6..3fece56 100644 (file)
@@ -1,4 +1,4 @@
-/*!
+/*!
  * @brief モンスターの思い出を記憶する処理
  * @date 2020/06/09
  * @author Hourier
@@ -6,8 +6,8 @@
 
 #include "lore/lore-store.h"
 #include "core/window-redrawer.h"
-#include "monster-race/race-flags1.h"
 #include "monster-race/monster-race.h"
+#include "monster-race/race-flags1.h"
 #include "monster/monster-info.h"
 #include "system/floor-type-definition.h"
 #include "system/monster-race-definition.h"
@@ -40,8 +40,7 @@ int lore_do_probe(PlayerType *player_ptr, MONRACE_IDX r_idx)
         }
     }
 
-    byte tmp_byte = (((r_ptr->flags1 & RF1_DROP_4D2) ? 8 : 0) + ((r_ptr->flags1 & RF1_DROP_3D2) ? 6 : 0) + ((r_ptr->flags1 & RF1_DROP_2D2) ? 4 : 0)
-        + ((r_ptr->flags1 & RF1_DROP_1D2) ? 2 : 0) + ((r_ptr->flags1 & RF1_DROP_90) ? 1 : 0) + ((r_ptr->flags1 & RF1_DROP_60) ? 1 : 0));
+    byte tmp_byte = (((r_ptr->flags1 & RF1_DROP_4D2) ? 8 : 0) + ((r_ptr->flags1 & RF1_DROP_3D2) ? 6 : 0) + ((r_ptr->flags1 & RF1_DROP_2D2) ? 4 : 0) + ((r_ptr->flags1 & RF1_DROP_1D2) ? 2 : 0) + ((r_ptr->flags1 & RF1_DROP_90) ? 1 : 0) + ((r_ptr->flags1 & RF1_DROP_60) ? 1 : 0));
 
     if (!(r_ptr->flags1 & RF1_ONLY_GOLD)) {
         if (r_ptr->r_drop_item != tmp_byte)
index 323131e..07f4543 100644 (file)
@@ -61,4 +61,7 @@ lore_type *initialize_lore_type(lore_type *lore_ptr, MONRACE_IDX r_idx, monster_
  * @brief モンスターの思い出メッセージをあらかじめ指定された関数ポインタに基づき出力する
  * @param str 出力文字列
  */
-void hooked_roff(concptr str) { hook_c_roff(TERM_WHITE, str); }
+void hooked_roff(concptr str)
+{
+    hook_c_roff(TERM_WHITE, str);
+}
index f018edf..5b69b25 100644 (file)
@@ -1,4 +1,4 @@
-#pragma once
+#pragma once
 
 #include "monster-attack/monster-attack-types.h"
 #include "monster-race/monster-aura-types.h"
@@ -73,7 +73,9 @@ extern hook_c_roff_pf hook_c_roff;
 lore_type *initialize_lore_type(lore_type *lore_ptr, MONRACE_IDX r_idx, monster_lore_mode mode);
 void hooked_roff(concptr str);
 
-enum WHO_WORD_TYPE { WHO = 0, WHOSE = 1, WHOM = 2 };
+enum WHO_WORD_TYPE { WHO = 0,
+    WHOSE = 1,
+    WHOM = 2 };
 using who_word_definition = std::unordered_map<WHO_WORD_TYPE, const std::unordered_map<bool, const std::unordered_map<monster_sex, std::string>>>;
 
 class Who {
index 112bd71..5613b4c 100644 (file)
@@ -1,9 +1,9 @@
-#include "melee/melee-spell-flags-checker.h"
+#include "melee/melee-spell-flags-checker.h"
 #include "dungeon/dungeon-flag-types.h"
 #include "dungeon/dungeon.h"
 #include "effect/effect-characteristics.h"
-#include "floor/line-of-sight.h"
 #include "floor/geometry.h"
+#include "floor/line-of-sight.h"
 #include "melee/melee-spell-util.h"
 #include "monster-floor/monster-move.h"
 #include "monster-race/monster-race.h"
@@ -83,8 +83,7 @@ static bool check_melee_spell_projection(PlayerType *player_ptr, melee_spell_typ
 
         ms_ptr->target_idx = dummy;
         ms_ptr->t_ptr = &floor_ptr->m_list[ms_ptr->target_idx];
-        if (!monster_is_valid(ms_ptr->t_ptr) || (ms_ptr->m_idx == ms_ptr->target_idx) || !are_enemies(player_ptr, ms_ptr->m_ptr, ms_ptr->t_ptr)
-            || !projectable(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx))
+        if (!monster_is_valid(ms_ptr->t_ptr) || (ms_ptr->m_idx == ms_ptr->target_idx) || !are_enemies(player_ptr, ms_ptr->m_ptr, ms_ptr->t_ptr) || !projectable(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx))
             continue;
 
         return true;
@@ -140,8 +139,7 @@ static void check_melee_spell_distance(PlayerType *player_ptr, melee_spell_type
     POSITION real_y = ms_ptr->y;
     POSITION real_x = ms_ptr->x;
     get_project_point(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, &real_y, &real_x, 0L);
-    if (!projectable(player_ptr, real_y, real_x, player_ptr->y, player_ptr->x) && ms_ptr->ability_flags.has(MonsterAbilityType::BA_LITE)
-        && (distance(real_y, real_x, player_ptr->y, player_ptr->x) <= 4) && los(player_ptr, real_y, real_x, player_ptr->y, player_ptr->x)) {
+    if (!projectable(player_ptr, real_y, real_x, player_ptr->y, player_ptr->x) && ms_ptr->ability_flags.has(MonsterAbilityType::BA_LITE) && (distance(real_y, real_x, player_ptr->y, player_ptr->x) <= 4) && los(player_ptr, real_y, real_x, player_ptr->y, player_ptr->x)) {
         ms_ptr->ability_flags.reset(MonsterAbilityType::BA_LITE);
 
         return;
@@ -173,8 +171,7 @@ static void check_melee_spell_rocket(PlayerType *player_ptr, melee_spell_type *m
 
 static void check_melee_spell_beam(PlayerType *player_ptr, melee_spell_type *ms_ptr)
 {
-    if (ms_ptr->ability_flags.has_none_of(RF_ABILITY_BEAM_MASK)
-        || direct_beam(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx, ms_ptr->m_ptr))
+    if (ms_ptr->ability_flags.has_none_of(RF_ABILITY_BEAM_MASK) || direct_beam(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx, ms_ptr->m_ptr))
         return;
 
     ms_ptr->ability_flags.reset(RF_ABILITY_BEAM_MASK);
@@ -191,14 +188,14 @@ static void check_melee_spell_breath(PlayerType *player_ptr, melee_spell_type *m
         return;
     }
 
-    if (ms_ptr->ability_flags.has(MonsterAbilityType::BR_LITE) && !breath_direct(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, 
-        ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx, rad, AttributeType::LITE, true)) {
+    if (ms_ptr->ability_flags.has(MonsterAbilityType::BR_LITE) && !breath_direct(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx,
+                                                                      ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx, rad, AttributeType::LITE, true)) {
         ms_ptr->ability_flags.reset(MonsterAbilityType::BR_LITE);
         return;
     }
 
-    if (ms_ptr->ability_flags.has(MonsterAbilityType::BR_DISI) && !breath_direct(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, 
-        ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx, rad, AttributeType::DISINTEGRATE, true)) {
+    if (ms_ptr->ability_flags.has(MonsterAbilityType::BR_DISI) && !breath_direct(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx,
+                                                                      ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx, rad, AttributeType::DISINTEGRATE, true)) {
         ms_ptr->ability_flags.reset(MonsterAbilityType::BR_DISI);
     }
 }
@@ -265,8 +262,7 @@ static void check_non_stupid(PlayerType *player_ptr, melee_spell_type *ms_ptr)
     if (ms_ptr->r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID))
         return;
 
-    if (ms_ptr->ability_flags.has_any_of(RF_ABILITY_BOLT_MASK)
-        && !clean_shot(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx, ms_ptr->pet)) {
+    if (ms_ptr->ability_flags.has_any_of(RF_ABILITY_BOLT_MASK) && !clean_shot(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx, ms_ptr->pet)) {
         ms_ptr->ability_flags.reset(RF_ABILITY_BOLT_MASK);
     }
 
@@ -280,8 +276,7 @@ static void check_non_stupid(PlayerType *player_ptr, melee_spell_type *ms_ptr)
     if (ms_ptr->ability_flags.has(MonsterAbilityType::RAISE_DEAD) && !raise_possible(player_ptr, ms_ptr->m_ptr))
         ms_ptr->ability_flags.reset(MonsterAbilityType::RAISE_DEAD);
 
-    if (ms_ptr->ability_flags.has(MonsterAbilityType::SPECIAL) && (ms_ptr->m_ptr->r_idx == MON_ROLENTO)
-        && !summon_possible(player_ptr, ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx))
+    if (ms_ptr->ability_flags.has(MonsterAbilityType::SPECIAL) && (ms_ptr->m_ptr->r_idx == MON_ROLENTO) && !summon_possible(player_ptr, ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx))
         ms_ptr->ability_flags.reset(MonsterAbilityType::SPECIAL);
 }
 
@@ -294,8 +289,7 @@ static void check_smart(PlayerType *player_ptr, melee_spell_type *ms_ptr)
         ms_ptr->ability_flags &= RF_ABILITY_INT_MASK;
     }
 
-    if (ms_ptr->ability_flags.has(MonsterAbilityType::TELE_LEVEL)
-        && is_teleport_level_ineffective(player_ptr, (ms_ptr->target_idx == player_ptr->riding) ? 0 : ms_ptr->target_idx))
+    if (ms_ptr->ability_flags.has(MonsterAbilityType::TELE_LEVEL) && is_teleport_level_ineffective(player_ptr, (ms_ptr->target_idx == player_ptr->riding) ? 0 : ms_ptr->target_idx))
         ms_ptr->ability_flags.reset(MonsterAbilityType::TELE_LEVEL);
 }
 
index e6aac4d..622c07c 100644 (file)
@@ -1,4 +1,4 @@
-/*!
+/*!
  * @brief モンスター同士が乱闘する処理
  * @date 2020/05/23
  * @author Hourier
@@ -11,6 +11,7 @@
 #include "core/player-redraw-types.h"
 #include "dungeon/dungeon-flag-types.h"
 #include "dungeon/dungeon.h"
+#include "effect/attribute-types.h"
 #include "effect/effect-characteristics.h"
 #include "effect/effect-processor.h"
 #include "main/sound-definitions-table.h"
@@ -31,7 +32,6 @@
 #include "monster/monster-status.h"
 #include "spell-kind/spells-teleport.h"
 #include "spell-realm/spells-hex.h"
-#include "effect/attribute-types.h"
 #include "system/floor-type-definition.h"
 #include "system/monster-race-definition.h"
 #include "system/monster-type-definition.h"
@@ -67,7 +67,7 @@ static void process_blow_effect(PlayerType *player_ptr, mam_type *mam_ptr)
             AttributeType::TURN_ALL, PROJECT_KILL | PROJECT_STOP | PROJECT_AIMED);
         break;
     case BLOW_EFFECT_TYPE_SLEEP:
-        project(player_ptr, mam_ptr->m_idx, 0, mam_ptr->t_ptr->fy, mam_ptr->t_ptr->fx, r_ptr->level, 
+        project(player_ptr, mam_ptr->m_idx, 0, mam_ptr->t_ptr->fy, mam_ptr->t_ptr->fx, r_ptr->level,
             AttributeType::OLD_SLEEP, PROJECT_KILL | PROJECT_STOP | PROJECT_AIMED);
         break;
     case BLOW_EFFECT_TYPE_HEAL:
index 26d1e52..5509a4c 100644 (file)
@@ -139,8 +139,8 @@ static void describe_silly_attacks(monap_type *monap_ptr)
     } else if (monap_ptr->abbreviate == 1) {
         msg_format("%s", monap_ptr->act);
     } else {
-       /* if (monap_ptr->abbreviate == -1) */
-       msg_format("%^s%s", monap_ptr->m_name, monap_ptr->act);
+        /* if (monap_ptr->abbreviate == -1) */
+        msg_format("%^s%s", monap_ptr->m_name, monap_ptr->act);
     }
 
     monap_ptr->abbreviate = 1; /*2回目以降は省略 */
index 1921495..89cadd2 100644 (file)
@@ -1,4 +1,4 @@
-/*!
+/*!
  * @brief モンスターの攻撃に関する処理
  * @date 2020/03/08
  * @author Hourier
@@ -125,8 +125,7 @@ bool process_monster_attack_to_monster(PlayerType *player_ptr, turn_flags *turn_
     do_kill_body &= (r_ptr->mexp * r_ptr->level > z_ptr->mexp * z_ptr->level);
     do_kill_body &= (g_ptr->m_idx != player_ptr->riding);
 
-    if (do_kill_body || are_enemies(player_ptr, m_ptr, y_ptr) || monster_confused_remaining(m_ptr)) 
-    {
+    if (do_kill_body || are_enemies(player_ptr, m_ptr, y_ptr) || monster_confused_remaining(m_ptr)) {
         return exe_monster_attack_to_monster(player_ptr, m_idx, g_ptr);
     }
 
@@ -136,8 +135,7 @@ bool process_monster_attack_to_monster(PlayerType *player_ptr, turn_flags *turn_
     do_move_body &= (g_ptr->m_idx != player_ptr->riding);
     do_move_body &= monster_can_cross_terrain(player_ptr, player_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].feat, z_ptr, 0);
 
-    if (do_move_body)
-    {
+    if (do_move_body) {
         turn_flags_ptr->do_move = true;
         turn_flags_ptr->did_move_body = true;
         (void)set_monster_csleep(player_ptr, g_ptr->m_idx, 0);
index 8eb5962..5cedc86 100644 (file)
@@ -1,4 +1,4 @@
-/*!
+/*!
  * @brief モンスターの移動方向を決定する処理
  * @date 2020/03/08
  * @author Hourier
@@ -78,8 +78,7 @@ static void decide_enemy_approch_direction(PlayerType *player_ptr, MONSTER_IDX m
         if (!are_enemies(player_ptr, m_ptr, t_ptr))
             continue;
 
-        if (((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != player_ptr->riding) || has_pass_wall(player_ptr)))
-            || ((r_ptr->flags2 & RF2_KILL_WALL) && (m_idx != player_ptr->riding))) {
+        if (((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != player_ptr->riding) || has_pass_wall(player_ptr))) || ((r_ptr->flags2 & RF2_KILL_WALL) && (m_idx != player_ptr->riding))) {
             if (!in_disintegration_range(floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
                 continue;
         } else {
@@ -188,7 +187,7 @@ static bool decide_pet_movement_direction(MonsterSweepGrid *msd)
     if (!is_pet(m_ptr)) {
         return false;
     }
-    
+
     bool avoid = ((msd->player_ptr->pet_follow_distance < 0) && (m_ptr->cdis <= (0 - msd->player_ptr->pet_follow_distance)));
     bool lonely = (!avoid && (m_ptr->cdis > msd->player_ptr->pet_follow_distance));
     bool distant = (m_ptr->cdis > PET_SEEK_DIST);
@@ -200,7 +199,7 @@ static bool decide_pet_movement_direction(MonsterSweepGrid *msd)
     if (!avoid && !lonely && !distant) {
         return true;
     }
-    
+
     POSITION dis = msd->player_ptr->pet_follow_distance;
     if (msd->player_ptr->pet_follow_distance > PET_SEEK_DIST) {
         msd->player_ptr->pet_follow_distance = PET_SEEK_DIST;
@@ -232,7 +231,7 @@ bool decide_monster_movement_direction(PlayerType *player_ptr, DIRECTION *mm, MO
     if (random_walk(player_ptr, mm, m_ptr)) {
         return true;
     }
-    
+
     if (r_ptr->behavior_flags.has(MonsterBehaviorType::NEVER_MOVE) && (m_ptr->cdis > 1)) {
         mm[0] = mm[1] = mm[2] = mm[3] = 5;
         return true;
@@ -242,7 +241,7 @@ bool decide_monster_movement_direction(PlayerType *player_ptr, DIRECTION *mm, MO
     if (decide_pet_movement_direction(&msd)) {
         return true;
     }
-    
+
     if (!is_hostile(m_ptr)) {
         mm[0] = mm[1] = mm[2] = mm[3] = 5;
         get_enemy_dir(player_ptr, m_idx, mm);
index 33a89ac..f79a05c 100644 (file)
@@ -1,4 +1,4 @@
-/*!
+/*!
  * todo 後で再分割する
  * @brief モンスター生成処理
  * @date 2020/06/10
@@ -12,6 +12,7 @@
 #include "floor/floor-util.h"
 #include "floor/geometry.h"
 #include "game-option/cheat-options.h"
+#include "game-option/cheat-types.h"
 #include "monster-floor/one-monster-placer.h"
 #include "monster-floor/place-monster-types.h"
 #include "monster-race/monster-race-hook.h"
@@ -36,7 +37,6 @@
 #include "util/string-processor.h"
 #include "view/display-messages.h"
 #include "wizard/wizard-messages.h"
-#include "game-option/cheat-types.h"
 
 #define MON_SCAT_MAXD 10 /*!< mon_scatter()関数によるモンスター配置で許される中心からの最大距離 */
 
@@ -146,7 +146,7 @@ bool multiply_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, bool clone, BIT
         return false;
 
     if (clone || m_ptr->mflag2.has(MonsterConstantFlagType::CLONED)) {
-        floor_ptr->m_list[hack_m_idx_ii].mflag2.set({MonsterConstantFlagType::CLONED, MonsterConstantFlagType::NOPET});
+        floor_ptr->m_list[hack_m_idx_ii].mflag2.set({ MonsterConstantFlagType::CLONED, MonsterConstantFlagType::NOPET });
     }
 
     return true;
@@ -345,8 +345,7 @@ bool place_monster(PlayerType *player_ptr, POSITION y, POSITION x, BIT_FLAGS mod
     if (r_idx == 0)
         return false;
 
-    if ((one_in_(5) || (player_ptr->current_floor_ptr->dun_level == 0)) && !(r_info[r_idx].flags1 & RF1_UNIQUE)
-        && angband_strchr("hkoptuyAHLOPTUVY", r_info[r_idx].d_char)) {
+    if ((one_in_(5) || (player_ptr->current_floor_ptr->dun_level == 0)) && !(r_info[r_idx].flags1 & RF1_UNIQUE) && angband_strchr("hkoptuyAHLOPTUVY", r_info[r_idx].d_char)) {
         mode |= PM_JURAL;
     }
 
index bf09b2e..e875ead 100644 (file)
@@ -9,6 +9,7 @@
 #include "core/player-update-types.h"
 #include "core/speed-table.h"
 #include "core/window-redrawer.h"
+#include "effect/attribute-types.h"
 #include "effect/effect-characteristics.h"
 #include "effect/effect-processor.h"
 #include "floor/cave.h"
@@ -33,7 +34,6 @@
 #include "monster/monster-update.h"
 #include "pet/pet-util.h"
 #include "player/player-status-flags.h"
-#include "effect/attribute-types.h"
 #include "system/floor-type-definition.h"
 #include "system/grid-type-definition.h"
 #include "system/monster-race-definition.h"
@@ -74,8 +74,7 @@ static bool process_wall(PlayerType *player_ptr, turn_flags *turn_flags_ptr, mon
         return true;
     }
 
-    if (((r_ptr->flags2 & RF2_KILL_WALL) != 0) && (can_cross ? f_ptr->flags.has_not(FloorFeatureType::LOS) : !turn_flags_ptr->is_riding_mon)
-        && f_ptr->flags.has(FloorFeatureType::HURT_DISI) && f_ptr->flags.has_not(FloorFeatureType::PERMANENT) && check_hp_for_feat_destruction(f_ptr, m_ptr)) {
+    if (((r_ptr->flags2 & RF2_KILL_WALL) != 0) && (can_cross ? f_ptr->flags.has_not(FloorFeatureType::LOS) : !turn_flags_ptr->is_riding_mon) && f_ptr->flags.has(FloorFeatureType::HURT_DISI) && f_ptr->flags.has_not(FloorFeatureType::PERMANENT) && check_hp_for_feat_destruction(f_ptr, m_ptr)) {
         turn_flags_ptr->do_move = true;
         if (!can_cross)
             turn_flags_ptr->must_alter_to_move = true;
@@ -185,8 +184,7 @@ static bool process_door(PlayerType *player_ptr, turn_flags *turn_flags_ptr, mon
     if (!turn_flags_ptr->did_open_door && !turn_flags_ptr->did_bash_door)
         return true;
 
-    if (turn_flags_ptr->did_bash_door
-        && ((randint0(100) < 50) || (feat_state(player_ptr->current_floor_ptr, g_ptr->feat, FloorFeatureType::OPEN) == g_ptr->feat) || f_ptr->flags.has(FloorFeatureType::GLASS))) {
+    if (turn_flags_ptr->did_bash_door && ((randint0(100) < 50) || (feat_state(player_ptr->current_floor_ptr, g_ptr->feat, FloorFeatureType::OPEN) == g_ptr->feat) || f_ptr->flags.has(FloorFeatureType::GLASS))) {
         cave_alter_feat(player_ptr, ny, nx, FloorFeatureType::BASH);
         if (!monster_is_valid(m_ptr)) {
             player_ptr->update |= (PU_FLOW);
@@ -410,9 +408,7 @@ bool process_monster_movement(PlayerType *player_ptr, turn_flags *turn_flags_ptr
             break;
 
         monster_race *ap_r_ptr = &r_info[m_ptr->ap_r_idx];
-        if (m_ptr->ml
-            && (disturb_move || (disturb_near && m_ptr->mflag.has(MonsterTemporaryFlagType::VIEW) && projectable(player_ptr, player_ptr->y, player_ptr->x, m_ptr->fy, m_ptr->fx))
-                || (disturb_high && ap_r_ptr->r_tkills && ap_r_ptr->level >= player_ptr->lev))) {
+        if (m_ptr->ml && (disturb_move || (disturb_near && m_ptr->mflag.has(MonsterTemporaryFlagType::VIEW) && projectable(player_ptr, player_ptr->y, player_ptr->x, m_ptr->fy, m_ptr->fx)) || (disturb_high && ap_r_ptr->r_tkills && ap_r_ptr->level >= player_ptr->lev))) {
             if (is_hostile(m_ptr))
                 disturb(player_ptr, false, true);
         }
@@ -462,8 +458,7 @@ void process_speak_sound(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION oy,
         msg_print(_("重厚な足音が聞こえた。", "You hear heavy steps."));
     }
 
-    if (((ap_r_ptr->flags2 & RF2_CAN_SPEAK) == 0) || !aware || !one_in_(SPEAK_CHANCE) || !player_has_los_bold(player_ptr, oy, ox)
-        || !projectable(player_ptr, oy, ox, player_ptr->y, player_ptr->x))
+    if (((ap_r_ptr->flags2 & RF2_CAN_SPEAK) == 0) || !aware || !one_in_(SPEAK_CHANCE) || !player_has_los_bold(player_ptr, oy, ox) || !projectable(player_ptr, oy, ox, player_ptr->y, player_ptr->x))
         return;
 
     GAME_TEXT m_name[MAX_NLEN];
@@ -505,4 +500,7 @@ void set_target(monster_type *m_ptr, POSITION y, POSITION x)
  * @brief モンスターの目標地点をリセットする / Reset the target of counter attack
  * @param m_ptr モンスターの参照ポインタ
  */
-void reset_target(monster_type *m_ptr) { set_target(m_ptr, 0, 0); }
+void reset_target(monster_type *m_ptr)
+{
+    set_target(m_ptr, 0, 0);
+}
index 26cb6b5..7a6d265 100644 (file)
@@ -1,4 +1,4 @@
-/*!
+/*!
  * @brief モンスターが移動した結果、床のアイテムに重なった時の処理と、モンスターがアイテムを落とす処理
  * @date 2020/03/07
  * @author Hourier
@@ -6,8 +6,8 @@
 
 #include "monster-floor/monster-object.h"
 #include "flavor/flavor-describer.h"
-#include "floor/floor-object.h"
 #include "floor/cave.h"
+#include "floor/floor-object.h"
 #include "floor/geometry.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
@@ -174,8 +174,7 @@ void update_object_by_monster_movement(PlayerType *player_ptr, turn_flags *turn_
         monster_desc(player_ptr, m_name, m_ptr, MD_INDEF_HIDDEN);
         update_object_flags(flgs, &flg2, &flg3, &flgr);
 
-        bool is_special_object = o_ptr->is_artifact() || ((r_ptr->flags3 & flg3) != 0) || ((r_ptr->flags2 & flg2) != 0)
-            || (((~(r_ptr->flagsr) & flgr) != 0) && !(r_ptr->flagsr & RFR_RES_ALL));
+        bool is_special_object = o_ptr->is_artifact() || ((r_ptr->flags3 & flg3) != 0) || ((r_ptr->flags2 & flg2) != 0) || (((~(r_ptr->flagsr) & flgr) != 0) && !(r_ptr->flagsr & RFR_RES_ALL));
         monster_pickup_object(player_ptr, turn_flags_ptr, m_idx, o_ptr, is_special_object, ny, nx, m_name, o_name, this_o_idx);
     }
 }
index 3bdd69b..c44337b 100644 (file)
@@ -62,9 +62,7 @@ bool MonsterSweepGrid::get_movable_grid()
     this->can_pass_wall = any_bits(r_ptr->flags2, RF2_PASS_WALL) && ((this->m_idx != this->player_ptr->riding) || has_pass_wall(this->player_ptr));
     if (!this->will_run && m_ptr->target_y) {
         int t_m_idx = floor_ptr->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
-        if ((t_m_idx > 0) && are_enemies(this->player_ptr, m_ptr, &floor_ptr->m_list[t_m_idx])
-            && los(this->player_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x)
-            && projectable(this->player_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x)) {
+        if ((t_m_idx > 0) && are_enemies(this->player_ptr, m_ptr, &floor_ptr->m_list[t_m_idx]) && los(this->player_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x) && projectable(this->player_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x)) {
             y = m_ptr->fy - m_ptr->target_y;
             x = m_ptr->fx - m_ptr->target_x;
             this->done = true;
@@ -140,8 +138,7 @@ void MonsterSweepGrid::check_hiding_grid(POSITION *y, POSITION *x, POSITION *y2,
         return;
     }
 
-    if ((!los(this->player_ptr, m_ptr->fy, m_ptr->fx, this->player_ptr->y, this->player_ptr->x)
-            || !projectable(this->player_ptr, m_ptr->fy, m_ptr->fx, this->player_ptr->y, this->player_ptr->x))) {
+    if ((!los(this->player_ptr, m_ptr->fy, m_ptr->fx, this->player_ptr->y, this->player_ptr->x) || !projectable(this->player_ptr, m_ptr->fy, m_ptr->fx, this->player_ptr->y, this->player_ptr->x))) {
         if (floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].get_distance(r_ptr) >= MAX_SIGHT / 2) {
             return;
         }
@@ -361,8 +358,7 @@ bool MonsterSweepGrid::is_best_cost(const POSITION y, const POSITION x, const in
     auto *floor_ptr = this->player_ptr->current_floor_ptr;
     auto *r_ptr = &r_info[floor_ptr->m_list[this->m_idx].r_idx];
     auto is_riding = this->m_idx == this->player_ptr->riding;
-    if ((none_bits(r_ptr->flags2, RF2_PASS_WALL) || (is_riding && !has_pass_wall(this->player_ptr)))
-            && (none_bits(r_ptr->flags2, RF2_KILL_WALL) || is_riding)) {
+    if ((none_bits(r_ptr->flags2, RF2_PASS_WALL) || (is_riding && !has_pass_wall(this->player_ptr))) && (none_bits(r_ptr->flags2, RF2_KILL_WALL) || is_riding)) {
         if (this->cost == 0) {
             return false;
         }
index 9f2b3e0..29ee553 100644 (file)
@@ -1,4 +1,4 @@
-/*!
+/*!
  * @brief モンスターをフロアに1体配置する処理
  * @date 2020/06/13
  * @author Hourier
@@ -8,6 +8,7 @@
 #include "core/player-update-types.h"
 #include "core/speed-table.h"
 #include "dungeon/quest.h"
+#include "effect/attribute-types.h"
 #include "effect/effect-characteristics.h"
 #include "effect/effect-processor.h"
 #include "flavor/flavor-describer.h"
@@ -36,7 +37,6 @@
 #include "monster/monster-util.h"
 #include "object/warning.h"
 #include "player/player-status.h"
-#include "effect/attribute-types.h"
 #include "system/floor-type-definition.h"
 #include "system/grid-type-definition.h"
 #include "system/monster-race-definition.h"
@@ -128,8 +128,7 @@ static bool check_unique_placeable(PlayerType *player_ptr, MONRACE_IDX r_idx)
             return false;
     }
 
-    if (any_bits(r_ptr->flags1, RF1_FORCE_DEPTH) && (player_ptr->current_floor_ptr->dun_level < r_ptr->level)
-        && (!ironman_nightmare || any_bits(r_ptr->flags1, RF1_QUESTOR))) {
+    if (any_bits(r_ptr->flags1, RF1_FORCE_DEPTH) && (player_ptr->current_floor_ptr->dun_level < r_ptr->level) && (!ironman_nightmare || any_bits(r_ptr->flags1, RF1_QUESTOR))) {
         return false;
     }
 
index b09d02c..cd55d00 100644 (file)
@@ -1,4 +1,4 @@
-#include "monster-race/monster-race-hook.h"
+#include "monster-race/monster-race-hook.h"
 #include "dungeon/dungeon.h"
 #include "monster-attack/monster-attack-effect.h"
 #include "monster-attack/monster-attack-types.h"
@@ -135,9 +135,7 @@ bool mon_hook_dungeon(PlayerType *player_ptr, MONRACE_IDX r_idx)
         return (any_bits(d_ptr->mflags8, RF8_WILD_MOUNTAIN) && any_bits(r_ptr->flags8, RF8_WILD_MOUNTAIN));
 
     bool land = none_bits(r_ptr->flags7, RF7_AQUATIC);
-    return none_bits(d_ptr->mflags8, RF8_WILD_MOUNTAIN | RF8_WILD_VOLCANO)
-        || (any_bits(d_ptr->mflags8, RF8_WILD_MOUNTAIN) && (land || any_bits(r_ptr->flags8, RF8_WILD_MOUNTAIN)))
-        || (any_bits(d_ptr->mflags8, RF8_WILD_VOLCANO) && (land || any_bits(r_ptr->flags8, RF8_WILD_VOLCANO)));
+    return none_bits(d_ptr->mflags8, RF8_WILD_MOUNTAIN | RF8_WILD_VOLCANO) || (any_bits(d_ptr->mflags8, RF8_WILD_MOUNTAIN) && (land || any_bits(r_ptr->flags8, RF8_WILD_MOUNTAIN))) || (any_bits(d_ptr->mflags8, RF8_WILD_VOLCANO) && (land || any_bits(r_ptr->flags8, RF8_WILD_VOLCANO)));
 }
 
 /*!
@@ -892,6 +890,5 @@ bool item_monster_okay(PlayerType *player_ptr, MONRACE_IDX r_idx)
  */
 bool vault_monster_okay(PlayerType *player_ptr, MONRACE_IDX r_idx)
 {
-    return (mon_hook_dungeon(player_ptr, r_idx) && none_bits(r_info[r_idx].flags1, RF1_UNIQUE) && none_bits(r_info[r_idx].flags7, RF7_UNIQUE2)
-        && none_bits(r_info[r_idx].flagsr, RFR_RES_ALL) && none_bits(r_info[r_idx].flags7, RF7_AQUATIC));
+    return (mon_hook_dungeon(player_ptr, r_idx) && none_bits(r_info[r_idx].flags1, RF1_UNIQUE) && none_bits(r_info[r_idx].flags7, RF7_UNIQUE2) && none_bits(r_info[r_idx].flagsr, RFR_RES_ALL) && none_bits(r_info[r_idx].flags7, RF7_AQUATIC));
 }
index a1dfc4b..55ce458 100644 (file)
@@ -1,4 +1,4 @@
-/*!
+/*!
  * @brief モンスター情報の記述 / describe monsters (using monster memory)
  * @date 2013/12/11
  * @author
  * @brief モンスターを友好的にする
  * @param m_ptr モンスター情報構造体の参照ポインタ
  */
-void set_friendly(monster_type *m_ptr) { m_ptr->mflag2.set(MonsterConstantFlagType::FRIENDLY); }
+void set_friendly(monster_type *m_ptr)
+{
+    m_ptr->mflag2.set(MonsterConstantFlagType::FRIENDLY);
+}
 
 /*!
  * @brief モンスターが地形を踏破できるかどうかを返す
@@ -229,16 +232,31 @@ bool monster_has_hostile_align(PlayerType *player_ptr, monster_type *m_ptr, int
     return false;
 }
 
-bool is_original_ap_and_seen(PlayerType *player_ptr, monster_type *m_ptr) { return m_ptr->ml && !player_ptr->hallucinated && (m_ptr->ap_r_idx == m_ptr->r_idx); }
+bool is_original_ap_and_seen(PlayerType *player_ptr, monster_type *m_ptr)
+{
+    return m_ptr->ml && !player_ptr->hallucinated && (m_ptr->ap_r_idx == m_ptr->r_idx);
+}
 
 /*  Determine monster race appearance index is same as race index */
-bool is_original_ap(monster_type *m_ptr) { return m_ptr->ap_r_idx == m_ptr->r_idx; }
+bool is_original_ap(monster_type *m_ptr)
+{
+    return m_ptr->ap_r_idx == m_ptr->r_idx;
+}
 
-bool is_friendly(monster_type *m_ptr) { return m_ptr->mflag2.has(MonsterConstantFlagType::FRIENDLY); }
+bool is_friendly(monster_type *m_ptr)
+{
+    return m_ptr->mflag2.has(MonsterConstantFlagType::FRIENDLY);
+}
 
-bool is_pet(monster_type *m_ptr) { return m_ptr->mflag2.has(MonsterConstantFlagType::PET); }
+bool is_pet(monster_type *m_ptr)
+{
+    return m_ptr->mflag2.has(MonsterConstantFlagType::PET);
+}
 
-bool is_hostile(monster_type *m_ptr) { return !is_friendly(m_ptr) && !is_pet(m_ptr); }
+bool is_hostile(monster_type *m_ptr)
+{
+    return !is_friendly(m_ptr) && !is_pet(m_ptr);
+}
 
 /*!
  * @brief モンスターがアイテム類に擬態しているかどうかを返す
@@ -276,7 +294,10 @@ bool is_mimicry(monster_type *m_ptr)
  * @param m_ptr モンスターの参照ポインタ
  * @return 本当のモンスター種族参照ポインタ
  */
-monster_race *real_r_ptr(monster_type *m_ptr) { return &r_info[real_r_idx(m_ptr)]; }
+monster_race *real_r_ptr(monster_type *m_ptr)
+{
+    return &r_info[real_r_idx(m_ptr)];
+}
 
 MONRACE_IDX real_r_idx(monster_type *m_ptr)
 {
index 575ebde..4b22d58 100644 (file)
@@ -1,4 +1,4 @@
-/*!
+/*!
  * @brief モンスター処理 / misc code for monsters
  * @date 2014/07/08
  * @author
@@ -210,8 +210,7 @@ static bool monster_hook_chameleon_lord(PlayerType *player_ptr, MONRACE_IDX r_id
     if (std::abs(r_ptr->level - r_info[MON_CHAMELEON_K].level) > 5)
         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->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))
         return false;
 
     if (!monster_can_cross_terrain(player_ptr, floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0))
@@ -248,8 +247,7 @@ static bool monster_hook_chameleon(PlayerType *player_ptr, MONRACE_IDX r_idx)
     if (r_ptr->behavior_flags.has(MonsterBehaviorType::FRIENDLY) && (r_ptr->flags7 & RF7_CHAMELEON))
         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->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))
         return false;
 
     if (!monster_can_cross_terrain(player_ptr, floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0))
index 6d2bae8..3afc15e 100644 (file)
 #include "system/monster-race-definition.h"
 #include "system/monster-type-definition.h"
 
- /*!
 * @brief ターン経過フラグ構造体の初期化
 * @param riding_idx 乗馬中のモンスターID
 * @param m_idx モンスターID
 * @return 初期化済のターン経過フラグ
 */
+/*!
+ * @brief ターン経過フラグ構造体の初期化
+ * @param riding_idx 乗馬中のモンスターID
+ * @param m_idx モンスターID
+ * @return 初期化済のターン経過フラグ
+ */
 turn_flags *init_turn_flags(MONSTER_IDX riding_idx, MONSTER_IDX m_idx, turn_flags *turn_flags_ptr)
 {
-       turn_flags_ptr->is_riding_mon = (m_idx == riding_idx);
-       turn_flags_ptr->do_turn = false;
-       turn_flags_ptr->do_move = false;
-       turn_flags_ptr->do_view = false;
-       turn_flags_ptr->must_alter_to_move = false;
-       turn_flags_ptr->did_open_door = false;
-       turn_flags_ptr->did_bash_door = false;
-       turn_flags_ptr->did_take_item = false;
-       turn_flags_ptr->did_kill_item = false;
-       turn_flags_ptr->did_move_body = false;
-       turn_flags_ptr->did_pass_wall = false;
-       turn_flags_ptr->did_kill_wall = false;
-       return turn_flags_ptr;
+    turn_flags_ptr->is_riding_mon = (m_idx == riding_idx);
+    turn_flags_ptr->do_turn = false;
+    turn_flags_ptr->do_move = false;
+    turn_flags_ptr->do_view = false;
+    turn_flags_ptr->must_alter_to_move = false;
+    turn_flags_ptr->did_open_door = false;
+    turn_flags_ptr->did_bash_door = false;
+    turn_flags_ptr->did_take_item = false;
+    turn_flags_ptr->did_kill_item = false;
+    turn_flags_ptr->did_move_body = false;
+    turn_flags_ptr->did_pass_wall = false;
+    turn_flags_ptr->did_kill_wall = false;
+    return turn_flags_ptr;
 }
 
-
 /*!
  * @brief old_race_flags_ptr の初期化
  */
 old_race_flags *init_old_race_flags(old_race_flags *old_race_flags_ptr)
 {
-       old_race_flags_ptr->old_r_flags1 = 0L;
-       old_race_flags_ptr->old_r_flags2 = 0L;
-       old_race_flags_ptr->old_r_flags3 = 0L;
-       old_race_flags_ptr->old_r_flagsr = 0L;
-        old_race_flags_ptr->old_r_ability_flags.clear();
-
-       old_race_flags_ptr->old_r_blows0 = 0;
-       old_race_flags_ptr->old_r_blows1 = 0;
-       old_race_flags_ptr->old_r_blows2 = 0;
-       old_race_flags_ptr->old_r_blows3 = 0;
-
-       old_race_flags_ptr->old_r_cast_spell = 0;
-       return old_race_flags_ptr;
+    old_race_flags_ptr->old_r_flags1 = 0L;
+    old_race_flags_ptr->old_r_flags2 = 0L;
+    old_race_flags_ptr->old_r_flags3 = 0L;
+    old_race_flags_ptr->old_r_flagsr = 0L;
+    old_race_flags_ptr->old_r_ability_flags.clear();
+
+    old_race_flags_ptr->old_r_blows0 = 0;
+    old_race_flags_ptr->old_r_blows1 = 0;
+    old_race_flags_ptr->old_r_blows2 = 0;
+    old_race_flags_ptr->old_r_blows3 = 0;
+
+    old_race_flags_ptr->old_r_cast_spell = 0;
+    return old_race_flags_ptr;
 }
 
-
 /*!
  * @brief coordinate_candidate の初期化
  * @param なし
@@ -66,14 +64,13 @@ old_race_flags *init_old_race_flags(old_race_flags *old_race_flags_ptr)
  */
 coordinate_candidate init_coordinate_candidate(void)
 {
-       coordinate_candidate candidate;
-       candidate.gy = 0;
-       candidate.gx = 0;
-       candidate.gdis = 0;
-       return candidate;
+    coordinate_candidate candidate;
+    candidate.gy = 0;
+    candidate.gx = 0;
+    candidate.gdis = 0;
+    return candidate;
 }
 
-
 /*!
  * @brief モンスターの移動方向を保存する
  * @param mm 移動方向
@@ -82,58 +79,42 @@ coordinate_candidate init_coordinate_candidate(void)
  */
 void store_enemy_approch_direction(int *mm, POSITION y, POSITION x)
 {
-       /* North, South, East, West, North-West, North-East, South-West, South-East */
-       if ((y < 0) && (x == 0))
-       {
-               mm[0] = 8;
-               mm[1] = 7;
-               mm[2] = 9;
-       }
-       else if ((y > 0) && (x == 0))
-       {
-               mm[0] = 2;
-               mm[1] = 1;
-               mm[2] = 3;
-       }
-       else if ((x > 0) && (y == 0))
-       {
-               mm[0] = 6;
-               mm[1] = 9;
-               mm[2] = 3;
-       }
-       else if ((x < 0) && (y == 0))
-       {
-               mm[0] = 4;
-               mm[1] = 7;
-               mm[2] = 1;
-       }
-       else if ((y < 0) && (x < 0))
-       {
-               mm[0] = 7;
-               mm[1] = 4;
-               mm[2] = 8;
-       }
-       else if ((y < 0) && (x > 0))
-       {
-               mm[0] = 9;
-               mm[1] = 6;
-               mm[2] = 8;
-       }
-       else if ((y > 0) && (x < 0))
-       {
-               mm[0] = 1;
-               mm[1] = 4;
-               mm[2] = 2;
-       }
-       else if ((y > 0) && (x > 0))
-       {
-               mm[0] = 3;
-               mm[1] = 6;
-               mm[2] = 2;
-       }
+    /* North, South, East, West, North-West, North-East, South-West, South-East */
+    if ((y < 0) && (x == 0)) {
+        mm[0] = 8;
+        mm[1] = 7;
+        mm[2] = 9;
+    } else if ((y > 0) && (x == 0)) {
+        mm[0] = 2;
+        mm[1] = 1;
+        mm[2] = 3;
+    } else if ((x > 0) && (y == 0)) {
+        mm[0] = 6;
+        mm[1] = 9;
+        mm[2] = 3;
+    } else if ((x < 0) && (y == 0)) {
+        mm[0] = 4;
+        mm[1] = 7;
+        mm[2] = 1;
+    } else if ((y < 0) && (x < 0)) {
+        mm[0] = 7;
+        mm[1] = 4;
+        mm[2] = 8;
+    } else if ((y < 0) && (x > 0)) {
+        mm[0] = 9;
+        mm[1] = 6;
+        mm[2] = 8;
+    } else if ((y > 0) && (x < 0)) {
+        mm[0] = 1;
+        mm[1] = 4;
+        mm[2] = 2;
+    } else if ((y > 0) && (x > 0)) {
+        mm[0] = 3;
+        mm[1] = 6;
+        mm[2] = 2;
+    }
 }
 
-
 /*!
  * @brief get_movable_grid() における移動の方向を保存する
  * @param mm 移動方向
@@ -142,186 +123,156 @@ void store_enemy_approch_direction(int *mm, POSITION y, POSITION x)
  */
 void store_moves_val(int *mm, int y, int x)
 {
-       POSITION ax = std::abs(x);
-       POSITION ay = std::abs(y);
-
-       int move_val = 0;
-       if (y < 0) move_val += 8;
-       if (x > 0) move_val += 4;
-
-       if (ay > (ax << 1)) move_val += 2;
-       else if (ax > (ay << 1)) move_val++;
-
-       switch (move_val)
-       {
-       case 0:
-       {
-               mm[0] = 9;
-               if (ay > ax)
-               {
-                       mm[1] = 8;
-                       mm[2] = 6;
-                       mm[3] = 7;
-                       mm[4] = 3;
-               }
-               else
-               {
-                       mm[1] = 6;
-                       mm[2] = 8;
-                       mm[3] = 3;
-                       mm[4] = 7;
-               }
-
-               break;
-       }
-       case 1:
-       case 9:
-       {
-               mm[0] = 6;
-               if (y < 0)
-               {
-                       mm[1] = 3;
-                       mm[2] = 9;
-                       mm[3] = 2;
-                       mm[4] = 8;
-               }
-               else
-               {
-                       mm[1] = 9;
-                       mm[2] = 3;
-                       mm[3] = 8;
-                       mm[4] = 2;
-               }
-
-               break;
-       }
-       case 2:
-       case 6:
-       {
-               mm[0] = 8;
-               if (x < 0)
-               {
-                       mm[1] = 9;
-                       mm[2] = 7;
-                       mm[3] = 6;
-                       mm[4] = 4;
-               }
-               else
-               {
-                       mm[1] = 7;
-                       mm[2] = 9;
-                       mm[3] = 4;
-                       mm[4] = 6;
-               }
-
-               break;
-       }
-       case 4:
-       {
-               mm[0] = 7;
-               if (ay > ax)
-               {
-                       mm[1] = 8;
-                       mm[2] = 4;
-                       mm[3] = 9;
-                       mm[4] = 1;
-               }
-               else
-               {
-                       mm[1] = 4;
-                       mm[2] = 8;
-                       mm[3] = 1;
-                       mm[4] = 9;
-               }
-
-               break;
-       }
-       case 5:
-       case 13:
-       {
-               mm[0] = 4;
-               if (y < 0)
-               {
-                       mm[1] = 1;
-                       mm[2] = 7;
-                       mm[3] = 2;
-                       mm[4] = 8;
-               }
-               else
-               {
-                       mm[1] = 7;
-                       mm[2] = 1;
-                       mm[3] = 8;
-                       mm[4] = 2;
-               }
-
-               break;
-       }
-       case 8:
-       {
-               mm[0] = 3;
-               if (ay > ax)
-               {
-                       mm[1] = 2;
-                       mm[2] = 6;
-                       mm[3] = 1;
-                       mm[4] = 9;
-               }
-               else
-               {
-                       mm[1] = 6;
-                       mm[2] = 2;
-                       mm[3] = 9;
-                       mm[4] = 1;
-               }
-       
-               break;
-       }
-       case 10:
-       case 14:
-       {
-               mm[0] = 2;
-               if (x < 0)
-               {
-                       mm[1] = 3;
-                       mm[2] = 1;
-                       mm[3] = 6;
-                       mm[4] = 4;
-               }
-               else
-               {
-                       mm[1] = 1;
-                       mm[2] = 3;
-                       mm[3] = 4;
-                       mm[4] = 6;
-               }
-
-               break;
-       }
-       case 12:
-       {
-               mm[0] = 1;
-               if (ay > ax)
-               {
-                       mm[1] = 2;
-                       mm[2] = 4;
-                       mm[3] = 3;
-                       mm[4] = 7;
-               }
-               else
-               {
-                       mm[1] = 4;
-                       mm[2] = 2;
-                       mm[3] = 7;
-                       mm[4] = 3;
-               }
-
-               break;
-       }
-       }
+    POSITION ax = std::abs(x);
+    POSITION ay = std::abs(y);
+
+    int move_val = 0;
+    if (y < 0)
+        move_val += 8;
+    if (x > 0)
+        move_val += 4;
+
+    if (ay > (ax << 1))
+        move_val += 2;
+    else if (ax > (ay << 1))
+        move_val++;
+
+    switch (move_val) {
+    case 0: {
+        mm[0] = 9;
+        if (ay > ax) {
+            mm[1] = 8;
+            mm[2] = 6;
+            mm[3] = 7;
+            mm[4] = 3;
+        } else {
+            mm[1] = 6;
+            mm[2] = 8;
+            mm[3] = 3;
+            mm[4] = 7;
+        }
+
+        break;
+    }
+    case 1:
+    case 9: {
+        mm[0] = 6;
+        if (y < 0) {
+            mm[1] = 3;
+            mm[2] = 9;
+            mm[3] = 2;
+            mm[4] = 8;
+        } else {
+            mm[1] = 9;
+            mm[2] = 3;
+            mm[3] = 8;
+            mm[4] = 2;
+        }
+
+        break;
+    }
+    case 2:
+    case 6: {
+        mm[0] = 8;
+        if (x < 0) {
+            mm[1] = 9;
+            mm[2] = 7;
+            mm[3] = 6;
+            mm[4] = 4;
+        } else {
+            mm[1] = 7;
+            mm[2] = 9;
+            mm[3] = 4;
+            mm[4] = 6;
+        }
+
+        break;
+    }
+    case 4: {
+        mm[0] = 7;
+        if (ay > ax) {
+            mm[1] = 8;
+            mm[2] = 4;
+            mm[3] = 9;
+            mm[4] = 1;
+        } else {
+            mm[1] = 4;
+            mm[2] = 8;
+            mm[3] = 1;
+            mm[4] = 9;
+        }
+
+        break;
+    }
+    case 5:
+    case 13: {
+        mm[0] = 4;
+        if (y < 0) {
+            mm[1] = 1;
+            mm[2] = 7;
+            mm[3] = 2;
+            mm[4] = 8;
+        } else {
+            mm[1] = 7;
+            mm[2] = 1;
+            mm[3] = 8;
+            mm[4] = 2;
+        }
+
+        break;
+    }
+    case 8: {
+        mm[0] = 3;
+        if (ay > ax) {
+            mm[1] = 2;
+            mm[2] = 6;
+            mm[3] = 1;
+            mm[4] = 9;
+        } else {
+            mm[1] = 6;
+            mm[2] = 2;
+            mm[3] = 9;
+            mm[4] = 1;
+        }
+
+        break;
+    }
+    case 10:
+    case 14: {
+        mm[0] = 2;
+        if (x < 0) {
+            mm[1] = 3;
+            mm[2] = 1;
+            mm[3] = 6;
+            mm[4] = 4;
+        } else {
+            mm[1] = 1;
+            mm[2] = 3;
+            mm[3] = 4;
+            mm[4] = 6;
+        }
+
+        break;
+    }
+    case 12: {
+        mm[0] = 1;
+        if (ay > ax) {
+            mm[1] = 2;
+            mm[2] = 4;
+            mm[3] = 3;
+            mm[4] = 7;
+        } else {
+            mm[1] = 4;
+            mm[2] = 2;
+            mm[3] = 7;
+            mm[4] = 3;
+        }
+
+        break;
+    }
+    }
 }
 
-
 /*!
  * @brief 古いモンスター情報の保存
  * @param monster_race_idx モンスターID
@@ -329,26 +280,26 @@ void store_moves_val(int *mm, int y, int x)
  */
 void save_old_race_flags(MONRACE_IDX monster_race_idx, old_race_flags *old_race_flags_ptr)
 {
-       if (monster_race_idx == 0) return;
+    if (monster_race_idx == 0)
+        return;
 
-       monster_race *r_ptr;
-       r_ptr = &r_info[monster_race_idx];
+    monster_race *r_ptr;
+    r_ptr = &r_info[monster_race_idx];
 
-       old_race_flags_ptr->old_r_flags1 = r_ptr->r_flags1;
-       old_race_flags_ptr->old_r_flags2 = r_ptr->r_flags2;
-       old_race_flags_ptr->old_r_flags3 = r_ptr->r_flags3;
-       old_race_flags_ptr->old_r_flagsr = r_ptr->r_flagsr;
-       old_race_flags_ptr->old_r_ability_flags = r_ptr->r_ability_flags;
+    old_race_flags_ptr->old_r_flags1 = r_ptr->r_flags1;
+    old_race_flags_ptr->old_r_flags2 = r_ptr->r_flags2;
+    old_race_flags_ptr->old_r_flags3 = r_ptr->r_flags3;
+    old_race_flags_ptr->old_r_flagsr = r_ptr->r_flagsr;
+    old_race_flags_ptr->old_r_ability_flags = r_ptr->r_ability_flags;
 
-       old_race_flags_ptr->old_r_blows0 = r_ptr->r_blows[0];
-       old_race_flags_ptr->old_r_blows1 = r_ptr->r_blows[1];
-       old_race_flags_ptr->old_r_blows2 = r_ptr->r_blows[2];
-       old_race_flags_ptr->old_r_blows3 = r_ptr->r_blows[3];
+    old_race_flags_ptr->old_r_blows0 = r_ptr->r_blows[0];
+    old_race_flags_ptr->old_r_blows1 = r_ptr->r_blows[1];
+    old_race_flags_ptr->old_r_blows2 = r_ptr->r_blows[2];
+    old_race_flags_ptr->old_r_blows3 = r_ptr->r_blows[3];
 
-       old_race_flags_ptr->old_r_cast_spell = r_ptr->r_cast_spell;
+    old_race_flags_ptr->old_r_cast_spell = r_ptr->r_cast_spell;
 }
 
-
 /*!
  * @brief モンスターの加速値を決定する
  * @param m_ptr モンスターへの参照ポインタ
@@ -356,11 +307,14 @@ void save_old_race_flags(MONRACE_IDX monster_race_idx, old_race_flags *old_race_
  */
 SPEED decide_monster_speed(monster_type *m_ptr)
 {
-       SPEED speed = m_ptr->mspeed;
-       if (ironman_nightmare) speed += 5;
+    SPEED speed = m_ptr->mspeed;
+    if (ironman_nightmare)
+        speed += 5;
 
-       if (monster_fast_remaining(m_ptr)) speed += 10;
-       if (monster_slow_remaining(m_ptr)) speed -= 10;
+    if (monster_fast_remaining(m_ptr))
+        speed += 10;
+    if (monster_slow_remaining(m_ptr))
+        speed -= 10;
 
-       return speed;
+    return speed;
 }
index 8088610..8b77026 100644 (file)
@@ -1,4 +1,4 @@
-/*!
+/*!
  * @brief monster-processのための構造体群
  * @date 2020/03/07
  * @author Hourier
@@ -6,8 +6,9 @@
 
 #pragma once
 
-#include "system/angband.h"
 #include "monster-race/race-ability-flags.h"
+#include "monster-race/race-behavior-flags.h"
+#include "system/angband.h"
 #include "util/flag-group.h"
 
 struct turn_flags {
@@ -20,13 +21,13 @@ struct turn_flags {
     bool do_take;
     bool must_alter_to_move;
 
-       bool did_open_door;
-       bool did_bash_door;
-       bool did_take_item;
-       bool did_kill_item;
-       bool did_move_body;
-       bool did_pass_wall;
-       bool did_kill_wall;
+    bool did_open_door;
+    bool did_bash_door;
+    bool did_take_item;
+    bool did_kill_item;
+    bool did_move_body;
+    bool did_pass_wall;
+    bool did_kill_wall;
 };
 
 struct old_race_flags {
@@ -37,12 +38,12 @@ struct old_race_flags {
     EnumClassFlagGroup<MonsterAbilityType> old_r_ability_flags;
     EnumClassFlagGroup<MonsterBehaviorType> old_r_behavior_flags;
 
-       byte old_r_blows0;
-       byte old_r_blows1;
-       byte old_r_blows2;
-       byte old_r_blows3;
+    byte old_r_blows0;
+    byte old_r_blows1;
+    byte old_r_blows2;
+    byte old_r_blows3;
 
-       byte old_r_cast_spell;
+    byte old_r_cast_spell;
 };
 
 struct coordinate_candidate {
index 0671b96..dd74951 100644 (file)
@@ -1,4 +1,4 @@
-/*!
+/*!
  * @brief モンスター情報のアップデート処理
  * @date 2020/03/08
  * @author Hourier
@@ -104,9 +104,7 @@ void update_player_type(PlayerType *player_ptr, turn_flags *turn_flags_ptr, mons
         player_ptr->window_flags |= PW_OVERHEAD | PW_DUNGEON;
     }
 
-    if (turn_flags_ptr->do_move
-        && ((r_ptr->flags7 & (RF7_SELF_LD_MASK | RF7_HAS_DARK_1 | RF7_HAS_DARK_2))
-            || ((r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) && !player_ptr->phase_out))) {
+    if (turn_flags_ptr->do_move && ((r_ptr->flags7 & (RF7_SELF_LD_MASK | RF7_HAS_DARK_1 | RF7_HAS_DARK_2)) || ((r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) && !player_ptr->phase_out))) {
         player_ptr->update |= PU_MON_LITE;
     }
 }
@@ -155,11 +153,11 @@ void update_player_window(PlayerType *player_ptr, old_race_flags *old_race_flags
 {
     monster_race *r_ptr;
     r_ptr = &r_info[player_ptr->monster_race_idx];
-    if ((old_race_flags_ptr->old_r_flags1 != r_ptr->r_flags1) || (old_race_flags_ptr->old_r_flags2 != r_ptr->r_flags2)
-        || (old_race_flags_ptr->old_r_flags3 != r_ptr->r_flags3) || (old_race_flags_ptr->old_r_ability_flags != r_ptr->r_ability_flags)
-        || (old_race_flags_ptr->old_r_flagsr != r_ptr->r_flagsr) || (old_race_flags_ptr->old_r_blows0 != r_ptr->r_blows[0])
-        || (old_race_flags_ptr->old_r_blows1 != r_ptr->r_blows[1]) || (old_race_flags_ptr->old_r_blows2 != r_ptr->r_blows[2])
-        || (old_race_flags_ptr->old_r_blows3 != r_ptr->r_blows[3]) || (old_race_flags_ptr->old_r_cast_spell != r_ptr->r_cast_spell)) {
+    if ((old_race_flags_ptr->old_r_flags1 != r_ptr->r_flags1) || (old_race_flags_ptr->old_r_flags2 != r_ptr->r_flags2) ||
+        (old_race_flags_ptr->old_r_flags3 != r_ptr->r_flags3) || (old_race_flags_ptr->old_r_ability_flags != r_ptr->r_ability_flags) ||
+        (old_race_flags_ptr->old_r_flagsr != r_ptr->r_flagsr) || (old_race_flags_ptr->old_r_blows0 != r_ptr->r_blows[0]) ||
+        (old_race_flags_ptr->old_r_blows1 != r_ptr->r_blows[1]) || (old_race_flags_ptr->old_r_blows2 != r_ptr->r_blows[2]) ||
+        (old_race_flags_ptr->old_r_blows3 != r_ptr->r_blows[3]) || (old_race_flags_ptr->old_r_cast_spell != r_ptr->r_cast_spell)) {
         player_ptr->window_flags |= PW_MONSTER;
     }
 }
@@ -453,13 +451,10 @@ static void update_invisible_monster(PlayerType *player_ptr, um_type *um_ptr, MO
             r_ptr->r_sights++;
     }
 
-    if (w_ptr->is_loading_now && w_ptr->character_dungeon && !player_ptr->phase_out
-        && r_info[um_ptr->m_ptr->ap_r_idx].flags2 & RF2_ELDRITCH_HORROR)
+    if (w_ptr->is_loading_now && w_ptr->character_dungeon && !player_ptr->phase_out && r_info[um_ptr->m_ptr->ap_r_idx].flags2 & RF2_ELDRITCH_HORROR)
         um_ptr->m_ptr->mflag.set(MonsterTemporaryFlagType::SANITY_BLAST);
 
-    if (disturb_near
-        && (projectable(player_ptr, um_ptr->m_ptr->fy, um_ptr->m_ptr->fx, player_ptr->y, player_ptr->x)
-            && projectable(player_ptr, player_ptr->y, player_ptr->x, um_ptr->m_ptr->fy, um_ptr->m_ptr->fx))) {
+    if (disturb_near && (projectable(player_ptr, um_ptr->m_ptr->fy, um_ptr->m_ptr->fx, player_ptr->y, player_ptr->x) && projectable(player_ptr, player_ptr->y, player_ptr->x, um_ptr->m_ptr->fy, um_ptr->m_ptr->fx))) {
         if (disturb_pets || is_hostile(um_ptr->m_ptr))
             disturb(player_ptr, true, true);
     }
index cd5c191..c5a4ede 100644 (file)
@@ -1,4 +1,4 @@
-#include "monster/monster-util.h"
+#include "monster/monster-util.h"
 #include "dungeon/dungeon-flag-types.h"
 #include "dungeon/dungeon.h"
 #include "dungeon/quest.h"
@@ -70,9 +70,8 @@ static bool restrict_monster_to_dungeon(PlayerType *player_ptr, MONRACE_IDX r_id
     if (d_ptr->flags.has(DungeonFeatureType::NO_MELEE)) {
         if (r_idx == MON_CHAMELEON)
             return true;
-        if (r_ptr->ability_flags.has_none_of(RF_ABILITY_BOLT_MASK | RF_ABILITY_BEAM_MASK | RF_ABILITY_BALL_MASK)
-            && r_ptr->ability_flags.has_none_of(
-                { MonsterAbilityType::CAUSE_1, MonsterAbilityType::CAUSE_2, MonsterAbilityType::CAUSE_3, MonsterAbilityType::CAUSE_4, MonsterAbilityType::MIND_BLAST, MonsterAbilityType::BRAIN_SMASH }))
+        if (r_ptr->ability_flags.has_none_of(RF_ABILITY_BOLT_MASK | RF_ABILITY_BEAM_MASK | RF_ABILITY_BALL_MASK) && r_ptr->ability_flags.has_none_of(
+                                                                                                                        { MonsterAbilityType::CAUSE_1, MonsterAbilityType::CAUSE_2, MonsterAbilityType::CAUSE_3, MonsterAbilityType::CAUSE_4, MonsterAbilityType::MIND_BLAST, MonsterAbilityType::BRAIN_SMASH }))
             return false;
     }
 
index 3428b26..19ff810 100644 (file)
@@ -1,4 +1,4 @@
-/*!
+/*!
  * @brief モンスターの魔法によってフロアを明るくする処理及びその判定
  * @date 2020/07/23
  * @author Hourier
@@ -108,16 +108,13 @@ static void feature_projection(floor_type *floor_ptr, msa_type *msa_ptr)
 
 static void check_lite_area_by_mspell(PlayerType *player_ptr, msa_type *msa_ptr)
 {
-    if (msa_ptr->ability_flags.has(MonsterAbilityType::BR_DISI) && (msa_ptr->m_ptr->cdis < get_max_range(player_ptr) / 2)
-        && in_disintegration_range(player_ptr->current_floor_ptr, msa_ptr->m_ptr->fy, msa_ptr->m_ptr->fx, msa_ptr->y, msa_ptr->x)
-        && (one_in_(10) || (projectable(player_ptr, msa_ptr->y, msa_ptr->x, msa_ptr->m_ptr->fy, msa_ptr->m_ptr->fx) && one_in_(2)))) {
+    if (msa_ptr->ability_flags.has(MonsterAbilityType::BR_DISI) && (msa_ptr->m_ptr->cdis < get_max_range(player_ptr) / 2) && in_disintegration_range(player_ptr->current_floor_ptr, msa_ptr->m_ptr->fy, msa_ptr->m_ptr->fx, msa_ptr->y, msa_ptr->x) && (one_in_(10) || (projectable(player_ptr, msa_ptr->y, msa_ptr->x, msa_ptr->m_ptr->fy, msa_ptr->m_ptr->fx) && one_in_(2)))) {
         msa_ptr->do_spell = DO_SPELL_BR_DISI;
         msa_ptr->success = true;
         return;
     }
 
-    if (msa_ptr->ability_flags.has(MonsterAbilityType::BR_LITE) && (msa_ptr->m_ptr->cdis < get_max_range(player_ptr) / 2)
-        && los(player_ptr, msa_ptr->m_ptr->fy, msa_ptr->m_ptr->fx, msa_ptr->y, msa_ptr->x) && one_in_(5)) {
+    if (msa_ptr->ability_flags.has(MonsterAbilityType::BR_LITE) && (msa_ptr->m_ptr->cdis < get_max_range(player_ptr) / 2) && los(player_ptr, msa_ptr->m_ptr->fy, msa_ptr->m_ptr->fx, msa_ptr->y, msa_ptr->x) && one_in_(5)) {
         msa_ptr->do_spell = DO_SPELL_BR_LITE;
         msa_ptr->success = true;
         return;
@@ -181,8 +178,7 @@ void decide_lite_area(PlayerType *player_ptr, msa_type *msa_ptr)
     if (msa_ptr->ability_flags.has_not(MonsterAbilityType::DARKNESS))
         return;
 
-    bool can_use_lite_area = (player_ptr->pclass == PlayerClassType::NINJA) && ((msa_ptr->r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) == 0)
-        && ((msa_ptr->r_ptr->flags7 & RF7_DARK_MASK) == 0);
+    bool can_use_lite_area = (player_ptr->pclass == PlayerClassType::NINJA) && ((msa_ptr->r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) == 0) && ((msa_ptr->r_ptr->flags7 & RF7_DARK_MASK) == 0);
 
     if (msa_ptr->r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID))
         return;
index 4713fc3..a299433 100644 (file)
@@ -1,4 +1,4 @@
-/*!
+/*!
  * @brief モンスターが詠唱する魔法を選択する処理
  * @date 2020/07/23
  * @author Hourier
@@ -14,9 +14,9 @@
 #include "mspell/mspell-attack-util.h"
 #include "mspell/mspell-judgement.h"
 #include "player/player-status.h"
-#include "system/monster-type-definition.h"
 #include "system/floor-type-definition.h"
 #include "system/monster-race-definition.h"
+#include "system/monster-type-definition.h"
 #include "system/player-type-definition.h"
 #include "util/enum-converter.h"
 #include "world/world.h"
@@ -375,8 +375,7 @@ MonsterAbilityType choose_attack_spell(PlayerType *player_ptr, msa_type *msa_ptr
             return (special[randint0(special.size())]);
     }
 
-    if ((distance(player_ptr->y, player_ptr->x, m_ptr->fy, m_ptr->fx) < 4) && (!attack.empty() || r_ptr->ability_flags.has(MonsterAbilityType::TRAPS)) && (randint0(100) < 75)
-        && !w_ptr->timewalk_m_idx) {
+    if ((distance(player_ptr->y, player_ptr->x, m_ptr->fy, m_ptr->fx) < 4) && (!attack.empty() || r_ptr->ability_flags.has(MonsterAbilityType::TRAPS)) && (randint0(100) < 75) && !w_ptr->timewalk_m_idx) {
         if (!tactic.empty())
             return (tactic[randint0(tactic.size())]);
     }
index 275aba1..917f108 100644 (file)
@@ -1394,7 +1394,6 @@ BIT_FLAGS has_resist_water(PlayerType *player_ptr)
         result |= FLAG_CAUSE_MAGIC_TIME_EFFECT;
     }
 
-
     return result;
 }
 
@@ -1593,11 +1592,9 @@ bool can_attack_with_sub_hand(PlayerType *player_ptr)
 bool has_two_handed_weapons(PlayerType *player_ptr)
 {
     if (can_two_hands_wielding(player_ptr)) {
-        if (can_attack_with_main_hand(player_ptr) && (empty_hands(player_ptr, false) == EMPTY_HAND_SUB)
-            && player_ptr->inventory_list[INVEN_MAIN_HAND].allow_two_hands_wielding()) {
+        if (can_attack_with_main_hand(player_ptr) && (empty_hands(player_ptr, false) == EMPTY_HAND_SUB) && player_ptr->inventory_list[INVEN_MAIN_HAND].allow_two_hands_wielding()) {
             return true;
-        } else if (can_attack_with_sub_hand(player_ptr) && (empty_hands(player_ptr, false) == EMPTY_HAND_MAIN)
-            && player_ptr->inventory_list[INVEN_SUB_HAND].allow_two_hands_wielding()) {
+        } else if (can_attack_with_sub_hand(player_ptr) && (empty_hands(player_ptr, false) == EMPTY_HAND_MAIN) && player_ptr->inventory_list[INVEN_SUB_HAND].allow_two_hands_wielding()) {
             return true;
         }
     }
@@ -1704,7 +1701,7 @@ bool has_not_monk_weapon(PlayerType *player_ptr, int i)
     if (!has_melee_weapon(player_ptr, INVEN_MAIN_HAND + i)) {
         return false;
     }
-    
+
     auto tval = player_ptr->inventory_list[INVEN_MAIN_HAND + i].tval;
     auto sval = player_ptr->inventory_list[INVEN_MAIN_HAND + i].sval;
     return ((player_ptr->pclass == PlayerClassType::MONK) || (player_ptr->pclass == PlayerClassType::FORCETRAINER)) && (player_ptr->weapon_exp_max[tval][sval] == PlayerSkill::weapon_exp_at(PlayerSkillRank::UNSKILLED));
index 6ac54b6..80baa35 100644 (file)
@@ -37,7 +37,7 @@
  * @param allow_flag_mask 生成が許されるpit/nestのビット配列
  * @return 選択されたpit/nestのID、選択失敗した場合-1を返す。
  */
-static int pick_vault_type(floor_type *floor_ptr, std::vector<nest_pit_type>l_ptr, BIT_FLAGS16 allow_flag_mask)
+static int pick_vault_type(floor_type *floor_ptr, std::vector<nest_pit_type> &l_ptr, BIT_FLAGS16 allow_flag_mask)
 {
     ProbabilityTable<int> table;
     for (size_t i = 0; i < l_ptr.size(); i++) {
@@ -93,13 +93,13 @@ static concptr pit_subtype_string(int type, bool nest)
             strcpy(inner_buf, _("(万色)", "(multi-hued)"));
         } else if (vault_aux_dragon_mask4.has(MonsterAbilityType::BR_ACID)) {
             strcpy(inner_buf, _("(酸)", "(acid)"));
-        }else if (vault_aux_dragon_mask4.has(MonsterAbilityType::BR_ELEC)) {
+        } else if (vault_aux_dragon_mask4.has(MonsterAbilityType::BR_ELEC)) {
             strcpy(inner_buf, _("(稲妻)", "(lightning)"));
-        }else if (vault_aux_dragon_mask4.has(MonsterAbilityType::BR_FIRE)) {
+        } else if (vault_aux_dragon_mask4.has(MonsterAbilityType::BR_FIRE)) {
             strcpy(inner_buf, _("(火炎)", "(fire)"));
-        }else if (vault_aux_dragon_mask4.has(MonsterAbilityType::BR_COLD)) {
+        } else if (vault_aux_dragon_mask4.has(MonsterAbilityType::BR_COLD)) {
             strcpy(inner_buf, _("(冷気)", "(frost)"));
-        }else if (vault_aux_dragon_mask4.has(MonsterAbilityType::BR_POIS)) {
+        } else if (vault_aux_dragon_mask4.has(MonsterAbilityType::BR_POIS)) {
             strcpy(inner_buf, _("(毒)", "(poison)"));
         } else {
             strcpy(inner_buf, _("(未定義)", "(undefined)"));
index 3353c01..eb2ec0a 100644 (file)
@@ -1,10 +1,12 @@
+#include "spell-kind/spells-lite.h"
 #include "dungeon/dungeon-flag-types.h"
 #include "dungeon/dungeon.h"
+#include "effect/attribute-types.h"
 #include "effect/effect-characteristics.h"
 #include "effect/effect-processor.h"
 #include "floor/cave.h"
-#include "floor/geometry.h"
 #include "floor/floor-util.h"
+#include "floor/geometry.h"
 #include "game-option/map-screen-options.h"
 #include "grid/feature.h"
 #include "grid/grid.h"
@@ -17,8 +19,6 @@
 #include "monster/monster-update.h"
 #include "player/special-defense-types.h"
 #include "spell-kind/spells-launcher.h"
-#include "spell-kind/spells-lite.h"
-#include "effect/attribute-types.h"
 #include "system/floor-type-definition.h"
 #include "system/grid-type-definition.h"
 #include "system/monster-race-definition.h"
@@ -235,8 +235,7 @@ static void cave_temp_room_aux(
          * properly.
          * This leaves only a check for 6 bounding walls!
          */
-        if (in_bounds(floor_ptr, y, x) && pass_bold(floor_ptr, y, x) && (next_to_walls_adj(floor_ptr, y, x, pass_bold) == 6)
-            && (next_to_open(floor_ptr, y, x, pass_bold) <= 1))
+        if (in_bounds(floor_ptr, y, x) && pass_bold(floor_ptr, y, x) && (next_to_walls_adj(floor_ptr, y, x, pass_bold) == 6) && (next_to_open(floor_ptr, y, x, pass_bold) <= 1))
             return;
     }
 
@@ -264,7 +263,10 @@ static void cave_temp_lite_room_aux(PlayerType *player_ptr, std::vector<Pos2D> &
  * @param x 指定X座標
  * @return 射線を通すならばtrueを返す。
  */
-static bool cave_pass_dark_bold(floor_type *floor_ptr, POSITION y, POSITION x) { return cave_has_flag_bold(floor_ptr, y, x, FloorFeatureType::PROJECT); }
+static bool cave_pass_dark_bold(floor_type *floor_ptr, POSITION y, POSITION x)
+{
+    return cave_has_flag_bold(floor_ptr, y, x, FloorFeatureType::PROJECT);
+}
 
 /*!
  * @brief (y,x) が暗くすべきマスなら points に加える
index 25ff5a8..f5313bd 100644 (file)
@@ -1,4 +1,4 @@
-#pragma once
+#pragma once
 
 #include <stdint.h>
 #include <string>
@@ -9,9 +9,9 @@ constexpr std::string_view VARIANT_NAME("Hengband");
  * @brief セーブファイル上のバージョン定義 / "Savefile Version Number" for Hengband
  * @details v1.1.1以上にのみ適用
  */
-#define H_VER_MAJOR  3 //!< ゲームのバージョン定義(メジャー番号)
-#define H_VER_MINOR  0 //!< ゲームのバージョン定義(マイナー番号)
-#define H_VER_PATCH  0 //!< ゲームのバージョン定義(パッチ番号)
+#define H_VER_MAJOR 3 //!< ゲームのバージョン定義(メジャー番号)
+#define H_VER_MINOR 0 //!< ゲームのバージョン定義(マイナー番号)
+#define H_VER_PATCH 0 //!< ゲームのバージョン定義(パッチ番号)
 #define H_VER_EXTRA 51 //!< ゲームのバージョン定義(エクストラ番号)
 
 /*!
index ac33f1e..550eba4 100644 (file)
@@ -1,4 +1,4 @@
-#include "target/target-getter.h"
+#include "target/target-getter.h"
 #include "core/asking-player.h"
 #include "effect/spells-effect-util.h"
 #include "floor/geometry.h"
@@ -194,8 +194,7 @@ bool get_rep_dir(PlayerType *player_ptr, DIRECTION *dp, bool under)
         dir = (DIRECTION)code;
 
     *dp = (DIRECTION)code;
-    concptr prompt
-        = under ? _("方向 ('.'足元, ESCで中断)? ", "Direction ('.' at feet, Escape to cancel)? ") : _("方向 (ESCで中断)? ", "Direction (Escape to cancel)? ");
+    concptr prompt = under ? _("方向 ('.'足元, ESCで中断)? ", "Direction ('.' at feet, Escape to cancel)? ") : _("方向 (ESCで中断)? ", "Direction (Escape to cancel)? ");
     while (!dir) {
         char ch;
         if (!get_com(prompt, &ch, true))