if ((have_flag(flgs, TR_SLAY_ANIMAL)) &&
(r_ptr->flags3 & RF3_ANIMAL))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_ANIMAL;
}
if ((have_flag(flgs, TR_KILL_ANIMAL)) &&
(r_ptr->flags3 & RF3_ANIMAL))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_ANIMAL;
}
if ((have_flag(flgs, TR_SLAY_EVIL)) &&
(r_ptr->flags3 & RF3_EVIL))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_EVIL;
}
if ((have_flag(flgs, TR_KILL_EVIL)) &&
(r_ptr->flags3 & RF3_EVIL))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_EVIL;
}
if ((have_flag(flgs, TR_SLAY_HUMAN)) &&
(r_ptr->flags2 & RF2_HUMAN))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags2 |= RF2_HUMAN;
}
if ((have_flag(flgs, TR_KILL_HUMAN)) &&
(r_ptr->flags2 & RF2_HUMAN))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags2 |= RF2_HUMAN;
}
if ((have_flag(flgs, TR_SLAY_UNDEAD)) &&
(r_ptr->flags3 & RF3_UNDEAD))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_UNDEAD;
}
if ((have_flag(flgs, TR_KILL_UNDEAD)) &&
(r_ptr->flags3 & RF3_UNDEAD))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_UNDEAD;
}
if ((have_flag(flgs, TR_SLAY_DEMON)) &&
(r_ptr->flags3 & RF3_DEMON))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_DEMON;
}
if ((have_flag(flgs, TR_KILL_DEMON)) &&
(r_ptr->flags3 & RF3_DEMON))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_DEMON;
}
if ((have_flag(flgs, TR_SLAY_ORC)) &&
(r_ptr->flags3 & RF3_ORC))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_ORC;
}
if ((have_flag(flgs, TR_KILL_ORC)) &&
(r_ptr->flags3 & RF3_ORC))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_ORC;
}
if ((have_flag(flgs, TR_SLAY_TROLL)) &&
(r_ptr->flags3 & RF3_TROLL))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_TROLL;
}
if ((have_flag(flgs, TR_KILL_TROLL)) &&
(r_ptr->flags3 & RF3_TROLL))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_TROLL;
}
if ((have_flag(flgs, TR_SLAY_GIANT)) &&
(r_ptr->flags3 & RF3_GIANT))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_GIANT;
}
if ((have_flag(flgs, TR_KILL_GIANT)) &&
(r_ptr->flags3 & RF3_GIANT))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_GIANT;
}
if ((have_flag(flgs, TR_SLAY_DRAGON)) &&
(r_ptr->flags3 & RF3_DRAGON))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_DRAGON;
}
if ((have_flag(flgs, TR_KILL_DRAGON)) &&
(r_ptr->flags3 & RF3_DRAGON))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_DRAGON;
}
if (have_flag(flgs, TR_BRAND_ACID) || ((p_ptr->special_attack & (ATTACK_ACID)) && !thrown))
{
/* Notice immunity */
- if (r_ptr->flags3 & RF3_EFF_IM_ACID_MASK)
+ if (r_ptr->flagsr & RFR_EFF_IM_ACID_MASK)
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
- r_ptr->r_flags3 |= (r_ptr->flags3 & RF3_EFF_IM_ACID_MASK);
+ r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ACID_MASK);
}
}
if (have_flag(flgs, TR_BRAND_ELEC) || ((p_ptr->special_attack & (ATTACK_ELEC)) && !thrown) || (mode == HISSATSU_ELEC))
{
/* Notice immunity */
- if (r_ptr->flags3 & RF3_EFF_IM_ELEC_MASK)
+ if (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK)
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
- r_ptr->r_flags3 |= (r_ptr->flags3 & RF3_EFF_IM_ELEC_MASK);
+ r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK);
}
}
if (have_flag(flgs, TR_BRAND_FIRE) || ((p_ptr->special_attack & (ATTACK_FIRE)) && !thrown) || (mode == HISSATSU_FIRE))
{
/* Notice immunity */
- if (r_ptr->flags3 & RF3_EFF_IM_FIRE_MASK)
+ if (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK)
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
- r_ptr->r_flags3 |= (r_ptr->flags3 & RF3_EFF_IM_FIRE_MASK);
+ r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK);
}
}
if (r_ptr->flags3 & RF3_HURT_FIRE)
{
if (mult < 70) mult = 70;
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_HURT_FIRE;
}
if (r_ptr->flags3 & RF3_HURT_FIRE)
{
if (mult < 50) mult = 50;
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_HURT_FIRE;
}
if (have_flag(flgs, TR_BRAND_COLD) || ((p_ptr->special_attack & (ATTACK_COLD)) && !thrown) || (mode == HISSATSU_COLD))
{
/* Notice immunity */
- if (r_ptr->flags3 & RF3_EFF_IM_COLD_MASK)
+ if (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK)
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
- r_ptr->r_flags3 |= (r_ptr->flags3 & RF3_EFF_IM_COLD_MASK);
+ r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK);
}
}
/* Otherwise, take the damage */
if (r_ptr->flags3 & RF3_HURT_COLD)
{
if (mult < 70) mult = 70;
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_HURT_COLD;
}
if (r_ptr->flags3 & RF3_HURT_COLD)
{
if (mult < 50) mult = 50;
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_HURT_COLD;
}
if (have_flag(flgs, TR_BRAND_POIS) || ((p_ptr->special_attack & (ATTACK_POIS)) && !thrown) || (mode == HISSATSU_POISON))
{
/* Notice immunity */
- if (r_ptr->flags3 & RF3_EFF_IM_POIS_MASK)
+ if (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK)
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
- r_ptr->r_flags3 |= (r_ptr->flags3 & RF3_EFF_IM_POIS_MASK);
+ r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK);
}
}
if (mult < 25) mult = 25;
}
}
- if ((mode == HISSATSU_ZANMA) && (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) && (r_ptr->flags3 & RF3_EVIL))
+ if ((mode == HISSATSU_ZANMA) && !monster_living(r_ptr) && (r_ptr->flags3 & RF3_EVIL))
{
if (mult < 15) mult = 25;
else if (mult < 50) mult = MIN(50, mult+20);
{
if (r_ptr->flags3 & RF3_UNDEAD)
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_UNDEAD;
}
if (mult == 10) mult = 40;
else if (mult < 60) mult = MIN(60, mult+30);
}
- if ((mode == HISSATSU_SEKIRYUKA) && p_ptr->cut && !(r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)))
+ if ((mode == HISSATSU_SEKIRYUKA) && p_ptr->cut && monster_living(r_ptr))
{
int tmp = MIN(100, MAX(10, p_ptr->cut / 10));
if (mult < tmp) mult = tmp;
}
if ((mode == HISSATSU_HAGAN) && (r_ptr->flags3 & RF3_HURT_ROCK))
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_HURT_ROCK;
}
if (p_ptr->resist_fire) aura_damage = (aura_damage + 2) / 3;
take_hit(DAMAGE_NOESCAPE, aura_damage, aura_dam, -1);
- r_ptr->r_flags2 |= RF2_AURA_FIRE;
+ if (m_ptr->ml && is_original_ap(m_ptr)) r_ptr->r_flags2 |= RF2_AURA_FIRE;
handle_stuff();
}
}
if (p_ptr->resist_cold) aura_damage = (aura_damage + 2) / 3;
take_hit(DAMAGE_NOESCAPE, aura_damage, aura_dam, -1);
- r_ptr->r_flags3 |= RF3_AURA_COLD;
+ if (m_ptr->ml && is_original_ap(m_ptr)) r_ptr->r_flags3 |= RF3_AURA_COLD;
handle_stuff();
}
}
#endif
take_hit(DAMAGE_NOESCAPE, aura_damage, aura_dam, -1);
- r_ptr->r_flags2 |= RF2_AURA_ELEC;
+ if (m_ptr->ml && is_original_ap(m_ptr)) r_ptr->r_flags2 |= RF2_AURA_ELEC;
handle_stuff();
}
}
/* Can't backstab creatures that we can't see, right? */
backstab = TRUE;
}
- else if ((p_ptr->special_defense & NINJA_S_STEALTH) && (randint0(tmp) > (r_ptr->level+20)) && m_ptr->ml && !(r_ptr->flags3 & RF3_RES_ALL))
+ else if ((p_ptr->special_defense & NINJA_S_STEALTH) && (randint0(tmp) > (r_ptr->level+20)) && m_ptr->ml && !(r_ptr->flagsr & RFR_RES_ALL))
{
fuiuchi = TRUE;
}
/* Disturb the monster */
m_ptr->csleep = 0;
- if (r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2))
+ if (r_ptr->flags7 & RF7_HAS_LD_MASK)
p_ptr->update |= (PU_MON_LITE);
/* Extract monster name (or "it") */
}
else success_hit = old_success_hit;
}
- else if ((p_ptr->pclass == CLASS_NINJA) && ((backstab || fuiuchi) && !(r_ptr->flags3 & RF3_RES_ALL))) success_hit = TRUE;
+ else if ((p_ptr->pclass == CLASS_NINJA) && ((backstab || fuiuchi) && !(r_ptr->flagsr & RFR_RES_ALL))) success_hit = TRUE;
else success_hit = test_hit_norm(chance, r_ptr->ac, m_ptr->ml);
/* Test for hit */
/* Handle normal weapon */
else if (o_ptr->k_idx)
{
- k = damroll(o_ptr->dd, o_ptr->ds);
- if (p_ptr->riding)
- {
- if((o_ptr->tval == TV_POLEARM) && ((o_ptr->sval == SV_LANCE) || (o_ptr->sval == SV_HEAVY_LANCE)))
- {
- k += damroll(2, o_ptr->ds);
- }
- }
-
+ k = damroll(o_ptr->dd + p_ptr->to_dd[hand], o_ptr->ds + p_ptr->to_ds[hand]);
k = tot_dam_aux(o_ptr, k, m_ptr, mode, FALSE);
if (backstab)
k *= mult;
/* Ouch! */
- if (((r_ptr->flags3 & RF3_RES_ALL) ? k/100 : k) > m_ptr->hp)
+ if (((r_ptr->flagsr & RFR_RES_ALL) ? k/100 : k) > m_ptr->hp)
{
#ifdef JP
msg_format("%s¤ò¿¿¤ÃÆó¤Ä¤Ë¤·¤¿¡ª", m_name);
drain_result += p_ptr->to_d[hand];
if ((mode == HISSATSU_SUTEMI) || (mode == HISSATSU_3DAN)) k *= 2;
- if ((mode == HISSATSU_SEKIRYUKA) && (r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON | RF3_NONLIVING))) k = 0;
+ if ((mode == HISSATSU_SEKIRYUKA) && !monster_living(r_ptr)) k = 0;
if ((mode == HISSATSU_SEKIRYUKA) && !p_ptr->cut) k /= 2;
/* No negative damage */
if (k < 0) k = 0;
- if ((mode == HISSATSU_ZANMA) && !((r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) && (r_ptr->flags3 & RF3_EVIL)))
+ if ((mode == HISSATSU_ZANMA) && !(!monster_living(r_ptr) && (r_ptr->flags3 & RF3_EVIL)))
{
k = 0;
}
/* Confuse the monster */
if (r_ptr->flags3 & RF3_NO_CONF)
{
- if (m_ptr->ml)
+ if (m_ptr->ml && is_original_ap(m_ptr))
{
r_ptr->r_flags3 |= RF3_NO_CONF;
}
{
bool resists_tele = FALSE;
- if (r_ptr->flags3 & RF3_RES_TELE)
+ if (r_ptr->flagsr & RFR_RES_TELE)
{
if (r_ptr->flags1 & RF1_UNIQUE)
{
- if (m_ptr->ml) r_ptr->r_flags3 |= RF3_RES_TELE;
+ if (m_ptr->ml && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
#ifdef JP
msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
#else
}
else if (r_ptr->level > randint1(100))
{
- if (m_ptr->ml) r_ptr->r_flags3 |= RF3_RES_TELE;
+ if (m_ptr->ml && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
#ifdef JP
msg_format("%^s¤ÏÄñ¹³ÎϤò»ý¤Ã¤Æ¤¤¤ë¡ª", m_name);
#else
else if ((chaos_effect == 5) && cave_floor_bold(y, x) &&
(randint1(90) > r_ptr->level))
{
- if (!(r_ptr->flags1 & RF1_UNIQUE) &&
- !(r_ptr->flags4 & RF4_BR_CHAO) &&
- !(r_ptr->flags1 & RF1_QUESTOR))
+ if (!(r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) &&
+ !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
{
if (polymorph_monster(y, x))
{
else
{
#ifdef JP
- msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
+ msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
#else
msg_format("%^s is unaffected.", m_name);
#endif
bool player_can_enter(byte feature)
{
- bool pass_wall;
-
- /* Player can not walk through "walls" unless in Shadow Form */
- if (p_ptr->wraith_form || p_ptr->pass_wall || p_ptr->kabenuke)
- pass_wall = TRUE;
- else
- pass_wall = FALSE;
-
switch (feature)
{
- case FEAT_DEEP_WATER:
- case FEAT_SHAL_LAVA:
- case FEAT_DEEP_LAVA:
- return (TRUE);
-
- case FEAT_DARK_PIT:
- {
- if (p_ptr->ffall)
- return (TRUE);
- else
- return (FALSE);
- }
+ case FEAT_DOOR_HEAD: /* Nasty hack -- Doors */
+ case FEAT_DOOR_HEAD + 0x01:
+ case FEAT_DOOR_HEAD + 0x02:
+ case FEAT_DOOR_HEAD + 0x03:
+ case FEAT_DOOR_HEAD + 0x04:
+ case FEAT_DOOR_HEAD + 0x05:
+ case FEAT_DOOR_HEAD + 0x06:
+ case FEAT_DOOR_HEAD + 0x07:
+ case FEAT_DOOR_HEAD + 0x08:
+ case FEAT_DOOR_HEAD + 0x09:
+ case FEAT_DOOR_HEAD + 0x0a:
+ case FEAT_DOOR_HEAD + 0x0b:
+ case FEAT_DOOR_HEAD + 0x0c:
+ case FEAT_DOOR_HEAD + 0x0d:
+ case FEAT_DOOR_HEAD + 0x0e:
+ case FEAT_DOOR_TAIL: /* Equals FEAT_DOOR_HEAD + 0x0f */
+ case FEAT_SECRET:
+ case FEAT_RUBBLE:
+ case FEAT_MAGMA:
+ case FEAT_QUARTZ:
+ case FEAT_MAGMA_H:
+ case FEAT_QUARTZ_H:
+ case FEAT_MAGMA_K:
+ case FEAT_QUARTZ_K:
+ case FEAT_WALL_EXTRA:
+ case FEAT_WALL_INNER:
+ case FEAT_WALL_OUTER:
+ case FEAT_WALL_SOLID:
+ /* Player can not walk through "walls" unless in Shadow Form */
+ return p_ptr->wraith_form || p_ptr->pass_wall || p_ptr->kabenuke;
+
+ case FEAT_PERM_EXTRA:
+ case FEAT_PERM_INNER:
+ case FEAT_PERM_OUTER:
+ case FEAT_PERM_SOLID:
+ case FEAT_PATTERN_START:
+ case FEAT_PATTERN_1:
+ case FEAT_PATTERN_2:
+ case FEAT_PATTERN_3:
+ case FEAT_PATTERN_4:
+ case FEAT_PATTERN_END:
+ case FEAT_PATTERN_OLD:
+ case FEAT_PATTERN_XTRA1:
+ case FEAT_PATTERN_XTRA2:
+ return FALSE;
- case FEAT_TREES:
- {
- return (TRUE);
- }
+ case FEAT_DARK_PIT:
+ return p_ptr->ffall;
- case FEAT_RUBBLE:
- case FEAT_MAGMA:
- case FEAT_QUARTZ:
- case FEAT_MAGMA_H:
- case FEAT_QUARTZ_H:
- case FEAT_MAGMA_K:
- case FEAT_QUARTZ_K:
- case FEAT_WALL_EXTRA:
- case FEAT_WALL_INNER:
- case FEAT_WALL_OUTER:
- case FEAT_WALL_SOLID:
- {
- return (pass_wall);
- }
-
- case FEAT_MOUNTAIN:
- {
- return (!dun_level && p_ptr->ffall);
- }
- case FEAT_PERM_EXTRA:
- case FEAT_PERM_INNER:
- case FEAT_PERM_OUTER:
- case FEAT_PERM_SOLID:
- case FEAT_PATTERN_START:
- case FEAT_PATTERN_1:
- case FEAT_PATTERN_2:
- case FEAT_PATTERN_3:
- case FEAT_PATTERN_4:
- case FEAT_PATTERN_END:
- case FEAT_PATTERN_OLD:
- case FEAT_PATTERN_XTRA1:
- case FEAT_PATTERN_XTRA2:
- {
- return (FALSE);
- }
+ case FEAT_MOUNTAIN:
+ return !dun_level && p_ptr->ffall;
}
- return (TRUE);
+ /* Assume okay */
+ return TRUE;
}
disturb(0, 0);
}
- else if ((p_ptr->riding && !(r_info[m_list[p_ptr->riding].r_idx].flags7 & (RF7_CAN_FLY)) && !(r_info[m_list[p_ptr->riding].r_idx].flags3 & RF3_EFF_IM_FIRE_MASK)) && ((c_ptr->feat == FEAT_SHAL_LAVA) || (c_ptr->feat == FEAT_DEEP_LAVA)))
+ else if ((p_ptr->riding && !(r_info[m_list[p_ptr->riding].r_idx].flags7 & (RF7_CAN_FLY)) && !(r_info[m_list[p_ptr->riding].r_idx].flagsr & RFR_EFF_IM_FIRE_MASK)) && ((c_ptr->feat == FEAT_SHAL_LAVA) || (c_ptr->feat == FEAT_DEEP_LAVA)))
{
#ifdef JP
msg_print("ÍÏ´ä¤Î¾å¤Ë¹Ô¤±¤Ê¤¤¡£");
}
/* Analyze unknown grids and floors considering mimic */
- if (inv || (!(feat & 0x20)))
+ if (inv || feat_floor(feat))
{
/* Looking for open area */
if (find_openarea)