#include "inventory/inventory-slot-types.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-flags2.h"
+#include "monster-race/race-flags7.h"
#include "mutation/mutation-flag-types.h"
-#include "object/object-flags.h"
#include "object-enchant/object-ego.h"
#include "object-enchant/tr-types.h"
#include "object-enchant/trc-types.h"
#include "object-hook/hook-checker.h"
+#include "object/object-flags.h"
#include "player/player-class.h"
#include "player/player-race-types.h"
#include "player/player-race.h"
#include "util/bit-flags-calculator.h"
#include "util/quarks.h"
#include "util/string-processor.h"
-#include "monster-race/race-flags7.h"
void have_kill_wall(player_type *creature_ptr)
{
if (!creature_ptr->mimic_form
&& (creature_ptr->prace == RACE_SKELETON || creature_ptr->prace == RACE_ZOMBIE || creature_ptr->prace == RACE_VAMPIRE
|| creature_ptr->prace == RACE_SPECTRE || creature_ptr->prace == RACE_BALROG || creature_ptr->prace == RACE_ANDROID)) {
- creature_ptr->hold_exp = TRUE;
- }
+ creature_ptr->hold_exp = TRUE;
+ }
if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU)) {
creature_ptr->hold_exp = TRUE;
creature_ptr->see_inv = TRUE;
}
- if (creature_ptr->tim_invis) {
+ if (creature_ptr->tim_invis) {
creature_ptr->see_inv = TRUE;
}
object_type *o_ptr;
BIT_FLAGS flgs[TR_FLAG_SIZE];
creature_ptr->free_act = FALSE;
-
- if (creature_ptr->muta3 & MUT3_MOTION)
+
+ if (creature_ptr->muta3 & MUT3_MOTION)
creature_ptr->free_act = TRUE;
if (!creature_ptr->mimic_form && creature_ptr->prace == RACE_GNOME) {
- creature_ptr->free_act = TRUE;
+ creature_ptr->free_act = TRUE;
}
if (!creature_ptr->mimic_form && creature_ptr->prace == RACE_GOLEM) {
creature_ptr->sustain_str = FALSE;
if (creature_ptr->pclass == CLASS_BERSERKER) {
creature_ptr->sustain_str = TRUE;
- }
+ }
if (!creature_ptr->mimic_form
&& (creature_ptr->prace == RACE_HALF_TROLL || creature_ptr->prace == RACE_HALF_OGRE || creature_ptr->prace == RACE_HALF_GIANT)) {
creature_ptr->sustain_str = TRUE;
object_type *o_ptr;
BIT_FLAGS flgs[TR_FLAG_SIZE];
creature_ptr->sustain_int = FALSE;
- if (!creature_ptr->mimic_form
- && (creature_ptr->prace == RACE_MIND_FLAYER)) {
+ if (!creature_ptr->mimic_form && (creature_ptr->prace == RACE_MIND_FLAYER)) {
creature_ptr->sustain_int = TRUE;
}
creature_ptr->sustain_wis = FALSE;
if (creature_ptr->pclass == CLASS_MINDCRAFTER && creature_ptr->lev > 19)
creature_ptr->sustain_wis = TRUE;
-
- if (!creature_ptr->mimic_form && (creature_ptr->prace == RACE_MIND_FLAYER)) {
+
+ if (!creature_ptr->mimic_form && (creature_ptr->prace == RACE_MIND_FLAYER)) {
creature_ptr->sustain_wis = TRUE;
}
creature_ptr->sustain_con = TRUE;
}
- if (!creature_ptr->mimic_form && (creature_ptr->prace == RACE_AMBERITE || creature_ptr->prace == RACE_DUNADAN)) {
+ if (!creature_ptr->mimic_form && (creature_ptr->prace == RACE_AMBERITE || creature_ptr->prace == RACE_DUNADAN)) {
creature_ptr->sustain_con = TRUE;
}
if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU)) {
creature_ptr->levitation = TRUE;
- }
+ }
if (creature_ptr->magicdef) {
}
void have_can_swim(player_type *creature_ptr)
{
- creature_ptr->can_swim = FALSE;
+ creature_ptr->can_swim = FALSE;
if (creature_ptr->riding) {
monster_type *riding_m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->riding];
monster_race *riding_r_ptr = &r_info[riding_m_ptr->r_idx];
creature_ptr->slow_digest = TRUE;
}
- if (creature_ptr->lev > 14 && !creature_ptr->mimic_form && creature_ptr->prace == RACE_HALF_TROLL) {
+ if (creature_ptr->lev > 14 && !creature_ptr->mimic_form && creature_ptr->prace == RACE_HALF_TROLL) {
if (creature_ptr->pclass == CLASS_WARRIOR || creature_ptr->pclass == CLASS_BERSERKER) {
creature_ptr->slow_digest = TRUE;
/* Let's not make Regeneration
}
}
- if (creature_ptr->tim_regen) {
+ if (creature_ptr->tim_regen) {
creature_ptr->regenerate = TRUE;
}
if (have_flag(flgs, TR_IMPACT))
creature_ptr->impact[(i == INVEN_RARM) ? 0 : 1] = TRUE;
}
-
}
void have_extra_blow(player_type *creature_ptr)
creature_ptr->resist_acid = TRUE;
}
- if (!creature_ptr->mimic_form && creature_ptr->prace == RACE_DRACONIAN && creature_ptr->lev > 14) {
+ if (!creature_ptr->mimic_form && creature_ptr->prace == RACE_DRACONIAN && creature_ptr->lev > 14) {
creature_ptr->resist_acid = TRUE;
- }
+ }
- if (creature_ptr->special_defense & KAMAE_SEIRYU) {
+ if (creature_ptr->special_defense & KAMAE_SEIRYU) {
creature_ptr->resist_acid = TRUE;
- }
+ }
if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU)) {
creature_ptr->resist_acid = TRUE;
creature_ptr->resist_acid = TRUE;
}
- if (creature_ptr->immune_acid)
+ if (creature_ptr->immune_acid)
creature_ptr->resist_acid = TRUE;
}
creature_ptr->resist_fire = TRUE;
}
- if (!creature_ptr->mimic_form && (creature_ptr->prace == RACE_IMP || creature_ptr->prace == RACE_BALROG)) {
+ if (!creature_ptr->mimic_form && (creature_ptr->prace == RACE_IMP || creature_ptr->prace == RACE_BALROG)) {
creature_ptr->resist_fire = TRUE;
}
BIT_FLAGS flgs[TR_FLAG_SIZE];
creature_ptr->resist_cold = FALSE;
-
if (creature_ptr->mimic_form == MIMIC_DEMON_LORD || creature_ptr->mimic_form == MIMIC_VAMPIRE) {
creature_ptr->resist_cold = TRUE;
}
creature_ptr->resist_cold = TRUE;
}
- if (!creature_ptr->mimic_form && (creature_ptr->prace == RACE_DRACONIAN || creature_ptr->prace == RACE_SKELETON)
- && creature_ptr->lev > 9) {
+ if (!creature_ptr->mimic_form && (creature_ptr->prace == RACE_DRACONIAN || creature_ptr->prace == RACE_SKELETON) && creature_ptr->lev > 9) {
creature_ptr->resist_cold = TRUE;
}
- if (!creature_ptr->mimic_form && (creature_ptr->prace == RACE_VAMPIRE || creature_ptr->prace == RACE_SPECTRE)) {
+ if (!creature_ptr->mimic_form && (creature_ptr->prace == RACE_VAMPIRE || creature_ptr->prace == RACE_SPECTRE)) {
creature_ptr->resist_fire = TRUE;
}
- if (creature_ptr->special_defense & KAMAE_SEIRYU) {
+ if (creature_ptr->special_defense & KAMAE_SEIRYU) {
creature_ptr->resist_cold = TRUE;
}
- if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU)) {
+ if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU)) {
creature_ptr->resist_cold = TRUE;
}
object_flags(creature_ptr, o_ptr, flgs);
- if (have_flag(flgs, TR_RES_COLD))
+ if (have_flag(flgs, TR_RES_COLD))
creature_ptr->resist_cold = TRUE;
}
creature_ptr->resist_pois = TRUE;
}
- if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU)) {
+ if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU)) {
creature_ptr->resist_pois = TRUE;
}
object_flags(creature_ptr, o_ptr, flgs);
- if (have_flag(flgs, TR_RES_POIS))
+ if (have_flag(flgs, TR_RES_POIS))
creature_ptr->resist_pois = TRUE;
}
}
object_flags(creature_ptr, o_ptr, flgs);
- if (have_flag(flgs, TR_RES_CONF))
- creature_ptr->resist_conf = TRUE;
+ if (have_flag(flgs, TR_RES_CONF))
+ creature_ptr->resist_conf = TRUE;
}
}
BIT_FLAGS flgs[TR_FLAG_SIZE];
creature_ptr->resist_sound = FALSE;
- if (creature_ptr->pclass == CLASS_BARD) {
+ if (creature_ptr->pclass == CLASS_BARD) {
creature_ptr->resist_sound = TRUE;
}
creature_ptr->resist_conf = TRUE;
}
- if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU)) {
+ if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU)) {
creature_ptr->lite = TRUE;
}
object_flags(creature_ptr, o_ptr, flgs);
- if (have_flag(flgs, TR_RES_SOUND))
- creature_ptr->resist_sound = TRUE;
+ if (have_flag(flgs, TR_RES_SOUND))
+ creature_ptr->resist_sound = TRUE;
}
}
object_flags(creature_ptr, o_ptr, flgs);
- if (have_flag(flgs, TR_RES_LITE))
- creature_ptr->resist_lite = TRUE;
+ if (have_flag(flgs, TR_RES_LITE))
+ creature_ptr->resist_lite = TRUE;
}
}
creature_ptr->resist_lite = TRUE;
}
- if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU)) {
+ if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU)) {
creature_ptr->resist_dark = TRUE;
}
object_flags(creature_ptr, o_ptr, flgs);
- if (have_flag(flgs, TR_RES_DARK))
- creature_ptr->resist_dark = TRUE;
+ if (have_flag(flgs, TR_RES_DARK))
+ creature_ptr->resist_dark = TRUE;
}
}
object_flags(creature_ptr, o_ptr, flgs);
- if (have_flag(flgs, TR_RES_CHAOS))
- creature_ptr->resist_chaos = TRUE;
+ if (have_flag(flgs, TR_RES_CHAOS))
+ creature_ptr->resist_chaos = TRUE;
}
}
object_flags(creature_ptr, o_ptr, flgs);
- if (have_flag(flgs, TR_RES_DISEN))
- creature_ptr->resist_disen = TRUE;
+ if (have_flag(flgs, TR_RES_DISEN))
+ creature_ptr->resist_disen = TRUE;
}
}
creature_ptr->resist_shard = TRUE;
}
- for (int i = INVEN_RARM; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_RARM; i < INVEN_TOTAL; i++) {
o_ptr = &creature_ptr->inventory_list[i];
if (!o_ptr->k_idx)
continue;
creature_ptr->resist_blind = TRUE;
}
- if (creature_ptr->magicdef) {
+ if (creature_ptr->magicdef) {
creature_ptr->resist_blind = TRUE;
}
creature_ptr->resist_time = TRUE;
}
- for (int i = INVEN_RARM; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_RARM; i < INVEN_TOTAL; i++) {
o_ptr = &creature_ptr->inventory_list[i];
if (!o_ptr->k_idx)
continue;
void have_resist_water(player_type *creature_ptr)
{
- object_type *o_ptr;
- BIT_FLAGS flgs[TR_FLAG_SIZE];
creature_ptr->resist_water = FALSE;
if (!creature_ptr->mimic_form && creature_ptr->prace == RACE_MERFOLK)
- creature_ptr->resist_water = TRUE;
+ creature_ptr->resist_water = TRUE;
+}
+
+void have_resist_fear(player_type *creature_ptr)
+{
+ object_type *o_ptr;
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
+ creature_ptr->resist_fear = FALSE;
+
+ switch (creature_ptr->pclass) {
+ case CLASS_WARRIOR:
+ if (creature_ptr->lev > 29)
+ creature_ptr->resist_fear = TRUE;
+ break;
+ case CLASS_PALADIN:
+ if (creature_ptr->lev > 39)
+ creature_ptr->resist_fear = TRUE;
+ break;
+ case CLASS_CHAOS_WARRIOR:
+ if (creature_ptr->lev > 39)
+ creature_ptr->resist_fear = TRUE;
+ break;
+ case CLASS_MINDCRAFTER:
+ if (creature_ptr->lev > 9)
+ creature_ptr->resist_fear = TRUE;
+ break;
+ case CLASS_SAMURAI:
+ if (creature_ptr->lev > 29)
+ creature_ptr->resist_fear = TRUE;
+ break;
+ case CLASS_NINJA:
+ creature_ptr->resist_fear = TRUE;
+ break;
+ }
+
+ if (creature_ptr->mimic_form == MIMIC_DEMON_LORD) {
+ creature_ptr->resist_fear = TRUE;
+ }
+
+ if (!creature_ptr->mimic_form && creature_ptr->prace == RACE_BARBARIAN)
+ creature_ptr->resist_fear = TRUE;
+
+ if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU)) {
+ creature_ptr->resist_fear = TRUE;
+ }
+
+ if (is_hero(creature_ptr) || creature_ptr->shero) {
+ creature_ptr->resist_fear = TRUE;
+ }
+
+ for (int i = INVEN_RARM; i < INVEN_TOTAL; i++) {
+ o_ptr = &creature_ptr->inventory_list[i];
+ if (!o_ptr->k_idx)
+ continue;
+
+ object_flags(creature_ptr, o_ptr, flgs);
+ if (have_flag(flgs, TR_RES_FEAR))
+ creature_ptr->resist_fear = TRUE;
+ }
}