/* 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;
-#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"
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;
}
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;
}
}
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)
* @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;
-#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 },
};
/*!
* 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 },
* 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 }
};
/*!
* 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 },
};
/*!
* 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 },
};
/*!
* 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 = {
-#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"
#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"
-/*!
+/*!
* @brief アイテム情報をセーブデータから読み込むクラスを選択するファクトリクラス
* @date 2021/10/16
* @author Hourier
* @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)) {
-/*!
+/*!
* @brief セーブファイル読み込み処理 / Purpose: support for loading savefiles -BEN-
* @date 2014/07/07
* @author
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);
if (loading_savefile_version_is_older_than(4)) {
return;
}
-
+
w_ptr->sf_play_time = rd_u32b();
}
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;
-/*!
+/*!
* @brief モンスターの思い出を記憶する処理
* @date 2020/06/09
* @author Hourier
#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"
}
}
- 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)
* @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);
+}
-#pragma once
+#pragma once
#include "monster-attack/monster-attack-types.h"
#include "monster-race/monster-aura-types.h"
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 {
-#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"
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;
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;
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);
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);
}
}
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);
}
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);
}
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);
}
-/*!
+/*!
* @brief モンスター同士が乱闘する処理
* @date 2020/05/23
* @author Hourier
#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"
#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"
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:
} 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回目以降は省略 */
-/*!
+/*!
* @brief モンスターの攻撃に関する処理
* @date 2020/03/08
* @author Hourier
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);
}
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);
-/*!
+/*!
* @brief モンスターの移動方向を決定する処理
* @date 2020/03/08
* @author Hourier
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 {
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);
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;
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;
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);
-/*!
+/*!
* todo 後で再分割する
* @brief モンスター生成処理
* @date 2020/06/10
#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"
#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()関数によるモンスター配置で許される中心からの最大距離 */
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;
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;
}
#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"
#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"
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;
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);
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);
}
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];
* @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);
+}
-/*!
+/*!
* @brief モンスターが移動した結果、床のアイテムに重なった時の処理と、モンスターがアイテムを落とす処理
* @date 2020/03/07
* @author Hourier
#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"
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);
}
}
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;
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;
}
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;
}
-/*!
+/*!
* @brief モンスターをフロアに1体配置する処理
* @date 2020/06/13
* @author Hourier
#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"
#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"
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;
}
-#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"
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)));
}
/*!
*/
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));
}
-/*!
+/*!
* @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 モンスターが地形を踏破できるかどうかを返す
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 モンスターがアイテム類に擬態しているかどうかを返す
* @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)
{
-/*!
+/*!
* @brief モンスター処理 / misc code for monsters
* @date 2014/07/08
* @author
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))
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))
#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 なし
*/
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 移動方向
*/
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 移動方向
*/
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
*/
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 モンスターへの参照ポインタ
*/
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;
}
-/*!
+/*!
* @brief monster-processのための構造体群
* @date 2020/03/07
* @author Hourier
#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 {
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 {
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 {
-/*!
+/*!
* @brief モンスター情報のアップデート処理
* @date 2020/03/08
* @author Hourier
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;
}
}
{
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;
}
}
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);
}
-#include "monster/monster-util.h"
+#include "monster/monster-util.h"
#include "dungeon/dungeon-flag-types.h"
#include "dungeon/dungeon.h"
#include "dungeon/quest.h"
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;
}
-/*!
+/*!
* @brief モンスターの魔法によってフロアを明るくする処理及びその判定
* @date 2020/07/23
* @author Hourier
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;
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;
-/*!
+/*!
* @brief モンスターが詠唱する魔法を選択する処理
* @date 2020/07/23
* @author Hourier
#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"
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())]);
}
result |= FLAG_CAUSE_MAGIC_TIME_EFFECT;
}
-
return result;
}
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;
}
}
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));
* @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++) {
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)"));
+#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"
#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"
* 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;
}
* @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 に加える
-#pragma once
+#pragma once
#include <stdint.h>
#include <string>
* @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 //!< ゲームのバージョン定義(エクストラ番号)
/*!
-#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"
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))