case CLASS_ELEMENTALIST:
if (has_element_resist(creature_ptr, ElementRealm::FIRE, 1))
add_flag(flags, TR_RES_FIRE);
- if (has_element_resist(creature_ptr, ElementRealm::FIRE, 30))
- add_flag(flags, TR_IM_FIRE);
if (has_element_resist(creature_ptr, ElementRealm::ICE, 1))
add_flag(flags, TR_RES_COLD);
- if (has_element_resist(creature_ptr, ElementRealm::ICE, 30))
- add_flag(flags, TR_IM_COLD);
if (has_element_resist(creature_ptr, ElementRealm::SKY, 1))
add_flag(flags, TR_RES_ELEC);
- if (has_element_resist(creature_ptr, ElementRealm::SKY, 30))
- add_flag(flags, TR_IM_ELEC);
if (has_element_resist(creature_ptr, ElementRealm::SEA, 1))
add_flag(flags, TR_RES_ACID);
- if (has_element_resist(creature_ptr, ElementRealm::SEA, 30))
- add_flag(flags, TR_IM_ACID);
if (has_element_resist(creature_ptr, ElementRealm::DARKNESS, 1))
add_flag(flags, TR_RES_DARK);
if (has_element_resist(creature_ptr, ElementRealm::DARKNESS, 30))
#include "object-enchant/tr-types.h"
#include "player/player-race.h"
#include "player/special-defense-types.h"
+#include "mind/mind-elementalist.h"
#include "util/bit-flags-calculator.h"
/*!
- * @brief プレイヤーの種族による免疫フラグを返す
+ * @brief プレイヤーの職業/種族による免疫フラグを返す
* @param creature_ptr プレーヤーへの参照ポインタ
* @param flags フラグを保管する配列
* @return なし
*/
void player_immunity(player_type *creature_ptr, BIT_FLAGS *flags)
{
- for (int i = 0; i < TR_FLAG_SIZE; i++)
- flags[i] = 0L;
+ for (int i = 0; i < TR_FLAG_SIZE; i++)
+ flags[i] = 0L;
- if (is_specific_player_race(creature_ptr, RACE_SPECTRE))
- add_flag(flags, TR_RES_NETHER);
- if (creature_ptr->mimic_form == MIMIC_VAMPIRE || is_specific_player_race(creature_ptr, RACE_VAMPIRE))
- add_flag(flags, TR_RES_DARK);
- if (creature_ptr->mimic_form == MIMIC_DEMON_LORD)
- add_flag(flags, TR_RES_FIRE);
- else if (is_specific_player_race(creature_ptr, RACE_YEEK) && creature_ptr->lev > 19)
- add_flag(flags, TR_RES_ACID);
+ if (is_specific_player_race(creature_ptr, RACE_SPECTRE))
+ add_flag(flags, TR_RES_NETHER);
+ if (creature_ptr->mimic_form == MIMIC_VAMPIRE || is_specific_player_race(creature_ptr, RACE_VAMPIRE))
+ add_flag(flags, TR_RES_DARK);
+ if (creature_ptr->mimic_form == MIMIC_DEMON_LORD)
+ add_flag(flags, TR_RES_FIRE);
+ else if (is_specific_player_race(creature_ptr, RACE_YEEK) && creature_ptr->lev > 19)
+ add_flag(flags, TR_RES_ACID);
+
+ if (creature_ptr->pclass == CLASS_ELEMENTALIST) {
+ if (has_element_resist(creature_ptr, ElementRealm::FIRE, 30))
+ add_flag(flags, TR_RES_FIRE);
+ if (has_element_resist(creature_ptr, ElementRealm::SKY, 30))
+ add_flag(flags, TR_RES_ELEC);
+ if (has_element_resist(creature_ptr, ElementRealm::SEA, 30))
+ add_flag(flags, TR_RES_ACID);
+ if (has_element_resist(creature_ptr, ElementRealm::ICE, 30))
+ add_flag(flags, TR_RES_COLD);
+ }
}