int ap_cnt;
int ac, rlev, pt;
char m_name[80], t_name[80];
- char temp[80];
+ char temp[MAX_NLEN];
bool blinked;
bool explode = FALSE, touched = FALSE, fear = FALSE;
int y_saver = t_ptr->fy;
}
+static bool check_hp_for_feat_destruction(feature_type *f_ptr, monster_type *m_ptr)
+{
+ return !have_flag(f_ptr->flags, FF_GLASS) ||
+ (r_info[m_ptr->r_idx].flags2 & RF2_STUPID) ||
+ (m_ptr->hp >= MAX(m_ptr->maxhp / 3, 200));
+}
+
+
/*
* Process a monster
*
#endif
}
+ if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
+ {
+ char m_name[80];
+
+ monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
+ do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_LOSE_PARENT, m_name);
+ }
+
/* Delete the monster */
delete_monster_idx(m_idx);
(void)set_monster_csleep(m_idx, 0);
/* Notice the "waking up" */
- if (see_m)
+ if (m_ptr->ml)
{
char m_name[80];
#endif
}
- if (m_ptr->ml)
+ /* Hack -- Count the wakings */
+ if (is_original_ap_and_seen(m_ptr) && (r_ptr->r_wake < MAX_UCHAR))
{
- /* Hack -- Count the wakings */
- if ((r_ptr->r_wake < MAX_UCHAR) && is_original_ap(m_ptr))
- {
- r_ptr->r_wake++;
- }
+ r_ptr->r_wake++;
}
}
else if ((r_ptr->flags2 & RF2_KILL_WALL) &&
(can_cross ? !have_flag(f_ptr->flags, FF_LOS) : !is_riding_mon) &&
have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT) &&
- (!have_flag(f_ptr->flags, FF_GLASS) || (r_ptr->flags2 & RF2_STUPID) || (m_ptr->hp >= MAX(m_ptr->maxhp / 3, 200))))
+ check_hp_for_feat_destruction(f_ptr, m_ptr))
{
/* Eat through walls/doors/rubble */
do_move = TRUE;
(!is_pet(m_ptr) || (p_ptr->pet_extra_flags & PF_OPEN_DOORS)))
{
/* Attempt to Bash XXX XXX XXX */
- if (randint0(m_ptr->hp / 10) > f_ptr->power)
+ if (check_hp_for_feat_destruction(f_ptr, m_ptr) && (randint0(m_ptr->hp / 10) > f_ptr->power))
{
/* Message */
if (have_flag(f_ptr->flags, FF_GLASS))
/* Creature has been allowed move */
if (do_move)
{
- s16b this_o_idx, next_o_idx;
-
/* Take a turn */
do_turn = TRUE;
/* Possible disturb */
if (m_ptr->ml &&
(disturb_move ||
- (disturb_near && (m_ptr->mflag & MFLAG_VIEW)) ||
+ (disturb_near && (m_ptr->mflag & MFLAG_VIEW) && projectable(py, px, m_ptr->fy, m_ptr->fx)) ||
(disturb_high && ap_r_ptr->r_tkills && ap_r_ptr->level >= p_ptr->lev)))
{
/* Disturb */
disturb(0, 0);
}
- /* Scan all objects in the grid */
- for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
+ /* Take or Kill objects on the floor */
+ if (c_ptr->o_idx && (r_ptr->flags2 & (RF2_TAKE_ITEM | RF2_KILL_ITEM)) &&
+ (!is_pet(m_ptr) || ((p_ptr->pet_extra_flags & PF_PICKUP_ITEMS) && (r_ptr->flags2 & RF2_TAKE_ITEM))))
{
- object_type *o_ptr;
-
- /* Acquire object */
- o_ptr = &o_list[this_o_idx];
-
- /* Acquire next object */
- next_o_idx = o_ptr->next_o_idx;
-
- /* Skip gold */
- if (o_ptr->tval == TV_GOLD) continue;
-
- /*
- * Skip "real" corpses and statues, to avoid extreme
- * silliness like a novice rogue pockets full of statues
- * and corpses.
- */
- if ((o_ptr->tval == TV_CORPSE) ||
- (o_ptr->tval == TV_STATUE)) continue;
+ s16b this_o_idx, next_o_idx;
+ bool do_take = (r_ptr->flags2 & RF2_TAKE_ITEM) ? TRUE : FALSE;
- /* Take or Kill objects on the floor */
- if ((r_ptr->flags2 & (RF2_TAKE_ITEM | RF2_KILL_ITEM)) &&
- (!is_pet(m_ptr) || (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)))
+ /* Scan all objects in the grid */
+ for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
- u32b flgs[TR_FLAG_SIZE];
+ u32b flgs[TR_FLAG_SIZE], flg2 = 0L, flg3 = 0L, flgr = 0L;
+ char m_name[80], o_name[MAX_NLEN];
- u32b flg2 = 0L;
- u32b flg3 = 0L;
+ /* Acquire object */
+ object_type *o_ptr = &o_list[this_o_idx];
- char m_name[80];
- char o_name[MAX_NLEN];
+ /* Acquire next object */
+ next_o_idx = o_ptr->next_o_idx;
+
+ if (do_take)
+ {
+ /* Skip gold */
+ if (o_ptr->tval == TV_GOLD) continue;
+
+ /*
+ * Skip "real" corpses and statues, to avoid extreme
+ * silliness like a novice rogue pockets full of statues
+ * and corpses.
+ */
+ if ((o_ptr->tval == TV_CORPSE) ||
+ (o_ptr->tval == TV_STATUE)) continue;
+ }
/* Extract some flags */
object_flags(o_ptr, flgs);
monster_desc(m_name, m_ptr, MD_INDEF_HIDDEN);
/* React to objects that hurt the monster */
- if (have_flag(flgs, TR_KILL_DRAGON)) flg3 |= (RF3_DRAGON);
if (have_flag(flgs, TR_SLAY_DRAGON)) flg3 |= (RF3_DRAGON);
+ if (have_flag(flgs, TR_KILL_DRAGON)) flg3 |= (RF3_DRAGON);
if (have_flag(flgs, TR_SLAY_TROLL)) flg3 |= (RF3_TROLL);
if (have_flag(flgs, TR_KILL_TROLL)) flg3 |= (RF3_TROLL);
- if (have_flag(flgs, TR_KILL_GIANT)) flg3 |= (RF3_GIANT);
if (have_flag(flgs, TR_SLAY_GIANT)) flg3 |= (RF3_GIANT);
+ if (have_flag(flgs, TR_KILL_GIANT)) flg3 |= (RF3_GIANT);
if (have_flag(flgs, TR_SLAY_ORC)) flg3 |= (RF3_ORC);
if (have_flag(flgs, TR_KILL_ORC)) flg3 |= (RF3_ORC);
if (have_flag(flgs, TR_SLAY_DEMON)) flg3 |= (RF3_DEMON);
if (have_flag(flgs, TR_KILL_EVIL)) flg3 |= (RF3_EVIL);
if (have_flag(flgs, TR_SLAY_HUMAN)) flg2 |= (RF2_HUMAN);
if (have_flag(flgs, TR_KILL_HUMAN)) flg2 |= (RF2_HUMAN);
+ if (have_flag(flgs, TR_BRAND_ACID)) flgr |= (RFR_IM_ACID);
+ if (have_flag(flgs, TR_BRAND_ELEC)) flgr |= (RFR_IM_ELEC);
+ if (have_flag(flgs, TR_BRAND_FIRE)) flgr |= (RFR_IM_FIRE);
+ if (have_flag(flgs, TR_BRAND_COLD)) flgr |= (RFR_IM_COLD);
+ if (have_flag(flgs, TR_BRAND_POIS)) flgr |= (RFR_IM_POIS);
/* The object cannot be picked up by the monster */
- if (object_is_artifact(o_ptr) || (r_ptr->flags3 & flg3) || (r_ptr->flags2 & flg2))
+ if (object_is_artifact(o_ptr) || (r_ptr->flags3 & flg3) || (r_ptr->flags2 & flg2) ||
+ ((~(r_ptr->flagsr) & flgr) && !(r_ptr->flagsr & RFR_RES_ALL)))
{
/* Only give a message for "take_item" */
- if ((r_ptr->flags2 & (RF2_TAKE_ITEM)) && (r_ptr->flags2 & (RF2_STUPID)))
+ if (do_take && (r_ptr->flags2 & RF2_STUPID))
{
/* Take note */
did_take_item = TRUE;
}
/* Pick up the item */
- else if (r_ptr->flags2 & RF2_TAKE_ITEM)
+ else if (do_take)
{
/* Take note */
did_take_item = TRUE;
excise_object_idx(this_o_idx);
/* Forget mark */
- o_ptr->marked = 0;
+ o_ptr->marked &= OM_TOUCHED;
/* Forget location */
o_ptr->iy = o_ptr->ix = 0;
else
{
/* Notice the "waking up" */
- if (is_seen(m_ptr))
+ if (m_ptr->ml)
{
char m_name[80];
{
if (!ignore_unview || player_can_see_bold(m_ptr->fy, m_ptr->fx))
{
+ if (p_ptr->image)
+ {
+ monster_race *hallu_race;
+
+ do
+ {
+ hallu_race = &r_info[randint1(max_r_idx - 1)];
+ }
+ while (!hallu_race->name || (hallu_race->flags1 & RF1_UNIQUE));
+
#ifdef JP
- msg_format("%s¤Ï%s¤Ë¿Ê²½¤·¤¿¡£", m_name, r_name + r_ptr->name);
+ msg_format("%s¤Ï%s¤Ë¿Ê²½¤·¤¿¡£", m_name, r_name + hallu_race->name);
#else
- msg_format("%^s evolved into %s.", m_name, r_name + r_ptr->name);
+ msg_format("%^s evolved into %s.", m_name, r_name + hallu_race->name);
#endif
+ }
+ else
+ {
+#ifdef JP
+ msg_format("%s¤Ï%s¤Ë¿Ê²½¤·¤¿¡£", m_name, r_name + r_ptr->name);
+#else
+ msg_format("%^s evolved into %s.", m_name, r_name + r_ptr->name);
+#endif
+ }
}
- r_info[old_r_idx].r_xtra1 |= MR1_SINKA;
+ if (!p_ptr->image) r_info[old_r_idx].r_xtra1 |= MR1_SINKA;
/* Now you feel very close to this pet. */
m_ptr->parent_m_idx = 0;