From 24f294c69028d660a42cc17c111522573150439a Mon Sep 17 00:00:00 2001 From: Slimebreath6078 Date: Sat, 5 Feb 2022 19:19:33 +0900 Subject: [PATCH] =?utf8?q?=E6=95=B4=E5=BD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/action/movement-execution.cpp | 3 +- src/dungeon/quest.cpp | 10 +- src/effect/effect-monster-resist-hurt.cpp | 2 +- src/info-reader/race-info-tokens-table.cpp | 296 ++++++------- src/load/floor-loader.cpp | 4 +- src/load/item/item-loader-factory.cpp | 4 +- src/load/load.cpp | 6 +- src/lore/lore-calculator.cpp | 4 +- src/lore/lore-store.cpp | 7 +- src/lore/lore-util.cpp | 5 +- src/lore/lore-util.h | 6 +- src/melee/melee-spell-flags-checker.cpp | 30 +- src/melee/monster-attack-monster.cpp | 6 +- src/monster-attack/monster-attack-player.cpp | 4 +- src/monster-attack/monster-attack-processor.cpp | 8 +- src/monster-floor/monster-direction.cpp | 13 +- src/monster-floor/monster-generator.cpp | 9 +- src/monster-floor/monster-move.cpp | 20 +- src/monster-floor/monster-object.cpp | 7 +- src/monster-floor/monster-sweep-grid.cpp | 10 +- src/monster-floor/one-monster-placer.cpp | 7 +- src/monster-race/monster-race-hook.cpp | 9 +- src/monster/monster-info.cpp | 37 +- src/monster/monster-list.cpp | 8 +- src/monster/monster-processor-util.cpp | 528 +++++++++++------------- src/monster/monster-processor-util.h | 29 +- src/monster/monster-update.cpp | 23 +- src/monster/monster-util.cpp | 7 +- src/mspell/mspell-lite.cpp | 12 +- src/mspell/mspell-selector.cpp | 7 +- src/player/player-status-flags.cpp | 9 +- src/room/rooms-pit-nest.cpp | 10 +- src/spell-kind/spells-lite.cpp | 14 +- src/system/angband-version.h | 8 +- src/target/target-getter.cpp | 5 +- 35 files changed, 553 insertions(+), 614 deletions(-) diff --git a/src/action/movement-execution.cpp b/src/action/movement-execution.cpp index b5de58ec8..68fafbea1 100644 --- a/src/action/movement-execution.cpp +++ b/src/action/movement-execution.cpp @@ -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; diff --git a/src/dungeon/quest.cpp b/src/dungeon/quest.cpp index c0969460c..be348859c 100644 --- a/src/dungeon/quest.cpp +++ b/src/dungeon/quest.cpp @@ -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) diff --git a/src/effect/effect-monster-resist-hurt.cpp b/src/effect/effect-monster-resist-hurt.cpp index a4a2cbc25..9915d88e7 100644 --- a/src/effect/effect-monster-resist-hurt.cpp +++ b/src/effect/effect-monster-resist-hurt.cpp @@ -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; diff --git a/src/info-reader/race-info-tokens-table.cpp b/src/info-reader/race-info-tokens-table.cpp index 6ea902761..93c551036 100644 --- a/src/info-reader/race-info-tokens-table.cpp +++ b/src/info-reader/race-info-tokens-table.cpp @@ -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 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 r_info_blow_metho * Monster Blow Effects */ const std::unordered_map 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 r_info_flags2 = { * Monster race flags */ const std::unordered_map 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 r_info_flags7 = { * Monster race flags */ const std::unordered_map 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 r_info_flags8 = { * Monster race flags */ const std::unordered_map 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 }, // r_info_flags9 = { * Monster race flags */ const std::unordered_map 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 r_info_aura_flags = { diff --git a/src/load/floor-loader.cpp b/src/load/floor-loader.cpp index 9411be807..6f498519f 100644 --- a/src/load/floor-loader.cpp +++ b/src/load/floor-loader.cpp @@ -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" diff --git a/src/load/item/item-loader-factory.cpp b/src/load/item/item-loader-factory.cpp index e7039d2db..5bb88688b 100644 --- a/src/load/item/item-loader-factory.cpp +++ b/src/load/item/item-loader-factory.cpp @@ -1,4 +1,4 @@ -/*! +/*! * @brief アイテム情報をセーブデータから読み込むクラスを選択するファクトリクラス * @date 2021/10/16 * @author Hourier @@ -33,7 +33,7 @@ std::shared_ptr 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)) { diff --git a/src/load/load.cpp b/src/load/load.cpp index e5d5b8930..795c26a80 100644 --- a/src/load/load.cpp +++ b/src/load/load.cpp @@ -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(); } diff --git a/src/lore/lore-calculator.cpp b/src/lore/lore-calculator.cpp index 06ed9840f..a965c5baf 100644 --- a/src/lore/lore-calculator.cpp +++ b/src/lore/lore-calculator.cpp @@ -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; diff --git a/src/lore/lore-store.cpp b/src/lore/lore-store.cpp index fbbe1b6eb..3fece5657 100644 --- a/src/lore/lore-store.cpp +++ b/src/lore/lore-store.cpp @@ -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) diff --git a/src/lore/lore-util.cpp b/src/lore/lore-util.cpp index 323131e8b..07f45430a 100644 --- a/src/lore/lore-util.cpp +++ b/src/lore/lore-util.cpp @@ -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); +} diff --git a/src/lore/lore-util.h b/src/lore/lore-util.h index f018edfe6..5b69b2549 100644 --- a/src/lore/lore-util.h +++ b/src/lore/lore-util.h @@ -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>>; class Who { diff --git a/src/melee/melee-spell-flags-checker.cpp b/src/melee/melee-spell-flags-checker.cpp index 112bd715a..5613b4ca2 100644 --- a/src/melee/melee-spell-flags-checker.cpp +++ b/src/melee/melee-spell-flags-checker.cpp @@ -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); } diff --git a/src/melee/monster-attack-monster.cpp b/src/melee/monster-attack-monster.cpp index e6aac4d7e..622c07ca6 100644 --- a/src/melee/monster-attack-monster.cpp +++ b/src/melee/monster-attack-monster.cpp @@ -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: diff --git a/src/monster-attack/monster-attack-player.cpp b/src/monster-attack/monster-attack-player.cpp index 26d1e52b2..5509a4c0f 100644 --- a/src/monster-attack/monster-attack-player.cpp +++ b/src/monster-attack/monster-attack-player.cpp @@ -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回目以降は省略 */ diff --git a/src/monster-attack/monster-attack-processor.cpp b/src/monster-attack/monster-attack-processor.cpp index 1921495ba..89cadd296 100644 --- a/src/monster-attack/monster-attack-processor.cpp +++ b/src/monster-attack/monster-attack-processor.cpp @@ -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); diff --git a/src/monster-floor/monster-direction.cpp b/src/monster-floor/monster-direction.cpp index 8eb59620a..5cedc8672 100644 --- a/src/monster-floor/monster-direction.cpp +++ b/src/monster-floor/monster-direction.cpp @@ -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); diff --git a/src/monster-floor/monster-generator.cpp b/src/monster-floor/monster-generator.cpp index 33a89ac12..f79a05c79 100644 --- a/src/monster-floor/monster-generator.cpp +++ b/src/monster-floor/monster-generator.cpp @@ -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; } diff --git a/src/monster-floor/monster-move.cpp b/src/monster-floor/monster-move.cpp index bf09b2ee4..e875ead62 100644 --- a/src/monster-floor/monster-move.cpp +++ b/src/monster-floor/monster-move.cpp @@ -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); +} diff --git a/src/monster-floor/monster-object.cpp b/src/monster-floor/monster-object.cpp index 26cb6b56e..7a6d265bc 100644 --- a/src/monster-floor/monster-object.cpp +++ b/src/monster-floor/monster-object.cpp @@ -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); } } diff --git a/src/monster-floor/monster-sweep-grid.cpp b/src/monster-floor/monster-sweep-grid.cpp index 3bdd69bbd..c44337bc7 100644 --- a/src/monster-floor/monster-sweep-grid.cpp +++ b/src/monster-floor/monster-sweep-grid.cpp @@ -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; } diff --git a/src/monster-floor/one-monster-placer.cpp b/src/monster-floor/one-monster-placer.cpp index 9f2b3e0c5..29ee55307 100644 --- a/src/monster-floor/one-monster-placer.cpp +++ b/src/monster-floor/one-monster-placer.cpp @@ -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; } diff --git a/src/monster-race/monster-race-hook.cpp b/src/monster-race/monster-race-hook.cpp index b09d02cc4..cd55d0021 100644 --- a/src/monster-race/monster-race-hook.cpp +++ b/src/monster-race/monster-race-hook.cpp @@ -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)); } diff --git a/src/monster/monster-info.cpp b/src/monster/monster-info.cpp index a1dfc4bf9..55ce45848 100644 --- a/src/monster/monster-info.cpp +++ b/src/monster/monster-info.cpp @@ -1,4 +1,4 @@ -/*! +/*! * @brief モンスター情報の記述 / describe monsters (using monster memory) * @date 2013/12/11 * @author @@ -38,7 +38,10 @@ * @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) { diff --git a/src/monster/monster-list.cpp b/src/monster/monster-list.cpp index 575ebde6d..4b22d58b1 100644 --- a/src/monster/monster-list.cpp +++ b/src/monster/monster-list.cpp @@ -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)) diff --git a/src/monster/monster-processor-util.cpp b/src/monster/monster-processor-util.cpp index 6d2bae87e..3afc15eba 100644 --- a/src/monster/monster-processor-util.cpp +++ b/src/monster/monster-processor-util.cpp @@ -14,51 +14,49 @@ #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; } diff --git a/src/monster/monster-processor-util.h b/src/monster/monster-processor-util.h index 808861050..8b7702665 100644 --- a/src/monster/monster-processor-util.h +++ b/src/monster/monster-processor-util.h @@ -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 old_r_ability_flags; EnumClassFlagGroup 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 { diff --git a/src/monster/monster-update.cpp b/src/monster/monster-update.cpp index 0671b961a..dd74951c2 100644 --- a/src/monster/monster-update.cpp +++ b/src/monster/monster-update.cpp @@ -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); } diff --git a/src/monster/monster-util.cpp b/src/monster/monster-util.cpp index cd5c191b9..c5a4ede1a 100644 --- a/src/monster/monster-util.cpp +++ b/src/monster/monster-util.cpp @@ -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; } diff --git a/src/mspell/mspell-lite.cpp b/src/mspell/mspell-lite.cpp index 3428b2658..19ff81097 100644 --- a/src/mspell/mspell-lite.cpp +++ b/src/mspell/mspell-lite.cpp @@ -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; diff --git a/src/mspell/mspell-selector.cpp b/src/mspell/mspell-selector.cpp index 4713fc3ef..a29943355 100644 --- a/src/mspell/mspell-selector.cpp +++ b/src/mspell/mspell-selector.cpp @@ -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())]); } diff --git a/src/player/player-status-flags.cpp b/src/player/player-status-flags.cpp index 275aba1dd..917f108b1 100644 --- a/src/player/player-status-flags.cpp +++ b/src/player/player-status-flags.cpp @@ -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)); diff --git a/src/room/rooms-pit-nest.cpp b/src/room/rooms-pit-nest.cpp index 6ac54b6f8..80baa3571 100644 --- a/src/room/rooms-pit-nest.cpp +++ b/src/room/rooms-pit-nest.cpp @@ -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& l_ptr, BIT_FLAGS16 allow_flag_mask) +static int pick_vault_type(floor_type *floor_ptr, std::vector &l_ptr, BIT_FLAGS16 allow_flag_mask) { ProbabilityTable 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)")); diff --git a/src/spell-kind/spells-lite.cpp b/src/spell-kind/spells-lite.cpp index 3353c0100..eb2ec0a15 100644 --- a/src/spell-kind/spells-lite.cpp +++ b/src/spell-kind/spells-lite.cpp @@ -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 & * @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 に加える diff --git a/src/system/angband-version.h b/src/system/angband-version.h index 25ff5a83a..f5313bd9b 100644 --- a/src/system/angband-version.h +++ b/src/system/angband-version.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include #include @@ -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 //!< ゲームのバージョン定義(エクストラ番号) /*! diff --git a/src/target/target-getter.cpp b/src/target/target-getter.cpp index ac33f1e9c..550eba47a 100644 --- a/src/target/target-getter.cpp +++ b/src/target/target-getter.cpp @@ -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)) -- 2.11.0