if ((have_flag(flgs, TR_SLAY_ANIMAL)) &&
(r_ptr->flags3 & RF3_ANIMAL))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_ANIMAL;
}
if ((have_flag(flgs, TR_KILL_ANIMAL)) &&
(r_ptr->flags3 & RF3_ANIMAL))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_ANIMAL;
}
if ((have_flag(flgs, TR_SLAY_EVIL)) &&
(r_ptr->flags3 & RF3_EVIL))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_EVIL;
}
if ((have_flag(flgs, TR_KILL_EVIL)) &&
(r_ptr->flags3 & RF3_EVIL))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_EVIL;
}
if ((have_flag(flgs, TR_SLAY_HUMAN)) &&
(r_ptr->flags2 & RF2_HUMAN))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags2 |= RF2_HUMAN;
}
if ((have_flag(flgs, TR_KILL_HUMAN)) &&
(r_ptr->flags2 & RF2_HUMAN))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags2 |= RF2_HUMAN;
}
if ((have_flag(flgs, TR_SLAY_UNDEAD)) &&
(r_ptr->flags3 & RF3_UNDEAD))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_UNDEAD;
}
if ((have_flag(flgs, TR_KILL_UNDEAD)) &&
(r_ptr->flags3 & RF3_UNDEAD))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_UNDEAD;
}
if ((have_flag(flgs, TR_SLAY_DEMON)) &&
(r_ptr->flags3 & RF3_DEMON))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_DEMON;
}
if ((have_flag(flgs, TR_KILL_DEMON)) &&
(r_ptr->flags3 & RF3_DEMON))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_DEMON;
}
if ((have_flag(flgs, TR_SLAY_ORC)) &&
(r_ptr->flags3 & RF3_ORC))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_ORC;
}
if ((have_flag(flgs, TR_KILL_ORC)) &&
(r_ptr->flags3 & RF3_ORC))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_ORC;
}
if ((have_flag(flgs, TR_SLAY_TROLL)) &&
(r_ptr->flags3 & RF3_TROLL))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_TROLL;
}
if ((have_flag(flgs, TR_KILL_TROLL)) &&
(r_ptr->flags3 & RF3_TROLL))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_TROLL;
}
if ((have_flag(flgs, TR_SLAY_GIANT)) &&
(r_ptr->flags3 & RF3_GIANT))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_GIANT;
}
if (mult < 30) mult = 30;
- if (o_ptr->name1 == ART_HRUNTING)
- mult *= 3;
}
/* Execute Giant */
if ((have_flag(flgs, TR_KILL_GIANT)) &&
(r_ptr->flags3 & RF3_GIANT))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_GIANT;
}
if ((have_flag(flgs, TR_SLAY_DRAGON)) &&
(r_ptr->flags3 & RF3_DRAGON))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_DRAGON;
}
if ((have_flag(flgs, TR_KILL_DRAGON)) &&
(r_ptr->flags3 & RF3_DRAGON))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_DRAGON;
}
/* Notice immunity */
if (r_ptr->flagsr & RFR_EFF_IM_ACID_MASK)
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ACID_MASK);
}
/* Notice immunity */
if (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK)
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK);
}
/* Notice immunity */
if (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK)
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
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 && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(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 && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_HURT_FIRE;
}
/* Notice immunity */
if (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK)
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK);
}
if (r_ptr->flags3 & RF3_HURT_COLD)
{
if (mult < 70) mult = 70;
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(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 && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_HURT_COLD;
}
/* Notice immunity */
if (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK)
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK);
}
{
if (r_ptr->flags3 & RF3_UNDEAD)
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_UNDEAD;
}
}
if ((mode == HISSATSU_HAGAN) && (r_ptr->flags3 & RF3_HURT_ROCK))
{
- if (m_ptr->ml && is_original_ap(m_ptr))
+ if (is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags3 |= RF3_HURT_ROCK;
}
msg_print("You have found a trap.");
#endif
-
/* Disturb */
disturb(0, 0);
}
if (!chest_traps[o_ptr->pval]) continue;
/* Identify once */
- if (!object_known_p(o_ptr))
+ if (!object_is_known(o_ptr))
{
/* Message */
#ifdef JP
msg_print("You have discovered a trap on the chest!");
#endif
-
/* Know the trap */
object_known(o_ptr);
#ifdef JP
/* Describe the object */
- object_desc(old_name, o_ptr, TRUE, 0);
+ object_desc(old_name, o_ptr, OD_NAME_ONLY);
object_desc_kosuu(kazu_str, o_ptr);
hirottakazu = o_ptr->number;
#endif
if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
{
- int idx;
bool old_known = identify_item(o_ptr);
/* Auto-inscription/destroy */
- idx = is_autopick(o_ptr);
- auto_inscribe_item(slot, idx);
- if (destroy_identify && !old_known)
- {
- if (auto_destroy_item(slot, idx))
- {
- if (o_ptr->marked & OM_AUTODESTROY) return;
- }
- }
+ autopick_alter_item(slot, (bool)(destroy_identify && !old_known));
+
+ /* If it is destroyed, don't pick it up */
+ if (o_ptr->marked & OM_AUTODESTROY) return;
}
/* Describe the object */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
/* Message */
#ifdef JP
* Note that we ONLY handle things that can be picked up.
* See "move_player()" for handling of other things.
*/
-void carry(int pickup)
+void carry(bool pickup)
{
cave_type *c_ptr = &cave[py][px];
handle_stuff();
/* Automatically pickup/destroy/inscribe items */
- auto_pickup_items(c_ptr);
+ autopick_pickup_items(c_ptr);
#ifdef ALLOW_EASY_FLOOR
#endif /* ALLOW_EASY_SENSE -- TNB */
/* Describe the object */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
/* Acquire next object */
next_o_idx = o_ptr->next_o_idx;
/* Pick up objects */
else
{
- /* Hack - some objects were handled in auto_pickup_items(). */
+ /* Hack - some objects were handled in autopick_pickup_items(). */
if (o_ptr->marked & OM_NOMSG)
{
/* Clear the flag. */
}
/* Describe the object */
else if (!pickup)
-
{
#ifdef JP
msg_format("%s¤¬¤¢¤ë¡£", o_name);
int i, num, dam;
int x = px, y = py;
- cave_type *c_ptr;
+ /* Get the cave grid */
+ cave_type *c_ptr = &cave[y][x];
+ 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 = "¥È¥é¥Ã¥×";
+ cptr name = "¥È¥é¥Ã¥×";
#else
cptr name = "a trap";
#endif
-
-
/* Disturb the player */
disturb(0, 0);
- /* Get the cave grid */
- c_ptr = &cave[y][x];
+ cave_alter_feat(y, x, FF_HIT_TRAP);
/* Analyze XXX XXX XXX */
- switch (c_ptr->feat)
+ switch (trap_feat_type)
{
- case FEAT_TRAP_TRAPDOOR:
+ case TRAP_TRAPDOOR:
{
- if (p_ptr->ffall)
+ 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
- prepare_change_floor_mode(CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
+ prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
/* Leaving */
p_ptr->leaving = TRUE;
break;
}
- case FEAT_TRAP_PIT:
+ case TRAP_PIT:
{
- if (p_ptr->ffall)
+ 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->ffall)
+ 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->ffall)
+ 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("²¿¤«¤¬¥Ô¥«¥Ã¤È¸÷¤Ã¤¿¡ª");
msg_print("There is a flash of shimmering light!");
#endif
- c_ptr->info &= ~(CAVE_MARK);
- cave_set_feat(y, x, floor_type[randint0(100)]);
num = 2 + randint1(3);
for (i = 0; i < num; i++)
{
break;
}
- case FEAT_TRAP_TELEPORT:
+ case TRAP_TELEPORT:
{
#ifdef JP
msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥È¥é¥Ã¥×¤Ë¤Ò¤Ã¤«¤«¤Ã¤¿¡ª");
msg_print("You hit a teleport trap!");
#endif
- teleport_player(100);
+ 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("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
msg_print("There is a bright flash of light!");
#endif
-
- /* Destroy this trap */
- cave_set_feat(y, x, floor_type[randint0(100)]);
-
/* Make some new traps */
project(0, 1, y, x, 0, GF_MAKE_TRAP, PROJECT_HIDE | PROJECT_JUMP | PROJECT_GRID, -1);
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;
msg_print("Suddenly, you are surrounded by immotal beings!");
#endif
- /* Destroy this trap */
- cave_set_feat(y, x, floor_type[randint0(100)]);
-
/* Summon Demons and Angels */
for (lev = dun_level; lev >= 20; lev -= 1 + lev/16)
{
/* Skip illegal grids */
if (!in_bounds(y1, x1)) continue;
- /* Require line of sight */
- if (!player_has_los_bold(y1, x1)) continue;
+ /* Require line of projection */
+ if (!projectable(py, px, y1, x1)) continue;
if (summon_specific(0, y1, x1, lev, SUMMON_ARMAGE_EVIL, (PM_NO_PET)))
evil_idx = hack_m_idx_ii;
break;
}
- case FEAT_TRAP_PIRANHA:
+ case TRAP_PIRANHA:
{
#ifdef JP
msg_print("ÆÍÁ³Êɤ«¤é¿å¤¬°î¤ì½Ð¤·¤¿¡ª¥Ô¥é¥Ë¥¢¤¬¤¤¤ë¡ª");
msg_print("Suddenly, the room is filled with water with piranhas!");
#endif
- /* Destroy this trap */
- cave_set_feat(y, x, floor_type[randint0(100)]);
-
/* Water fills room */
fire_ball_hide(GF_WATER_FLOW, 0, 1, 10);
break;
}
}
+
if (break_trap && is_trap(c_ptr->feat))
{
- cave_set_feat(y, x, floor_type[randint0(100)]);
+ cave_alter_feat(y, x, FF_DISARM);
#ifdef JP
msg_print("¥È¥é¥Ã¥×¤òÊ´ºÕ¤·¤¿¡£");
#else
msg_print("You are suddenly very hot!");
#endif
-
if (prace_is_(RACE_ENT)) aura_damage += aura_damage / 3;
if (IS_OPPOSE_FIRE()) aura_damage = (aura_damage + 2) / 3;
if (p_ptr->resist_fire) aura_damage = (aura_damage + 2) / 3;
take_hit(DAMAGE_NOESCAPE, aura_damage, aura_dam, -1);
- if (m_ptr->ml && is_original_ap(m_ptr)) r_ptr->r_flags2 |= RF2_AURA_FIRE;
+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= RF2_AURA_FIRE;
handle_stuff();
}
}
msg_print("You are suddenly very cold!");
#endif
-
if (IS_OPPOSE_COLD()) aura_damage = (aura_damage + 2) / 3;
if (p_ptr->resist_cold) aura_damage = (aura_damage + 2) / 3;
take_hit(DAMAGE_NOESCAPE, aura_damage, aura_dam, -1);
- if (m_ptr->ml && is_original_ap(m_ptr)) r_ptr->r_flags3 |= RF3_AURA_COLD;
+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_AURA_COLD;
handle_stuff();
}
}
#endif
take_hit(DAMAGE_NOESCAPE, aura_damage, aura_dam, -1);
- if (m_ptr->ml && is_original_ap(m_ptr)) r_ptr->r_flags2 |= RF2_AURA_ELEC;
+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= RF2_AURA_ELEC;
handle_stuff();
}
}
monster_type *m_ptr = &m_list[c_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- object_type *o_ptr;
+ /* Access the weapon */
+ object_type *o_ptr = &inventory[INVEN_RARM + hand];
char m_name[80];
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;
}
- if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
+ if (!o_ptr->k_idx) /* Empty hand */
{
if ((r_ptr->level + 10) > p_ptr->lev)
{
}
}
}
- else
+ else if (object_is_melee_weapon(o_ptr))
{
if ((r_ptr->level + 10) > p_ptr->lev)
{
- int tval = inventory[INVEN_RARM+hand].tval - TV_BOW;
+ int tval = inventory[INVEN_RARM+hand].tval - TV_WEAPON_BEGIN;
int sval = inventory[INVEN_RARM+hand].sval;
int now_exp = p_ptr->weapon_exp[tval][sval];
if (now_exp < s_info[p_ptr->pclass].w_max[tval][sval])
}
/* 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);
- /* Access the weapon */
- o_ptr = &inventory[INVEN_RARM+hand];
-
/* Calculate the "attack quality" */
bonus = p_ptr->to_h[hand] + o_ptr->to_h;
chance = (p_ptr->skill_thn + (bonus * BTH_PLUS_ADJ));
else if (ma_ptr->effect == MA_SLOW)
{
if (!((r_ptr->flags1 & RF1_NEVER_MOVE) ||
- strchr("~#{}.UjmeEv$,DdsbBFIJQSXclnw!=?", r_ptr->d_char)))
+ my_strchr("~#{}.UjmeEv$,DdsbBFIJQSXclnw!=?", r_ptr->d_char)))
{
#ifdef JP
msg_format("%s¤Î¼ó¤Ë´ØÀá½³¤ê¤ò¤¯¤é¤ï¤·¤¿¡ª", m_name);
{
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
{
{
if ((randint1(randint1(r_ptr->level/7)+5) == 1) && !(r_ptr->flags1 & RF1_UNIQUE) && !(r_ptr->flags7 & RF7_UNIQUE2))
{
- if (k < m_ptr->hp + 1) k = m_ptr->hp + 1;
+ k = m_ptr->hp + 1;
#ifdef JP
msg_format("%s¤ÎµÞ½ê¤òÆͤ»É¤·¤¿¡ª", m_name);
#else
}
else
{
- if (k < m_ptr->hp + 1) k = m_ptr->hp + 1;
+ k = m_ptr->hp + 1;
#ifdef JP
msg_format("¿Ï¤¬%s¤ÎµÞ½ê¤ò´Ó¤¤¤¿¡ª", m_name);
#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;
/* Confuse the monster */
if (r_ptr->flags3 & RF3_NO_CONF)
{
- if (m_ptr->ml && is_original_ap(m_ptr))
- {
- r_ptr->r_flags3 |= RF3_NO_CONF;
- }
+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_NO_CONF;
#ifdef JP
msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
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);
}
}
{
if (r_ptr->flags1 & RF1_UNIQUE)
{
- if (m_ptr->ml && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
+ if (is_original_ap_and_seen(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 && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
+ if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
#ifdef JP
msg_format("%^s¤ÏÄñ¹³ÎϤò»ý¤Ã¤Æ¤¤¤ë¡ª", m_name);
#else
msg_format("%^s disappears!", m_name);
#endif
- teleport_away(c_ptr->m_idx, 50, FALSE);
+ teleport_away(c_ptr->m_idx, 50, TELEPORT_PASSIVE);
num = num_blow + 1; /* Can't hit it anymore! */
*mdeath = TRUE;
}
}
- else if ((chaos_effect == 5) && cave_floor_bold(y, x) &&
- (randint1(90) > r_ptr->level))
+ else if ((chaos_effect == 5) && (randint1(90) > r_ptr->level))
{
if (!(r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) &&
!(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
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)
object_type *q_ptr = &o_list[m_ptr->hold_o_idx];
char o_name[MAX_NLEN];
- object_desc(o_name, q_ptr, TRUE, 0);
+ object_desc(o_name, q_ptr, OD_NAME_ONLY);
q_ptr->held_m_idx = 0;
q_ptr->marked = 0;
m_ptr->hold_o_idx = q_ptr->next_o_idx;
energy_use = 100;
- if (m_ptr->csleep) /* It is not honorable etc to attack helpless victims */
+ if (!p_ptr->migite && !p_ptr->hidarite &&
+ !(p_ptr->muta2 & (MUT2_HORNS | MUT2_BEAK | MUT2_SCOR_TAIL | MUT2_TRUNK | MUT2_TENTACLES)))
{
- 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);
+#ifdef JP
+ msg_format("%s¹¶·â¤Ç¤¤Ê¤¤¡£", (empty_hands(FALSE) == EMPTY_HAND_NONE) ? "ξ¼ê¤¬¤Õ¤µ¤¬¤Ã¤Æ" : "");
+#else
+ msg_print("You cannot do attacking.");
+#endif
+ return FALSE;
}
/* 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 (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 (p_ptr->migite && p_ptr->hidarite)
{
if ((p_ptr->skill_exp[GINOU_NITOURYU] < s_info[p_ptr->pclass].s_max[GINOU_NITOURYU]) && ((p_ptr->skill_exp[GINOU_NITOURYU] - 1000) / 200 < r_ptr->level))
}
-static bool pattern_seq(int c_y, int c_x, int n_y, int n_x)
+bool pattern_seq(int c_y, int c_x, int n_y, int n_x)
{
- if (!pattern_tile(c_y, c_x) && !pattern_tile(n_y, n_x))
- return TRUE;
+ feature_type *cur_f_ptr = &f_info[cave[c_y][c_x].feat];
+ feature_type *new_f_ptr = &f_info[cave[n_y][n_x].feat];
+ bool is_pattern_tile_cur = have_flag(cur_f_ptr->flags, FF_PATTERN);
+ bool is_pattern_tile_new = have_flag(new_f_ptr->flags, FF_PATTERN);
+ int pattern_type_cur, pattern_type_new;
+
+ if (!is_pattern_tile_cur && !is_pattern_tile_new) return TRUE;
+
+ 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 (cave[n_y][n_x].feat == FEAT_PATTERN_START)
+ if (pattern_type_new == PATTERN_TILE_START)
{
- if (!pattern_tile(c_y, c_x) &&
- !p_ptr->confused && !p_ptr->stun && !p_ptr->image)
+ if (!is_pattern_tile_cur && !p_ptr->confused && !p_ptr->stun && !p_ptr->image)
{
#ifdef JP
if (get_check("¥Ñ¥¿¡¼¥ó¤Î¾å¤òÊ⤻Ϥá¤ë¤È¡¢Á´¤Æ¤òÊ⤫¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¤¤¤¤¤Ç¤¹¤«¡©"))
#else
if (get_check("If you start walking the Pattern, you must walk the whole way. Ok? "))
#endif
-
return TRUE;
else
return FALSE;
else
return TRUE;
}
- else if ((cave[n_y][n_x].feat == FEAT_PATTERN_OLD) ||
- (cave[n_y][n_x].feat == FEAT_PATTERN_END) ||
- (cave[n_y][n_x].feat == FEAT_PATTERN_XTRA2))
+ else if ((pattern_type_new == PATTERN_TILE_OLD) ||
+ (pattern_type_new == PATTERN_TILE_END) ||
+ (pattern_type_new == PATTERN_TILE_WRECKED))
{
- if (pattern_tile(c_y, c_x))
+ if (is_pattern_tile_cur)
{
return TRUE;
}
return FALSE;
}
}
- else if ((cave[n_y][n_x].feat == FEAT_PATTERN_XTRA1) ||
- (cave[c_y][c_x].feat == FEAT_PATTERN_XTRA1))
+ else if ((pattern_type_new == PATTERN_TILE_TELEPORT) ||
+ (pattern_type_cur == PATTERN_TILE_TELEPORT))
{
return TRUE;
}
- else if (cave[c_y][c_x].feat == FEAT_PATTERN_START)
+ else if (pattern_type_cur == PATTERN_TILE_START)
{
- if (pattern_tile(n_y, n_x))
+ if (is_pattern_tile_new)
return TRUE;
else
{
return FALSE;
}
}
- else if ((cave[c_y][c_x].feat == FEAT_PATTERN_OLD) ||
- (cave[c_y][c_x].feat == FEAT_PATTERN_END) ||
- (cave[c_y][c_x].feat == FEAT_PATTERN_XTRA2))
+ else if ((pattern_type_cur == PATTERN_TILE_OLD) ||
+ (pattern_type_cur == PATTERN_TILE_END) ||
+ (pattern_type_cur == PATTERN_TILE_WRECKED))
{
- if (!pattern_tile(n_y, n_x))
+ if (!is_pattern_tile_new)
{
#ifdef JP
msg_print("¥Ñ¥¿¡¼¥ó¤òƧ¤ß³°¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£");
}
else
{
- if (!pattern_tile(c_y, c_x))
+ if (!is_pattern_tile_cur)
{
#ifdef JP
msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤òÊ⤯¤Ë¤Ï¥¹¥¿¡¼¥ÈÃÏÅÀ¤«¤éÊ⤻Ϥá¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£");
}
else
{
- byte ok_move = FEAT_PATTERN_START;
- switch (cave[c_y][c_x].feat)
+ byte ok_move = PATTERN_TILE_START;
+ switch (pattern_type_cur)
{
- case FEAT_PATTERN_1:
- ok_move = FEAT_PATTERN_2;
+ case PATTERN_TILE_1:
+ ok_move = PATTERN_TILE_2;
break;
- case FEAT_PATTERN_2:
- ok_move = FEAT_PATTERN_3;
+ case PATTERN_TILE_2:
+ ok_move = PATTERN_TILE_3;
break;
- case FEAT_PATTERN_3:
- ok_move = FEAT_PATTERN_4;
+ case PATTERN_TILE_3:
+ ok_move = PATTERN_TILE_4;
break;
- case FEAT_PATTERN_4:
- ok_move = FEAT_PATTERN_1;
+ case PATTERN_TILE_4:
+ ok_move = PATTERN_TILE_1;
break;
default:
if (p_ptr->wizard)
#ifdef JP
- msg_format("¤ª¤«¤·¤Ê¥Ñ¥¿¡¼¥óÊâ¹Ô¡¢%d¡£", cave[c_y][c_x].feat);
+ msg_format("¤ª¤«¤·¤Ê¥Ñ¥¿¡¼¥óÊâ¹Ô¡¢%d¡£", pattern_type_cur);
#else
- msg_format("Funny Pattern walking, %d.", cave[c_y][c_x].feat);
+ msg_format("Funny Pattern walking, %d.", pattern_type_cur);
#endif
return TRUE; /* Goof-up */
}
- if ((cave[n_y][n_x].feat == ok_move) ||
- (cave[n_y][n_x].feat == cave[c_y][c_x].feat))
+ if ((pattern_type_new == ok_move) ||
+ (pattern_type_new == pattern_type_cur))
return TRUE;
else
{
- if (!pattern_tile(n_y, n_x))
+ if (!is_pattern_tile_new)
#ifdef JP
msg_print("¥Ñ¥¿¡¼¥ó¤òƧ¤ß³°¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£");
#else
msg_print("You may not step off from the Pattern.");
#endif
-
else
#ifdef JP
msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤ÏÀµ¤·¤¤½ç½ø¤ÇÊ⤫¤Í¤Ð¤Ê¤ê¤Þ¤»¤ó¡£");
msg_print("You must walk the Pattern in correct order.");
#endif
-
return FALSE;
}
}
}
-
-bool player_can_enter(byte feature)
+bool player_can_enter(s16b feature, u16b mode)
{
- switch (feature)
- {
- 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;
+ feature_type *f_ptr = &f_info[feature];
- case FEAT_DARK_PIT:
- return p_ptr->ffall;
+ if (p_ptr->riding) return monster_can_cross_terrain(feature, &r_info[m_list[p_ptr->riding].r_idx], mode | CEM_RIDING);
- case FEAT_MOUNTAIN:
- return !dun_level && p_ptr->ffall;
+ /* Pattern */
+ if (have_flag(f_ptr->flags, FF_PATTERN))
+ {
+ if (!(mode & CEM_P_CAN_ENTER_PATTERN)) return FALSE;
}
- /* Assume okay */
+ /* "CAN" flags */
+ if (have_flag(f_ptr->flags, FF_CAN_FLY) && p_ptr->levitation) return TRUE;
+ if (have_flag(f_ptr->flags, FF_CAN_SWIM) && p_ptr->can_swim) return TRUE;
+ if (have_flag(f_ptr->flags, FF_CAN_PASS) && p_ptr->pass_wall) return TRUE;
+
+ if (!have_flag(f_ptr->flags, FF_MOVE)) return FALSE;
+
return TRUE;
}
/*
- * Get feature string which blocks your way
+ * Move the player
*/
-static cptr blocking_feat_name(byte feat)
+bool move_player_effect(int ny, int nx, u32b mpe_mode)
{
- switch (feat)
+ cave_type *c_ptr = &cave[ny][nx];
+ feature_type *f_ptr = &f_info[c_ptr->feat];
+
+ if (!(mpe_mode & MPE_STAYING))
+ {
+ int oy = py;
+ int ox = px;
+ cave_type *oc_ptr = &cave[oy][ox];
+ int om_idx = oc_ptr->m_idx;
+ int nm_idx = c_ptr->m_idx;
+
+ /* Move the player */
+ py = ny;
+ px = nx;
+
+ /* Hack -- For moving monster or riding player's moving */
+ if (!(mpe_mode & MPE_DONT_SWAP_MON))
+ {
+ /* Swap two monsters */
+ c_ptr->m_idx = om_idx;
+ oc_ptr->m_idx = nm_idx;
+
+ if (om_idx > 0) /* Monster on old spot (or p_ptr->riding) */
+ {
+ monster_type *om_ptr = &m_list[om_idx];
+ om_ptr->fy = ny;
+ om_ptr->fx = nx;
+ update_mon(om_idx, TRUE);
+ }
+
+ if (nm_idx > 0) /* Monster on new spot */
+ {
+ monster_type *nm_ptr = &m_list[nm_idx];
+ nm_ptr->fy = oy;
+ nm_ptr->fx = ox;
+ update_mon(nm_idx, TRUE);
+ }
+ }
+
+ /* Redraw old spot */
+ lite_spot(oy, ox);
+
+ /* Redraw new spot */
+ lite_spot(ny, nx);
+
+ /* 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);
+
+ /* Window stuff */
+ p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+
+ /* Remove "unsafe" flag */
+ if ((!p_ptr->blind && !no_lite()) || !is_trap(c_ptr->feat)) c_ptr->info &= ~(CAVE_UNSAFE);
+
+ /* For get everything when requested hehe I'm *NASTY* */
+ if (dun_level && (d_info[dungeon_type].flags1 & DF1_FORGET)) wiz_dark();
+
+ /* Handle stuff */
+ if (mpe_mode & MPE_HANDLE_STUFF) handle_stuff();
+
+ if (p_ptr->pclass == CLASS_NINJA)
+ {
+ if (c_ptr->info & (CAVE_GLOW)) set_superstealth(FALSE);
+ else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
+ }
+
+ 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 here.");
+#endif
+ set_action(ACTION_NONE);
+ }
+ }
+
+ if (mpe_mode & MPE_ENERGY_USE)
+ {
+ if (music_singing(MUSIC_WALL))
+ {
+ (void)project(0, 0, py, px, (60 + p_ptr->lev), GF_DISINTEGRATE,
+ PROJECT_KILL | PROJECT_ITEM, -1);
+
+ if (!player_bold(ny, nx) || p_ptr->is_dead || p_ptr->leaving) return FALSE;
+ }
+
+ /* Spontaneous Searching */
+ if ((p_ptr->skill_fos >= 50) || (0 == randint0(50 - p_ptr->skill_fos)))
+ {
+ search();
+ }
+
+ /* Continuous Searching */
+ if (p_ptr->action == ACTION_SEARCH)
+ {
+ search();
+ }
+ }
+
+ /* Handle "objects" */
+ if (!(mpe_mode & MPE_DONT_PICKUP))
+ {
+ carry((mpe_mode & MPE_DO_PICKUP) ? TRUE : FALSE);
+ }
+
+ /* Handle "store doors" */
+ if (have_flag(f_ptr->flags, FF_STORE))
+ {
+ /* Disturb */
+ disturb(0, 0);
+
+ energy_use = 0;
+ /* Hack -- Enter store */
+ command_new = SPECIAL_KEY_STORE;
+ }
+
+ /* Handle "building doors" -KMW- */
+ else if (have_flag(f_ptr->flags, FF_BLDG))
+ {
+ /* Disturb */
+ disturb(0, 0);
+
+ energy_use = 0;
+ /* Hack -- Enter building */
+ command_new = SPECIAL_KEY_BUILDING;
+ }
+
+ /* Handle quest areas -KMW- */
+ else if (have_flag(f_ptr->flags, FF_QUEST_ENTER))
+ {
+ /* Disturb */
+ disturb(0, 0);
+
+ energy_use = 0;
+ /* Hack -- Enter quest level */
+ command_new = SPECIAL_KEY_QUEST;
+ }
+
+ else if (have_flag(f_ptr->flags, FF_QUEST_EXIT))
+ {
+ if (quest[p_ptr->inside_quest].type == QUEST_TYPE_FIND_EXIT)
+ {
+ if (record_fix_quest) do_cmd_write_nikki(NIKKI_FIX_QUEST_C, p_ptr->inside_quest, NULL);
+ quest[p_ptr->inside_quest].status = QUEST_STATUS_COMPLETED;
+ quest[p_ptr->inside_quest].complev = (byte)p_ptr->lev;
+#ifdef JP
+ msg_print("¥¯¥¨¥¹¥È¤òãÀ®¤·¤¿¡ª");
+#else
+ msg_print("You accomplished your quest!");
+#endif
+
+ msg_print(NULL);
+ }
+
+ leave_quest_check();
+
+ p_ptr->inside_quest = c_ptr->special;
+ dun_level = 0;
+ p_ptr->oldpx = 0;
+ p_ptr->oldpy = 0;
+
+ p_ptr->leaving = TRUE;
+ }
+
+ /* Set off a trap */
+ else if (have_flag(f_ptr->flags, FF_HIT_TRAP) && !(mpe_mode & MPE_STAYING))
+ {
+ /* Disturb */
+ disturb(0, 0);
+
+ /* Hidden trap */
+ if (c_ptr->mimic || have_flag(f_ptr->flags, FF_SECRET))
+ {
+ /* Message */
+#ifdef JP
+ msg_print("¥È¥é¥Ã¥×¤À¡ª");
+#else
+ msg_print("You found a trap!");
+#endif
+
+ /* Pick a trap */
+ disclose_grid(py, px);
+ }
+
+ /* Hit the trap */
+ hit_trap((mpe_mode & MPE_BREAK_TRAP) ? TRUE : FALSE);
+
+ if (!player_bold(ny, nx) || p_ptr->is_dead || p_ptr->leaving) return FALSE;
+ }
+
+ /* Warn when leaving trap detected region */
+ if (!(mpe_mode & MPE_STAYING) && (disturb_trap_detect || alert_trap_detect)
+ && p_ptr->dtrap && !(c_ptr->info & CAVE_IN_DETECT))
{
+ /* No duplicate warning */
+ p_ptr->dtrap = FALSE;
+
+ /* You are just on the edge */
+ if (!(c_ptr->info & CAVE_UNSAFE))
+ {
+ if (alert_trap_detect)
+ {
#ifdef JP
- case FEAT_TREES: return "ÌÚ";
- case FEAT_MOUNTAIN: return "»³";
- default: return "ÊÉ";
+ msg_print("* Ãí°Õ:¤³¤ÎÀè¤Ï¥È¥é¥Ã¥×¤Î´¶ÃÎÈϰϳ°¤Ç¤¹¡ª *");
#else
- case FEAT_TREES: return "tree";
- case FEAT_MOUNTAIN: return "mountain";
- default: return "wall";
+ msg_print("*Leaving trap detect region!*");
#endif
+ }
+
+ if (disturb_trap_detect) disturb(0, 0);
+ }
+ }
+
+ return player_bold(ny, nx) && !p_ptr->is_dead && !p_ptr->leaving;
+}
+
+
+bool trap_can_be_ignored(int feat)
+{
+ feature_type *f_ptr = &f_info[feat];
+
+ if (!have_flag(f_ptr->flags, FF_TRAP)) return TRUE;
+
+ switch (f_ptr->subtype)
+ {
+ case TRAP_TRAPDOOR:
+ case TRAP_PIT:
+ case TRAP_SPIKED_PIT:
+ case TRAP_POISON_PIT:
+ if (p_ptr->levitation) return TRUE;
+ break;
+ case TRAP_TELEPORT:
+ if (p_ptr->anti_tele) return TRUE;
+ break;
+ case TRAP_FIRE:
+ if (p_ptr->immune_fire) return TRUE;
+ break;
+ case TRAP_ACID:
+ if (p_ptr->immune_acid) return TRUE;
+ break;
+ case TRAP_BLIND:
+ if (p_ptr->resist_blind) return TRUE;
+ break;
+ case TRAP_CONFUSE:
+ if (p_ptr->resist_conf) return TRUE;
+ break;
+ case TRAP_POISON:
+ if (p_ptr->resist_pois) return TRUE;
+ break;
+ case TRAP_SLEEP:
+ if (p_ptr->free_act) return TRUE;
+ break;
}
+
+ return FALSE;
}
/*
+ * Determine if a "boundary" grid is "floor mimic"
+ */
+#define boundary_floor(C, F, MF) \
+ ((C)->mimic && permanent_wall(F) && \
+ (have_flag((MF)->flags, FF_MOVE) || have_flag((MF)->flags, FF_CAN_FLY)) && \
+ have_flag((MF)->flags, FF_PROJECT) && \
+ !have_flag((MF)->flags, FF_OPEN))
+
+/*
* Move player in the given direction, with the given "pickup" flag.
*
* This routine should (probably) always induce energy expenditure.
* any monster which might be in the destination grid. Previously,
* moving into walls was "free" and did NOT hit invisible monsters.
*/
-void move_player(int dir, int do_pickup, bool break_trap)
+void move_player(int dir, bool do_pickup, bool break_trap)
{
- int y, x;
+ /* Find the result of moving */
+ int y = py + ddy[dir];
+ int x = px + ddx[dir];
+
+ /* Examine the destination */
+ cave_type *c_ptr = &cave[y][x];
+
+ feature_type *f_ptr = &f_info[c_ptr->feat];
- cave_type *c_ptr;
monster_type *m_ptr;
monster_type *riding_m_ptr = &m_list[p_ptr->riding];
char m_name[80];
- bool p_can_pass_walls = FALSE;
+ bool p_can_enter = player_can_enter(c_ptr->feat, CEM_P_CAN_ENTER_PATTERN);
+ bool p_can_kill_walls = FALSE;
bool stormbringer = FALSE;
bool oktomove = TRUE;
bool do_past = FALSE;
- /* Find the result of moving */
- y = py + ddy[dir];
- x = px + ddx[dir];
-
- /* Examine the destination */
- c_ptr = &cave[y][x];
-
/* Exit the area */
if (!dun_level && !p_ptr->wild_mode &&
((x == 0) || (x == MAX_WID - 1) ||
(y == 0) || (y == MAX_HGT - 1)))
{
/* Can the player enter the grid? */
- if (c_ptr->mimic && player_can_enter(c_ptr->mimic))
+ if (c_ptr->mimic && player_can_enter(c_ptr->mimic, 0))
{
/* Hack: move to new area */
if ((y == 0) && (x == 0))
ambush_flag = FALSE;
}
- /* Clear all saved floors */
- prepare_change_floor_mode(CFM_CLEAR_ALL);
-
p_ptr->leaving = TRUE;
energy_use = 100;
/* "Blocked" message appears later */
/* oktomove = FALSE; */
+ p_can_enter = FALSE;
}
/* Get the monster */
/* Player can not walk through "walls"... */
/* unless in Shadow Form */
- if (p_ptr->wraith_form || p_ptr->pass_wall || p_ptr->kabenuke)
- p_can_pass_walls = TRUE;
- if ((c_ptr->feat >= FEAT_PERM_EXTRA) && (c_ptr->feat <= FEAT_PERM_SOLID))
- {
- p_can_pass_walls = FALSE;
- }
+ 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);
/* Hack -- attack monsters */
- if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x) || p_can_pass_walls))
+ if (c_ptr->m_idx && (m_ptr->ml || p_can_enter || p_can_kill_walls))
{
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (!is_hostile(m_ptr) &&
!(p_ptr->confused || p_ptr->image || !m_ptr->ml || p_ptr->stun ||
((p_ptr->muta2 & MUT2_BERS_RAGE) && p_ptr->shero)) &&
- (pattern_seq(py, px, y, x)) &&
- ((cave_floor_bold(y, x)) || (c_ptr->feat == FEAT_TREES) || (p_can_pass_walls)))
+ 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);
- /* 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);
+ }
/* displace? */
if ((stormbringer && (randint1(1000) > 666)) || (p_ptr->pclass == CLASS_BERSERKER))
py_attack(y, x, 0);
oktomove = FALSE;
}
- else if (monster_can_cross_terrain(cave[py][px].feat, r_ptr) &&
- (cave_floor_bold(py, px) || cave[py][px].feat == FEAT_TREES ||
- (r_ptr->flags2 & RF2_PASS_WALL)))
+ else if (monster_can_cross_terrain(cave[py][px].feat, r_ptr, 0))
{
do_past = TRUE;
}
}
}
- if (!oktomove)
- {
- }
-
- else if ((c_ptr->feat == FEAT_DARK_PIT) && !p_ptr->ffall)
+ if (oktomove && p_ptr->riding)
{
+ if (riding_r_ptr->flags1 & RF1_NEVER_MOVE)
+ {
#ifdef JP
- msg_print("Îö¤±Ìܤò²£Àڤ뤳¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£");
+ msg_print("Æ°¤±¤Ê¤¤¡ª");
#else
- msg_print("You can't cross the chasm.");
+ msg_print("Can't move!");
#endif
+ energy_use = 0;
+ oktomove = FALSE;
+ disturb(0, 0);
+ }
+ else if (MON_MONFEAR(riding_m_ptr))
+ {
+ char m_name[80];
- energy_use = 0;
- running = 0;
- oktomove = FALSE;
- }
+ /* Acquire the monster name */
+ monster_desc(m_name, riding_m_ptr, 0);
- else if (c_ptr->feat == FEAT_MOUNTAIN)
- {
- if (dun_level || !p_ptr->ffall)
- {
+ /* Dump a message */
#ifdef JP
- msg_print("»³¤Ë¤ÏÅФì¤Þ¤»¤ó¡ª");
+ msg_format("%s¤¬¶²Éݤ·¤Æ¤¤¤ÆÀ©¸æ¤Ç¤¤Ê¤¤¡£", m_name);
#else
- msg_print("You can't climb the mountains!");
+ msg_format("%^s is too scared to control.", m_name);
#endif
-
- running = 0;
- energy_use = 0;
oktomove = FALSE;
+ disturb(0, 0);
}
- }
- /*
- * Player can move through trees and
- * has effective -10 speed
- * Rangers can move without penality
- */
- else if (c_ptr->feat == FEAT_TREES)
- {
- oktomove = TRUE;
- if ((p_ptr->pclass != CLASS_RANGER) && !p_ptr->ffall) energy_use *= 2;
- }
-
- else if ((c_ptr->feat >= FEAT_QUEST_ENTER) &&
- (c_ptr->feat <= FEAT_QUEST_EXIT))
- {
- oktomove = TRUE;
- }
-
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
- /* Disarm a visible trap */
- else if ((do_pickup != easy_disarm) && is_known_trap(c_ptr))
- {
- bool ignore = FALSE;
- switch (c_ptr->feat)
+ else if (p_ptr->riding_ryoute)
{
- case FEAT_TRAP_TRAPDOOR:
- case FEAT_TRAP_PIT:
- case FEAT_TRAP_SPIKED_PIT:
- case FEAT_TRAP_POISON_PIT:
- if (p_ptr->ffall) ignore = TRUE;
- break;
- case FEAT_TRAP_TELEPORT:
- if (p_ptr->anti_tele) ignore = TRUE;
- break;
- case FEAT_TRAP_FIRE:
- if (p_ptr->immune_fire) ignore = TRUE;
- break;
- case FEAT_TRAP_ACID:
- if (p_ptr->immune_acid) ignore = TRUE;
- break;
- case FEAT_TRAP_BLIND:
- if (p_ptr->resist_blind) ignore = TRUE;
- break;
- case FEAT_TRAP_CONFUSE:
- if (p_ptr->resist_conf) ignore = TRUE;
- break;
- case FEAT_TRAP_POISON:
- if (p_ptr->resist_pois) ignore = TRUE;
- break;
- case FEAT_TRAP_SLEEP:
- if (p_ptr->free_act) ignore = TRUE;
- break;
+ oktomove = FALSE;
+ disturb(0, 0);
}
-
- if (!ignore)
+ else if (have_flag(f_ptr->flags, FF_CAN_FLY) && (riding_r_ptr->flags7 & RF7_CAN_FLY))
{
- (void)do_cmd_disarm_aux(y, x, dir);
- return;
+ /* Allow moving */
}
- }
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
- else if (p_ptr->riding && (riding_r_ptr->flags1 & RF1_NEVER_MOVE))
- {
+ else if (have_flag(f_ptr->flags, FF_CAN_SWIM) && (riding_r_ptr->flags7 & RF7_CAN_SWIM))
+ {
+ /* Allow moving */
+ }
+ else if (have_flag(f_ptr->flags, FF_WATER) &&
+ !(riding_r_ptr->flags7 & RF7_AQUATIC) &&
+ (have_flag(f_ptr->flags, FF_DEEP) || (riding_r_ptr->flags2 & RF2_AURA_FIRE)))
+ {
#ifdef JP
- msg_print("Æ°¤±¤Ê¤¤¡ª");
+ msg_format("%s¤Î¾å¤Ë¹Ô¤±¤Ê¤¤¡£", f_name + f_info[get_feat_mimic(c_ptr)].name);
#else
- msg_print("Can't move!");
+ msg_print("Can't swim.");
#endif
- energy_use = 0;
- oktomove = FALSE;
- disturb(0, 0);
- }
-
- else if (p_ptr->riding && riding_m_ptr->monfear)
- {
- char m_name[80];
-
- /* Acquire the monster name */
- monster_desc(m_name, riding_m_ptr, 0);
-
- /* Dump a message */
+ energy_use = 0;
+ oktomove = FALSE;
+ disturb(0, 0);
+ }
+ else if (!have_flag(f_ptr->flags, FF_WATER) && (riding_r_ptr->flags7 & RF7_AQUATIC))
+ {
#ifdef JP
- msg_format("%s¤¬¶²Éݤ·¤Æ¤¤¤ÆÀ©¸æ¤Ç¤¤Ê¤¤¡£", m_name);
+ msg_format("%s¤«¤é¾å¤¬¤ì¤Ê¤¤¡£", f_name + f_info[get_feat_mimic(&cave[py][px])].name);
#else
- msg_format("%^s is too scared to control.", m_name);
+ msg_print("Can't land.");
#endif
- oktomove = FALSE;
- disturb(0, 0);
- }
-
- else if (p_ptr->riding && p_ptr->riding_ryoute)
- {
- oktomove = FALSE;
- disturb(0, 0);
- }
-
- else if ((p_ptr->riding && (riding_r_ptr->flags7 & RF7_AQUATIC)) && (c_ptr->feat != FEAT_SHAL_WATER) && (c_ptr->feat != FEAT_DEEP_WATER))
- {
+ energy_use = 0;
+ oktomove = FALSE;
+ disturb(0, 0);
+ }
+ else if (have_flag(f_ptr->flags, FF_LAVA) && !(riding_r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK))
+ {
#ifdef JP
- msg_print("Φ¾å¤Ë¾å¤¬¤ì¤Ê¤¤¡£");
+ msg_format("%s¤Î¾å¤Ë¹Ô¤±¤Ê¤¤¡£", f_name + f_info[get_feat_mimic(c_ptr)].name);
#else
- msg_print("Can't land.");
+ msg_print("Too hot to go through.");
#endif
- energy_use = 0;
- oktomove = FALSE;
- disturb(0, 0);
- }
+ energy_use = 0;
+ oktomove = FALSE;
+ disturb(0, 0);
+ }
- else if ((p_ptr->riding && !(riding_r_ptr->flags7 & (RF7_AQUATIC | RF7_CAN_SWIM | RF7_CAN_FLY))) && (c_ptr->feat == FEAT_DEEP_WATER))
- {
+ if (oktomove && MON_STUNNED(riding_m_ptr) && one_in_(2))
+ {
+ char m_name[80];
+ monster_desc(m_name, riding_m_ptr, 0);
#ifdef JP
- msg_print("¿å¾å¤Ë¹Ô¤±¤Ê¤¤¡£");
+ msg_format("%s¤¬Û¯Û°¤È¤·¤Æ¤¤¤Æ¤¦¤Þ¤¯Æ°¤±¤Ê¤¤¡ª",m_name);
#else
- msg_print("Can't swim.");
+ msg_format("You cannot control stunned %s!",m_name);
#endif
- energy_use = 0;
- oktomove = FALSE;
- disturb(0, 0);
+ oktomove = FALSE;
+ disturb(0, 0);
+ }
}
- else if ((p_ptr->riding && (riding_r_ptr->flags2 & RF2_AURA_FIRE) && !(riding_r_ptr->flags7 & RF7_CAN_FLY)) && (c_ptr->feat == FEAT_SHAL_WATER))
+ if (!oktomove)
{
-#ifdef JP
- msg_print("¿å¾å¤Ë¹Ô¤±¤Ê¤¤¡£");
-#else
- msg_print("Can't swim.");
-#endif
- energy_use = 0;
- oktomove = FALSE;
- disturb(0, 0);
}
- else if ((p_ptr->riding && !(riding_r_ptr->flags7 & RF7_CAN_FLY) && !(riding_r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK)) && ((c_ptr->feat == FEAT_SHAL_LAVA) || (c_ptr->feat == FEAT_DEEP_LAVA)))
+ else if (!have_flag(f_ptr->flags, FF_MOVE) && have_flag(f_ptr->flags, FF_CAN_FLY) && !p_ptr->levitation)
{
#ifdef JP
- msg_print("ÍÏ´ä¤Î¾å¤Ë¹Ô¤±¤Ê¤¤¡£");
+ msg_format("¶õ¤òÈô¤Ð¤Ê¤¤¤È%s¤Î¾å¤Ë¤Ï¹Ô¤±¤Ê¤¤¡£", f_name + f_info[get_feat_mimic(c_ptr)].name);
#else
- msg_print("Too hot to go through.");
+ msg_format("You need to fly to go through the %s.", f_name + f_info[get_feat_mimic(c_ptr)].name);
#endif
+
energy_use = 0;
+ running = 0;
oktomove = FALSE;
- disturb(0, 0);
}
- else if (p_ptr->riding && riding_m_ptr->stunned && one_in_(2))
+ /*
+ * Player can move through trees and
+ * has effective -10 speed
+ * Rangers can move without penality
+ */
+ else if (have_flag(f_ptr->flags, FF_TREE) && !p_can_kill_walls)
{
- char m_name[80];
- monster_desc(m_name, riding_m_ptr, 0);
-#ifdef JP
- msg_format("%s¤¬Û¯Û°¤È¤·¤Æ¤¤¤Æ¤¦¤Þ¤¯Æ°¤±¤Ê¤¤¡ª",m_name);
-#else
- msg_format("You cannot control stunned %s!",m_name);
-#endif
- oktomove = FALSE;
- disturb(0, 0);
+ if ((p_ptr->pclass != CLASS_RANGER) && !p_ptr->levitation && (!p_ptr->riding || !(riding_r_ptr->flags8 & RF8_WILD_WOOD))) energy_use *= 2;
}
- /* Player can not walk through "walls" unless in wraith form...*/
- else if ((!cave_floor_bold(y, x)) &&
- (!p_can_pass_walls))
+#ifdef ALLOW_EASY_DISARM /* TNB */
+
+ /* Disarm a visible trap */
+ else if ((do_pickup != easy_disarm) && have_flag(f_ptr->flags, FF_DISARM) && !c_ptr->mimic)
{
- byte feat;
+ if (!trap_can_be_ignored(c_ptr->feat))
+ {
+ (void)do_cmd_disarm_aux(y, x, dir);
+ return;
+ }
+ }
- oktomove = FALSE;
+#endif /* ALLOW_EASY_DISARM -- TNB */
+ /* Player can not walk through "walls" unless in wraith form...*/
+ else if (!p_can_enter && !p_can_kill_walls)
+ {
/* Feature code (applying "mimic" field) */
- feat = f_info[c_ptr->mimic ? c_ptr->mimic : c_ptr->feat].mimic;
+ s16b feat = get_feat_mimic(c_ptr);
+ feature_type *mimic_f_ptr = &f_info[feat];
+ cptr name = f_name + mimic_f_ptr->name;
+
+ oktomove = FALSE;
/* Disturb the player */
disturb(0, 0);
/* Notice things in the dark */
- if ((!(c_ptr->info & (CAVE_MARK))) &&
- (p_ptr->blind || !(c_ptr->info & (CAVE_LITE))))
+ if (!(c_ptr->info & CAVE_MARK) && !player_can_see_bold(y, x))
{
- /* Rubble */
- if (feat == FEAT_RUBBLE)
- {
-#ifdef JP
- msg_print("´äÀФ¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¤è¤¦¤À¡£");
-#else
- msg_print("You feel some rubble blocking your way.");
-#endif
-
- c_ptr->info |= (CAVE_MARK);
- lite_spot(y, x);
- }
-
- /* Closed door */
- else if (is_closed_door(feat))
- {
-#ifdef JP
- msg_print("¥É¥¢¤¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¤è¤¦¤À¡£");
-#else
- msg_print("You feel a closed door blocking your way.");
-#endif
-
- c_ptr->info |= (CAVE_MARK);
- lite_spot(y, x);
- }
-
/* Boundary floor mimic */
- else if (boundary_floor_grid(c_ptr))
+ if (boundary_floor(c_ptr, f_ptr, mimic_f_ptr))
{
#ifdef JP
msg_print("¤½¤ì°Ê¾åÀè¤Ë¤Ï¿Ê¤á¤Ê¤¤¤è¤¦¤À¡£");
else
{
#ifdef JP
- msg_format("%s¤¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¤è¤¦¤À¡£", blocking_feat_name(feat));
+ msg_format("%s¤¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¤è¤¦¤À¡£", name);
#else
- msg_format("You feel a %s blocking your way.", blocking_feat_name(feat));
+ msg_format("You feel %s %s blocking your way.",
+ is_a_vowel(name[0]) ? "an" : "a", name);
#endif
c_ptr->info |= (CAVE_MARK);
/* Notice things */
else
{
- /* Rubble */
- if (feat == FEAT_RUBBLE)
- {
-#ifdef JP
- msg_print("´äÀФ¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¡£");
-#else
- msg_print("There is rubble blocking your way.");
-#endif
-
- if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
- energy_use = 0;
-
- /*
- * Well, it makes sense that you lose time bumping into
- * a wall _if_ you are confused, stunned or blind; but
- * typing mistakes should not cost you a turn...
- */
- }
- /* Closed doors */
- else if (is_closed_door(feat))
- {
-#ifdef ALLOW_EASY_OPEN
-
- if (easy_open && easy_open_door(y, x)) return;
-
-#endif /* ALLOW_EASY_OPEN */
-
-#ifdef JP
- msg_print("¥É¥¢¤¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¡£");
-#else
- msg_print("There is a closed door blocking your way.");
-#endif
-
- if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
- energy_use = 0;
- }
-
/* Boundary floor mimic */
- else if (boundary_floor_grid(c_ptr))
+ if (boundary_floor(c_ptr, f_ptr, mimic_f_ptr))
{
#ifdef JP
msg_print("¤½¤ì°Ê¾åÀè¤Ë¤Ï¿Ê¤á¤Ê¤¤¡£");
/* Wall (or secret door) */
else
{
+#ifdef ALLOW_EASY_OPEN
+ /* Closed doors */
+ if (easy_open && is_closed_door(feat) && easy_open_door(y, x)) return;
+#endif /* ALLOW_EASY_OPEN */
+
#ifdef JP
- msg_format("%s¤¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¡£", blocking_feat_name(feat));
+ msg_format("%s¤¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¡£", name);
#else
- msg_format("There is a %s blocking your way.", blocking_feat_name(feat));
+ msg_format("There is %s %s blocking your way.",
+ is_a_vowel(name[0]) ? "an" : "a", name);
#endif
+ /*
+ * Well, it makes sense that you lose time bumping into
+ * a wall _if_ you are confused, stunned or blind; but
+ * typing mistakes should not cost you a turn...
+ */
if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
energy_use = 0;
}
}
/* Sound */
- if (!boundary_floor_grid(c_ptr)) sound(SOUND_HITWALL);
+ if (!boundary_floor(c_ptr, f_ptr, mimic_f_ptr)) sound(SOUND_HITWALL);
}
/* Normal movement */
- if (!pattern_seq(py, px, y, x))
+ if (oktomove && !pattern_seq(py, px, y, x))
{
if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
{
/* Normal movement */
if (oktomove)
{
- int oy, ox;
+ u32b mpe_mode = MPE_ENERGY_USE;
if (p_ptr->warning)
{
- if(!process_warning(x, y))
+ if (!process_warning(x, y))
{
energy_use = 25;
return;
}
}
- /* Hack -- For moving monster or riding player's moving */
- cave[py][px].m_idx = c_ptr->m_idx;
- c_ptr->m_idx = 0;
-
if (do_past)
{
#ifdef JP
#else
msg_format("You push past %s.", m_name);
#endif
-
- m_ptr->fy = py;
- m_ptr->fx = px;
- update_mon(cave[py][px].m_idx, TRUE);
}
/* Change oldpx and oldpy to place the player well when going back to big mode */
if (p_ptr->wild_mode)
{
- if(ddy[dir] > 0) p_ptr->oldpy = 1;
- if(ddy[dir] < 0) p_ptr->oldpy = MAX_HGT - 2;
- if(ddy[dir] == 0) p_ptr->oldpy = MAX_HGT / 2;
- if(ddx[dir] > 0) p_ptr->oldpx = 1;
- if(ddx[dir] < 0) p_ptr->oldpx = MAX_WID - 2;
- if(ddx[dir] == 0) p_ptr->oldpx = MAX_WID / 2;
- }
-
- /* Save old location */
- oy = py;
- ox = px;
-
- /* Move the player */
- py = y;
- px = x;
-
- if (p_ptr->riding && (riding_r_ptr->flags2 & RF2_KILL_WALL))
- {
- if (cave[py][px].feat >= FEAT_RUBBLE && cave[py][px].feat < FEAT_PERM_SOLID)
- {
- /* Forget the wall */
- cave[py][px].info &= ~(CAVE_MARK);
-
- /* Notice */
- cave_set_feat(py, px, floor_type[randint0(100)]);
- }
+ if (ddy[dir] > 0) p_ptr->oldpy = 1;
+ if (ddy[dir] < 0) p_ptr->oldpy = MAX_HGT - 2;
+ if (ddy[dir] == 0) p_ptr->oldpy = MAX_HGT / 2;
+ if (ddx[dir] > 0) p_ptr->oldpx = 1;
+ if (ddx[dir] < 0) p_ptr->oldpx = MAX_WID - 2;
+ if (ddx[dir] == 0) p_ptr->oldpx = MAX_WID / 2;
}
- if (music_singing(MUSIC_WALL))
- {
- project(0, 0, py, px,
- (60 + p_ptr->lev), GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM, -1);
- }
- else if (p_ptr->kill_wall)
+ if (p_can_kill_walls)
{
- if (cave_valid_bold(py, px) &&
- (cave[py][px].feat < FEAT_PATTERN_START ||
- cave[py][px].feat > FEAT_PATTERN_XTRA2) &&
- (cave[py][px].feat < FEAT_DEEP_WATER ||
- cave[py][px].feat > FEAT_GRASS))
- {
- if (cave[py][px].feat == FEAT_TREES)
- cave_set_feat(py, px, FEAT_GRASS);
- else
- cave_set_feat(py, px, floor_type[randint0(100)]);
- }
+ cave_alter_feat(y, x, FF_HURT_DISI);
/* Update some things -- similar to GF_KILL_WALL */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
+ p_ptr->update |= (PU_FLOW);
}
- /* Remove "unsafe" flag */
- if ((!p_ptr->blind && !no_lite()) || !is_trap(c_ptr->feat)) c_ptr->info &= ~(CAVE_UNSAFE);
-
- if (p_ptr->riding)
- {
- riding_m_ptr->fy = py;
- riding_m_ptr->fx = px;
- cave[py][px].m_idx = p_ptr->riding;
- update_mon(p_ptr->riding, TRUE);
- }
-
- /* Redraw new spot */
- lite_spot(py, px);
-
- /* Redraw old spot */
- lite_spot(oy, ox);
-
/* Sound */
/* sound(SOUND_WALK); */
- /* Check for new panel (redraw map) */
- verify_panel();
-
- /* For get everything when requested hehe I'm *NASTY* */
- if (dun_level && (d_info[dungeon_type].flags1 & DF1_FORGET))
- {
- wiz_dark();
- }
-
- if ((p_ptr->pclass == CLASS_NINJA))
- {
- if (c_ptr->info & (CAVE_GLOW)) set_superstealth(FALSE);
- else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
- }
- if ((p_ptr->action == ACTION_HAYAGAKE) && !cave_floor_bold(py, px))
- {
-#ifdef JP
- msg_print("¤³¤³¤Ç¤ÏÁÇÁ᤯ư¤±¤Ê¤¤¡£");
-#else
- msg_print("You cannot run in wall.");
-#endif
- set_action(ACTION_NONE);
- }
-
- /* Update stuff */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
-
- /* Update the monsters */
- p_ptr->update |= (PU_DISTANCE);
-
- /* Window stuff */
- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
-
- /* Spontaneous Searching */
- if ((p_ptr->skill_fos >= 50) ||
- (0 == randint0(50 - p_ptr->skill_fos)))
- {
- search();
- }
-
- /* Continuous Searching */
- if (p_ptr->action == ACTION_SEARCH)
- {
- search();
- }
-
- /* Handle "objects" */
-
#ifdef ALLOW_EASY_DISARM /* TNB */
- carry(do_pickup != always_pickup);
+ if (do_pickup != always_pickup) mpe_mode |= MPE_DO_PICKUP;
#else /* ALLOW_EASY_DISARM -- TNB */
- carry(do_pickup);
+ if (do_pickup) mpe_mode |= MPE_DO_PICKUP;
#endif /* ALLOW_EASY_DISARM -- TNB */
- /* Handle "store doors" */
- if (((c_ptr->feat >= FEAT_SHOP_HEAD) &&
- (c_ptr->feat <= FEAT_SHOP_TAIL)) ||
- (c_ptr->feat == FEAT_MUSEUM))
- {
- /* Disturb */
- disturb(0, 0);
-
- energy_use = 0;
- /* Hack -- Enter store */
- command_new = SPECIAL_KEY_STORE;
- }
-
- /* Handle "building doors" -KMW- */
- else if ((c_ptr->feat >= FEAT_BLDG_HEAD) &&
- (c_ptr->feat <= FEAT_BLDG_TAIL))
- {
- /* Disturb */
- disturb(0, 0);
-
- energy_use = 0;
- /* Hack -- Enter building */
- command_new = SPECIAL_KEY_BUILDING;
- }
-
- /* Handle quest areas -KMW- */
- else if (c_ptr->feat == FEAT_QUEST_ENTER)
- {
- /* Disturb */
- disturb(0, 0);
-
- energy_use = 0;
- /* Hack -- Enter quest level */
- command_new = SPECIAL_KEY_QUEST;
- }
-
- else if (c_ptr->feat == FEAT_QUEST_EXIT)
- {
- if (quest[p_ptr->inside_quest].type == QUEST_TYPE_FIND_EXIT)
- {
- if (record_fix_quest) do_cmd_write_nikki(NIKKI_FIX_QUEST_C, p_ptr->inside_quest, NULL);
- quest[p_ptr->inside_quest].status = QUEST_STATUS_COMPLETED;
- quest[p_ptr->inside_quest].complev = (byte)p_ptr->lev;
-#ifdef JP
- msg_print("¥¯¥¨¥¹¥È¤òãÀ®¤·¤¿¡ª");
-#else
- msg_print("You accomplished your quest!");
-#endif
-
- msg_print(NULL);
- }
-
- leave_quest_check();
-
- p_ptr->inside_quest = c_ptr->special;
- dun_level = 0;
- p_ptr->oldpx = 0;
- p_ptr->oldpy = 0;
-
- /* Clear all saved floors */
- prepare_change_floor_mode(CFM_CLEAR_ALL);
-
- p_ptr->leaving = TRUE;
- }
+ if (break_trap) mpe_mode |= MPE_BREAK_TRAP;
- /* Set off a trap */
- else if (is_trap(c_ptr->feat))
- {
- /* Disturb */
- disturb(0, 0);
-
- /* Hidden trap */
- if (c_ptr->mimic)
- {
- /* Message */
-#ifdef JP
- msg_print("¥È¥é¥Ã¥×¤À¡ª");
-#else
- msg_print("You found a trap!");
-#endif
-
- /* Pick a trap */
- disclose_grid(py, px);
- }
-
- /* Hit the trap */
- hit_trap(break_trap);
- }
-
- /* Warn when leaving trap detected region */
- if ((disturb_trap_detect || alert_trap_detect)
- && p_ptr->dtrap && !(cave[py][px].info & CAVE_IN_DETECT))
- {
- /* No duplicate warning */
- p_ptr->dtrap = FALSE;
-
- /* You are just on the edge */
- if (!(cave[py][px].info & CAVE_UNSAFE))
- {
- if (alert_trap_detect)
- {
-#ifdef JP
- msg_print("* Ãí°Õ:¤³¤ÎÀè¤Ï¥È¥é¥Ã¥×¤Î´¶ÃÎÈϰϳ°¤Ç¤¹¡ª *");
-#else
- msg_print("*Leaving trap detect region!*");
-#endif
- }
-
- if (disturb_trap_detect)
- {
- disturb(0, 0);
- }
- }
- }
+ /* Move the player */
+ (void)move_player_effect(y, x, mpe_mode);
}
}
+static bool ignore_avoid_run;
+
/*
* Hack -- Check for a "known wall" (see below)
*/
static int see_wall(int dir, int y, int x)
{
cave_type *c_ptr;
- byte feat;
/* Get the new location */
y += ddy[dir];
/* Access grid */
c_ptr = &cave[y][x];
- /* Feature code (applying "mimic" field) */
- feat = f_info[c_ptr->mimic ? c_ptr->mimic : c_ptr->feat].mimic;
-
/* Must be known to the player */
if (c_ptr->info & (CAVE_MARK))
{
- /* Rubble, Magma, Quartz, Wall, Perm wall */
- if (feat >= FEAT_RUBBLE && feat <= FEAT_PERM_SOLID) return TRUE;
+ /* Feature code (applying "mimic" field) */
+ s16b feat = get_feat_mimic(c_ptr);
+ feature_type *f_ptr = &f_info[feat];
- /* Tree */
- if (feat == FEAT_TREES) return TRUE;
+ /* Wall grids are known walls */
+ if (!player_can_enter(feat, 0)) return !have_flag(f_ptr->flags, FF_DOOR);
+
+ /* Don't run on a tree unless explicitly requested */
+ if (have_flag(f_ptr->flags, FF_AVOID_RUN) && !ignore_avoid_run)
+ return TRUE;
- /* Mountain */
- if (feat == FEAT_MOUNTAIN) return TRUE;
+ /* Don't run in a wall */
+ if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY))
+ return !have_flag(f_ptr->flags, FF_DOOR);
}
return FALSE;
/* Memorized grids are always known */
if (cave[y][x].info & (CAVE_MARK)) return (FALSE);
- /* Non-floor grids are unknown */
- if (!cave_floor_bold(y, x)) return (TRUE);
-
/* Viewable door/wall grids are known */
if (player_can_see_bold(y, x)) return (FALSE);
row = py + ddy[dir];
col = px + ddx[dir];
+ ignore_avoid_run = cave_have_flag_bold(row, col, FF_AVOID_RUN);
+
/* Extract cycle index */
i = chome[dir];
int i, max, inv;
int option = 0, option2 = 0;
cave_type *c_ptr;
- byte feat;
+ s16b feat;
+ feature_type *f_ptr;
/* Where we came from */
prev_dir = find_prevdir;
{
s16b this_o_idx, next_o_idx = 0;
-
/* New direction */
new_dir = cycle[chome[prev_dir] + i];
c_ptr = &cave[row][col];
/* Feature code (applying "mimic" field) */
- feat = f_info[c_ptr->mimic ? c_ptr->mimic : c_ptr->feat].mimic;
+ feat = get_feat_mimic(c_ptr);
+ f_ptr = &f_info[feat];
/* Visible monsters abort running */
if (c_ptr->m_idx)
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 */
inv = TRUE;
/* Check memorized grids */
if (c_ptr->info & (CAVE_MARK))
{
- bool notice = TRUE;
-
- /* Examine the terrain */
- switch (feat)
- {
- /* Floors */
- case FEAT_FLOOR:
-
- /* Invis traps */
- case FEAT_INVIS:
-
- /* Normal veins */
- case FEAT_MAGMA:
- case FEAT_QUARTZ:
-
- /* Hidden treasure */
- case FEAT_MAGMA_H:
- case FEAT_QUARTZ_H:
-
- /* Known treasure (almost uninteresting) */
- case FEAT_MAGMA_K:
- case FEAT_QUARTZ_K:
-
- /* Walls */
- case FEAT_RUBBLE:
- case FEAT_WALL_EXTRA:
- case FEAT_WALL_INNER:
- case FEAT_WALL_OUTER:
- case FEAT_WALL_SOLID:
- case FEAT_PERM_EXTRA:
- case FEAT_PERM_INNER:
- case FEAT_PERM_OUTER:
- case FEAT_PERM_SOLID:
- /* dirt, grass, trees, ... */
- case FEAT_SHAL_WATER:
- case FEAT_DIRT:
- case FEAT_GRASS:
- case FEAT_DEEP_GRASS:
- case FEAT_FLOWER:
- case FEAT_DARK_PIT:
- case FEAT_TREES:
- case FEAT_MOUNTAIN:
+ bool notice = have_flag(f_ptr->flags, FF_NOTICE);
+
+ if (notice && have_flag(f_ptr->flags, FF_MOVE))
+ {
+ /* Open doors */
+ if (find_ignore_doors && have_flag(f_ptr->flags, FF_DOOR) && have_flag(f_ptr->flags, FF_CLOSE))
{
- /* Ignore */
+ /* Option -- ignore */
notice = FALSE;
-
- /* Done */
- break;
}
- /* quest features */
- case FEAT_QUEST_ENTER:
- case FEAT_QUEST_EXIT:
+ /* Stairs */
+ else if (find_ignore_stairs && have_flag(f_ptr->flags, FF_STAIRS))
{
- /* Notice */
- notice = TRUE;
-
- /* Done */
- break;
+ /* Option -- ignore */
+ notice = FALSE;
}
- case FEAT_DEEP_LAVA:
- case FEAT_SHAL_LAVA:
+ /* Lava */
+ else if (have_flag(f_ptr->flags, FF_LAVA) && (p_ptr->immune_fire || IS_INVULN()))
{
/* Ignore */
- if (IS_INVULN() || p_ptr->immune_fire) notice = FALSE;
-
- /* Done */
- break;
+ notice = FALSE;
}
- case FEAT_DEEP_WATER:
+ /* 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 <= weight_limit())))
{
/* Ignore */
- if (p_ptr->ffall || p_ptr->total_weight<= (((u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]]*(p_ptr->pclass == CLASS_BERSERKER ? 150 : 100))/2)) notice = FALSE;
-
- /* Done */
- break;
- }
-
- /* Open doors */
- case FEAT_OPEN:
- case FEAT_BROKEN:
- {
- /* Option -- ignore */
- if (find_ignore_doors) notice = FALSE;
-
- /* Done */
- break;
- }
-
- /* Stairs */
- case FEAT_LESS:
- case FEAT_MORE:
- case FEAT_LESS_LESS:
- case FEAT_MORE_MORE:
- case FEAT_ENTRANCE:
- {
- /* Option -- ignore */
- if (find_ignore_stairs) notice = FALSE;
-
- /* Done */
- break;
+ notice = FALSE;
}
}
}
/* Analyze unknown grids and floors considering mimic */
- if (inv || feat_floor(feat))
+ if (inv || !see_wall(0, row, col))
{
/* Looking for open area */
if (find_openarea)
}
}
-
/* Looking for open area */
if (find_openarea)
{
/* Hack -- look again */
for (i = -max; i < 0; i++)
{
- new_dir = cycle[chome[prev_dir] + i];
-
- row = py + ddy[new_dir];
- col = px + ddx[new_dir];
-
- /* Access grid */
- c_ptr = &cave[row][col];
-
- /* Feature code (applying "mimic" field) */
- feat = f_info[c_ptr->mimic ? c_ptr->mimic : c_ptr->feat].mimic;
-
- /* Unknown grid or non-wall XXX XXX XXX cave_floor_grid(c_ptr)) */
- if (!(c_ptr->info & (CAVE_MARK)) ||
- ((feat <= FEAT_DOOR_TAIL) ||
- (feat == FEAT_FLOWER) ||
- (feat == FEAT_DEEP_GRASS) ||
- ((feat >= FEAT_DEEP_WATER) &&
- (feat <= FEAT_GRASS))))
-
+ /* Unknown grid or non-wall */
+ if (!see_wall(cycle[chome[prev_dir] + i], py, px))
{
/* Looking to break right */
if (find_breakright)
/* Hack -- look again */
for (i = max; i > 0; i--)
{
- new_dir = cycle[chome[prev_dir] + i];
-
- row = py + ddy[new_dir];
- col = px + ddx[new_dir];
-
- /* Access grid */
- c_ptr = &cave[row][col];
-
- /* Feature code (applying "mimic" field) */
- feat = f_info[c_ptr->mimic ? c_ptr->mimic : c_ptr->feat].mimic;
-
- /* Unknown grid or non-wall XXX XXX XXX cave_floor_grid(c_ptr)) */
- if (!(c_ptr->info & (CAVE_MARK)) ||
- ((feat <= FEAT_DOOR_TAIL) ||
- (feat == FEAT_FLOWER) ||
- (feat == FEAT_DEEP_GRASS) ||
- ((feat >= FEAT_DEEP_WATER) &&
- (feat <= FEAT_GRASS))))
-
+ /* Unknown grid or non-wall */
+ if (!see_wall(cycle[chome[prev_dir] + i], py, px))
{
/* Looking to break left */
if (find_breakleft)
}
}
-
/* Not looking for open area */
else
{
}
}
-
/* About to hit a known wall, stop */
if (see_wall(find_current, py, px))
{
return (TRUE);
}
-
/* Failure */
return (FALSE);
}
/* Start running */
if (dir)
{
- cave_type *c_ptr;
- byte feat;
-
- /* Access grid */
- c_ptr = &cave[py+ddy[dir]][px+ddx[dir]];
-
- /* Feature code (applying "mimic" field) */
- feat = f_info[c_ptr->mimic ? c_ptr->mimic : c_ptr->feat].mimic;
+ /* Ignore AVOID_RUN on a first step */
+ ignore_avoid_run = TRUE;
/* Hack -- do not start silly run */
- if (see_wall(dir, py, px) &&
- (feat != FEAT_TREES))
+ if (see_wall(dir, py, px))
{
/* Message */
#ifdef JP
- msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¹Ô¤±¤Þ¤»¤ó¡£");
+ msg_print("¤½¤ÎÊý¸þ¤Ë¤ÏÁö¤ì¤Þ¤»¤ó¡£");
#else
msg_print("You cannot run in that direction.");
#endif
-
/* Disturb */
disturb(0, 0);