-/* File: cmd3.c */
-
-/* Purpose: Inventory commands */
-
-/*
- * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
+/*!
+ * @file cmd3.c
+ * @brief プレイヤーのアイテムに関するコマンドの実装1 / Inventory commands
+ * @date 2014/01/02
+ * @author
+ * 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"
+#include "selfinfo.h"
+#include "cmd-activate.h"
+#include "cmd-eat.h"
+#include "cmd-quaff.h"
+#include "cmd-read.h"
+#include "cmd-usestaff.h"
+#include "cmd-zaprod.h"
+#include "cmd-zapwand.h"
-/*
- * Display inventory
+/*!
+ * @brief 持ち物一覧を表示するコマンドのメインルーチン / Display inventory
+ * @return なし
*/
void do_cmd_inven(void)
{
item_tester_full = FALSE;
#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));
+ sprintf(out_val, "持ち物: 合計 %3d.%1d kg (限界の%ld%%) コマンド: ",
+ (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
}
-/*
- * Display equipment
+/*!
+ * @brief 装備一覧を表示するコマンドのメインルーチン / Display equipment
+ * @return なし
*/
void do_cmd_equip(void)
{
/* 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));
+ sprintf(out_val, "装備: 合計 %3d.%1d kg (限界の%ld%%) コマンド: ",
+ (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
}
-/*
- * The "wearable" tester
+/*!
+ * @brief オブジェクトを防具として装備できるかの判定 / The "wearable" tester
+ * @param o_ptr 判定するオブジェクトの構造体参照ポインタ
+ * @return オブジェクトが防具として装備できるならTRUEを返す。
*/
static bool item_tester_hook_wear(object_type *o_ptr)
{
}
+/*!
+ * @brief オブジェクトがどちらの手にも装備できる武器かどうかの判定
+ * @param o_ptr 判定するオブジェクトの構造体参照ポインタ
+ * @return 左右両方の手で装備できるならばTRUEを返す。
+ */
static bool item_tester_hook_mochikae(object_type *o_ptr)
{
/* Check for a usable slot */
return (FALSE);
}
-
+/*!
+ * @brief オブジェクトが右手か左手に装備できる武器かどうかの判定
+ * @param o_ptr 判定するオブジェクトの構造体参照ポインタ
+ * @return 右手か左手の武器として装備できるならばTRUEを返す。
+ */
static bool item_tester_hook_melee_weapon(object_type *o_ptr)
{
/* Check for a usable slot */
}
-/*
- * Wield or wear a single item from the pack or floor
+bool select_ring_slot = FALSE;
+
+/*!
+ * @brief 装備するコマンドのメインルーチン / Wield or wear a single item from the pack or floor
+ * @return なし
*/
void do_cmd_wield(void)
{
- int i, item, slot;
+ OBJECT_IDX item, slot;
object_type forge;
object_type *q_ptr;
cptr q, s;
+ OBJECT_IDX need_switch_wielding = 0;
+
if (p_ptr->special_defense & KATA_MUSOU)
{
set_action(ACTION_NONE);
item_tester_hook = item_tester_hook_wear;
/* Get an item */
-#ifdef JP
- q = "¤É¤ì¤òÁõÈ÷¤·¤Þ¤¹¤«? ";
- s = "ÁõÈ÷²Äǽ¤Ê¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
-#else
- q = "Wear/Wield which item? ";
- s = "You have nothing you can wear or wield.";
-#endif
+ q = _("どれを装備しますか? ", "Wear/Wield which item? ");
+ s = _("装備可能なアイテムがない。", "You have nothing you can wear or wield.");
if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
/* 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)
- {
- /* 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
-
-#ifdef JP
-s = "¤ª¤Ã¤È¡£";
-#else
- s = "Oops.";
-#endif
-
- if (!get_item(&slot, q, s, (USE_EQUIP)))
- return;
- }
-
-#endif /* EASY_RING -- TNB */
- if (((o_ptr->tval == TV_SHIELD) || (o_ptr->tval == TV_CARD) || (o_ptr->tval == TV_CAPTURE)) &&
- buki_motteruka(INVEN_RARM) && buki_motteruka(INVEN_LARM))
+ switch (o_ptr->tval)
{
- /* 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
-q = "¤É¤Á¤é¤ÎÉð´ï¤È¼è¤êÂؤ¨¤Þ¤¹¤«?";
-#else
- q = "Replace which weapon? ";
-#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 */
+ q = _("どちらの武器と取り替えますか?", "Replace which weapon? ");
+ s = _("おっと。", "Oops.");
+ if (!get_item(&slot, q, s, (USE_EQUIP))) return;
+ if (slot == INVEN_RARM) need_switch_wielding = INVEN_LARM;
+ }
-#ifdef JP
-s = "¤ª¤Ã¤È¡£";
-#else
- s = "Oops.";
-#endif
+ else if (buki_motteruka(INVEN_LARM)) slot = INVEN_RARM;
- if (!get_item(&slot, q, s, (USE_EQUIP)))
- return;
- if (slot == INVEN_RARM)
+ /* 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]))
{
- 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];
+ /* Restrict the choices */
+ item_tester_hook = item_tester_hook_mochikae;
- otmp_ptr = &object_tmp;
+ /* Choose a hand */
+ q = _("どちらの手に装備しますか?", "Equip which hand? ");
+ s = _("おっと。", "Oops.");
+ 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)
+ {
+ if (!get_check(_("二刀流で戦いますか?", "Dual wielding? "))) slot = INVEN_RARM;
+ }
- object_desc(ol_name, ol_ptr, FALSE, 0);
+ else if (!inventory[INVEN_RARM].k_idx && buki_motteruka(INVEN_LARM))
+ {
+ if (!get_check(_("二刀流で戦いますか?", "Dual wielding? "))) slot = INVEN_LARM;
+ }
- object_copy(otmp_ptr, ol_ptr);
- object_copy(ol_ptr, or_ptr);
- object_copy(or_ptr, otmp_ptr);
-#ifdef JP
- msg_format("%s¤ò±¦¼ê¤Ë¹½¤¨¤Ê¤ª¤·¤¿¡£", ol_name);
-#else
- msg_format("You wield %s at right hand.", ol_name);
-#endif
+ /* 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;
- slot = INVEN_LARM;
+ /* Choose a hand */
+ q = _("どちらの手に装備しますか?", "Equip which hand? ");
+ s = _("おっと。", "Oops.");
+
+ 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))
- {
-#ifdef JP
- if (!get_check("ÆóÅáή¤ÇÀ襤¤Þ¤¹¤«¡©"))
-#else
- if (!get_check("Dual wielding? "))
-#endif
+ /* Rings */
+ case TV_RING:
+ /* Choose a ring slot */
+ if (inventory[INVEN_LEFT].k_idx && inventory[INVEN_RIGHT].k_idx)
{
- slot = INVEN_RARM;
+ q = _("どちらの指輪と取り替えますか?", "Replace which ring? ");
}
- }
+ else
+ {
+ q = _("どちらの手に装備しますか?", "Equip which hand? ");
+ }
+ s = _("おっと。", "Oops.");
- 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 */
-#ifdef JP
-q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
-#else
- q = "Equip which hand? ";
-#endif
-
-#ifdef JP
-s = "¤ª¤Ã¤È¡£";
-#else
- s = "Oops.";
-#endif
+ 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
- msg_format("%s%s¤Ï¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£",
- describe_use(slot) , o_name );
+ msg_format("%s%sは呪われているようだ。",
+ describe_use(slot) , o_name );
#else
msg_format("The %s you are %s appears to be cursed.",
- o_name, describe_use(slot));
+ 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);
-
-#ifdef JP
-sprintf(dummy, "ËÜÅö¤Ë%s{¼ö¤ï¤ì¤Æ¤¤¤ë}¤ò»È¤¤¤Þ¤¹¤«¡©", o_name);
-#else
- sprintf(dummy, "Really use the %s {cursed}? ", o_name);
-#endif
-
+ object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+ sprintf(dummy, _("本当に%s{呪われている}を使いますか?", "Really use the %s {cursed}? "), o_name);
- 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, "%sを装備すると吸血鬼になります。よろしいですか?", o_name);
#else
msg_format("%s will transforms you into a vampire permanently when equiped.", 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;
-#ifdef JP
-msg_print("¥¯¥¨¥¹¥È¤òãÀ®¤·¤¿¡ª");
-#else
- msg_print("You completed the quest!");
-#endif
+ 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];
- msg_print(NULL);
- }
+ 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);
+
+ msg_format(_("%sを%sに構えなおした。", "You wield %s at %s hand."), switch_name,
+ (slot == INVEN_RARM) ? (left_hander ? _("左手", "left") : _("右手", "right")) :
+ (left_hander ? _("右手", "right") : _("左手", "left")));
+ 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;
+ p_ptr->energy_use = 100;
/* Get local object */
q_ptr = &forge;
/* 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 = "¤òξ¼ê¤Ç¹½¤¨¤¿";
-#else
- act = "You are wielding";
-#endif
- else
#ifdef JP
- act = (left_hander ? "¤òº¸¼ê¤ËÁõÈ÷¤·¤¿" : "¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿");
+#define STR_WIELD_RARM "%s(%c)を右手に装備した。"
+#define STR_WIELD_LARM "%s(%c)を左手に装備した。"
+#define STR_WIELD_ARMS "%s(%c)を両手で構えた。"
#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)
- {
-#ifdef JP
- act = "¤ò¼Í·âÍѤËÁõÈ÷¤·¤¿";
-#else
- act = "You are shooting with";
-#endif
+ 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;
- }
- else if (slot == INVEN_LITE)
- {
-#ifdef JP
- act = "¤ò¸÷¸»¤Ë¤·¤¿";
-#else
- act = "Your light source is";
-#endif
+ case INVEN_BOW:
+ act = _("%s(%c)を射撃用に装備した。", "You are shooting with %s (%c).");
+ break;
- }
- else
- {
-#ifdef JP
- act = "¤òÁõÈ÷¤·¤¿";
-#else
- act = "You are wearing";
-#endif
+ case INVEN_LITE:
+ act = _("%s(%c)を光源にした。", "Your light source is %s (%c).");
+ break;
+ default:
+ act = _("%s(%c)を装備した。", "You are wearing %s (%c).");
+ 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
- msg_print("¤¦¤ï¡ª ¤¹¤µ¤Þ¤¸¤¯Î䤿¤¤¡ª");
-#else
- msg_print("Oops! It feels deathly cold!");
-#endif
-
-
+ msg_print(_("うわ! すさまじく冷たい!", "Oops! It feels deathly cold!"));
chg_virtue(V_HARMONY, -1);
/* Note the curse */
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 */
calc_android_exp();
}
-
+/*!
+ * @brief 持ち替え処理
+ * @param item 持ち替えを行いたい装備部位ID
+ * @return なし
+ */
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)))
-#ifdef JP
- msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name );
-#else
- msg_format("You are wielding %s with two-handed.", o_name );
-#endif
- else
-#ifdef JP
- msg_format("%s¤ò%s¤Ç¹½¤¨¤¿¡£", o_name, (left_hander ? "º¸¼ê" : "±¦¼ê"));
-#else
- msg_format("You are wielding %s with %s hand.", o_name, (left_hander ? "left":"right") );
-#endif
+ 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())
+ msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
+ else
+ msg_format(_("%sを%sで構えた。", "You are wielding %s in your %s hand."), o_name,
+ (left_hander ? _("左手", "left") : _("右手", "right")));
+ }
+ else
+ {
+ if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
+ msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
+ }
+ }
}
- 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)))
-#ifdef JP
- msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name );
-#else
- msg_format("You are wielding %s with two-handed.", 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);
-#ifdef JP
- msg_format("%s¤ò»ý¤ÁÂؤ¨¤¿¡£", o_name );
-#else
- msg_format("You switched hand of %s.", o_name );
-#endif
+ 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())
+ msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
+ }
+ 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);
+ msg_format(_("%sを持ち替えた。", "You switched hand of %s."), o_name);
+ }
}
}
-/*
- * Take off an item
+/*!
+ * @brief 装備を外すコマンドのメインルーチン / Take off an item
+ * @return なし
*/
void do_cmd_takeoff(void)
{
- int item;
+ OBJECT_IDX item;
object_type *o_ptr;
item_tester_no_ryoute = TRUE;
/* Get an item */
#ifdef JP
- q = "¤É¤ì¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤Þ¤¹¤«? ";
- s = "¤Ï¤º¤»¤ëÁõÈ÷¤¬¤Ê¤¤¡£";
+ q = "どれを装備からはずしますか? ";
+ s = "はずせる装備がない。";
#else
q = "Take off which item? ";
s = "You are not wearing anything to take off.";
/* 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))
{
/* Oops */
-#ifdef JP
- msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
-#else
- msg_print("Hmmm, it seems to be cursed.");
-#endif
+ msg_print(_("ふーむ、どうやら呪われているようだ。", "Hmmm, it seems to be cursed."));
/* Nope */
return;
if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && one_in_(7)) || one_in_(4))
{
-#ifdef JP
- msg_print("¼ö¤ï¤ì¤¿ÁõÈ÷¤òÎϤŤ¯¤ÇÇí¤¬¤·¤¿¡ª");
-#else
- msg_print("You teared a cursed equipment off by sheer strength!");
-#endif
+ msg_print(_("呪われた装備を力づくで剥がした!", "You teared a cursed equipment off by sheer strength!"));
/* Hack -- Assume felt */
o_ptr->ident |= (IDENT_SENSE);
/* Window stuff */
p_ptr->window |= (PW_EQUIP);
-#ifdef JP
- msg_print("¼ö¤¤¤òÂǤÁÇˤä¿¡£");
-#else
- msg_print("You break the curse.");
-#endif
+ msg_print(_("呪いを打ち破った。", "You break the curse."));
}
else
{
-#ifdef JP
- msg_print("ÁõÈ÷¤ò³°¤»¤Ê¤«¤Ã¤¿¡£");
-#else
- msg_print("You couldn't remove the equipment.");
-#endif
- energy_use = 50;
+ msg_print(_("装備を外せなかった。", "You couldn't remove the equipment."));
+ p_ptr->energy_use = 50;
return;
}
}
/* Take a partial turn */
- energy_use = 50;
+ p_ptr->energy_use = 50;
/* Take off the item */
(void)inven_takeoff(item, 255);
}
-/*
- * Drop an item
+/*!
+ * @brief アイテムを落とすコマンドのメインルーチン / Drop an item
+ * @return なし
*/
void do_cmd_drop(void)
{
- int item, amt = 1;
+ OBJECT_IDX item;
+ int amt = 1;
object_type *o_ptr;
item_tester_no_ryoute = TRUE;
/* Get an item */
#ifdef JP
- q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÍî¤È¤·¤Þ¤¹¤«? ";
- s = "Íî¤È¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
+ q = "どのアイテムを落としますか? ";
+ s = "落とせるアイテムを持っていない。";
#else
q = "Drop which item? ";
s = "You have nothing to drop.";
/* 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
- msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
-#else
- msg_print("Hmmm, it seems to be cursed.");
-#endif
-
-
+ msg_print(_("ふーむ、どうやら呪われているようだ。", "Hmmm, it seems to be cursed."));
/* Nope */
return;
}
/* Take a partial turn */
- energy_use = 50;
+ p_ptr->energy_use = 50;
/* 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);
}
-
+/*!
+ * @brief オブジェクトが高位の魔法書かどうかを判定する
+ * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
+ * @return オブジェクトが高位の魔法書ならばTRUEを返す
+ */
static bool high_level_book(object_type *o_ptr)
{
if ((o_ptr->tval == TV_LIFE_BOOK) ||
(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;
}
-/*
- * Destroy an item
+/*!
+ * @brief アイテムを破壊するコマンドのメインルーチン / Destroy an item
+ * @return なし
*/
void do_cmd_destroy(void)
{
- int item, amt = 1;
- int old_number;
-
- bool force = FALSE;
+ OBJECT_IDX item;
+ QUANTITY amt = 1;
+ QUANTITY old_number;
- object_type *o_ptr;
- object_type forge;
- object_type *q_ptr = &forge;
+ bool force = FALSE;
- char o_name[MAX_NLEN];
+ object_type *o_ptr;
+ object_type forge;
+ object_type *q_ptr = &forge;
- char out_val[MAX_NLEN+40];
+ char o_name[MAX_NLEN];
+ char out_val[MAX_NLEN+40];
cptr q, s;
/* Get an item */
#ifdef JP
- q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò²õ¤·¤Þ¤¹¤«? ";
- s = "²õ¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£";
+ q = "どのアイテムを壊しますか? ";
+ s = "壊せるアイテムを持っていない。";
#else
q = "Destroy which item? ";
s = "You have nothing to destroy.";
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, _("本当に%sを壊しますか? [y/n/Auto]", "Really destroy %s? [y/n/Auto]"), 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;
+ p_ptr->energy_use = 100;
/* Artifacts cannot be destroyed */
if (!can_player_destroy_object(o_ptr))
{
- energy_use = 0;
+ p_ptr->energy_use = 0;
/* Message */
-#ifdef JP
- msg_format("%s¤ÏÇ˲õÉÔ²Äǽ¤À¡£", o_name);
-#else
- msg_format("You cannot destroy %s.", o_name);
-#endif
-
+ msg_format(_("%sは破壊不可能だ。", "You cannot destroy %s."), o_name);
/* Done */
return;
}
object_copy(q_ptr, o_ptr);
/* Message */
-#ifdef JP
- msg_format("%s¤ò²õ¤·¤¿¡£", o_name);
-#else
- msg_format("You destroy %s.", o_name);
-#endif
-
+ msg_format(_("%sを壊した。", "You destroy %s."), o_name);
sound(SOUND_DESTITEM);
/* Reduce the charges of rods/wands */
if (q_ptr->sval < 3) tester_exp /= 4;
if (tester_exp<1) tester_exp = 1;
-#ifdef JP
-msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
-#else
- msg_print("You feel more experienced.");
-#endif
-
+ msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
gain_exp(tester_exp * amt);
}
if (high_level_book(q_ptr) && q_ptr->tval == TV_LIFE_BOOK)
}
-/*
- * Observe an item which has been *identify*-ed
+/*!
+ * @brief アイテムを調査するコマンドのメインルーチン / Observe an item which has been *identify*-ed
+ * @return なし
*/
void do_cmd_observe(void)
{
- int item;
-
+ OBJECT_IDX item;
object_type *o_ptr;
-
char o_name[MAX_NLEN];
cptr q, s;
item_tester_no_ryoute = TRUE;
/* Get an item */
#ifdef JP
- q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«? ";
- s = "Ä´¤Ù¤é¤ì¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
+ q = "どのアイテムを調べますか? ";
+ s = "調べられるアイテムがない。";
#else
q = "Examine which item? ";
s = "You have nothing to examine.";
/* Require full knowledge */
if (!(o_ptr->ident & IDENT_MENTAL))
{
-#ifdef JP
- msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ä¤¤¤ÆÆäËÃΤäƤ¤¤ë¤³¤È¤Ï¤Ê¤¤¡£");
-#else
- msg_print("You have no special knowledge about that item.");
-#endif
-
+ msg_print(_("このアイテムについて特に知っていることはない。", "You have no special knowledge about that item."));
return;
}
/* Description */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
/* Describe */
-#ifdef JP
- msg_format("%s¤òÄ´¤Ù¤Æ¤¤¤ë...", o_name);
-#else
- msg_format("Examining %s...", o_name);
-#endif
-
+ msg_format(_("%sを調べている...", "Examining %s..."), o_name);
/* Describe it fully */
-#ifdef JP
- if (!identify_fully_aux(o_ptr)) msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
-#else
- if (!identify_fully_aux(o_ptr)) msg_print("You see nothing special.");
-#endif
-
+ if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
}
-/*
- * Remove the inscription from an object
- * XXX Mention item (when done)?
+/*!
+ * @brief アイテムの銘を消すコマンドのメインルーチン
+ * Remove the inscription from an object XXX Mention item (when done)?
+ * @return なし
*/
void do_cmd_uninscribe(void)
{
- int item;
-
+ OBJECT_IDX item;
object_type *o_ptr;
-
cptr q, s;
item_tester_no_ryoute = TRUE;
/* Get an item */
#ifdef JP
- q = "¤É¤Î¥¢¥¤¥Æ¥à¤ÎÌäò¾Ã¤·¤Þ¤¹¤«? ";
- s = "Ìäò¾Ã¤»¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
+ q = "どのアイテムの銘を消しますか? ";
+ s = "銘を消せるアイテムがない。";
#else
q = "Un-inscribe which item? ";
s = "You have nothing to un-inscribe.";
/* Nothing to remove */
if (!o_ptr->inscription)
{
-#ifdef JP
- msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ï¾Ã¤¹¤Ù¤Ì䬤ʤ¤¡£");
-#else
- msg_print("That item had no inscription to remove.");
-#endif
-
+ msg_print(_("このアイテムには消すべき銘がない。", "That item had no inscription to remove."));
return;
}
/* Message */
-#ifdef JP
- msg_print("Ìäò¾Ã¤·¤¿¡£");
-#else
- msg_print("Inscription removed.");
-#endif
-
+ msg_print(_("銘を消した。", "Inscription removed."));
/* Remove the incription */
o_ptr->inscription = 0;
/* Window stuff */
p_ptr->window |= (PW_INVEN | PW_EQUIP);
- /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
+ /* .や$の関係で, 再計算が必要なはず -- henkma */
p_ptr->update |= (PU_BONUS);
}
-/*
- * Auto flag inscribe
- */
-
-typedef struct flag_insc_table
-{
-#ifdef JP
- cptr japanese;
-#endif
- cptr english;
- int flag;
- u32b except_flag;
-} flag_insc_table;
-
-#ifdef JP
-static flag_insc_table flag_insc_plus[] =
-{
- { "¹¶", "At", TR_BLOWS, -1 },
- { "®", "Sp", TR_SPEED, -1 },
- { "ÏÓ", "St", TR_STR, -1 },
- { "ÃÎ", "In", TR_INT, -1 },
- { "¸", "Wi", TR_WIS, -1 },
- { "´ï", "Dx", TR_DEX, -1 },
- { "ÂÑ", "Cn", TR_CON, -1 },
- { "̥", "Ch", TR_CHR, -1 },
- { "±£", "Sl", TR_STEALTH, -1 },
- { "õ", "Sr", TR_SEARCH, -1 },
- { "ÀÖ", "If", TR_INFRA, -1 },
- { "·¡", "Dg", TR_TUNNEL, -1 },
- { NULL, NULL, 0, -1 }
-};
-
-static flag_insc_table flag_insc_immune[] =
-{
- { "»À", "Ac", TR_IM_ACID, -1 },
- { "ÅÅ", "El", TR_IM_ELEC, -1 },
- { "²Ð", "Fi", TR_IM_FIRE, -1 },
- { "Îä", "Co", TR_IM_COLD, -1 },
- { NULL, NULL, 0, -1 }
-};
-
-static flag_insc_table flag_insc_resistance[] =
-{
- { "»À", "Ac", TR_RES_ACID, TR_IM_ACID },
- { "ÅÅ", "El", TR_RES_ELEC, TR_IM_ELEC },
- { "²Ð", "Fi", TR_RES_FIRE, TR_IM_FIRE },
- { "Îä", "Co", TR_RES_COLD, TR_IM_COLD },
- { "ÆÇ", "Po", TR_RES_POIS, -1 },
- { "Á®", "Li", TR_RES_LITE, -1 },
- { "°Å", "Dk", TR_RES_DARK, -1 },
- { "ÇË", "Sh", TR_RES_SHARDS, -1 },
- { "ÌÕ", "Bl", TR_RES_BLIND, -1 },
- { "Íð", "Cf", TR_RES_CONF, -1 },
- { "¹ì", "So", TR_RES_SOUND, -1 },
- { "¹ö", "Nt", TR_RES_NETHER, -1 },
- { "°ø", "Nx", TR_RES_NEXUS, -1 },
- { "ÆÙ", "Ca", TR_RES_CHAOS, -1 },
- { "Îô", "Di", TR_RES_DISEN, -1 },
- { "¶²", "Fe", TR_RES_FEAR, -1 },
- { NULL, NULL, 0, -1 }
-};
-
-static flag_insc_table flag_insc_misc[] =
-{
- { "ËâÎÏ", "Ma", TR_DEC_MANA, -1 },
- { "Åê", "Th", TR_THROW, -1 },
- { "ȿ", "Rf", TR_REFLECT, -1 },
- { "Ëã", "Fa", TR_FREE_ACT, -1 },
- { "ȑ", "Si", TR_SEE_INVIS, -1 },
- { "·Ð", "Hl", TR_HOLD_LIFE, -1 },
- { "´¶", "Esp", TR_TELEPATHY, -1 },
- { "ÃÙ", "Sd", TR_SLOW_DIGEST, -1 },
- { "³è", "Rg", TR_REGEN, -1 },
- { "Éâ", "Lv", TR_FEATHER, -1 },
- { "ÌÀ", "Lu", TR_LITE, -1 },
- { "·Ù", "Wr", TR_WARNING, -1 },
- { "ÇÜ", "Xm", TR_XTRA_MIGHT, -1 },
- { "¼Í", "Xs", TR_XTRA_SHOTS, -1 },
- { "ÅÜ", "Ag", TR_AGGRAVATE, -1 },
- { "½Ë", "Bs", TR_BLESSED, -1 },
-#if 0
- { "±Ê¼ö", "Pc", TR_PERMA_CURSE, -1 },
- { "¼ö", "Cu", TR_HEAVY_CURSE, TR_PERMA_CURSE },
- { "´÷", "Ty", TR_TY_CURSE, -1 },
-#endif
- { NULL, NULL, 0, -1 }
-};
-
-static flag_insc_table flag_insc_aura[] =
-{
- { "±ê", "F", TR_SH_FIRE, -1 },
- { "ÅÅ", "E", TR_SH_ELEC, -1 },
- { "Îä", "C", TR_SH_COLD, -1 },
- { "Ëâ", "M", TR_NO_MAGIC, -1 },
- { "½Ö", "T", TR_NO_TELE, -1 },
- { NULL, NULL, 0, -1 }
-};
-
-static flag_insc_table flag_insc_brand[] =
-{
- { "»À", "A", TR_BRAND_ACID, -1 },
- { "ÅÅ", "E", TR_BRAND_ELEC, -1 },
- { "¾Æ", "F", TR_BRAND_FIRE, -1 },
- { "Åà", "Co", TR_BRAND_COLD, -1 },
- { "ÆÇ", "P", TR_BRAND_POIS, -1 },
- { "ÆÙ", "Ca", TR_CHAOTIC, -1 },
- { "µÛ", "V", TR_VAMPIRIC, -1 },
- { "¿Ì", "Q", TR_IMPACT, -1 },
- { "ÀÚ", "S", TR_VORPAL, -1 },
- { "Íý", "M", TR_FORCE_WEAPON, -1 },
- { NULL, NULL, 0, -1 }
-};
-
-static flag_insc_table flag_insc_kill[] =
-{
- { "¼Ù", "*", TR_KILL_EVIL, -1 },
- { "¿Í", "p", TR_KILL_HUMAN, -1 },
- { "ζ", "D", TR_KILL_DRAGON, -1 },
- { "¥ª", "o", TR_KILL_ORC, -1 },
- { "¥È", "T", TR_KILL_TROLL, -1 },
- { "µð", "P", TR_KILL_GIANT, -1 },
- { "¥Ç", "U", TR_KILL_DEMON, -1 },
- { "Ȉ", "L", TR_KILL_UNDEAD, -1 },
- { "ư", "Z", TR_KILL_ANIMAL, -1 },
- { NULL, NULL, 0, -1 }
-};
-
-static flag_insc_table flag_insc_slay[] =
-{
- { "¼Ù", "*", TR_SLAY_EVIL, TR_KILL_EVIL },
- { "¿Í", "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
- { "ε", "d", TR_SLAY_DRAGON, TR_KILL_DRAGON },
- { "¥ª", "o", TR_SLAY_ORC, TR_KILL_ORC },
- { "¥È", "T", TR_SLAY_TROLL, TR_KILL_TROLL },
- { "µð", "P", TR_SLAY_GIANT, TR_KILL_GIANT },
- { "¥Ç", "U", TR_SLAY_DEMON, TR_KILL_DEMON },
- { "Ȉ", "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
- { "ư", "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
- { NULL, NULL, 0, -1 }
-};
-
-static flag_insc_table flag_insc_sust[] =
-{
- { "ÏÓ", "St", TR_SUST_STR, -1 },
- { "ÃÎ", "In", TR_SUST_INT, -1 },
- { "¸", "Wi", TR_SUST_WIS, -1 },
- { "´ï", "Dx", TR_SUST_DEX, -1 },
- { "ÂÑ", "Cn", TR_SUST_CON, -1 },
- { "̥", "Ch", TR_SUST_CHR, -1 },
- { NULL, NULL, 0, -1 }
-};
-
-#else
-static flag_insc_table flag_insc_plus[] =
-{
- { "At", TR_BLOWS, -1 },
- { "Sp", TR_SPEED, -1 },
- { "St", TR_STR, -1 },
- { "In", TR_INT, -1 },
- { "Wi", TR_WIS, -1 },
- { "Dx", TR_DEX, -1 },
- { "Cn", TR_CON, -1 },
- { "Ch", TR_CHR, -1 },
- { "Sl", TR_STEALTH, -1 },
- { "Sr", TR_SEARCH, -1 },
- { "If", TR_INFRA, -1 },
- { "Dg", TR_TUNNEL, -1 },
- { NULL, 0, -1 }
-};
-
-static flag_insc_table flag_insc_immune[] =
-{
- { "Ac", TR_IM_ACID, -1 },
- { "El", TR_IM_ELEC, -1 },
- { "Fi", TR_IM_FIRE, -1 },
- { "Co", TR_IM_COLD, -1 },
- { NULL, 0, -1 }
-};
-
-static flag_insc_table flag_insc_resistance[] =
-{
- { "Ac", TR_RES_ACID, TR_IM_ACID },
- { "El", TR_RES_ELEC, TR_IM_ELEC },
- { "Fi", TR_RES_FIRE, TR_IM_FIRE },
- { "Co", TR_RES_COLD, TR_IM_COLD },
- { "Po", TR_RES_POIS, -1 },
- { "Li", TR_RES_LITE, -1 },
- { "Dk", TR_RES_DARK, -1 },
- { "Sh", TR_RES_SHARDS, -1 },
- { "Bl", TR_RES_BLIND, -1 },
- { "Cf", TR_RES_CONF, -1 },
- { "So", TR_RES_SOUND, -1 },
- { "Nt", TR_RES_NETHER, -1 },
- { "Nx", TR_RES_NEXUS, -1 },
- { "Ca", TR_RES_CHAOS, -1 },
- { "Di", TR_RES_DISEN, -1 },
- { "Fe", TR_RES_FEAR, -1 },
- { NULL, 0, -1 }
-};
-
-static flag_insc_table flag_insc_misc[] =
-{
- { "Ma", TR_DEC_MANA, -1 },
- { "Th", TR_THROW, -1 },
- { "Rf", TR_REFLECT, -1 },
- { "Fa", TR_FREE_ACT, -1 },
- { "Si", TR_SEE_INVIS, -1 },
- { "Hl", TR_HOLD_LIFE, -1 },
- { "Esp", TR_TELEPATHY, -1 },
- { "Sd", TR_SLOW_DIGEST, -1 },
- { "Rg", TR_REGEN, -1 },
- { "Lv", TR_FEATHER, -1 },
- { "Lu", TR_LITE, -1 },
- { "Wr", TR_WARNING, -1 },
- { "Xm", TR_XTRA_MIGHT, -1 },
- { "Xs", TR_XTRA_SHOTS, -1 },
- { "Ag", TR_AGGRAVATE, -1 },
- { "Bs", TR_BLESSED, -1 },
-#if 0
- { "Pc", TR_PERMA_CURSE, -1 },
- { "Cu", TR_HEAVY_CURSE, TR_PERMA_CURSE },
- { "Ty", TR_TY_CURSE, -1 },
-#endif
-#if 0
- { "De", TR_DRAIN_EXP, -1 },
-#endif
- { NULL, 0, -1 }
-};
-
-static flag_insc_table flag_insc_aura[] =
-{
- { "F", TR_SH_FIRE, -1 },
- { "E", TR_SH_ELEC, -1 },
- { "C", TR_SH_COLD, -1 },
- { "M", TR_NO_MAGIC, -1 },
- { "T", TR_NO_TELE, -1 },
- { NULL, 0, -1 }
-};
-
-static flag_insc_table flag_insc_brand[] =
-{
- { "A", TR_BRAND_ACID, -1 },
- { "E", TR_BRAND_ELEC, -1 },
- { "F", TR_BRAND_FIRE, -1 },
- { "Co", TR_BRAND_COLD, -1 },
- { "P", TR_BRAND_POIS, -1 },
- { "Ca", TR_CHAOTIC, -1 },
- { "V", TR_VAMPIRIC, -1 },
- { "Q", TR_IMPACT, -1 },
- { "S", TR_VORPAL, -1 },
- { "M", TR_FORCE_WEAPON, -1 },
- { NULL, 0, -1 }
-};
-
-static flag_insc_table flag_insc_kill[] =
-{
- { "*", TR_KILL_EVIL, -1 },
- { "p", TR_KILL_HUMAN, -1 },
- { "D", TR_KILL_DRAGON, -1 },
- { "o", TR_KILL_ORC, -1 },
- { "T", TR_KILL_TROLL, -1 },
- { "P", TR_KILL_GIANT, -1 },
- { "U", TR_KILL_DEMON, -1 },
- { "L", TR_KILL_UNDEAD, -1 },
- { "Z", TR_KILL_ANIMAL, -1 },
- { NULL, 0, -1 }
-};
-
-static flag_insc_table flag_insc_slay[] =
-{
- { "*", TR_SLAY_EVIL, TR_KILL_EVIL },
- { "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
- { "d", TR_SLAY_DRAGON, TR_KILL_DRAGON },
- { "o", TR_SLAY_ORC, TR_KILL_ORC },
- { "T", TR_SLAY_TROLL, TR_KILL_TROLL },
- { "P", TR_SLAY_GIANT, TR_KILL_GIANT },
- { "U", TR_SLAY_DEMON, TR_KILL_DEMON },
- { "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
- { "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
- { NULL, 0, -1 }
-};
-
-static flag_insc_table flag_insc_sust[] =
-{
- { "St", TR_SUST_STR, -1 },
- { "In", TR_SUST_INT, -1 },
- { "Wi", TR_SUST_WIS, -1 },
- { "Dx", TR_SUST_DEX, -1 },
- { "Cn", TR_SUST_CON, -1 },
- { "Ch", TR_SUST_CHR, -1 },
- { NULL, 0, -1 }
-};
-#endif
-
-#define ADD_INSC(STR) (void)(strcat(ptr, (STR)), ptr += strlen(STR))
-
-static char *inscribe_flags_aux(flag_insc_table *fi_ptr, u32b flgs[TR_FLAG_SIZE], bool kanji, char *ptr)
-{
- while (fi_ptr->english)
- {
- if (have_flag(flgs, fi_ptr->flag) &&
- (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
-#ifdef JP
- ADD_INSC(kanji ? fi_ptr->japanese : fi_ptr->english);
-#else
- ADD_INSC(fi_ptr->english);
-#endif
- fi_ptr++;
- }
-
- return ptr;
-}
-
-static bool have_flag_of(flag_insc_table *fi_ptr, u32b flgs[TR_FLAG_SIZE])
-{
- while (fi_ptr->english)
- {
- if (have_flag(flgs, fi_ptr->flag) &&
- (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
- return (TRUE);
- fi_ptr++;
- }
-
- return (FALSE);
-}
-
-s16b inscribe_flags(object_type *o_ptr, cptr out_val)
-{
- char buff[1024];
- char *ptr = buff;
- char *prev_ptr = buff;
- int i;
-
- bool kanji = FALSE;
- bool all = TRUE;
- u32b flgs[TR_FLAG_SIZE];
-
- /* not fully identified */
- if (!(o_ptr->ident & IDENT_MENTAL))
- return quark_add(out_val);
-
- /* Extract the flags */
- object_flags(o_ptr, flgs);
-
-
- *buff = '\0';
- for (i = 0; out_val[i]; i++)
- {
- if ('%' == out_val[i] )
- {
- cptr start_percent = ptr;
-#ifdef JP
- if ('%' == out_val[i+1])
- {
- i++;
- kanji = FALSE;
- }
- else
- {
- kanji = TRUE;
- }
-#endif
- if ('a' == out_val[i+1] && 'l' == out_val[i+2] && 'l' == out_val[i+3])
- {
- all = TRUE;
- i += 3;
- }
- else
- {
- all = FALSE;
- }
-
- /* check for too long inscription */
- if (ptr >= buff + MAX_NLEN) continue;
-
- /* Remove obvious flags */
- if (!all)
- {
- object_kind *k_ptr = &k_info[o_ptr->k_idx];
- int j;
-
- /* Base object */
- for (j = 0; j < TR_FLAG_SIZE; j++)
- flgs[j] &= ~k_ptr->flags[j];
-
- if (o_ptr->name1)
- {
- artifact_type *a_ptr = &a_info[o_ptr->name1];
-
- for (j = 0; j < TR_FLAG_SIZE; j++)
- flgs[j] &= ~a_ptr->flags[j];
- }
-
- if (o_ptr->name2)
- {
- ego_item_type *e_ptr = &e_info[o_ptr->name2];
-
- for (j = 0; j < TR_FLAG_SIZE; j++)
- flgs[j] &= ~e_ptr->flags[j];
- }
- }
-
-
- /* Plusses */
- if (have_flag_of(flag_insc_plus, flgs))
- {
- if (kanji)
- ADD_INSC("+");
- }
- ptr = inscribe_flags_aux(flag_insc_plus, flgs, kanji, ptr);
-
- /* Immunity */
- if (have_flag_of(flag_insc_immune, flgs))
- {
- if (!kanji && ptr != prev_ptr)
- {
- ADD_INSC(";");
- prev_ptr = ptr;
- }
- ADD_INSC("*");
- }
- ptr = inscribe_flags_aux(flag_insc_immune, flgs, kanji, ptr);
-
- /* Resistance */
- if (have_flag_of(flag_insc_resistance, flgs))
- {
- if (kanji)
- ADD_INSC("r");
- else if (ptr != prev_ptr)
- {
- ADD_INSC(";");
- prev_ptr = ptr;
- }
- }
- ptr = inscribe_flags_aux(flag_insc_resistance, flgs, kanji, ptr);
-
- /* Misc Ability */
- if (have_flag_of(flag_insc_misc, flgs))
- {
- if (ptr != prev_ptr)
- {
- ADD_INSC(";");
- prev_ptr = ptr;
- }
- }
- ptr = inscribe_flags_aux(flag_insc_misc, flgs, kanji, ptr);
-
- /* Aura */
- if (have_flag_of(flag_insc_aura, flgs))
- {
- ADD_INSC("[");
- }
- ptr = inscribe_flags_aux(flag_insc_aura, flgs, kanji, ptr);
-
- /* Brand Weapon */
- if (have_flag_of(flag_insc_brand, flgs))
- ADD_INSC("|");
- ptr = inscribe_flags_aux(flag_insc_brand, flgs, kanji, ptr);
-
- /* Kill Weapon */
- if (have_flag_of(flag_insc_kill, flgs))
- ADD_INSC("/X");
- ptr = inscribe_flags_aux(flag_insc_kill, flgs, kanji, ptr);
-
- /* Slay Weapon */
- if (have_flag_of(flag_insc_slay, flgs))
- ADD_INSC("/");
- ptr = inscribe_flags_aux(flag_insc_slay, flgs, kanji, ptr);
-
- /* Random Teleport */
- if (have_flag(flgs, TR_TELEPORT))
- {
- ADD_INSC(".");
- }
-
- /* sustain */
- if (have_flag_of(flag_insc_sust, flgs))
- {
- ADD_INSC("(");
- }
- ptr = inscribe_flags_aux(flag_insc_sust, flgs, kanji, ptr);
-
- if (ptr == start_percent)
- ADD_INSC(" ");
- }
- else
- {
- *ptr++ = out_val[i];
- *ptr = '\0';
- }
- }
-
- /* cut too long inscription */
- if (strlen(buff) >= MAX_NLEN-1)
- {
-#ifdef JP
- int n;
- for (n = 0; n < MAX_NLEN; n++)
- if(iskanji(buff[n])) n++;
- if (n == MAX_NLEN) n = MAX_NLEN-2; /* ºÇ¸å¤¬´Á»úȾʬ */
- buff[n] = '\0';
-#else
- buff[MAX_NLEN-1] = '\0';
-#endif
- }
-
- return quark_add(buff);
-}
-/*
+/*!
+ * @brief アイテムの銘を刻むコマンドのメインルーチン
* Inscribe an object with a comment
+ * @return なし
*/
void do_cmd_inscribe(void)
{
- int item;
-
+ OBJECT_IDX item;
object_type *o_ptr;
-
char o_name[MAX_NLEN];
-
char out_val[80];
-
cptr q, s;
item_tester_no_ryoute = TRUE;
/* Get an item */
#ifdef JP
- q = "¤É¤Î¥¢¥¤¥Æ¥à¤ËÌäò¹ï¤ß¤Þ¤¹¤«? ";
- s = "Ìäò¹ï¤á¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¡£";
+ q = "どのアイテムに銘を刻みますか? ";
+ s = "銘を刻めるアイテムがない。";
#else
q = "Inscribe which item? ";
s = "You have nothing to inscribe.";
}
/* Describe the activity */
- object_desc(o_name, o_ptr, TRUE, 2);
+ object_desc(o_name, o_ptr, OD_OMIT_INSCRIPTION);
/* Message */
-#ifdef JP
- msg_format("%s¤ËÌäò¹ï¤à¡£", o_name);
-#else
- msg_format("Inscribing %s.", o_name);
-#endif
-
+ msg_format(_("%sに銘を刻む。", "Inscribing %s."), o_name);
msg_print(NULL);
/* Start with nothing */
}
/* Get a new inscription (possibly empty) */
-#ifdef JP
- if (get_string("ÌÃ: ", out_val, 80))
-#else
- if (get_string("Inscription: ", out_val, 80))
-#endif
+ if (get_string(_("銘: ", "Inscription: "), out_val, 80))
{
/* Save the inscription */
- o_ptr->inscription = inscribe_flags(o_ptr, out_val);
+ o_ptr->inscription = quark_add(out_val);
/* Combine the pack */
p_ptr->notice |= (PN_COMBINE);
/* Window stuff */
p_ptr->window |= (PW_INVEN | PW_EQUIP);
- /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */
+ /* .や$の関係で, 再計算が必要なはず -- henkma */
p_ptr->update |= (PU_BONUS);
}
}
-/*
+/*!
+ * @brief オブジェクトがランタンの燃料になるかどうかを判定する
* An "item_tester_hook" for refilling lanterns
+ * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
+ * @return オブジェクトがランタンの燃料になるならばTRUEを返す
*/
static bool item_tester_refill_lantern(object_type *o_ptr)
{
}
-/*
+/*!
+ * @brief ランタンに燃料を加えるコマンドのメインルーチン
* Refill the players lamp (from the pack or floor)
+ * @return なし
*/
static void do_cmd_refill_lamp(void)
{
- int item;
+ OBJECT_IDX item;
object_type *o_ptr;
object_type *j_ptr;
/* Get an item */
#ifdef JP
- q = "¤É¤ÎÌý¤Ä¤Ü¤«¤éÃí¤®¤Þ¤¹¤«? ";
- s = "Ìý¤Ä¤Ü¤¬¤Ê¤¤¡£";
+ q = "どの油つぼから注ぎますか? ";
+ s = "油つぼがない。";
#else
q = "Refill with which flask? ";
s = "You have no flasks of oil.";
/* Take a partial turn */
- energy_use = 50;
+ p_ptr->energy_use = 50;
/* Access the lantern */
j_ptr = &inventory[INVEN_LITE];
j_ptr->xtra4 += o_ptr->xtra4;
/* Message */
-#ifdef JP
- msg_print("¥é¥ó¥×¤ËÌý¤òÃí¤¤¤À¡£");
-#else
- msg_print("You fuel your lamp.");
-#endif
+ msg_print(_("ランプに油を注いだ。", "You fuel your lamp."));
/* Comment */
if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
{
j_ptr->xtra4 = 0;
-#ifdef JP
- msg_print("¥é¥ó¥×¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
-#else
- msg_print("Your lamp has gone out!");
-#endif
+ msg_print(_("ランプが消えてしまった!", "Your lamp has gone out!"));
}
else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
{
j_ptr->xtra4 = 0;
-#ifdef JP
- msg_print("¤·¤«¤·¥é¥ó¥×¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
-#else
- msg_print("Curiously, your lamp doesn't light.");
-#endif
+ msg_print(_("しかしランプは全く光らない。", "Curiously, your lamp doesn't light."));
}
else if (j_ptr->xtra4 >= FUEL_LAMP)
{
j_ptr->xtra4 = FUEL_LAMP;
-#ifdef JP
- msg_print("¥é¥ó¥×¤ÎÌý¤Ï°ìÇÕ¤À¡£");
-#else
- msg_print("Your lamp is full.");
-#endif
-
+ msg_print(_("ランプの油は一杯だ。", "Your lamp is full."));
}
/* Decrease the item (from the pack) */
}
-/*
+/*!
+ * @brief オブジェクトが松明に束ねられるかどうかを判定する
* An "item_tester_hook" for refilling torches
+ * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
+ * @return オブジェクトが松明に束ねられるならばTRUEを返す
*/
static bool item_tester_refill_torch(object_type *o_ptr)
{
}
-/*
+/*!
+ * @brief 松明を束ねるコマンドのメインルーチン
* Refuel the players torch (from the pack or floor)
+ * @return なし
*/
static void do_cmd_refill_torch(void)
{
- int item;
+ OBJECT_IDX item;
object_type *o_ptr;
object_type *j_ptr;
/* Get an item */
#ifdef JP
- q = "¤É¤Î¾¾ÌÀ¤ÇÌÀ¤«¤ê¤ò¶¯¤á¤Þ¤¹¤«? ";
- s = "¾¤Ë¾¾ÌÀ¤¬¤Ê¤¤¡£";
+ q = "どの松明で明かりを強めますか? ";
+ s = "他に松明がない。";
#else
q = "Refuel with which torch? ";
s = "You have no extra torches.";
/* Take a partial turn */
- energy_use = 50;
+ p_ptr->energy_use = 50;
/* Access the primary torch */
j_ptr = &inventory[INVEN_LITE];
j_ptr->xtra4 += o_ptr->xtra4 + 5;
/* Message */
-#ifdef JP
- msg_print("¾¾ÌÀ¤ò·ë¹ç¤·¤¿¡£");
-#else
- msg_print("You combine the torches.");
-#endif
-
+ msg_print(_("松明を結合した。", "You combine the torches."));
/* Comment */
if ((o_ptr->name2 == EGO_LITE_DARKNESS) && (j_ptr->xtra4 > 0))
{
j_ptr->xtra4 = 0;
-#ifdef JP
- msg_print("¾¾ÌÀ¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
-#else
- msg_print("Your torch has gone out!");
-#endif
+ msg_print(_("松明が消えてしまった!", "Your torch has gone out!"));
}
else if ((o_ptr->name2 == EGO_LITE_DARKNESS) || (j_ptr->name2 == EGO_LITE_DARKNESS))
{
j_ptr->xtra4 = 0;
-#ifdef JP
- msg_print("¤·¤«¤·¾¾ÌÀ¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£");
-#else
- msg_print("Curiously, your torche don't light.");
-#endif
+ msg_print(_("しかし松明は全く光らない。", "Curiously, your torche don't light."));
}
/* Over-fuel message */
else if (j_ptr->xtra4 >= FUEL_TORCH)
{
j_ptr->xtra4 = FUEL_TORCH;
-#ifdef JP
- msg_print("¾¾ÌÀ¤Î¼÷Ì¿¤Ï½½Ê¬¤À¡£");
-#else
- msg_print("Your torch is fully fueled.");
-#endif
-
+ msg_print(_("松明の寿命は十分だ。", "Your torch is fully fueled."));
}
/* Refuel message */
else
{
-#ifdef JP
- msg_print("¾¾ÌÀ¤Ï¤¤¤Ã¤½¤¦ÌÀ¤ë¤¯µ±¤¤¤¿¡£");
-#else
- msg_print("Your torch glows more brightly.");
-#endif
-
+ msg_print(_("松明はいっそう明るく輝いた。", "Your torch glows more brightly."));
}
/* Decrease the item (from the pack) */
}
-/*
+/*!
+ * @brief 燃料を補充するコマンドのメインルーチン
* Refill the players lamp, or restock his torches
+ * @return なし
*/
void do_cmd_refill(void)
{
/* It is nothing */
if (o_ptr->tval != TV_LITE)
{
-#ifdef JP
- msg_print("¸÷¸»¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£");
-#else
- msg_print("You are not wielding a light.");
-#endif
-
+ msg_print(_("光源を装備していない。", "You are not wielding a light."));
}
/* It's a lamp */
/* No torch to refill */
else
{
-#ifdef JP
- msg_print("¤³¤Î¸÷¸»¤Ï¼÷Ì¿¤ò±ä¤Ð¤»¤Ê¤¤¡£");
-#else
- msg_print("Your light cannot be refilled.");
-#endif
-
+ msg_print(_("この光源は寿命を延ばせない。", "Your light cannot be refilled."));
}
}
-/*
+/*!
+ * @brief ターゲットを設定するコマンドのメインルーチン
* Target command
+ * @return なし
*/
void do_cmd_target(void)
{
/* Target set */
if (target_set(TARGET_KILL))
{
-#ifdef JP
- msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
-#else
- msg_print("Target Selected.");
-#endif
-
+ msg_print(_("ターゲット決定。", "Target Selected."));
}
/* Target aborted */
else
{
-#ifdef JP
- msg_print("¥¿¡¼¥²¥Ã¥È²ò½ü¡£");
-#else
- msg_print("Target Aborted.");
-#endif
-
+ msg_print(_("ターゲット解除。", "Target Aborted."));
}
}
-/*
+/*!
+ * @brief 周囲を見渡すコマンドのメインルーチン
* Look command
+ * @return なし
*/
void do_cmd_look(void)
{
+ /*TEST*/
+ p_ptr->window |= PW_MONSTER_LIST;
+ window_stuff();
+ /*TEST*/
+
/* Look around */
if (target_set(TARGET_LOOK))
{
-#ifdef JP
- msg_print("¥¿¡¼¥²¥Ã¥È·èÄê¡£");
-#else
- msg_print("Target Selected.");
-#endif
-
+ msg_print(_("ターゲット決定。", "Target Selected."));
}
}
-
-/*
+/*!
+ * @brief 位置を確認するコマンドのメインルーチン
* Allow the player to examine other sectors on the map
+ * @return なし
*/
void do_cmd_locate(void)
{
if ((y2 == y1) && (x2 == x1))
{
#ifdef JP
- strcpy(tmp_val, "¿¿¾å");
+ strcpy(tmp_val, "真上");
#else
tmp_val[0] = '\0';
#endif
{
#ifdef JP
sprintf(tmp_val, "%s%s",
- ((y2 < y1) ? "ËÌ" : (y2 > y1) ? "Æî" : ""),
- ((x2 < x1) ? "À¾" : (x2 > x1) ? "Åì" : ""));
+ ((y2 < y1) ? "北" : (y2 > y1) ? "南" : ""),
+ ((x2 < x1) ? "西" : (x2 > x1) ? "東" : ""));
#else
sprintf(tmp_val, "%s%s of",
- ((y2 < y1) ? " North" : (y2 > y1) ? " South" : ""),
- ((x2 < x1) ? " West" : (x2 > x1) ? " East" : ""));
+ ((y2 < y1) ? " North" : (y2 > y1) ? " South" : ""),
+ ((x2 < x1) ? " West" : (x2 > x1) ? " East" : ""));
#endif
}
/* Prepare to ask which way to look */
- sprintf(out_val,
-#ifdef JP
- "¥Þ¥Ã¥×°ÌÃÖ [%d(%02d),%d(%02d)] (¥×¥ì¥¤¥ä¡¼¤Î%s) Êý¸þ?",
-#else
- "Map sector [%d(%02d),%d(%02d)], which is%s your sector. Direction?",
-#endif
-
- y2 / (hgt / 2), y2 % (hgt / 2),
- x2 / (wid / 2), x2 % (wid / 2), tmp_val);
+ sprintf(out_val, _("マップ位置 [%d(%02d),%d(%02d)] (プレイヤーの%s) 方向?",
+ "Map sector [%d(%02d),%d(%02d)], which is%s your sector. Direction?"),
+ y2 / (hgt / 2), y2 % (hgt / 2),
+ x2 / (wid / 2), x2 % (wid / 2), tmp_val);
/* Assume no direction */
dir = 0;
-/*
- * 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
-};
-
-
-/*
+/*!
+ * @brief モンスター種族情報を特定の基準によりソートするための比較処理
* Sorting hook -- Comp function -- see below
- *
+ * @param u モンスター種族情報の入れるポインタ
+ * @param v 条件基準ID
+ * @param a 比較するモンスター種族のID1
+ * @param b 比較するモンスター種族のID2
+ * @return 2の方が大きければTRUEを返す
* We use "u" to point to array of monster indexes,
* and "v" to select the type of sorting to perform on "u".
*/
int z1, z2;
-
/* Sort by player kills */
if (*why >= 4)
{
}
-/*
+/*!
+ * @brief モンスター種族情報を特定の基準によりソートするためのスワップ処理
* Sorting hook -- Swap function -- see below
- *
+ * @param u モンスター種族情報の入れるポインタ
+ * @param v 未使用
+ * @param a スワップするモンスター種族のID1
+ * @param b スワップするモンスター種族のID2
+ * @return なし
+ * @details
* We use "u" to point to array of monster indexes,
* and "v" to select the type of sorting to perform.
*/
u16b holder;
+ /* Unused */
+ (void)v;
+
/* Swap */
holder = who[a];
who[a] = who[b];
-/*
+/*!
+ * @brief モンスターの思い出を見るコマンドのメインルーチン
* Identify a character, allow recall of monsters
- *
+ * @return なし
+ * @details
+ * <pre>
* Several "special" responses recall "multiple" monsters:
* ^A (all monsters)
* ^U (all unique monsters)
* The responses may be sorted in several ways, see below.
*
* Note that the player ghosts are ignored. XXX XXX XXX
+ * </pre>
*/
void do_cmd_query_symbol(void)
{
- int i, n, r_idx;
+ IDX i;
+ int n;
+ MONRACE_IDX r_idx;
char sym, query;
char buf[128];
bool all = FALSE;
bool uniq = FALSE;
bool norm = FALSE;
+ bool ride = FALSE;
char temp[80] = "";
bool recall = FALSE;
u16b why = 0;
- u16b *who;
+ IDX *who;
/* Get a character, or abort */
-#ifdef JP
- if (!get_com("ÃΤꤿ¤¤Ê¸»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤(µ¹æ or ^AÁ´,^U¥æ,^NÈó¥æ,^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
-
+ if (!get_com(_("知りたい文字を入力して下さい(記号 or ^A全,^Uユ,^N非ユ,^R乗馬,^M名前): ",
+ "Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): "), &sym, FALSE)) return;
/* Find that character info, and describe it */
for (i = 0; ident_info[i]; ++i)
if (sym == KTRL('A'))
{
all = TRUE;
-#ifdef JP
- strcpy(buf, "Á´¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
-#else
- strcpy(buf, "Full monster list.");
-#endif
-
+ strcpy(buf, _("全モンスターのリスト", "Full monster list."));
}
else if (sym == KTRL('U'))
{
all = uniq = TRUE;
-#ifdef JP
- strcpy(buf, "¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
-#else
- strcpy(buf, "Unique monster list.");
-#endif
-
+ strcpy(buf, _("ユニーク・モンスターのリスト", "Unique monster list."));
}
else if (sym == KTRL('N'))
{
all = norm = TRUE;
-#ifdef JP
- strcpy(buf, "¥æ¥Ë¡¼¥¯³°¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È");
-#else
- strcpy(buf, "Non-unique monster list.");
-#endif
-
+ strcpy(buf, _("ユニーク外モンスターのリスト", "Non-unique monster list."));
+ }
+ else if (sym == KTRL('R'))
+ {
+ all = ride = TRUE;
+ strcpy(buf, _("乗馬可能モンスターのリスト", "Ridable monster list."));
}
/* XTRA HACK WHATSEARCH */
else if (sym == KTRL('M'))
{
all = TRUE;
-#ifdef JP
- if (!get_string("̾Á°(±Ñ¸ì¤Î¾ì¹ç¾®Ê¸»ú¤Ç²Ä)",temp, 70))
-#else
- if (!get_string("Enter name:",temp, 70))
-#endif
+ if (!get_string(_("名前(英語の場合小文字で可)", "Enter name:"),temp, 70))
{
temp[0]=0;
return;
}
-#ifdef JP
- sprintf(buf, "̾Á°:%s¤Ë¥Þ¥Ã¥Á",temp);
-#else
- sprintf(buf, "Monsters with a name \"%s\"",temp);
-#endif
+ sprintf(buf, _("名前:%sにマッチ", "Monsters with a name \"%s\""),temp);
}
else if (ident_info[i])
{
}
else
{
-#ifdef JP
- sprintf(buf, "%c - %s", sym, "̵¸ú¤Êʸ»ú");
-#else
- sprintf(buf, "%c - %s.", sym, "Unknown Symbol");
-#endif
-
+ sprintf(buf, "%c - %s", sym, _("無効な文字", "Unknown Symbol"));
}
/* Display the result */
prt(buf, 0, 0);
/* Allocate the "who" array */
- C_MAKE(who, max_r_idx, u16b);
+ C_MAKE(who, max_r_idx, IDX);
/* Collect matching monsters */
for (n = 0, i = 1; i < max_r_idx; i++)
/* 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(temp[xx])) temp[xx]=tolower(temp[xx]);
+ if (isupper(temp[xx])) temp[xx] = (char)tolower(temp[xx]);
}
#ifdef JP
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]);
+ if (isupper(temp2[xx])) temp2[xx] = (char)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
+ who[n++] = i;
+ }
+
/* 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 */
if (!n)
{
/* Free the "who" array */
- C_KILL(who, max_r_idx, u16b);
+ C_KILL(who, max_r_idx, IDX);
return;
}
/* Prompt XXX XXX XXX */
-#ifdef JP
- put_str("»×¤¤½Ð¤ò¸«¤Þ¤¹¤«? (k:»¦³²½ç/y/n): ", 0, 36);
-#else
- put_str("Recall details? (k/y/n): ", 0, 40);
-#endif
+ put_str(_("思い出を見ますか? (k:殺害順/y/n): ", "Recall details? (k/y/n): "), 0, _(36, 40));
/* Query */
if (query != 'y')
{
/* Free the "who" array */
- C_KILL(who, max_r_idx, u16b);
+ C_KILL(who, max_r_idx, IDX);
return;
}
/* 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) */
-#ifdef JP
- Term_addstr(-1, TERM_WHITE, " ['r'»×¤¤½Ð, ESC]");
-#else
- Term_addstr(-1, TERM_WHITE, " [(r)ecall, ESC]");
-#endif
+ /* Hack -- Begin the prompt */
+ roff_top(r_idx);
- }
+ /* Hack -- Complete the prompt */
+ Term_addstr(-1, TERM_WHITE, _(" ['r'思い出, ESC]", " [(r)ecall, ESC]"));
/* Command */
query = inkey();
}
/* Free the "who" array */
- C_KILL(who, max_r_idx, u16b);
+ C_KILL(who, max_r_idx, IDX);
/* Re-display the identity */
prt(buf, 0, 0);
}
-/*
- * research_mon
- * -KMW-
- */
-bool research_mon(void)
+/*!
+* @brief オブジェクトをプレイヤーが簡易使用コマンドで利用できるかを判定する /
+* Hook to determine if an object is useable
+* @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
+* @return 利用可能ならばTRUEを返す
+*/
+static bool item_tester_hook_use(object_type *o_ptr)
{
- 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;
-
+ u32b flgs[TR_FLAG_SIZE];
- /* 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
+ /* Ammo */
+ if (o_ptr->tval == p_ptr->tval_ammo)
+ return (TRUE);
+ /* Useable object */
+ switch (o_ptr->tval)
{
- /* Restore */
- screen_load();
-
- return (FALSE);
- }
-
- /* Find that character info, and describe it */
- for (i = 0; ident_info[i]; ++i)
+ case TV_SPIKE:
+ case TV_STAFF:
+ case TV_WAND:
+ case TV_ROD:
+ case TV_SCROLL:
+ case TV_POTION:
+ case TV_FOOD:
{
- if (sym == ident_info[i][0]) break;
+ return (TRUE);
}
- /* 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'))
+ default:
{
- 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
+ int i;
+
+ /* Not known */
+ if (!object_is_known(o_ptr)) return (FALSE);
+
+ /* HACK - only items from the equipment can be activated */
+ for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
{
- temp[0]=0;
- return FALSE;
+ if (&inventory[i] == o_ptr)
+ {
+ /* Extract the flags */
+ object_flags(o_ptr, flgs);
+
+ /* Check activation flag */
+ if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
+ }
}
-#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);
+ /* Assume not */
+ return (FALSE);
+}
- /* Allocate the "who" array */
- C_MAKE(who, max_r_idx, u16b);
+/*!
+ * @brief アイテムを汎用的に「使う」コマンドのメインルーチン /
+ * Use an item
+ * @return なし
+ * @details
+ * XXX - Add actions for other item types
+ */
+void do_cmd_use(void)
+{
+ OBJECT_IDX item;
+ object_type *o_ptr;
+ cptr q, s;
- /* Collect matching monsters */
- for (n = 0, i = 1; i < max_r_idx; i++)
+ if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
{
- monster_race *r_ptr = &r_info[i];
+ set_action(ACTION_NONE);
+ }
- /* XTRA HACK WHATSEARCH */
- /* Require non-unique monsters if needed */
- if (norm && (r_ptr->flags1 & (RF1_UNIQUE))) continue;
+ item_tester_no_ryoute = TRUE;
+ /* Prepare the hook */
+ item_tester_hook = item_tester_hook_use;
- /* Require unique monsters if needed */
- if (uniq && !(r_ptr->flags1 & (RF1_UNIQUE))) continue;
+ /* Get an item */
+ q = _("どれを使いますか?", "Use which item? ");
+ s = _("使えるものがありません。", "You have nothing to use.");
- /* ̾Á°¸¡º÷ */
- 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;
- }
+ if (!get_item(&item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR))) return;
- /* Nothing to recall */
- if (!n)
+ /* Get the item (in the pack) */
+ if (item >= 0)
{
- /* Free the "who" array */
- C_KILL(who, max_r_idx, u16b);
-
- /* Restore */
- screen_load();
-
- return (FALSE);
+ o_ptr = &inventory[item];
}
-
- /* Sort by level */
- why = 2;
- query = 'y';
-
- /* Sort if needed */
- if (why)
+ /* Get the item (on the floor) */
+ else
{
- /* 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);
+ o_ptr = &o_list[0 - item];
}
-
- /* 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)
+ switch (o_ptr->tval)
{
- /* Extract a race */
- r_idx = who[i];
+ /* Spike a door */
+ case TV_SPIKE:
+ {
+ do_cmd_spike();
+ break;
+ }
- /* Save this monster ID */
- p_ptr->monster_race_idx = r_idx;
+ /* Eat some food */
+ case TV_FOOD:
+ {
+ do_cmd_eat_food_aux(item);
+ break;
+ }
- /* Hack -- Handle stuff */
- handle_stuff();
+ /* Aim a wand */
+ case TV_WAND:
+ {
+ do_cmd_aim_wand_aux(item);
+ break;
+ }
- /* Hack -- Begin the prompt */
- roff_top(r_idx);
+ /* Use a staff */
+ case TV_STAFF:
+ {
+ do_cmd_use_staff_aux(item);
+ break;
+ }
- /* 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
+ /* Zap a rod */
+ case TV_ROD:
+ {
+ do_cmd_zap_rod_aux(item);
+ break;
+ }
+ /* Quaff a potion */
+ case TV_POTION:
+ {
+ do_cmd_quaff_potion_aux(item);
+ break;
+ }
- /* Interact */
- while (1)
+ /* Read a scroll */
+ case TV_SCROLL:
{
- /* Recall */
- if (recall)
+ /* Check some conditions */
+ if (p_ptr->blind)
{
- /* 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;
+ msg_print(_("目が見えない。", "You can't see anything."));
+ return;
+ }
+ if (no_lite())
+ {
+ msg_print(_("明かりがないので、暗くて読めない。", "You have no light to read by."));
+ return;
+ }
+ if (p_ptr->confused)
+ {
+ msg_print(_("混乱していて読めない!", "You are too confused!"));
+ return;
}
- /* Command */
- query = inkey();
-
- /* Normal commands */
- if (query != 'r') break;
-
- /* Toggle recall */
- recall = !recall;
+ do_cmd_read_scroll_aux(item, TRUE);
+ break;
}
- /* Stop scanning */
- if (query == ESCAPE) break;
-
- /* Move to "prev" monster */
- if (query == '-')
+ /* Fire ammo */
+ case TV_SHOT:
+ case TV_ARROW:
+ case TV_BOLT:
{
- if (++i == n)
- {
- i = 0;
- if (!expand_list) break;
- }
+ do_cmd_fire_aux(item, &inventory[INVEN_BOW]);
+ break;
}
- /* Move to "next" monster */
- else
+ /* Activate an artifact */
+ default:
{
- if (i-- == 0)
- {
- i = n - 1;
- if (!expand_list) break;
- }
+ do_cmd_activate_aux(item);
+ 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);
}