1 #include "mspell/smart-mspell-util.h"
2 #include "monster-race/monster-race.h"
3 #include "monster-race/race-ability-flags.h"
4 #include "monster-race/race-flags2.h"
5 #include "monster/smart-learn-types.h"
6 #include "system/floor-type-definition.h"
7 #include "system/monster-race-definition.h"
8 #include "system/monster-type-definition.h"
9 #include "system/player-type-definition.h"
11 msr_type *initialize_msr_type(PlayerType *player_ptr, msr_type *msr_ptr, MONSTER_IDX m_idx, const EnumClassFlagGroup<MonsterAbilityType> &ability_flags)
13 monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
14 msr_ptr->r_ptr = &r_info[m_ptr->r_idx];
15 msr_ptr->ability_flags = ability_flags;
16 msr_ptr->smart.clear();
21 * @brief モンスターがプレイヤーの弱点をついた選択を取るかどうかの判定 /
22 * Internal probability routine
23 * @param r_ptr モンスター種族の構造体参照ポインタ
25 * @return 適した選択を取るならばTRUEを返す。
27 bool int_outof(monster_race *r_ptr, PERCENTAGE prob)
29 if (r_ptr->behavior_flags.has_not(MonsterBehaviorType::SMART))
32 return (randint0(100) < prob);