#endif
int msex = 0;
- int speed = (ironman_nightmare) ? r_ptr->speed + 5 : r_ptr->speed;
+ bool nightmare = ironman_nightmare && !(mode & 0x02);
+ int speed = nightmare ? r_ptr->speed + 5 : r_ptr->speed;
bool breath = FALSE;
bool magic = FALSE;
#ifdef JP
if (flags2 & RF2_HUMAN) hook_c_roff(TERM_L_WHITE, "¿Í´Ö");
#else
- if (flags2 & RF2_HUMAN) hook_c_roff(TERM_L_WHITE, " Human");
+ if (flags2 & RF2_HUMAN) hook_c_roff(TERM_L_WHITE, " human");
#endif
#ifdef JP
if ((flags2 & RF2_AURA_FIRE) && (flags2 & RF2_AURA_ELEC) && (flags3 & RF3_AURA_COLD))
{
#ifdef JP
-hook_c_roff(TERM_VIOLET, format("%^s¤Ï±ê¤Èɹ¤È¥¹¥Ñ¡¼¥¯¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
+ hook_c_roff(TERM_VIOLET, format("%^s¤Ï±ê¤Èɹ¤È¥¹¥Ñ¡¼¥¯¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
#else
- hook_c_roff(TERM_VIOLET, format("%^s is surrounded by flames and electricity. ", wd_he[msex]));
+ hook_c_roff(TERM_VIOLET, format("%^s is surrounded by flames, ice and electricity. ", wd_he[msex]));
#endif
-
}
else if ((flags2 & RF2_AURA_FIRE) && (flags2 & RF2_AURA_ELEC))
{
#ifdef JP
-hook_c_roff(TERM_L_RED, format("%^s¤Ï±ê¤È¥¹¥Ñ¡¼¥¯¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
+ hook_c_roff(TERM_L_RED, format("%^s¤Ï±ê¤È¥¹¥Ñ¡¼¥¯¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
#else
hook_c_roff(TERM_L_RED, format("%^s is surrounded by flames and electricity. ", wd_he[msex]));
#endif
-
}
else if ((flags2 & RF2_AURA_FIRE) && (flags3 & RF3_AURA_COLD))
{
#ifdef JP
-hook_c_roff(TERM_BLUE, format("%^s¤Ï±ê¤Èɹ¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
+ hook_c_roff(TERM_BLUE, format("%^s¤Ï±ê¤Èɹ¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
#else
- hook_c_roff(TERM_BLUE, format("%^s is surrounded by flames and electricity. ", wd_he[msex]));
+ hook_c_roff(TERM_BLUE, format("%^s is surrounded by flames and ice. ", wd_he[msex]));
#endif
-
}
else if ((flags3 & RF3_AURA_COLD) && (flags2 & RF2_AURA_ELEC))
{
#ifdef JP
-hook_c_roff(TERM_L_GREEN, format("%^s¤Ïɹ¤È¥¹¥Ñ¡¼¥¯¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
+ hook_c_roff(TERM_L_GREEN, format("%^s¤Ïɹ¤È¥¹¥Ñ¡¼¥¯¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
#else
hook_c_roff(TERM_L_GREEN, format("%^s is surrounded by ice and electricity. ", wd_he[msex]));
#endif
-
}
else if (flags2 & RF2_AURA_FIRE)
{
#ifdef JP
-hook_c_roff(TERM_RED, format("%^s¤Ï±ê¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
+ hook_c_roff(TERM_RED, format("%^s¤Ï±ê¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
#else
hook_c_roff(TERM_RED, format("%^s is surrounded by flames. ", wd_he[msex]));
#endif
-
}
else if (flags3 & RF3_AURA_COLD)
{
#ifdef JP
-hook_c_roff(TERM_BLUE, format("%^s¤Ïɹ¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
+ hook_c_roff(TERM_BLUE, format("%^s¤Ïɹ¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
#else
hook_c_roff(TERM_BLUE, format("%^s is surrounded by ice. ", wd_he[msex]));
#endif
-
}
else if (flags2 & RF2_AURA_ELEC)
{
#ifdef JP
-hook_c_roff(TERM_L_BLUE, format("%^s¤Ï¥¹¥Ñ¡¼¥¯¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
+ hook_c_roff(TERM_L_BLUE, format("%^s¤Ï¥¹¥Ñ¡¼¥¯¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
#else
hook_c_roff(TERM_L_BLUE, format("%^s is surrounded by electricity. ", wd_he[msex]));
#endif
-
}
if (flags2 & RF2_REFLECTING)
{
#ifdef JP
-hooked_roff(format("%^s¤ÏÌð¤Î¼öʸ¤òÄ·¤ÍÊÖ¤¹¡£", wd_he[msex]));
+ hooked_roff(format("%^s¤ÏÌð¤Î¼öʸ¤òÄ·¤ÍÊÖ¤¹¡£", wd_he[msex]));
#else
hooked_roff(format("%^s reflects bolt spells. ", wd_he[msex]));
#endif
wd_he[msex], r_ptr->ac));
/* Maximized hitpoints */
- if (flags1 & RF1_FORCE_MAXHP)
+ if ((flags1 & RF1_FORCE_MAXHP) || (r_ptr->hside == 1))
{
+ u32b hp = r_ptr->hdice * (nightmare ? 2 : 1) * r_ptr->hside;
#ifdef JP
hooked_roff(format(" %d ¤ÎÂÎÎϤ¬¤¢¤ë¡£",
#else
hooked_roff(format(" and a life rating of %d. ",
#endif
-
- r_ptr->hdice * r_ptr->hside));
+ (s16b)MIN(30000, hp)));
}
/* Variable hitpoints */
#else
hooked_roff(format(" and a life rating of %dd%d. ",
#endif
-
- r_ptr->hdice, r_ptr->hside));
+ r_ptr->hdice * (nightmare ? 2 : 1), r_ptr->hside));
}
}
#ifdef JP
hooked_roff(format("%^s¤Ï¸÷¤Ã¤Æ¤¤¤ë¡£", wd_he[msex]));
#else
- hooked_roff(format("%^s illuminate the dungeon. ", wd_he[msex]));
+ hooked_roff(format("%^s is shining. ", wd_he[msex]));
#endif
}
case RBE_DR_MANA: q = "drain mana force"; break;
#endif
+#ifdef JP
+ case RBE_INERTIA: q = "¸ºÂ®¤µ¤»¤ë"; break;
+ case RBE_STUN: q = "Û¯Û°¤È¤µ¤»¤ë"; break;
+#else
+ case RBE_INERTIA: q = "slow"; break;
+ case RBE_STUN: q = "stun"; break;
+#endif
}
monster_hook_type get_monster_hook2(int y, int x)
{
+ feature_type *f_ptr = &f_info[cave[y][x].feat];
+
/* Set the monster list */
- switch (cave[y][x].feat)
- {
- case FEAT_SHAL_WATER:
- return (monster_hook_type)mon_hook_shallow_water;
- case FEAT_DEEP_WATER:
- return (monster_hook_type)mon_hook_deep_water;
- case FEAT_DEEP_LAVA:
- case FEAT_SHAL_LAVA:
+
+ /* Water */
+ if (have_flag(f_ptr->flags, FF_WATER))
+ {
+ /* Deep water */
+ if (have_flag(f_ptr->flags, FF_DEEP))
+ {
+ return (monster_hook_type)mon_hook_deep_water;
+ }
+
+ /* Shallow water */
+ else
+ {
+ return (monster_hook_type)mon_hook_shallow_water;
+ }
+ }
+
+ /* Lava */
+ else if (have_flag(f_ptr->flags, FF_LAVA))
+ {
return (monster_hook_type)mon_hook_lava;
- default:
- return (monster_hook_type)mon_hook_floor;
}
+
+ else return (monster_hook_type)mon_hook_floor;
}
void set_pet(monster_type *m_ptr)
{
+ if (!is_pet(m_ptr)) check_pets_num_and_align(m_ptr, TRUE);
+
/* Check for quest completion */
check_quest_completion(m_ptr);
void set_hostile(monster_type *m_ptr)
{
if (p_ptr->inside_battle) return;
+
+ if (is_pet(m_ptr)) check_pets_num_and_align(m_ptr, FALSE);
+
m_ptr->smart &= ~SM_PET;
m_ptr->smart &= ~SM_FRIENDLY;
}
/*
* Check if monster can cross terrain
*/
-bool monster_can_cross_terrain(byte feat, monster_race *r_ptr)
+bool monster_can_cross_terrain(s16b feat, monster_race *r_ptr, u16b mode)
{
- /* Pit */
- if (feat == FEAT_DARK_PIT)
- {
- if (r_ptr->flags7 & RF7_CAN_FLY)
- return TRUE;
- else
- return FALSE;
- }
- /* Deep water */
- if (feat == FEAT_DEEP_WATER)
+ feature_type *f_ptr = &f_info[feat];
+
+ /* Pattern */
+ if (have_flag(f_ptr->flags, FF_PATTERN))
{
- if ((r_ptr->flags7 & RF7_AQUATIC) ||
- (r_ptr->flags7 & RF7_CAN_FLY) ||
- (r_ptr->flags7 & RF7_CAN_SWIM))
- return TRUE;
+ if (!(mode & CEM_RIDING))
+ {
+ if (!(r_ptr->flags7 & RF7_CAN_FLY)) return FALSE;
+ }
else
- return FALSE;
+ {
+ if (!(mode & CEM_P_CAN_ENTER_PATTERN)) return FALSE;
+ }
}
- /* Shallow water */
- else if (feat == FEAT_SHAL_WATER)
+
+ /* "CAN" flags */
+ if (have_flag(f_ptr->flags, FF_CAN_FLY) && (r_ptr->flags7 & RF7_CAN_FLY)) return TRUE;
+ if (have_flag(f_ptr->flags, FF_CAN_SWIM) && (r_ptr->flags7 & RF7_CAN_SWIM)) return TRUE;
+ if (have_flag(f_ptr->flags, FF_CAN_PASS))
{
- if (!(r_ptr->flags2 & RF2_AURA_FIRE) ||
- (r_ptr->flags7 & RF7_AQUATIC) ||
- (r_ptr->flags7 & RF7_CAN_FLY) ||
- (r_ptr->flags7 & RF7_CAN_SWIM))
- return TRUE;
- else
- return FALSE;
+ if ((r_ptr->flags2 & RF2_PASS_WALL) && (!(mode & CEM_RIDING) || p_ptr->pass_wall)) return TRUE;
}
- /* Aquatic monster */
- else if ((r_ptr->flags7 & RF7_AQUATIC) &&
- !(r_ptr->flags7 & RF7_CAN_FLY))
+
+ if (!have_flag(f_ptr->flags, FF_MOVE)) return FALSE;
+
+ /* Some monsters can walk on mountains */
+ if (have_flag(f_ptr->flags, FF_MOUNTAIN) && (r_ptr->flags8 & RF8_WILD_MOUNTAIN)) return TRUE;
+
+ /* Water */
+ if (have_flag(f_ptr->flags, FF_WATER))
{
- return FALSE;
+ if (!(r_ptr->flags7 & RF7_AQUATIC))
+ {
+ /* Deep water */
+ if (have_flag(f_ptr->flags, FF_DEEP)) return FALSE;
+
+ /* Shallow water */
+ else if (r_ptr->flags2 & RF2_AURA_FIRE) return FALSE;
+ }
}
+
+ /* Aquatic monster into non-water? */
+ else if (r_ptr->flags7 & RF7_AQUATIC) return FALSE;
+
/* Lava */
- else if ((feat == FEAT_SHAL_LAVA) ||
- (feat == FEAT_DEEP_LAVA))
+ if (have_flag(f_ptr->flags, FF_LAVA))
{
- if ((r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK) ||
- (r_ptr->flags7 & RF7_CAN_FLY))
- return TRUE;
- else
- return FALSE;
+ if (!(r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK)) return FALSE;
}
return TRUE;
/*
* Strictly check if monster can enter the grid
*/
-bool monster_can_enter(int y, int x, monster_race *r_ptr)
+bool monster_can_enter(int y, int x, monster_race *r_ptr, u16b mode)
{
cave_type *c_ptr = &cave[y][x];
- byte feat = c_ptr->feat;
/* Player or other monster */
if (player_bold(y, x)) return FALSE;
if (c_ptr->m_idx) return FALSE;
- /* Permanent wall */
- if ((c_ptr->feat >= FEAT_PERM_EXTRA) &&
- (c_ptr->feat <= FEAT_PERM_SOLID))
- return FALSE;
-
- /* Can fly over the Pattern */
- if ((c_ptr->feat >= FEAT_PATTERN_START) &&
- (c_ptr->feat <= FEAT_PATTERN_XTRA2))
- {
- if (!(r_ptr->flags7 & RF7_CAN_FLY))
- return FALSE;
- else
- return TRUE;
- }
-
- /* Can fly over mountain on the surface */
- if (feat == FEAT_MOUNTAIN)
- {
- if (!dun_level &&
- ((r_ptr->flags7 & RF7_CAN_FLY) ||
- (r_ptr->flags8 & RF8_WILD_MOUNTAIN)))
- return TRUE;
- else
- return FALSE;
- }
-
- /* Cannot enter wall without pass wall ability */
- if (!cave_floor_grid(c_ptr) && !(r_ptr->flags2 & RF2_PASS_WALL))
- return FALSE;
-
- /* Pit */
- if (feat == FEAT_DARK_PIT)
- {
- if (r_ptr->flags7 & RF7_CAN_FLY)
- return TRUE;
- else
- return FALSE;
- }
- /* Deep water */
- if (feat == FEAT_DEEP_WATER)
- {
- if ((r_ptr->flags7 & RF7_AQUATIC) ||
- (r_ptr->flags7 & RF7_CAN_FLY) ||
- (r_ptr->flags7 & RF7_CAN_SWIM))
- return TRUE;
- else
- return FALSE;
- }
- /* Shallow water */
- else if (feat == FEAT_SHAL_WATER)
- {
- if (!(r_ptr->flags2 & RF2_AURA_FIRE) ||
- (r_ptr->flags7 & RF7_AQUATIC) ||
- (r_ptr->flags7 & RF7_CAN_FLY) ||
- (r_ptr->flags7 & RF7_CAN_SWIM))
- return TRUE;
- else
- return FALSE;
- }
- /* Aquatic monster */
- else if ((r_ptr->flags7 & RF7_AQUATIC) &&
- !(r_ptr->flags7 & RF7_CAN_FLY))
- {
- return FALSE;
- }
- /* Lava */
- else if ((feat == FEAT_SHAL_LAVA) ||
- (feat == FEAT_DEEP_LAVA))
- {
- if ((r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK) ||
- (r_ptr->flags7 & RF7_CAN_FLY))
- return TRUE;
- else
- return FALSE;
- }
-
- return TRUE;
+ return monster_can_cross_terrain(c_ptr->feat, r_ptr, mode);
}