/* Get the cave grid */
cave_type *c_ptr = &cave[y][x];
-
- int trap_feat = c_ptr->feat;
+ feature_type *f_ptr = &f_info[c_ptr->feat];
+ int trap_feat_type = have_flag(f_ptr->flags, FF_TRAP) ? f_ptr->subtype : NOT_TRAP;
#ifdef JP
cptr name = "¥È¥é¥Ã¥×";
cave_alter_feat(y, x, FF_HIT_TRAP);
/* Analyze XXX XXX XXX */
- switch (trap_feat)
+ switch (trap_feat_type)
{
- case FEAT_TRAP_TRAPDOOR:
+ case TRAP_TRAPDOOR:
{
if (p_ptr->levitation)
{
#ifdef JP
- msg_print("Í¸Í¤òÈô¤Ó±Û¤¨¤¿¡£");
+ msg_print("Íî¤Ȥ·¸Í¤òÈô¤Ó±Û¤¨¤¿¡£");
#else
msg_print("You fly over a trap door.");
#endif
else
{
#ifdef JP
- msg_print("Í¸Í¤ËÍî¤Á¤¿¡ª");
+ msg_print("Íî¤Ȥ·¸Í¤ËÍî¤Á¤¿¡ª");
if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
msg_print("¤¯¤Ã¤½¡Á¡ª");
#else
sound(SOUND_FALL);
dam = damroll(2, 8);
#ifdef JP
- name = "Í¸Í";
+ name = "Íî¤Ȥ·¸Í";
#else
name = "a trap door";
#endif
do_cmd_save_game(TRUE);
#ifdef JP
- do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "Í¸Í¤ËÍî¤Á¤¿");
+ do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "Íî¤Ȥ·¸Í¤ËÍî¤Á¤¿");
#else
do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "You have fallen through a trap door!");
#endif
break;
}
- case FEAT_TRAP_PIT:
+ case TRAP_PIT:
{
if (p_ptr->levitation)
{
#ifdef JP
- msg_print("Í·ê¤òÈô¤Ó±Û¤¨¤¿¡£");
+ msg_print("Íî¤Ȥ··ê¤òÈô¤Ó±Û¤¨¤¿¡£");
#else
msg_print("You fly over a pit trap.");
#endif
else
{
#ifdef JP
- msg_print("Í·ê¤ËÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª");
+ msg_print("Íî¤Ȥ··ê¤ËÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª");
#else
msg_print("You have fallen into a pit!");
#endif
dam = damroll(2, 6);
#ifdef JP
- name = "Í·ê";
+ name = "Íî¤Ȥ··ê";
#else
name = "a pit trap";
#endif
break;
}
- case FEAT_TRAP_SPIKED_PIT:
+ case TRAP_SPIKED_PIT:
{
if (p_ptr->levitation)
{
#ifdef JP
- msg_print("¥È¥²¤Î¤¢¤ëÍ·ê¤òÈô¤Ó±Û¤¨¤¿¡£");
+ msg_print("¥È¥²¤Î¤¢¤ëÍî¤Ȥ··ê¤òÈô¤Ó±Û¤¨¤¿¡£");
#else
msg_print("You fly over a spiked pit.");
#endif
else
{
#ifdef JP
- msg_print("¥¹¥Ñ¥¤¥¯¤¬Éߤ«¤ì¤¿Í·ê¤ËÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª");
+ msg_print("¥¹¥Ñ¥¤¥¯¤¬Éߤ«¤ì¤¿Íî¤È¤··ê¤ËÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª");
#else
msg_print("You fall into a spiked pit!");
#endif
/* Base damage */
#ifdef JP
- name = "Í·ê";
+ name = "Íî¤Ȥ··ê";
#else
name = "a pit trap";
#endif
#ifdef JP
- name = "¥È¥²¤Î¤¢¤ëÍ·ê";
+ name = "¥È¥²¤Î¤¢¤ëÍî¤Ȥ··ê";
#else
name = "a spiked pit";
#endif
break;
}
- case FEAT_TRAP_POISON_PIT:
+ case TRAP_POISON_PIT:
{
if (p_ptr->levitation)
{
#ifdef JP
- msg_print("¥È¥²¤Î¤¢¤ëÍ·ê¤òÈô¤Ó±Û¤¨¤¿¡£");
+ msg_print("¥È¥²¤Î¤¢¤ëÍî¤Ȥ··ê¤òÈô¤Ó±Û¤¨¤¿¡£");
#else
msg_print("You fly over a spiked pit.");
#endif
else
{
#ifdef JP
- msg_print("¥¹¥Ñ¥¤¥¯¤¬Éߤ«¤ì¤¿Í·ê¤ËÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª");
+ msg_print("¥¹¥Ñ¥¤¥¯¤¬Éߤ«¤ì¤¿Íî¤Ȥ··ê¤ËÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª");
#else
msg_print("You fall into a spiked pit!");
#endif
dam = damroll(2, 6);
#ifdef JP
- name = "Í·ê";
+ name = "Íî¤Ȥ··ê";
#else
name = "a pit trap";
#endif
#ifdef JP
- name = "¥È¥²¤Î¤¢¤ëÍ·ê";
+ name = "¥È¥²¤Î¤¢¤ëÍî¤Ȥ··ê";
#else
name = "a spiked pit";
#endif
break;
}
- case FEAT_TRAP_TY_CURSE:
+ case TRAP_TY_CURSE:
{
#ifdef JP
msg_print("²¿¤«¤¬¥Ô¥«¥Ã¤È¸÷¤Ã¤¿¡ª");
break;
}
- case FEAT_TRAP_TELEPORT:
+ case TRAP_TELEPORT:
{
#ifdef JP
msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥È¥é¥Ã¥×¤Ë¤Ò¤Ã¤«¤«¤Ã¤¿¡ª");
msg_print("You hit a teleport trap!");
#endif
- teleport_player(100, TRUE);
+ teleport_player(100, TELEPORT_PASSIVE);
break;
}
- case FEAT_TRAP_FIRE:
+ case TRAP_FIRE:
{
#ifdef JP
msg_print("±ê¤ËÊñ¤Þ¤ì¤¿¡ª");
break;
}
- case FEAT_TRAP_ACID:
+ case TRAP_ACID:
{
#ifdef JP
msg_print("»À¤¬¿á¤¤«¤±¤é¤ì¤¿¡ª");
break;
}
- case FEAT_TRAP_SLOW:
+ case TRAP_SLOW:
{
if (check_hit(125))
{
break;
}
- case FEAT_TRAP_LOSE_STR:
+ case TRAP_LOSE_STR:
{
if (check_hit(125))
{
break;
}
- case FEAT_TRAP_LOSE_DEX:
+ case TRAP_LOSE_DEX:
{
if (check_hit(125))
{
break;
}
- case FEAT_TRAP_LOSE_CON:
+ case TRAP_LOSE_CON:
{
if (check_hit(125))
{
break;
}
- case FEAT_TRAP_BLIND:
+ case TRAP_BLIND:
{
#ifdef JP
msg_print("¹õ¤¤¥¬¥¹¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡ª");
break;
}
- case FEAT_TRAP_CONFUSE:
+ case TRAP_CONFUSE:
{
#ifdef JP
msg_print("¤¤é¤á¤¯¥¬¥¹¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡ª");
break;
}
- case FEAT_TRAP_POISON:
+ case TRAP_POISON:
{
#ifdef JP
msg_print("»É·ãŪ¤ÊÎп§¤Î¥¬¥¹¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡ª");
break;
}
- case FEAT_TRAP_SLEEP:
+ case TRAP_SLEEP:
{
#ifdef JP
msg_print("´ñ̯¤ÊÇò¤¤Ì¸¤ËÊñ¤Þ¤ì¤¿¡ª");
break;
}
- case FEAT_TRAP_TRAPS:
+ case TRAP_TRAPS:
{
#ifdef JP
msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
break;
}
- case FEAT_TRAP_ALARM:
+ case TRAP_ALARM:
{
#ifdef JP
msg_print("¤±¤¿¤¿¤Þ¤·¤¤²»¤¬ÌĤê¶Á¤¤¤¿¡ª");
break;
}
- case FEAT_TRAP_OPEN:
+ case TRAP_OPEN:
{
#ifdef JP
msg_print("Âç²»¶Á¤È¶¦¤Ë¤Þ¤ï¤ê¤ÎÊɤ¬Êø¤ì¤¿¡ª");
break;
}
- case FEAT_TRAP_ARMAGEDDON:
+ case TRAP_ARMAGEDDON:
{
static int levs[10] = {0, 0, 20, 10, 5, 3, 2, 1, 1, 1};
int evil_idx = 0, good_idx = 0;
break;
}
- case FEAT_TRAP_PIRANHA:
+ case TRAP_PIRANHA:
{
#ifdef JP
msg_print("ÆÍÁ³Êɤ«¤é¿å¤¬°î¤ì½Ð¤·¤¿¡ª¥Ô¥é¥Ë¥¢¤¬¤¤¤ë¡ª");
if (p_ptr->monlite && (mode != HISSATSU_NYUSIN)) tmp /= 3;
if (p_ptr->cursed & TRC_AGGRAVATE) tmp /= 2;
if (r_ptr->level > (p_ptr->lev * p_ptr->lev / 20 + 10)) tmp /= 3;
- if (m_ptr->csleep && m_ptr->ml)
+ if (MON_CSLEEP(m_ptr) && m_ptr->ml)
{
/* Can't backstab creatures that we can't see, right? */
backstab = TRUE;
{
fuiuchi = TRUE;
}
- else if (m_ptr->monfear && m_ptr->ml)
+ else if (MON_MONFEAR(m_ptr) && m_ptr->ml)
{
stab_fleeing = TRUE;
}
case CLASS_MONK:
case CLASS_FORCETRAINER:
case CLASS_BERSERKER:
- if (empty_hands(TRUE) & EMPTY_HAND_RARM) monk_attack = TRUE;
+ if ((empty_hands(TRUE) & EMPTY_HAND_RARM) && !p_ptr->riding) monk_attack = TRUE;
break;
}
}
/* Disturb the monster */
- m_ptr->csleep = 0;
- if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
+ (void)set_monster_csleep(c_ptr->m_idx, 0);
/* Extract monster name (or "it") */
monster_desc(m_name, m_ptr, 0);
{
if (p_ptr->lev > randint1(r_ptr->level + resist_stun + 10))
{
+ if (set_monster_stunned(c_ptr->m_idx, stun_effect + MON_STUNNED(m_ptr)))
+ {
#ifdef JP
- if (m_ptr->stunned) msg_format("%^s¤Ï¤µ¤é¤Ë¥Õ¥é¥Õ¥é¤Ë¤Ê¤Ã¤¿¡£", m_name);
- else msg_format("%^s¤Ï¥Õ¥é¥Õ¥é¤Ë¤Ê¤Ã¤¿¡£", m_name);
+ msg_format("%^s¤Ï¥Õ¥é¥Õ¥é¤Ë¤Ê¤Ã¤¿¡£", m_name);
#else
- if (m_ptr->stunned) msg_format("%^s is more stunned.", m_name);
- else msg_format("%^s is stunned.", m_name);
+ msg_format("%^s is stunned.", m_name);
#endif
-
- m_ptr->stunned += stun_effect;
+ }
+ else
+ {
+#ifdef JP
+ msg_format("%^s¤Ï¤µ¤é¤Ë¥Õ¥é¥Õ¥é¤Ë¤Ê¤Ã¤¿¡£", m_name);
+#else
+ msg_format("%^s is more stunned.", m_name);
+#endif
+ }
}
}
}
if (!(r_ptr->flags3 & (RF3_NO_STUN)))
{
/* Get stunned */
- if (m_ptr->stunned)
+ if (MON_STUNNED(m_ptr))
{
#ifdef JP
msg_format("%s¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£", m_name);
}
/* Apply stun */
- m_ptr->stunned = (tmp < 200) ? tmp : 200;
+ (void)set_monster_stunned(c_ptr->m_idx, MON_STUNNED(m_ptr) + tmp);
}
else
{
}
m_ptr->maxhp -= (k+7)/8;
if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
+ if (m_ptr->maxhp < 1) m_ptr->maxhp = 1;
weak = TRUE;
}
can_drain = FALSE;
msg_format("%^s appears confused.", m_name);
#endif
- m_ptr->confused += 10 + randint0(p_ptr->lev) / 5;
+ (void)set_monster_confused(c_ptr->m_idx, MON_CONFUSED(m_ptr) + 10 + randint0(p_ptr->lev) / 5);
}
}
msg_format("%^s disappears!", m_name);
#endif
- teleport_away(c_ptr->m_idx, 50, FALSE, TRUE);
+ teleport_away(c_ptr->m_idx, 50, TELEPORT_PASSIVE);
num = num_blow + 1; /* Can't hit it anymore! */
*mdeath = TRUE;
}
msg_format("%^s changes!", m_name);
#endif
-
- /* Hack -- Get new monster */
- m_ptr = &m_list[c_ptr->m_idx];
-
- /* Oops, we need a different name... */
- monster_desc(m_name, m_ptr, 0);
-
- /* Hack -- Get new race */
- r_ptr = &r_info[m_ptr->r_idx];
-
*fear = FALSE;
weak = FALSE;
}
#else
msg_format("%^s is unaffected.", m_name);
#endif
-
}
+
+ /* Hack -- Get new monster */
+ m_ptr = &m_list[c_ptr->m_idx];
+
+ /* Oops, we need a different name... */
+ monster_desc(m_name, m_ptr, 0);
+
+ /* Hack -- Get new race */
+ r_ptr = &r_info[m_ptr->r_idx];
}
}
else if (o_ptr->name1 == ART_G_HAMMER)
/* Extract monster name (or "it") */
monster_desc(m_name, m_ptr, 0);
- /* Auto-Recall if possible and visible */
- if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
+ if (m_ptr->ml)
+ {
+ /* Auto-Recall if possible and visible */
+ monster_race_track(m_ptr->ap_r_idx);
- /* Track a new monster */
- if (m_ptr->ml) health_track(c_ptr->m_idx);
+ /* Track a new monster */
+ health_track(c_ptr->m_idx);
+ }
if ((r_ptr->flags1 & RF1_FEMALE) &&
!(p_ptr->stun || p_ptr->confused || p_ptr->image || !m_ptr->ml))
/* Message */
if (m_ptr->ml)
#ifdef JP
- msg_format("¶²¤¯¤Æ%s¤ò¹¶·â¤Ç¤¤Ê¤¤¡ª", m_name);
+ msg_format("¶²¤¯¤Æ%s¤ò¹¶·â¤Ç¤¤Ê¤¤¡ª", m_name);
#else
msg_format("You are too afraid to attack %s!", m_name);
#endif
#endif
/* Disturb the monster */
- m_ptr->csleep = 0;
- if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
+ (void)set_monster_csleep(c_ptr->m_idx, 0);
/* Done */
return FALSE;
}
- if (m_ptr->csleep) /* It is not honorable etc to attack helpless victims */
+ if (MON_CSLEEP(m_ptr)) /* It is not honorable etc to attack helpless victims */
{
if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
if (!is_pattern_tile_cur && !is_pattern_tile_new) return TRUE;
- pattern_type_cur = is_pattern_tile_cur ? cur_f_ptr->power : NOT_PATTERN_TILE;
- pattern_type_new = is_pattern_tile_new ? new_f_ptr->power : NOT_PATTERN_TILE;
+ pattern_type_cur = is_pattern_tile_cur ? cur_f_ptr->subtype : NOT_PATTERN_TILE;
+ pattern_type_new = is_pattern_tile_new ? new_f_ptr->subtype : NOT_PATTERN_TILE;
if (pattern_type_new == PATTERN_TILE_START)
{
/* Redraw new spot */
lite_spot(ny, nx);
- if (mpe_mode & MPE_FORGET_FLOW) forget_flow();
-
/* Check for new panel (redraw map) */
verify_panel();
+ if (mpe_mode & MPE_FORGET_FLOW)
+ {
+ forget_flow();
+
+ /* Mega-Hack -- Forget the view */
+ p_ptr->update |= (PU_UN_VIEW);
+
+ /* Redraw map */
+ p_ptr->redraw |= (PR_MAP);
+ }
+
/* Update stuff */
p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_DISTANCE);
else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
}
- if ((p_ptr->action == ACTION_HAYAGAKE) && !have_flag(f_ptr->flags, FF_PROJECT))
+ if ((p_ptr->action == ACTION_HAYAGAKE) &&
+ (!have_flag(f_ptr->flags, FF_PROJECT) ||
+ (!p_ptr->levitation && have_flag(f_ptr->flags, FF_DEEP))))
{
#ifdef JP
msg_print("¤³¤³¤Ç¤ÏÁÇÁ᤯ư¤±¤Ê¤¤¡£");
#else
- msg_print("You cannot run in wall.");
+ msg_print("You cannot run in here.");
#endif
set_action(ACTION_NONE);
}
bool trap_can_be_ignored(int feat)
{
- switch (feat)
+ feature_type *f_ptr = &f_info[feat];
+
+ if (!have_flag(f_ptr->flags, FF_TRAP)) return TRUE;
+
+ switch (f_ptr->subtype)
{
- case FEAT_TRAP_TRAPDOOR:
- case FEAT_TRAP_PIT:
- case FEAT_TRAP_SPIKED_PIT:
- case FEAT_TRAP_POISON_PIT:
+ case TRAP_TRAPDOOR:
+ case TRAP_PIT:
+ case TRAP_SPIKED_PIT:
+ case TRAP_POISON_PIT:
if (p_ptr->levitation) return TRUE;
break;
- case FEAT_TRAP_TELEPORT:
+ case TRAP_TELEPORT:
if (p_ptr->anti_tele) return TRUE;
break;
- case FEAT_TRAP_FIRE:
+ case TRAP_FIRE:
if (p_ptr->immune_fire) return TRUE;
break;
- case FEAT_TRAP_ACID:
+ case TRAP_ACID:
if (p_ptr->immune_acid) return TRUE;
break;
- case FEAT_TRAP_BLIND:
+ case TRAP_BLIND:
if (p_ptr->resist_blind) return TRUE;
break;
- case FEAT_TRAP_CONFUSE:
+ case TRAP_CONFUSE:
if (p_ptr->resist_conf) return TRUE;
break;
- case FEAT_TRAP_POISON:
+ case TRAP_POISON:
if (p_ptr->resist_pois) return TRUE;
break;
- case FEAT_TRAP_SLEEP:
+ case TRAP_SLEEP:
if (p_ptr->free_act) return TRUE;
break;
}
/* Player can not walk through "walls"... */
/* unless in Shadow Form */
- p_can_kill_walls = p_ptr->kill_wall && have_flag(f_ptr->flags, FF_TUNNEL) &&
+ p_can_kill_walls = p_ptr->kill_wall && have_flag(f_ptr->flags, FF_HURT_DISI) &&
(!p_can_enter || !have_flag(f_ptr->flags, FF_LOS)) &&
!have_flag(f_ptr->flags, FF_PERMANENT);
((p_ptr->muta2 & MUT2_BERS_RAGE) && p_ptr->shero)) &&
pattern_seq(py, px, y, x) && (p_can_enter || p_can_kill_walls))
{
- m_ptr->csleep = 0;
- if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
+ /* Disturb the monster */
+ (void)set_monster_csleep(c_ptr->m_idx, 0);
/* Extract monster name (or "it") */
monster_desc(m_name, m_ptr, 0);
oktomove = FALSE;
disturb(0, 0);
}
- else if (riding_m_ptr->monfear)
+ else if (MON_MONFEAR(riding_m_ptr))
{
char m_name[80];
disturb(0, 0);
}
- if (oktomove && riding_m_ptr->stunned && one_in_(2))
+ if (oktomove && MON_STUNNED(riding_m_ptr) && one_in_(2))
{
char m_name[80];
monster_desc(m_name, riding_m_ptr, 0);
*/
else if (have_flag(f_ptr->flags, FF_TREE) && !p_can_kill_walls)
{
- if ((p_ptr->pclass != CLASS_RANGER) && !p_ptr->levitation) energy_use *= 2;
+ if ((p_ptr->pclass != CLASS_RANGER) && !p_ptr->levitation && (!p_ptr->riding || !(riding_r_ptr->flags8 & RF8_WILD_WOOD))) energy_use *= 2;
}
#ifdef ALLOW_EASY_DISARM /* TNB */
next_o_idx = o_ptr->next_o_idx;
/* Visible object */
- if (o_ptr->marked) return (TRUE);
+ if (o_ptr->marked & OM_FOUND) return (TRUE);
}
/* Assume unknown */
/* Deep water */
else if (have_flag(f_ptr->flags, FF_WATER) && have_flag(f_ptr->flags, FF_DEEP) &&
- (p_ptr->levitation || p_ptr->can_swim ||
- p_ptr->total_weight <= (((u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]]*(p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2)))
+ (p_ptr->levitation || p_ptr->can_swim || (p_ptr->total_weight <= weight_limit())))
{
/* Ignore */
notice = FALSE;