/* Purpose: Inventory commands */
/*
- * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
*
- * This software may be copied and distributed for educational, research, and
- * not for profit purposes provided that this copyright and statement are
- * included in all such copies.
+ * This software may be copied and distributed for educational, research,
+ * and not for profit purposes provided that this copyright and statement
+ * are included in all such copies. Other copyrights may also apply.
*/
#include "angband.h"
#ifdef JP
sprintf(out_val, "»ý¤Áʪ¡§ ¹ç·× %3d.%1d kg (¸Â³¦¤Î%ld%%) ¥³¥Þ¥ó¥É: ",
- lbtokg1(p_ptr->total_weight) , lbtokg2(p_ptr->total_weight) ,
- (p_ptr->total_weight * 100) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100))
-/ 2));
+ (int)lbtokg1(p_ptr->total_weight) , (int)lbtokg2(p_ptr->total_weight) ,
+ (long int)((p_ptr->total_weight * 100) / weight_limit()));
#else
sprintf(out_val, "Inventory: carrying %d.%d pounds (%ld%% of capacity). Command: ",
(int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
- (p_ptr->total_weight * 100) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2));
+ (p_ptr->total_weight * 100) / weight_limit());
#endif
/* Build a prompt */
#ifdef JP
sprintf(out_val, "ÁõÈ÷¡§ ¹ç·× %3d.%1d kg (¸Â³¦¤Î%ld%%) ¥³¥Þ¥ó¥É: ",
- lbtokg1(p_ptr->total_weight) , lbtokg2(p_ptr->total_weight) ,
- (p_ptr->total_weight * 100) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100))
-/ 2));
+ (int)lbtokg1(p_ptr->total_weight) , (int)lbtokg2(p_ptr->total_weight) ,
+ (long int)((p_ptr->total_weight * 100) / weight_limit()));
#else
sprintf(out_val, "Equipment: carrying %d.%d pounds (%ld%% of capacity). Command: ",
(int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
- (p_ptr->total_weight * 100) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2));
+ (long int)((p_ptr->total_weight * 100) / weight_limit()));
#endif
}
+bool select_ring_slot = FALSE;
+
/*
* Wield or wear a single item from the pack or floor
*/
void do_cmd_wield(void)
{
- int i, item, slot;
+ int item, slot;
object_type forge;
object_type *q_ptr;
cptr q, s;
+ int need_switch_wielding = 0;
+
if (p_ptr->special_defense & KATA_MUSOU)
{
set_action(ACTION_NONE);
/* Check the slot */
slot = wield_slot(o_ptr);
-#if 1 /* EASY_RING -- TNB */
- if ((o_ptr->tval == TV_RING) && inventory[INVEN_LEFT].k_idx &&
- inventory[INVEN_RIGHT].k_idx)
+ switch (o_ptr->tval)
{
- /* Restrict the choices */
- item_tester_tval = TV_RING;
- item_tester_no_ryoute = TRUE;
-
- /* Choose a ring from the equipment only */
-#ifdef JP
-q = "¤É¤Á¤é¤Î»ØÎؤȼè¤êÂؤ¨¤Þ¤¹¤«?";
-#else
- q = "Replace which ring? ";
-#endif
+ /* Shields and some misc. items */
+ case TV_CAPTURE:
+ case TV_SHIELD:
+ case TV_CARD:
+ /* Dual wielding */
+ if (buki_motteruka(INVEN_RARM) && buki_motteruka(INVEN_LARM))
+ {
+ /* Restrict the choices */
+ item_tester_hook = item_tester_hook_melee_weapon;
+ item_tester_no_ryoute = TRUE;
+ /* Choose a weapon from the equipment only */
#ifdef JP
-s = "¤ª¤Ã¤È¡£";
+ q = "¤É¤Á¤é¤ÎÉð´ï¤È¼è¤êÂؤ¨¤Þ¤¹¤«?";
+ s = "¤ª¤Ã¤È¡£";
#else
- s = "Oops.";
+ q = "Replace which weapon? ";
+ s = "Oops.";
#endif
- if (!get_item(&slot, q, s, (USE_EQUIP)))
- return;
- }
+ if (!get_item(&slot, q, s, (USE_EQUIP))) return;
+ if (slot == INVEN_RARM) need_switch_wielding = INVEN_LARM;
+ }
-#endif /* EASY_RING -- TNB */
+ else if (buki_motteruka(INVEN_LARM)) slot = INVEN_RARM;
- if (((o_ptr->tval == TV_SHIELD) || (o_ptr->tval == TV_CARD) || (o_ptr->tval == TV_CAPTURE)) &&
- buki_motteruka(INVEN_RARM) && buki_motteruka(INVEN_LARM))
- {
- /* Restrict the choices */
- item_tester_hook = item_tester_hook_melee_weapon;
- item_tester_no_ryoute = TRUE;
+ /* Both arms are already used by non-weapon */
+ else if (inventory[INVEN_RARM].k_idx && !object_is_melee_weapon(&inventory[INVEN_RARM]) &&
+ inventory[INVEN_LARM].k_idx && !object_is_melee_weapon(&inventory[INVEN_LARM]))
+ {
+ /* Restrict the choices */
+ item_tester_hook = item_tester_hook_mochikae;
- /* Choose a weapon from the equipment only */
+ /* Choose a hand */
#ifdef JP
-q = "¤É¤Á¤é¤ÎÉð´ï¤È¼è¤êÂؤ¨¤Þ¤¹¤«?";
+ q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
+ s = "¤ª¤Ã¤È¡£";
#else
- q = "Replace which weapon? ";
+ q = "Equip which hand? ";
+ s = "Oops.";
#endif
+ if (!get_item(&slot, q, s, (USE_EQUIP))) return;
+ }
+ break;
+
+ /* Melee weapons */
+ case TV_DIGGING:
+ case TV_HAFTED:
+ case TV_POLEARM:
+ case TV_SWORD:
+ /* Asking for dual wielding */
+ if (slot == INVEN_LARM)
+ {
#ifdef JP
-s = "¤ª¤Ã¤È¡£";
+ if (!get_check("ÆóÅáή¤ÇÀ襤¤Þ¤¹¤«¡©")) slot = INVEN_RARM;
#else
- s = "Oops.";
+ if (!get_check("Dual wielding? ")) slot = INVEN_RARM;
#endif
+ }
- if (!get_item(&slot, q, s, (USE_EQUIP)))
- return;
- if (slot == INVEN_RARM)
+ else if (!inventory[INVEN_RARM].k_idx && buki_motteruka(INVEN_LARM))
{
- object_type *or_ptr = &inventory[INVEN_RARM];
- object_type *ol_ptr = &inventory[INVEN_LARM];
- object_type *otmp_ptr;
- object_type object_tmp;
- char ol_name[MAX_NLEN];
-
- otmp_ptr = &object_tmp;
+#ifdef JP
+ if (!get_check("ÆóÅáή¤ÇÀ襤¤Þ¤¹¤«¡©")) slot = INVEN_LARM;
+#else
+ if (!get_check("Dual wielding? ")) slot = INVEN_LARM;
+#endif
+ }
- object_desc(ol_name, ol_ptr, FALSE, 0);
+ /* Both arms are already used */
+ else if (inventory[INVEN_LARM].k_idx && inventory[INVEN_RARM].k_idx)
+ {
+ /* Restrict the choices */
+ item_tester_hook = item_tester_hook_mochikae;
- object_copy(otmp_ptr, ol_ptr);
- object_copy(ol_ptr, or_ptr);
- object_copy(or_ptr, otmp_ptr);
+ /* Choose a hand */
#ifdef JP
- msg_format("%s¤ò%s¤Ë¹½¤¨¤Ê¤ª¤·¤¿¡£", ol_name, left_hander ? "º¸¼ê" : "±¦¼ê");
+ q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
+ s = "¤ª¤Ã¤È¡£";
#else
- msg_format("You wield %s at %s hand.", ol_name, left_hander ? "left" : "right");
+ q = "Equip which hand? ";
+ s = "Oops.";
#endif
- slot = INVEN_LARM;
+ if (!get_item(&slot, q, s, (USE_EQUIP))) return;
+ if ((slot == INVEN_LARM) && !buki_motteruka(INVEN_RARM))
+ need_switch_wielding = INVEN_RARM;
}
- }
+ break;
- /* ÆóÅáή¤Ë¤¹¤ë¤«¤É¤¦¤« */
- if ((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD) && (slot == INVEN_LARM))
- {
+ /* Rings */
+ case TV_RING:
+ /* Choose a ring slot */
+ if (inventory[INVEN_LEFT].k_idx && inventory[INVEN_RIGHT].k_idx)
+ {
#ifdef JP
- if (!get_check("ÆóÅáή¤ÇÀ襤¤Þ¤¹¤«¡©"))
+ q = "¤É¤Á¤é¤Î»ØÎؤȼè¤êÂؤ¨¤Þ¤¹¤«?";
#else
- if (!get_check("Dual wielding? "))
+ q = "Replace which ring? ";
#endif
- {
- slot = INVEN_RARM;
}
- }
-
- if ((o_ptr->tval >= TV_DIGGING) && (o_ptr->tval <= TV_SWORD) &&
- inventory[INVEN_LARM].k_idx &&
- inventory[INVEN_RARM].k_idx)
- {
- /* Restrict the choices */
- item_tester_hook = item_tester_hook_mochikae;
-
- /* Choose a ring from the equipment only */
+ else
+ {
#ifdef JP
-q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
+ q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
#else
- q = "Equip which hand? ";
+ q = "Equip which hand? ";
#endif
+ }
#ifdef JP
-s = "¤ª¤Ã¤È¡£";
+ s = "¤ª¤Ã¤È¡£";
#else
s = "Oops.";
#endif
+ /* Restrict the choices */
+ select_ring_slot = TRUE;
+ item_tester_no_ryoute = TRUE;
+
if (!get_item(&slot, q, s, (USE_EQUIP)))
+ {
+ select_ring_slot = FALSE;
return;
+ }
+ select_ring_slot = FALSE;
+ break;
}
/* Prevent wielding into a cursed slot */
- if (cursed_p(&inventory[slot]))
+ if (object_is_cursed(&inventory[slot]))
{
/* Describe it */
- object_desc(o_name, &inventory[slot], FALSE, 0);
+ object_desc(o_name, &inventory[slot], (OD_OMIT_PREFIX | OD_NAME_ONLY));
/* Message */
#ifdef JP
o_name, describe_use(slot));
#endif
-
/* Cancel the command */
return;
}
- if (cursed_p(o_ptr) && confirm_wear &&
- (object_known_p(o_ptr) || (o_ptr->ident & IDENT_SENSE)))
+ if (confirm_wear &&
+ ((object_is_cursed(o_ptr) && object_is_known(o_ptr)) ||
+ ((o_ptr->ident & IDENT_SENSE) &&
+ (FEEL_BROKEN <= o_ptr->feeling) && (o_ptr->feeling <= FEEL_CURSED))))
{
char dummy[MAX_NLEN+80];
/* Describe it */
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
#ifdef JP
sprintf(dummy, "ËÜÅö¤Ë%s{¼ö¤ï¤ì¤Æ¤¤¤ë}¤ò»È¤¤¤Þ¤¹¤«¡©", o_name);
sprintf(dummy, "Really use the %s {cursed}? ", o_name);
#endif
-
- if (!get_check(dummy))
- return;
+ if (!get_check(dummy)) return;
}
- if ((o_ptr->name1 == ART_STONEMASK) && object_known_p(o_ptr) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
+ if ((o_ptr->name1 == ART_STONEMASK) && object_is_known(o_ptr) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
{
char dummy[MAX_NLEN+80];
/* Describe it */
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
#ifdef JP
sprintf(dummy, "%s¤òÁõÈ÷¤¹¤ë¤ÈµÛ·ìµ´¤Ë¤Ê¤ê¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©", o_name);
sprintf(dummy, "Do you become a vampire?");
#endif
-
- if (!get_check(dummy))
- return;
+ if (!get_check(dummy)) return;
}
- /* Check if completed a quest */
- for (i = 0; i < max_quests; i++)
+ if (need_switch_wielding && !object_is_cursed(&inventory[need_switch_wielding]))
{
- if ((quest[i].type == QUEST_TYPE_FIND_ARTIFACT) &&
- (quest[i].status == QUEST_STATUS_TAKEN) &&
- (quest[i].k_idx == o_ptr->name1))
- {
- if (record_fix_quest) do_cmd_write_nikki(NIKKI_FIX_QUEST_C, i, NULL);
- quest[i].status = QUEST_STATUS_COMPLETED;
- quest[i].complev = (byte)p_ptr->lev;
+ object_type *slot_o_ptr = &inventory[slot];
+ object_type *switch_o_ptr = &inventory[need_switch_wielding];
+ object_type object_tmp;
+ object_type *otmp_ptr = &object_tmp;
+ char switch_name[MAX_NLEN];
+
+ object_desc(switch_name, switch_o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+
+ object_copy(otmp_ptr, switch_o_ptr);
+ object_copy(switch_o_ptr, slot_o_ptr);
+ object_copy(slot_o_ptr, otmp_ptr);
#ifdef JP
-msg_print("¥¯¥¨¥¹¥È¤òãÀ®¤·¤¿¡ª");
+ msg_format("%s¤ò%s¤Ë¹½¤¨¤Ê¤ª¤·¤¿¡£", switch_name, (slot == INVEN_RARM) ? (left_hander ? "º¸¼ê" : "±¦¼ê") : (left_hander ? "±¦¼ê" : "º¸¼ê"));
#else
- msg_print("You completed the quest!");
+ msg_format("You wield %s at %s hand.", switch_name, (slot == INVEN_RARM) ? (left_hander ? "left" : "right") : (left_hander ? "right" : "left"));
#endif
- msg_print(NULL);
- }
+ slot = need_switch_wielding;
}
- if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN) identify_item(o_ptr);
+ check_find_art_quest_completion(o_ptr);
+
+ if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
+ {
+ identify_item(o_ptr);
+
+ /* Auto-inscription */
+ autopick_alter_item(item, FALSE);
+ }
/* Take a turn */
energy_use = 100;
/* Wear the new stuff */
object_copy(o_ptr, q_ptr);
+ /* Player touches it */
+ o_ptr->marked |= OM_TOUCHED;
+
/* Increase the weight */
p_ptr->total_weight += q_ptr->weight;
/* Increment the equip counter by hand */
equip_cnt++;
- /* Where is the item now */
- if (slot == INVEN_RARM)
- {
- if((o_ptr->tval != TV_SHIELD) && (o_ptr->tval != TV_CAPTURE) && (o_ptr->tval != TV_CARD) && (empty_hands(FALSE) & 0x00000001) && ((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
#ifdef JP
- act = "¤òξ¼ê¤Ç¹½¤¨¤¿";
+#define STR_WIELD_RARM "%s(%c)¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿¡£"
+#define STR_WIELD_LARM "%s(%c)¤òº¸¼ê¤ËÁõÈ÷¤·¤¿¡£"
+#define STR_WIELD_ARMS "%s(%c)¤òξ¼ê¤Ç¹½¤¨¤¿¡£"
#else
- act = "You are wielding";
-#endif
- else
-#ifdef JP
- act = (left_hander ? "¤òº¸¼ê¤ËÁõÈ÷¤·¤¿" : "¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿");
-#else
- act = "You are wielding";
+#define STR_WIELD_RARM "You are wielding %s (%c) in your right hand."
+#define STR_WIELD_LARM "You are wielding %s (%c) in your left hand."
+#define STR_WIELD_ARMS "You are wielding %s (%c) with both hands."
#endif
- }
- else if (slot == INVEN_LARM)
+ /* Where is the item now */
+ switch (slot)
{
-#ifdef JP
- act = (left_hander ? "¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿" : "¤òº¸¼ê¤ËÁõÈ÷¤·¤¿");
-#else
- act = "You are wielding";
-#endif
+ case INVEN_RARM:
+ if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(FALSE) == EMPTY_HAND_LARM) && CAN_TWO_HANDS_WIELDING())
+ act = STR_WIELD_ARMS;
+ else
+ act = (left_hander ? STR_WIELD_LARM : STR_WIELD_RARM);
+ break;
- }
- else if (slot == INVEN_BOW)
- {
+ case INVEN_LARM:
+ if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(FALSE) == EMPTY_HAND_RARM) && CAN_TWO_HANDS_WIELDING())
+ act = STR_WIELD_ARMS;
+ else
+ act = (left_hander ? STR_WIELD_RARM : STR_WIELD_LARM);
+ break;
+
+ case INVEN_BOW:
#ifdef JP
- act = "¤ò¼Í·âÍѤËÁõÈ÷¤·¤¿";
+ act = "%s(%c)¤ò¼Í·âÍѤËÁõÈ÷¤·¤¿¡£";
#else
- act = "You are shooting with";
+ act = "You are shooting with %s (%c).";
#endif
+ break;
- }
- else if (slot == INVEN_LITE)
- {
+ case INVEN_LITE:
#ifdef JP
- act = "¤ò¸÷¸»¤Ë¤·¤¿";
+ act = "%s(%c)¤ò¸÷¸»¤Ë¤·¤¿¡£";
#else
- act = "Your light source is";
+ act = "Your light source is %s (%c).";
#endif
+ break;
- }
- else
- {
+ default:
#ifdef JP
- act = "¤òÁõÈ÷¤·¤¿";
+ act = "%s(%c)¤òÁõÈ÷¤·¤¿¡£";
#else
- act = "You are wearing";
+ act = "You are wearing %s (%c).";
#endif
-
+ break;
}
/* Describe the result */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
/* Message */
-#ifdef JP
- msg_format("%s(%c)%s¡£", o_name, index_to_label(slot), act );
-#else
- msg_format("%s %s (%c).", act, o_name, index_to_label(slot));
-#endif
+ msg_format(act, o_name, index_to_label(slot));
/* Cursed! */
- if (cursed_p(o_ptr))
+ if (object_is_cursed(o_ptr))
{
/* Warn the player */
#ifdef JP
o_ptr->ident |= (IDENT_SENSE);
}
+ /* The Stone Mask make the player turn into a vampire! */
if ((o_ptr->name1 == ART_STONEMASK) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
{
- int h_percent;
- if (p_ptr->prace < 32)
- {
- p_ptr->old_race1 |= 1L << p_ptr->prace;
- }
- else
- {
- p_ptr->old_race2 = 1L << (p_ptr->prace-32);
- }
- p_ptr->prace = RACE_VAMPIRE;
-#ifdef JP
- msg_format("¤¢¤Ê¤¿¤ÏµÛ·ìµ´¤ËÊѲ½¤·¤¿¡ª");
-#else
- msg_format("You polymorphed into a vampire!");
-#endif
-
- rp_ptr = &race_info[p_ptr->prace];
-
- /* Experience factor */
- p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
-
- /* Calculate the height/weight for males */
- if (p_ptr->psex == SEX_MALE)
- {
- p_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
- h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
- p_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent /100
- , (int)(rp_ptr->m_m_wt) * h_percent / 300 );
- }
-
- /* Calculate the height/weight for females */
- else if (p_ptr->psex == SEX_FEMALE)
- {
- p_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
- h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
- p_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent /100
- , (int)(rp_ptr->f_m_wt) * h_percent / 300 );
- }
-
- check_experience();
-
- /* Hitdice */
- if (p_ptr->pclass == CLASS_SORCERER)
- p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
- else
- p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
-
- do_cmd_rerate(FALSE);
-
- p_ptr->redraw |= (PR_BASIC);
-
- p_ptr->update |= (PU_BONUS);
-
- handle_stuff();
- lite_spot(py, px);
+ /* Turn into a vampire */
+ change_race(RACE_VAMPIRE, "");
}
/* Recalculate bonuses */
void kamaenaoshi(int item)
{
- object_type *o_ptr, *o2_ptr;
+ object_type *o_ptr, *new_o_ptr;
char o_name[MAX_NLEN];
- if ((item == INVEN_RARM) && buki_motteruka(INVEN_LARM))
+ if (item == INVEN_RARM)
{
- o_ptr = &inventory[INVEN_RARM];
- o2_ptr = &inventory[INVEN_LARM];
- object_copy(o_ptr, o2_ptr);
- p_ptr->total_weight += o2_ptr->weight;
- inven_item_increase(INVEN_LARM,-1);
- inven_item_optimize(INVEN_LARM);
- object_desc(o_name, o_ptr, TRUE, 3);
- if (((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
+ if (buki_motteruka(INVEN_LARM))
+ {
+ o_ptr = &inventory[INVEN_LARM];
+ object_desc(o_name, o_ptr, 0);
+
+ if (!object_is_cursed(o_ptr))
+ {
+ new_o_ptr = &inventory[INVEN_RARM];
+ object_copy(new_o_ptr, o_ptr);
+ p_ptr->total_weight += o_ptr->weight;
+ inven_item_increase(INVEN_LARM, -((int)o_ptr->number));
+ inven_item_optimize(INVEN_LARM);
+ if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
#ifdef JP
- msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name );
+ msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name);
#else
- msg_format("You are wielding %s with two-handed.", o_name );
+ msg_format("You are wielding %s with both hands.", o_name);
#endif
- else
+ else
#ifdef JP
- msg_format("%s¤ò%s¤Ç¹½¤¨¤¿¡£", o_name, (left_hander ? "º¸¼ê" : "±¦¼ê"));
+ msg_format("%s¤ò%s¤Ç¹½¤¨¤¿¡£", o_name, (left_hander ? "º¸¼ê" : "±¦¼ê"));
#else
- msg_format("You are wielding %s with %s hand.", o_name, (left_hander ? "left":"right") );
+ msg_format("You are wielding %s in your %s hand.", o_name, (left_hander ? "left":"right"));
#endif
+ }
+ else
+ {
+ if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
+#ifdef JP
+ msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name);
+#else
+ msg_format("You are wielding %s with both hands.", o_name);
+#endif
+ }
+ }
}
- else if ((item == INVEN_LARM) && buki_motteruka(INVEN_RARM))
+ else if (item == INVEN_LARM)
{
o_ptr = &inventory[INVEN_RARM];
- object_desc(o_name, o_ptr, TRUE, 3);
- if (((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
+ if (o_ptr->k_idx) object_desc(o_name, o_ptr, 0);
+
+ if (buki_motteruka(INVEN_RARM))
+ {
+ if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
#ifdef JP
- msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name );
+ msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name);
#else
- msg_format("You are wielding %s with two-handed.", o_name );
+ msg_format("You are wielding %s with both hands.", o_name);
#endif
- }
- else if ((item == INVEN_LARM) && !(empty_hands(FALSE) & 0x0002))
- {
- o_ptr = &inventory[INVEN_LARM];
- o2_ptr = &inventory[INVEN_RARM];
- object_copy(o_ptr, o2_ptr);
- p_ptr->total_weight += o2_ptr->weight;
- inven_item_increase(INVEN_RARM,-1);
- inven_item_optimize(INVEN_RARM);
- object_desc(o_name, o_ptr, TRUE, 3);
+ }
+ else if (!(empty_hands(FALSE) & EMPTY_HAND_RARM) && !object_is_cursed(o_ptr))
+ {
+ new_o_ptr = &inventory[INVEN_LARM];
+ object_copy(new_o_ptr, o_ptr);
+ p_ptr->total_weight += o_ptr->weight;
+ inven_item_increase(INVEN_RARM, -((int)o_ptr->number));
+ inven_item_optimize(INVEN_RARM);
#ifdef JP
- msg_format("%s¤ò»ý¤ÁÂؤ¨¤¿¡£", o_name );
+ msg_format("%s¤ò»ý¤ÁÂؤ¨¤¿¡£", o_name);
#else
- msg_format("You switched hand of %s.", o_name );
+ msg_format("You switched hand of %s.", o_name);
#endif
+ }
}
}
/* Item is cursed */
- if (cursed_p(o_ptr))
+ if (object_is_cursed(o_ptr))
{
if ((o_ptr->curse_flags & TRC_PERMA_CURSE) || (p_ptr->pclass != CLASS_BERSERKER))
{
/* Hack -- Cannot remove cursed items */
- if ((item >= INVEN_RARM) && cursed_p(o_ptr))
+ if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
{
/* Oops */
#ifdef JP
/* Drop (some of) the item */
inven_drop(item, amt);
- if ((item == INVEN_RARM) || (item == INVEN_LARM)) kamaenaoshi(item);
-
- if (item >= INVEN_RARM) calc_android_exp();
+ if (item >= INVEN_RARM)
+ {
+ kamaenaoshi(item);
+ calc_android_exp();
+ }
p_ptr->redraw |= (PR_EQUIPPY);
}
(o_ptr->tval == TV_CHAOS_BOOK) ||
(o_ptr->tval == TV_DEATH_BOOK) ||
(o_ptr->tval == TV_TRUMP_BOOK) ||
- (o_ptr->tval == TV_ENCHANT_BOOK) ||
+ (o_ptr->tval == TV_CRAFT_BOOK) ||
(o_ptr->tval == TV_DAEMON_BOOK) ||
(o_ptr->tval == TV_CRUSADE_BOOK) ||
- (o_ptr->tval == TV_MUSIC_BOOK))
+ (o_ptr->tval == TV_MUSIC_BOOK) ||
+ (o_ptr->tval == TV_HEX_BOOK))
{
if (o_ptr->sval > 1)
return TRUE;
o_ptr = &o_list[0 - item];
}
+ /* Verify unless quantity given beforehand */
+ if (!force && (confirm_destroy || (object_value(o_ptr) > 0)))
+ {
+ object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
+
+ /* Make a verification */
+ sprintf(out_val,
+#ifdef JP
+ "ËÜÅö¤Ë%s¤ò²õ¤·¤Þ¤¹¤«? [y/n/Auto]",
+#else
+ "Really destroy %s? [y/n/Auto]",
+#endif
+ o_name);
+
+ msg_print(NULL);
+
+ /* HACK : Add the line to message buffer */
+ message_add(out_val);
+ p_ptr->window |= (PW_MESSAGE);
+ window_stuff();
+
+ /* Get an acceptable answer */
+ while (TRUE)
+ {
+ char i;
+
+ /* Prompt */
+ prt(out_val, 0, 0);
+
+ i = inkey();
+
+ /* Erase the prompt */
+ prt("", 0, 0);
+
+
+ if (i == 'y' || i == 'Y')
+ {
+ break;
+ }
+ if (i == ESCAPE || i == 'n' || i == 'N')
+ {
+ /* Cancel */
+ return;
+ }
+ if (i == 'A')
+ {
+ /* Add an auto-destroy preference line */
+ if (autopick_autoregister(o_ptr))
+ {
+ /* Auto-destroy it */
+ autopick_alter_item(item, TRUE);
+ }
+
+ /* The object is already destroyed. */
+ return;
+ }
+ } /* while (TRUE) */
+ }
/* See how many items */
if (o_ptr->number > 1)
/* Describe the object */
old_number = o_ptr->number;
o_ptr->number = amt;
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
o_ptr->number = old_number;
- /* Verify unless quantity given */
- if (!force)
- {
- if (confirm_destroy || (object_value(o_ptr) > 0))
- {
- /* Make a verification */
-#ifdef JP
- sprintf(out_val, "ËÜÅö¤Ë%s¤ò²õ¤·¤Þ¤¹¤«? ", o_name);
-#else
- sprintf(out_val, "Really destroy %s? ", o_name);
-#endif
-
- if (!get_check(out_val)) return;
- }
- }
-
/* Take a turn */
energy_use = 100;
/* Description */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
/* Describe */
#ifdef JP
/* Describe it fully */
#ifdef JP
- if (!screen_object(o_ptr, TRUE)) msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
+ if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
#else
- if (!screen_object(o_ptr, TRUE)) msg_print("You see nothing special.");
+ if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) msg_print("You see nothing special.");
#endif
}
}
/* Describe the activity */
- object_desc(o_name, o_ptr, TRUE, 2);
+ object_desc(o_name, o_ptr, OD_OMIT_INSCRIPTION);
/* Message */
#ifdef JP
*/
void do_cmd_look(void)
{
+ /*TEST*/
+ p_ptr->window |= PW_MONSTER_LIST;
+ window_stuff();
+ /*TEST*/
+
/* Look around */
if (target_set(TARGET_LOOK))
{
/*
- * The table of "symbol info" -- each entry is a string of the form
- * "X:desc" where "X" is the trigger, and "desc" is the "info".
- */
-static cptr ident_info[] =
-{
-#ifdef JP
- " :°Å°Ç",
- "!:Ìô, ¥ª¥¤¥ë",
- "\":¥¢¥ß¥å¥ì¥Ã¥È, ðô¾þ¤ê",
- "#:ÊÉ(±£¤·¥É¥¢)Ëô¤Ï¿¢Êª",
- "$:ºâÊõ(¶â¤«ÊõÀÐ)",
- "%:¹ÛÌ®(Íϴ䤫ÀбÑ)",
- "&:Ȣ",
- "':³«¤¤¤¿¥É¥¢",
- "(:Æð¤é¤«¤¤Ëɶñ",
- "):½â",
- "*:ºâÊõ¤ò´Þ¤ó¤À¹ÛÌ®¤Þ¤¿¤Ïµå·Á¤Î²øʪ",
- "+:ÊĤ¸¤¿¥É¥¢",
- ",:¿©¤Ùʪ, ¤ª¤Ð¤±¥¥Î¥³",
- "-:ËâË¡ËÀ, ¥í¥Ã¥É",
- ".:¾²",
- "/:´È¾õÉð´ï(¥¢¥Ã¥¯¥¹/¥Ñ¥¤¥¯/Åù)",
- "0:Çîʪ´Û¤ÎÆþ¸ý",
- "1:»¨²ß²°¤ÎÆþ¸ý",
- "2:Ëɶñ²°¤ÎÆþ¸ý",
- "3:Éð´ïÀìÌ珤ÎÆþ¸ý",
- "4:»û±¡¤ÎÆþ¸ý",
- "5:Ï£¶â½Ñ¤ÎŹ¤ÎÆþ¸ý",
- "6:ËâË¡¤ÎŹ¤ÎÆþ¸ý",
- "7:¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤ÎÆþ¸ý",
- "8:²æ¤¬²È¤ÎÆþ¸ý",
- "9:½ñŹ¤ÎÆþ¸ý",
- "::´äÀÐ",
- ";:²óÈò¤Î³¨Ê¸»ú/Çúȯ¤Î¥ë¡¼¥ó",
- "<:¾å¤ê³¬ÃÊ",
- "=:»ØÎØ",
- ">:²¼¤ê³¬ÃÊ",
- "?:´¬Êª",
- "@:¥×¥ì¥¤¥ä¡¼",
- "A:Å·»È",
- "B:Ļ",
- "C:¸¤",
- "D:¸ÅÂå¥É¥é¥´¥ó/¥ï¥¤¥¢¡¼¥à",
- "E:¥¨¥ì¥á¥ó¥¿¥ë",
- "F:¥È¥ó¥Ü",
- "G:¥´¡¼¥¹¥È",
- "H:»¨¼ï",
- "I:º«Ãî",
- "J:¥Ø¥Ó",
- "K:¥¥é¡¼¡¦¥Ó¡¼¥È¥ë",
- "L:¥ê¥Ã¥Á",
- "M:¿¼ó¤Îà¨ÃîÎà",
- "N:Ææ¤ÎÀ¸Êª",
- "O:¥ª¡¼¥¬",
- "P:µðÂç¿Í´Ö·¿À¸Êª",
- "Q:¥¯¥¤¥ë¥¹¥ë¥°(Ì®ÂǤÄÆù²ô)",
- "R:à¨ÃîÎà/ξÀ¸Îà",
- "S:ÃØéá/¥µ¥½¥ê/¥À¥Ë",
- "T:¥È¥í¥ë",
- "U:¾åµé¥Ç¡¼¥â¥ó",
- "V:¥Ð¥ó¥Ñ¥¤¥¢",
- "W:¥ï¥¤¥È/¥ì¥¤¥¹/Åù",
- "X:¥¾¡¼¥ó/¥¶¥ì¥ó/Åù",
- "Y:¥¤¥¨¥Æ¥£",
- "Z:¥Ï¥¦¥ó¥É",
- "[:·ø¤¤¥¢¡¼¥Þ¡¼",
- "\\:Æß´ï(¥á¥¤¥¹/¥à¥Á/Åù)",
- "]:¼ï¡¹¤ÎËɶñ",
- "^:¥È¥é¥Ã¥×",
- "_:¾ó",
- "`:¿Í·Á¡¤Ä¦Áü",
- "a:¥¢¥ê",
- "b:¥³¥¦¥â¥ê",
- "c:¥à¥«¥Ç",
- "d:¥É¥é¥´¥ó",
- "e:ÌܶÌ",
- "f:¥Í¥³",
- "g:¥´¡¼¥ì¥à",
- "h:¥Û¥Ó¥Ã¥È/¥¨¥ë¥Õ/¥É¥ï¡¼¥Õ",
- "i:¥Ù¥È¥Ù¥È",
- "j:¥¼¥ê¡¼",
- "k:¥³¥Ü¥ë¥É",
- "l:¿åÀ³À¸Êª",
- "m:¥â¥ë¥É",
- "n:¥Ê¡¼¥¬",
- "o:¥ª¡¼¥¯",
- "p:¿Í´Ö",
- "q:»Í½Ã",
- "r:¥Í¥º¥ß",
- "s:¥¹¥±¥ë¥È¥ó",
- "t:Ä®¤Î¿Í",
- "u:²¼µé¥Ç¡¼¥â¥ó",
- "v:¥Ü¥ë¥Æ¥Ã¥¯¥¹",
- "w:¥¤¥â¥à¥·/Âç·²",
- /* "x:unused", */
- "y:¥¤¡¼¥¯",
- "z:¥¾¥ó¥Ó/¥ß¥¤¥é",
- "{:Èô¤ÓÆ»¶ñ¤ÎÃÆ(Ìð/ÃÆ)",
- "|:Åá·õÎà(¥½¡¼¥É/¥À¥¬¡¼/Åù)",
- "}:Èô¤ÓÆ»¶ñ(µÝ/¥¯¥í¥¹¥Ü¥¦/¥¹¥ê¥ó¥°)",
- "~:¿å/ÍÏ´äή(¼ï¡¹¤Î¥¢¥¤¥Æ¥à)",
-#else
- " :A dark grid",
- "!:A potion (or oil)",
- "\":An amulet (or necklace)",
- "#:A wall (or secret door)",
- "$:Treasure (gold or gems)",
- "%:A vein (magma or quartz)",
- "&:A chest",
- "':An open door",
- "(:Soft armor",
- "):A shield",
- "*:A vein with treasure or a ball monster",
- "+:A closed door",
- ",:Food (or mushroom patch)",
- "-:A wand (or rod)",
- ".:Floor",
- "/:A polearm (Axe/Pike/etc)",
- "0:Entrance to Museum",
- "1:Entrance to General Store",
- "2:Entrance to Armory",
- "3:Entrance to Weaponsmith",
- "4:Entrance to Temple",
- "5:Entrance to Alchemy shop",
- "6:Entrance to Magic store",
- "7:Entrance to Black Market",
- "8:Entrance to your home",
- "9:Entrance to the bookstore",
- "::Rubble",
- ";:A glyph of warding / explosive rune",
- "<:An up staircase",
- "=:A ring",
- ">:A down staircase",
- "?:A scroll",
- "@:You",
- "A:Angel",
- "B:Bird",
- "C:Canine",
- "D:Ancient Dragon/Wyrm",
- "E:Elemental",
- "F:Dragon Fly",
- "G:Ghost",
- "H:Hybrid",
- "I:Insect",
- "J:Snake",
- "K:Killer Beetle",
- "L:Lich",
- "M:Multi-Headed Reptile",
- "N:Mystery Living",
- "O:Ogre",
- "P:Giant Humanoid",
- "Q:Quylthulg (Pulsing Flesh Mound)",
- "R:Reptile/Amphibian",
- "S:Spider/Scorpion/Tick",
- "T:Troll",
- "U:Major Demon",
- "V:Vampire",
- "W:Wight/Wraith/etc",
- "X:Xorn/Xaren/etc",
- "Y:Yeti",
- "Z:Zephyr Hound",
- "[:Hard armor",
- "\\:A hafted weapon (mace/whip/etc)",
- "]:Misc. armor",
- "^:A trap",
- "_:A staff",
- "`:A figurine or statue",
- "a:Ant",
- "b:Bat",
- "c:Centipede",
- "d:Dragon",
- "e:Floating Eye",
- "f:Feline",
- "g:Golem",
- "h:Hobbit/Elf/Dwarf",
- "i:Icky Thing",
- "j:Jelly",
- "k:Kobold",
- "l:Aquatic monster",
- "m:Mold",
- "n:Naga",
- "o:Orc",
- "p:Person/Human",
- "q:Quadruped",
- "r:Rodent",
- "s:Skeleton",
- "t:Townsperson",
- "u:Minor Demon",
- "v:Vortex",
- "w:Worm/Worm-Mass",
- /* "x:unused", */
- "y:Yeek",
- "z:Zombie/Mummy",
- "{:A missile (arrow/bolt/shot)",
- "|:An edged weapon (sword/dagger/etc)",
- "}:A launcher (bow/crossbow/sling)",
- "~:Fluid terrain (or miscellaneous item)",
-#endif
-
- NULL
-};
-
-
-/*
* Sorting hook -- Comp function -- see below
*
* We use "u" to point to array of monster indexes,
int z1, z2;
-
/* Sort by player kills */
if (*why >= 4)
{
u16b holder;
+ /* Unused */
+ (void)v;
+
/* Swap */
holder = who[a];
who[a] = who[b];
bool all = FALSE;
bool uniq = FALSE;
bool norm = FALSE;
+ bool ride = FALSE;
char temp[80] = "";
bool recall = FALSE;
/* Get a character, or abort */
#ifdef JP
- if (!get_com("ÃΤꤿ¤¤Ê¸»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤(µ¹æ or ^AÁ´,^U¥æ,^NÈó¥æ,^M̾Á°): ", &sym, FALSE)) return;
+ if (!get_com("ÃΤꤿ¤¤Ê¸»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤(µ¹æ or ^AÁ´,^U¥æ,^NÈó¥æ,^R¾èÇÏ,^M̾Á°): ", &sym, FALSE)) return;
#else
if (!get_com("Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): ", &sym, FALSE)) return;
#endif
-
/* Find that character info, and describe it */
for (i = 0; ident_info[i]; ++i)
{
#else
strcpy(buf, "Full monster list.");
#endif
-
}
else if (sym == KTRL('U'))
{
#else
strcpy(buf, "Unique monster list.");
#endif
-
}
else if (sym == KTRL('N'))
{
#else
strcpy(buf, "Non-unique monster list.");
#endif
-
+ }
+ else if (sym == KTRL('R'))
+ {
+ all = ride = TRUE;
+#ifdef JP
+ strcpy(buf, "¾èÇϲÄǽ¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
+#else
+ strcpy(buf, "Ridable monster list.");
+#endif
}
/* XTRA HACK WHATSEARCH */
else if (sym == KTRL('M'))
#else
sprintf(buf, "%c - %s.", sym, "Unknown Symbol");
#endif
-
}
/* Display the result */
/* Require unique monsters if needed */
if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue;
+ /* Require ridable monsters if needed */
+ if (ride && !(r_ptr->flags7 & (RF7_RIDING))) continue;
+
/* XTRA HACK WHATSEARCH */
- if (temp[0]){
+ if (temp[0])
+ {
int xx;
char temp2[80];
- for (xx=0; temp[xx] && xx<80; xx++){
+ for (xx=0; temp[xx] && xx<80; xx++)
+ {
#ifdef JP
if (iskanji( temp[xx])) { xx++; continue; }
#endif
if (isupper(temp2[xx])) temp2[xx]=tolower(temp2[xx]);
#ifdef JP
- if (strstr(temp2, temp) || strstr_j(r_name + r_ptr->name, temp) )
+ if (my_strstr(temp2, temp) || my_strstr(r_name + r_ptr->name, temp) )
#else
- if (strstr(temp2, temp))
+ if (my_strstr(temp2, temp))
#endif
who[n++]=i;
- }else
+ }
+
/* Collect "appropriate" monsters */
- if (all || (r_ptr->d_char == sym)) who[n++] = i;
+ else if (all || (r_ptr->d_char == sym)) who[n++] = i;
}
/* Nothing to recall */
/* Hack -- Handle stuff */
handle_stuff();
- /* Hack -- Begin the prompt */
- roff_top(r_idx);
-
- /* Hack -- Complete the prompt */
-#ifdef JP
- Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ESC]");
-#else
- Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC]");
-#endif
-
-
/* Interact */
while (1)
{
/* Recall on screen */
screen_roff(who[i], 0);
+ }
- /* Hack -- Complete the prompt (again) */
+ /* Hack -- Begin the prompt */
+ roff_top(r_idx);
+
+ /* Hack -- Complete the prompt */
#ifdef JP
- Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ESC]");
+ Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ESC]");
#else
- Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC]");
+ Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC]");
#endif
- }
-
/* Command */
query = inkey();
}
-/*
- * research_mon
- * -KMW-
- */
-bool research_mon(void)
-{
- int i, n, r_idx;
- char sym, query;
- char buf[128];
-
- bool notpicked;
-
- bool recall = FALSE;
-
- u16b why = 0;
-
- u16b *who;
-
- /* XTRA HACK WHATSEARCH */
- bool all = FALSE;
- bool uniq = FALSE;
- bool norm = FALSE;
- char temp[80] = "";
-
- /* XTRA HACK REMEMBER_IDX */
- static int old_sym = '\0';
- static int old_i = 0;
-
-
- /* Save the screen */
- screen_save();
-
- /* Get a character, or abort */
-#ifdef JP
-if (!get_com("¥â¥ó¥¹¥¿¡¼¤Îʸ»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤(µ¹æ or ^AÁ´,^U¥æ,^NÈó¥æ,^M̾Á°):", &sym, FALSE))
-#else
- if (!get_com("Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): ", &sym, FALSE))
-#endif
-
- {
- /* Restore */
- screen_load();
-
- return (FALSE);
- }
-
- /* Find that character info, and describe it */
- for (i = 0; ident_info[i]; ++i)
- {
- if (sym == ident_info[i][0]) break;
- }
-
- /* XTRA HACK WHATSEARCH */
- if (sym == KTRL('A'))
- {
- all = TRUE;
-#ifdef JP
- strcpy(buf, "Á´¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
-#else
- strcpy(buf, "Full monster list.");
-#endif
- }
- else if (sym == KTRL('U'))
- {
- all = uniq = TRUE;
-#ifdef JP
- strcpy(buf, "¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
-#else
- strcpy(buf, "Unique monster list.");
-#endif
- }
- else if (sym == KTRL('N'))
- {
- all = norm = TRUE;
-#ifdef JP
- strcpy(buf, "¥æ¥Ë¡¼¥¯³°¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
-#else
- strcpy(buf, "Non-unique monster list.");
-#endif
- }
- else if (sym == KTRL('M'))
- {
- all = TRUE;
-#ifdef JP
- if (!get_string("̾Á°(±Ñ¸ì¤Î¾ì¹ç¾®Ê¸»ú¤Ç²Ä)",temp, 70))
-#else
- if (!get_string("Enter name:",temp, 70))
-#endif
- {
- temp[0]=0;
-
- /* Restore */
- screen_load();
-
- return FALSE;
- }
-#ifdef JP
- sprintf(buf, "̾Á°:%s¤Ë¥Þ¥Ã¥Á",temp);
-#else
- sprintf(buf, "Monsters with a name \"%s\"",temp);
-#endif
- }
- else if (ident_info[i])
- {
- sprintf(buf, "%c - %s.", sym, ident_info[i] + 2);
- }
- else
- {
-#ifdef JP
-sprintf(buf, "%c - %s", sym, "̵¸ú¤Êʸ»ú");
-#else
- sprintf(buf, "%c - %s.", sym, "Unknown Symbol");
-#endif
-
- }
-
- /* Display the result */
- prt(buf, 16, 10);
-
-
- /* Allocate the "who" array */
- C_MAKE(who, max_r_idx, u16b);
-
- /* Collect matching monsters */
- for (n = 0, i = 1; i < max_r_idx; i++)
- {
- monster_race *r_ptr = &r_info[i];
-
- /* XTRA HACK WHATSEARCH */
- /* Require non-unique monsters if needed */
- if (norm && (r_ptr->flags1 & (RF1_UNIQUE))) continue;
-
- /* Require unique monsters if needed */
- if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue;
-
- /* ̾Á°¸¡º÷ */
- if (temp[0]){
- int xx;
- char temp2[80];
-
- for (xx=0; temp[xx] && xx<80; xx++){
-#ifdef JP
- if (iskanji( temp[xx])) { xx++; continue; }
-#endif
- if (isupper(temp[xx])) temp[xx]=tolower(temp[xx]);
- }
-
-#ifdef JP
- strcpy(temp2, r_name+r_ptr->E_name);
-#else
- strcpy(temp2, r_name+r_ptr->name);
-#endif
- for (xx=0; temp2[xx] && xx<80; xx++)
- if (isupper(temp2[xx])) temp2[xx]=tolower(temp2[xx]);
-
-#ifdef JP
- if (strstr(temp2, temp) || strstr_j(r_name + r_ptr->name, temp) )
-#else
- if (strstr(temp2, temp))
-#endif
- who[n++]=i;
- }
- else if (all || (r_ptr->d_char == sym)) who[n++] = i;
- }
-
- /* Nothing to recall */
- if (!n)
- {
- /* Free the "who" array */
- C_KILL(who, max_r_idx, u16b);
-
- /* Restore */
- screen_load();
-
- return (FALSE);
- }
-
- /* Sort by level */
- why = 2;
- query = 'y';
-
- /* Sort if needed */
- if (why)
- {
- /* Select the sort method */
- ang_sort_comp = ang_sort_comp_hook;
- ang_sort_swap = ang_sort_swap_hook;
-
- /* Sort the array */
- ang_sort(who, &why, n);
- }
-
-
- /* Start at the end */
- /* XTRA HACK REMEMBER_IDX */
- if (old_sym == sym && old_i < n) i = old_i;
- else i = n - 1;
-
- notpicked = TRUE;
-
- /* Scan the monster memory */
- while (notpicked)
- {
- /* Extract a race */
- r_idx = who[i];
-
- /* Save this monster ID */
- p_ptr->monster_race_idx = r_idx;
-
- /* Hack -- Handle stuff */
- handle_stuff();
-
- /* Hack -- Begin the prompt */
- roff_top(r_idx);
-
- /* Hack -- Complete the prompt */
-#ifdef JP
-Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ' '¤Ç³¹Ô, ESC]");
-#else
- Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC, space to continue]");
-#endif
-
-
- /* Interact */
- while (1)
- {
- /* Recall */
- if (recall)
- {
- /* Recall on screen */
- monster_race *r_ptr = &r_info[r_idx];
- int m;
-
- /* Hack -- Maximal info */
- r_ptr->r_wake = r_ptr->r_ignore = MAX_UCHAR;
-
- /* Observe "maximal" attacks */
- for (m = 0; m < 4; m++)
- {
- /* Examine "actual" blows */
- if (r_ptr->blow[m].effect || r_ptr->blow[m].method)
- {
- /* Hack -- maximal observations */
- r_ptr->r_blows[m] = MAX_UCHAR;
- }
- }
-
- /* Hack -- maximal drops */
- r_ptr->r_drop_gold = r_ptr->r_drop_item =
- (((r_ptr->flags1 & RF1_DROP_4D2) ? 8 : 0) +
- ((r_ptr->flags1 & RF1_DROP_3D2) ? 6 : 0) +
- ((r_ptr->flags1 & RF1_DROP_2D2) ? 4 : 0) +
- ((r_ptr->flags1 & RF1_DROP_1D2) ? 2 : 0) +
- ((r_ptr->flags1 & RF1_DROP_90) ? 1 : 0) +
- ((r_ptr->flags1 & RF1_DROP_60) ? 1 : 0));
-
- /* Hack -- but only "valid" drops */
- if (r_ptr->flags1 & RF1_ONLY_GOLD) r_ptr->r_drop_item = 0;
- if (r_ptr->flags1 & RF1_ONLY_ITEM) r_ptr->r_drop_gold = 0;
-
- /* Hack -- observe many spells */
- r_ptr->r_cast_inate = MAX_UCHAR;
- r_ptr->r_cast_spell = MAX_UCHAR;
-
- /* Hack -- know all the flags */
- r_ptr->r_flags1 = r_ptr->flags1;
- r_ptr->r_flags2 = r_ptr->flags2;
- r_ptr->r_flags3 = r_ptr->flags3;
- r_ptr->r_flags4 = r_ptr->flags4;
- r_ptr->r_flags5 = r_ptr->flags5;
- r_ptr->r_flags6 = r_ptr->flags6;
-
- r_ptr->r_xtra1 |= MR1_SINKA;
-
- /* know every thing mode */
- screen_roff(r_idx, 0x01);
- notpicked = FALSE;
-
- /* XTRA HACK REMEMBER_IDX */
- old_sym = sym;
- old_i = i;
- }
-
- /* Command */
- query = inkey();
-
- /* Normal commands */
- if (query != 'r') break;
-
- /* Toggle recall */
- recall = !recall;
- }
-
- /* Stop scanning */
- if (query == ESCAPE) break;
-
- /* Move to "prev" monster */
- if (query == '-')
- {
- if (++i == n)
- {
- i = 0;
- if (!expand_list) break;
- }
- }
-
- /* Move to "next" monster */
- else
- {
- if (i-- == 0)
- {
- i = n - 1;
- if (!expand_list) break;
- }
- }
- }
-
-
- /* Re-display the identity */
- /* prt(buf, 5, 5);*/
-
- /* Free the "who" array */
- C_KILL(who, max_r_idx, u16b);
-
- /* Restore */
- screen_load();
-
- return (!notpicked);
-}
-