- /* Otherwise, take the damage */
- else if ((have_flag(flgs, TR_BRAND_FIRE) || ((p_ptr->special_attack & (ATTACK_FIRE)) && !thrown)) && (mode == HISSATSU_FIRE))
- {
- if (r_ptr->flags3 & RF3_HURT_FIRE)
- {
- if (mult < 70) mult = 70;
- if (m_ptr->ml && is_original_ap(m_ptr))
- {
- r_ptr->r_flags3 |= RF3_HURT_FIRE;
- }
- }
- else if (mult < 35) mult = 35;
- }
- else
- {
- if (r_ptr->flags3 & RF3_HURT_FIRE)
- {
- if (mult < 50) mult = 50;
- if (m_ptr->ml && is_original_ap(m_ptr))
- {
- r_ptr->r_flags3 |= RF3_HURT_FIRE;
- }
- }
- else if (mult < 25) mult = 25;
- }
- }
-
- /* Brand (Cold) */
- if (have_flag(flgs, TR_BRAND_COLD) || ((p_ptr->special_attack & (ATTACK_COLD)) && !thrown) || (mode == HISSATSU_COLD))
- {
- /* Notice immunity */
- if (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK)
- {
- if (m_ptr->ml && is_original_ap(m_ptr))
- {
- r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK);
- }
- }
- /* Otherwise, take the damage */
- else if ((have_flag(flgs, TR_BRAND_COLD) || ((p_ptr->special_attack & (ATTACK_COLD)) && !thrown)) && (mode == HISSATSU_COLD))
- {
- if (r_ptr->flags3 & RF3_HURT_COLD)
- {
- if (mult < 70) mult = 70;
- if (m_ptr->ml && is_original_ap(m_ptr))
- {
- r_ptr->r_flags3 |= RF3_HURT_COLD;
- }
- }
- else if (mult < 35) mult = 35;
- }
- else
- {
- if (r_ptr->flags3 & RF3_HURT_COLD)
- {
- if (mult < 50) mult = 50;
- if (m_ptr->ml && is_original_ap(m_ptr))
- {
- r_ptr->r_flags3 |= RF3_HURT_COLD;
- }
- }
- else if (mult < 25) mult = 25;
- }
- }
-
- /* Brand (Poison) */
- if (have_flag(flgs, TR_BRAND_POIS) || ((p_ptr->special_attack & (ATTACK_POIS)) && !thrown) || (mode == HISSATSU_POISON))
- {
- /* Notice immunity */
- if (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK)
- {
- if (m_ptr->ml && is_original_ap(m_ptr))
- {
- r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK);
- }
- }
-
- /* Otherwise, take the damage */
- else if ((have_flag(flgs, TR_BRAND_POIS) || ((p_ptr->special_attack & (ATTACK_POIS)) && !thrown)) && (mode == HISSATSU_POISON))
- {
- if (mult < 35) mult = 35;
- }
- else
- {
- if (mult < 25) mult = 25;
- }
- }
- if ((mode == HISSATSU_ZANMA) && !monster_living(r_ptr) && (r_ptr->flags3 & RF3_EVIL))
- {
- if (mult < 15) mult = 25;
- else if (mult < 50) mult = MIN(50, mult+20);
- }
- if (mode == HISSATSU_UNDEAD)
- {
- if (r_ptr->flags3 & RF3_UNDEAD)
- {
- if (m_ptr->ml && is_original_ap(m_ptr))
- {
- r_ptr->r_flags3 |= RF3_UNDEAD;
- }
- if (mult == 10) mult = 70;
- else if (mult < 140) mult = MIN(140, mult+60);
- }
- if (mult == 10) mult = 40;
- else if (mult < 60) mult = MIN(60, mult+30);
- }
- if ((mode == HISSATSU_SEKIRYUKA) && p_ptr->cut && monster_living(r_ptr))
- {
- int tmp = MIN(100, MAX(10, p_ptr->cut / 10));
- if (mult < tmp) mult = tmp;
- }
- if ((mode == HISSATSU_HAGAN) && (r_ptr->flags3 & RF3_HURT_ROCK))
- {
- if (m_ptr->ml && is_original_ap(m_ptr))
- {
- r_ptr->r_flags3 |= RF3_HURT_ROCK;
- }
- if (mult == 10) mult = 40;
- else if (mult < 60) mult = 60;
- }
- if ((p_ptr->pclass != CLASS_SAMURAI) && (have_flag(flgs, TR_FORCE_WEAPON)) && (p_ptr->csp > (o_ptr->dd * o_ptr->ds / 5)))
- {
- p_ptr->csp -= (1+(o_ptr->dd * o_ptr->ds / 5));
- p_ptr->redraw |= (PR_MANA);
- mult = mult * 3 / 2 + 20;
- }
- break;
- }
- }
- if (mult > 150) mult = 150;
-
- /* Return the total damage */
- return (tdam * mult / 10);
-}
-
-
-/*
- * Search for hidden things
- */
-void search(void)
-{
- int y, x, chance;
-
- s16b this_o_idx, next_o_idx = 0;
-
- cave_type *c_ptr;
-
-
- /* Start with base search ability */
- chance = p_ptr->skill_srh;
-
- /* Penalize various conditions */
- if (p_ptr->blind || no_lite()) chance = chance / 10;
- if (p_ptr->confused || p_ptr->image) chance = chance / 10;
-
- /* Search the nearby grids, which are always in bounds */
- for (y = (py - 1); y <= (py + 1); y++)
- {
- for (x = (px - 1); x <= (px + 1); x++)
- {
- /* Sometimes, notice things */
- if (randint0(100) < chance)
- {
- /* Access the grid */
- c_ptr = &cave[y][x];
-
- /* Invisible trap */
- if (c_ptr->mimic && is_trap(c_ptr->feat))
- {
- /* Pick a trap */
- disclose_grid(y, x);
-
- /* Message */
-#ifdef JP
- msg_print("¥È¥é¥Ã¥×¤òȯ¸«¤·¤¿¡£");
-#else
- msg_print("You have found a trap.");
-#endif
-
-
- /* Disturb */
- disturb(0, 0);
- }
-
- /* Secret door */
- if (is_hidden_door(c_ptr))
- {
- /* Message */
-#ifdef JP
- msg_print("±£¤·¥É¥¢¤òȯ¸«¤·¤¿¡£");
-#else
- msg_print("You have found a secret door.");
-#endif
-
- /* Disclose */
- disclose_grid(y, x);
-
- /* 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)
- {
- 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 non-chests */
- if (o_ptr->tval != TV_CHEST) continue;
-
- /* Skip non-trapped chests */
- if (!chest_traps[o_ptr->pval]) continue;
-
- /* Identify once */
- if (!object_known_p(o_ptr))
- {
- /* Message */
-#ifdef JP
- msg_print("È¢¤Ë»Å³Ý¤±¤é¤ì¤¿¥È¥é¥Ã¥×¤òȯ¸«¤·¤¿¡ª");
-#else
- msg_print("You have discovered a trap on the chest!");
-#endif
-
-
- /* Know the trap */
- object_known(o_ptr);
-
- /* Notice it */
- disturb(0, 0);
- }
- }
- }
- }
- }
-}
-
-
-/*
- * Helper routine for py_pickup() and py_pickup_floor().
- *
- * Add the given dungeon object to the character's inventory.
- *
- * Delete the object afterwards.
- */
-void py_pickup_aux(int o_idx)
-{
- int slot, i;
-
-#ifdef JP
-/*
- * ¥¢¥¤¥Æ¥à¤ò½¦¤Ã¤¿ºÝ¤Ë¡Ö£²¤Ä¤Î¥±¡¼¥¤ò»ý¤Ã¤Æ¤¤¤ë¡×
- * "You have two cakes." ¤È¥¢¥¤¥Æ¥à¤ò½¦¤Ã¤¿¸å¤Î¹ç·×¤Î¤ß¤Îɽ¼¨¤¬¥ª¥ê¥¸¥Ê¥ë
- * ¤À¤¬¡¢°ãÏ´¶¤¬
- * ¤¢¤ë¤È¤¤¤¦»ØŦ¤ò¤¦¤±¤¿¤Î¤Ç¡¢¡Ö¡Á¤ò½¦¤Ã¤¿¡¢¡Á¤ò»ý¤Ã¤Æ¤¤¤ë¡×¤È¤¤¤¦É½¼¨
- * ¤Ë¤«¤¨¤Æ¤¢¤ë¡£¤½¤Î¤¿¤á¤ÎÇÛÎó¡£
- */
- char o_name[MAX_NLEN];
- char old_name[MAX_NLEN];
- char kazu_str[80];
- int hirottakazu;
-#else
- char o_name[MAX_NLEN];
-#endif
-
- object_type *o_ptr;
-
- o_ptr = &o_list[o_idx];
-
-#ifdef JP
- /* Describe the object */
- object_desc(old_name, o_ptr, TRUE, 0);
- object_desc_kosuu(kazu_str, o_ptr);
- hirottakazu = o_ptr->number;
-#endif
- /* Carry the object */
- slot = inven_carry(o_ptr);
-
- /* Get the object again */
- o_ptr = &inventory[slot];
-
- /* Delete the object */
- delete_object_idx(o_idx);
-
- 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;
- }
- }
- }
-
- /* Describe the object */
- object_desc(o_name, o_ptr, TRUE, 3);