creature_ptr->resist_disen = TRUE;
creature_ptr->resist_nexus = TRUE;
creature_ptr->resist_fear = TRUE;
- creature_ptr->levitation = TRUE;
break;
case MIMIC_VAMPIRE:
creature_ptr->resist_dark = TRUE;
creature_ptr->resist_dark = TRUE;
break;
case RACE_DRACONIAN:
- creature_ptr->levitation = TRUE;
if (creature_ptr->lev > 4)
creature_ptr->resist_fire = TRUE;
if (creature_ptr->lev > 9)
creature_ptr->lite = TRUE;
break;
case RACE_SPECTRE:
- creature_ptr->levitation = TRUE;
creature_ptr->resist_neth = TRUE;
creature_ptr->resist_pois = TRUE;
creature_ptr->slow_digest = TRUE;
creature_ptr->pass_wall = TRUE;
break;
case RACE_SPRITE:
- creature_ptr->levitation = TRUE;
creature_ptr->resist_lite = TRUE;
break;
case RACE_BEASTMAN:
creature_ptr->resist_conf = TRUE;
creature_ptr->resist_sound = TRUE;
break;
- case RACE_ARCHON:
- creature_ptr->levitation = TRUE;
- break;
case RACE_BALROG:
creature_ptr->resist_fire = TRUE;
creature_ptr->resist_neth = TRUE;
}
break;
- case RACE_S_FAIRY:
- creature_ptr->levitation = TRUE;
- break;
case RACE_KUTAR:
creature_ptr->resist_conf = TRUE;
break;
#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)
{
creature_ptr->sustain_chr = TRUE;
}
}
+
+void have_levitation(player_type *creature_ptr)
+{
+ object_type *o_ptr;
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
+ creature_ptr->levitation = FALSE;
+
+ if (creature_ptr->mimic_form == MIMIC_DEMON_LORD) {
+ creature_ptr->levitation = TRUE;
+ }
+
+ if (!creature_ptr->mimic_form
+ && (creature_ptr->prace == RACE_DRACONIAN || creature_ptr->prace == RACE_SPECTRE || creature_ptr->prace == RACE_SPRITE
+ || creature_ptr->prace == RACE_ARCHON || creature_ptr->prace == RACE_S_FAIRY)) {
+ creature_ptr->levitation = TRUE;
+ }
+
+ if (creature_ptr->special_defense & KAMAE_SEIRYU || creature_ptr->special_defense & KAMAE_SUZAKU) {
+ creature_ptr->levitation = TRUE;
+ }
+
+ if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU)) {
+ creature_ptr->slow_digest = TRUE;
+ creature_ptr->regenerate = TRUE;
+ }
+
+ if (creature_ptr->magicdef) {
+ creature_ptr->levitation = TRUE;
+ }
+
+ 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->levitation = (riding_r_ptr->flags7 & RF7_CAN_FLY) ? TRUE : FALSE;
+ }
+
+ if (creature_ptr->tim_levitation) {
+ creature_ptr->levitation = 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_LEVITATION))
+ creature_ptr->levitation = TRUE;
+ }
+}
void have_sustain_dex(player_type *creature_ptr);
void have_sustain_con(player_type *creature_ptr);
void have_sustain_chr(player_type *creature_ptr);
+void have_levitation(player_type *creature_ptr);
creature_ptr->slow_digest = FALSE;
creature_ptr->regenerate = FALSE;
creature_ptr->can_swim = FALSE;
- creature_ptr->levitation = FALSE;
- creature_ptr->lite = FALSE;
creature_ptr->resist_acid = FALSE;
creature_ptr->resist_elec = FALSE;
creature_ptr->resist_fire = FALSE;
have_sustain_dex(creature_ptr);
have_sustain_con(creature_ptr);
have_sustain_chr(creature_ptr);
+ have_levitation(creature_ptr);
calc_race_status(creature_ptr);
monster_race *riding_r_ptr = &r_info[riding_m_ptr->r_idx];
if (riding_r_ptr->flags7 & (RF7_CAN_SWIM | RF7_AQUATIC))
creature_ptr->can_swim = TRUE;
-
- creature_ptr->levitation = (riding_r_ptr->flags7 & RF7_CAN_FLY) ? TRUE : FALSE;
}
creature_ptr->hold = adj_str_hold[creature_ptr->stat_ind[A_STR]];
creature_ptr->resist_elec = TRUE;
creature_ptr->resist_cold = TRUE;
creature_ptr->resist_pois = TRUE;
- creature_ptr->levitation = TRUE;
} else if (creature_ptr->special_defense & KAMAE_GENBU) {
creature_ptr->to_a += (creature_ptr->lev * creature_ptr->lev) / 50;
creature_ptr->dis_to_a += (creature_ptr->lev * creature_ptr->lev) / 50;
creature_ptr->dis_to_h[i] -= (creature_ptr->lev / 3);
creature_ptr->dis_to_d[i] -= (creature_ptr->lev / 6);
creature_ptr->num_blow[i] /= 2;
- creature_ptr->levitation = TRUE;
}
creature_ptr->num_blow[i] += 1 + creature_ptr->extra_blows[0];
if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU)) {
creature_ptr->slow_digest = TRUE;
creature_ptr->regenerate = TRUE;
- creature_ptr->levitation = TRUE;
creature_ptr->lite = TRUE;
creature_ptr->resist_acid = TRUE;
creature_ptr->resist_elec = TRUE;
creature_ptr->resist_time = TRUE;
}
-
if (creature_ptr->magicdef) {
creature_ptr->resist_blind = TRUE;
creature_ptr->resist_conf = TRUE;
- creature_ptr->levitation = TRUE;
}
-
if (creature_ptr->ele_immune) {
if (creature_ptr->special_defense & DEFENSE_ACID)
creature_ptr->immune_acid = TRUE;
creature_ptr->regenerate = TRUE;
}
- if (creature_ptr->tim_levitation) {
- creature_ptr->levitation = TRUE;
- }
-
if (is_hero(creature_ptr) || creature_ptr->shero) {
creature_ptr->resist_fear = TRUE;
}
if (have_flag(flgs, TR_REGEN))
creature_ptr->regenerate = TRUE;
- if (have_flag(flgs, TR_LEVITATION))
- creature_ptr->levitation = TRUE;
-
if (have_flag(flgs, TR_TELEPORT)) {
if (object_is_cursed(o_ptr))
creature_ptr->cursed |= TRC_TELEPORT;