- /* Extract some flags */
- object_flags(o_ptr, flgs);
-
- /* Acquire the object name */
- object_desc(o_name, o_ptr, 0);
- monster_desc(m_name, m_ptr, MD_INDEF_HIDDEN);
-
- /* React to objects that hurt the monster */
- 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_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_DEMON)) flg3 |= (RF3_DEMON);
- if (have_flag(flgs, TR_SLAY_UNDEAD)) flg3 |= (RF3_UNDEAD);
- if (have_flag(flgs, TR_KILL_UNDEAD)) flg3 |= (RF3_UNDEAD);
- if (have_flag(flgs, TR_SLAY_ANIMAL)) flg3 |= (RF3_ANIMAL);
- if (have_flag(flgs, TR_KILL_ANIMAL)) flg3 |= (RF3_ANIMAL);
- if (have_flag(flgs, TR_SLAY_EVIL)) flg3 |= (RF3_EVIL);
- 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) ||
- ((~(r_ptr->flagsr) & flgr) && !(r_ptr->flagsr & RFR_RES_ALL)))
- {
- /* Only give a message for "take_item" */
- if (do_take && (r_ptr->flags2 & RF2_STUPID))
- {
- did_take_item = TRUE;
-
- /* Describe observable situations */
- if (m_ptr->ml && player_can_see_bold(p_ptr, ny, nx))
- {
- msg_format(_("%^sは%sを拾おうとしたが、だめだった。", "%^s tries to pick up %s, but fails."), m_name, o_name);
- }
- }
- }
-
- /* Pick up the item */
- else if (do_take)
- {
- did_take_item = TRUE;
-
- /* Describe observable situations */
- if (player_can_see_bold(p_ptr, ny, nx))
- {
- msg_format(_("%^sが%sを拾った。", "%^s picks up %s."), m_name, o_name);
- }