X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fcmd3.c;h=cd1a67e0d4d16ce42e3158623af4ec90a36c4639;hb=5622138905059aebf7735886250b1a3c13514017;hp=1b1a072b9371051262d8f6d631c9420c4fcc7aa0;hpb=4f50f7e6bbf369522f89b0cfca3afe0a21daa325;p=hengband%2Fhengband.git diff --git a/src/cmd3.c b/src/cmd3.c index 1b1a072b9..cd1a67e0d 100644 --- a/src/cmd3.c +++ b/src/cmd3.c @@ -1,6 +1,6 @@ -/*! +/*! * @file cmd3.c - * @brief ¥×¥ì¥¤¥ä¡¼¤Î¥¢¥¤¥Æ¥à¤Ë´Ø¤¹¤ë¥³¥Þ¥ó¥É¤Î¼ÂÁõ1 / Inventory commands + * @brief プレイヤーのアイテムに関するコマンドの実装1 / Inventory commands * @date 2014/01/02 * @author * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke @@ -12,12 +12,20 @@ #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" /*! - * @brief »ý¤Áʪ°ìÍ÷¤òɽ¼¨¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó / Display inventory - * @return ¤Ê¤· + * @brief 持ち物一覧を表示するコマンドのメインルーチン / Display inventory + * @return なし */ void do_cmd_inven(void) { @@ -47,7 +55,7 @@ void do_cmd_inven(void) item_tester_full = FALSE; #ifdef JP - sprintf(out_val, "»ý¤Áʪ¡§ ¹ç·× %3d.%1d kg (¸Â³¦¤Î%ld%%) ¥³¥Þ¥ó¥É: ", + 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 @@ -90,8 +98,8 @@ void do_cmd_inven(void) /*! - * @brief ÁõÈ÷°ìÍ÷¤òɽ¼¨¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó / Display equipment - * @return ¤Ê¤· + * @brief 装備一覧を表示するコマンドのメインルーチン / Display equipment + * @return なし */ void do_cmd_equip(void) { @@ -122,7 +130,7 @@ void do_cmd_equip(void) /* Build a prompt */ #ifdef JP - sprintf(out_val, "ÁõÈ÷¡§ ¹ç·× %3d.%1d kg (¸Â³¦¤Î%ld%%) ¥³¥Þ¥ó¥É: ", + 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 @@ -165,9 +173,9 @@ void do_cmd_equip(void) /*! - * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤òËɶñ¤È¤·¤ÆÁõÈ÷¤Ç¤­¤ë¤«¤ÎȽÄê / The "wearable" tester - * @param o_ptr ȽÄꤹ¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿ - * @return ¥ª¥Ö¥¸¥§¥¯¥È¤¬Ëɶñ¤È¤·¤ÆÁõÈ÷¤Ç¤­¤ë¤Ê¤éTRUE¤òÊÖ¤¹¡£ + * @brief オブジェクトを防具として装備できるかの判定 / The "wearable" tester + * @param o_ptr 判定するオブジェクトの構造体参照ポインタ + * @return オブジェクトが防具として装備できるならTRUEを返す。 */ static bool item_tester_hook_wear(object_type *o_ptr) { @@ -183,9 +191,9 @@ static bool item_tester_hook_wear(object_type *o_ptr) /*! - * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬¤É¤Á¤é¤Î¼ê¤Ë¤âÁõÈ÷¤Ç¤­¤ëÉð´ï¤«¤É¤¦¤«¤ÎȽÄê - * @param o_ptr ȽÄꤹ¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿ - * @return º¸±¦Î¾Êý¤Î¼ê¤ÇÁõÈ÷¤Ç¤­¤ë¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£ + * @brief オブジェクトがどちらの手にも装備できる武器かどうかの判定 + * @param o_ptr 判定するオブジェクトの構造体参照ポインタ + * @return 左右両方の手で装備できるならばTRUEを返す。 */ static bool item_tester_hook_mochikae(object_type *o_ptr) { @@ -199,9 +207,9 @@ static bool item_tester_hook_mochikae(object_type *o_ptr) } /*! - * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬±¦¼ê¤«º¸¼ê¤ËÁõÈ÷¤Ç¤­¤ëÉð´ï¤«¤É¤¦¤«¤ÎȽÄê - * @param o_ptr ȽÄꤹ¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿ - * @return ±¦¼ê¤«º¸¼ê¤ÎÉð´ï¤È¤·¤ÆÁõÈ÷¤Ç¤­¤ë¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£ + * @brief オブジェクトが右手か左手に装備できる武器かどうかの判定 + * @param o_ptr 判定するオブジェクトの構造体参照ポインタ + * @return 右手か左手の武器として装備できるならばTRUEを返す。 */ static bool item_tester_hook_melee_weapon(object_type *o_ptr) { @@ -216,12 +224,12 @@ static bool item_tester_hook_melee_weapon(object_type *o_ptr) bool select_ring_slot = FALSE; /*! - * @brief ÁõÈ÷¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó / Wield or wear a single item from the pack or floor - * @return ¤Ê¤· + * @brief 装備するコマンドのメインルーチン / Wield or wear a single item from the pack or floor + * @return なし */ void do_cmd_wield(void) { - int item, slot; + OBJECT_IDX item, slot; object_type forge; object_type *q_ptr; @@ -234,7 +242,7 @@ void do_cmd_wield(void) cptr q, s; - int need_switch_wielding = 0; + OBJECT_IDX need_switch_wielding = 0; if (p_ptr->special_defense & KATA_MUSOU) { @@ -245,13 +253,8 @@ void do_cmd_wield(void) 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; @@ -285,14 +288,8 @@ void do_cmd_wield(void) item_tester_no_ryoute = TRUE; /* Choose a weapon from the equipment only */ -#ifdef JP - q = "¤É¤Á¤é¤ÎÉð´ï¤È¼è¤êÂؤ¨¤Þ¤¹¤«?"; - s = "¤ª¤Ã¤È¡£"; -#else - q = "Replace which weapon? "; - s = "Oops."; -#endif - + q = _("どちらの武器と取り替えますか?", "Replace which weapon? "); + s = _("おっと。", "Oops."); if (!get_item(&slot, q, s, (USE_EQUIP))) return; if (slot == INVEN_RARM) need_switch_wielding = INVEN_LARM; } @@ -307,14 +304,8 @@ void do_cmd_wield(void) item_tester_hook = item_tester_hook_mochikae; /* Choose a hand */ -#ifdef JP - q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?"; - s = "¤ª¤Ã¤È¡£"; -#else - q = "Equip which hand? "; - s = "Oops."; -#endif - + q = _("どちらの手に装備しますか?", "Equip which hand? "); + s = _("おっと。", "Oops."); if (!get_item(&slot, q, s, (USE_EQUIP))) return; } break; @@ -327,20 +318,12 @@ void do_cmd_wield(void) /* Asking for dual wielding */ if (slot == INVEN_LARM) { -#ifdef JP - if (!get_check("ÆóÅáή¤ÇÀ襤¤Þ¤¹¤«¡©")) slot = INVEN_RARM; -#else - if (!get_check("Dual wielding? ")) slot = INVEN_RARM; -#endif + if (!get_check(_("二刀流で戦いますか?", "Dual wielding? "))) slot = INVEN_RARM; } else if (!inventory[INVEN_RARM].k_idx && buki_motteruka(INVEN_LARM)) { -#ifdef JP - if (!get_check("ÆóÅáή¤ÇÀ襤¤Þ¤¹¤«¡©")) slot = INVEN_LARM; -#else - if (!get_check("Dual wielding? ")) slot = INVEN_LARM; -#endif + if (!get_check(_("二刀流で戦いますか?", "Dual wielding? "))) slot = INVEN_LARM; } /* Both arms are already used */ @@ -350,14 +333,9 @@ void do_cmd_wield(void) item_tester_hook = item_tester_hook_mochikae; /* Choose a hand */ -#ifdef JP - q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?"; - s = "¤ª¤Ã¤È¡£"; -#else - q = "Equip which hand? "; - s = "Oops."; -#endif - + 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; @@ -369,26 +347,13 @@ void do_cmd_wield(void) /* Choose a ring slot */ if (inventory[INVEN_LEFT].k_idx && inventory[INVEN_RIGHT].k_idx) { -#ifdef JP - q = "¤É¤Á¤é¤Î»ØÎؤȼè¤êÂؤ¨¤Þ¤¹¤«?"; -#else - q = "Replace which ring? "; -#endif + q = _("どちらの指輪と取り替えますか?", "Replace which ring? "); } else { -#ifdef JP - q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?"; -#else - q = "Equip which hand? "; -#endif + q = _("どちらの手に装備しますか?", "Equip which hand? "); } - -#ifdef JP - s = "¤ª¤Ã¤È¡£"; -#else - s = "Oops."; -#endif + s = _("おっと。", "Oops."); /* Restrict the choices */ select_ring_slot = TRUE; @@ -411,7 +376,7 @@ void do_cmd_wield(void) /* Message */ #ifdef JP - msg_format("%s%s¤Ï¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£", + msg_format("%s%sは呪われているようだ。", describe_use(slot) , o_name ); #else msg_format("The %s you are %s appears to be cursed.", @@ -431,12 +396,7 @@ void do_cmd_wield(void) /* Describe it */ object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY)); - -#ifdef JP -sprintf(dummy, "ËÜÅö¤Ë%s{¼ö¤ï¤ì¤Æ¤¤¤ë}¤ò»È¤¤¤Þ¤¹¤«¡©", o_name); -#else - sprintf(dummy, "Really use the %s {cursed}? ", o_name); -#endif + sprintf(dummy, _("本当に%s{呪われている}を使いますか?", "Really use the %s {cursed}? "), o_name); if (!get_check(dummy)) return; } @@ -449,7 +409,7 @@ sprintf(dummy, " 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?"); @@ -471,12 +431,10 @@ sprintf(dummy, "%s 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_format("%s¤ò%s¤Ë¹½¤¨¤Ê¤ª¤·¤¿¡£", switch_name, (slot == INVEN_RARM) ? (left_hander ? "º¸¼ê" : "±¦¼ê") : (left_hander ? "±¦¼ê" : "º¸¼ê")); -#else - msg_format("You wield %s at %s hand.", switch_name, (slot == INVEN_RARM) ? (left_hander ? "left" : "right") : (left_hander ? "right" : "left")); -#endif - + + 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; } @@ -491,7 +449,7 @@ sprintf(dummy, "%s } /* Take a turn */ - energy_use = 100; + p_ptr->energy_use = 100; /* Get local object */ q_ptr = &forge; @@ -539,9 +497,9 @@ sprintf(dummy, "%s equip_cnt++; #ifdef JP -#define STR_WIELD_RARM "%s(%c)¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿¡£" -#define STR_WIELD_LARM "%s(%c)¤òº¸¼ê¤ËÁõÈ÷¤·¤¿¡£" -#define STR_WIELD_ARMS "%s(%c)¤òξ¼ê¤Ç¹½¤¨¤¿¡£" +#define STR_WIELD_RARM "%s(%c)を右手に装備した。" +#define STR_WIELD_LARM "%s(%c)を左手に装備した。" +#define STR_WIELD_ARMS "%s(%c)を両手で構えた。" #else #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." @@ -566,27 +524,15 @@ sprintf(dummy, "%s break; case INVEN_BOW: -#ifdef JP - act = "%s(%c)¤ò¼Í·âÍѤËÁõÈ÷¤·¤¿¡£"; -#else - act = "You are shooting with %s (%c)."; -#endif + act = _("%s(%c)を射撃用に装備した。", "You are shooting with %s (%c)."); break; case INVEN_LITE: -#ifdef JP - act = "%s(%c)¤ò¸÷¸»¤Ë¤·¤¿¡£"; -#else - act = "Your light source is %s (%c)."; -#endif + act = _("%s(%c)を光源にした。", "Your light source is %s (%c)."); break; default: -#ifdef JP - act = "%s(%c)¤òÁõÈ÷¤·¤¿¡£"; -#else - act = "You are wearing %s (%c)."; -#endif + act = _("%s(%c)を装備した。", "You are wearing %s (%c)."); break; } @@ -601,13 +547,7 @@ sprintf(dummy, "%s 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 */ @@ -639,9 +579,9 @@ sprintf(dummy, "%s } /*! - * @brief »ý¤ÁÂؤ¨½èÍý - * @param item »ý¤ÁÂؤ¨¤ò¹Ô¤¤¤¿¤¤ÁõÈ÷Éô°ÌID - * @return ¤Ê¤· + * @brief 持ち替え処理 + * @param item 持ち替えを行いたい装備部位ID + * @return なし */ void kamaenaoshi(int item) { @@ -663,26 +603,15 @@ void kamaenaoshi(int item) 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); -#else - msg_format("You are wielding %s with both hands.", o_name); -#endif + msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name); else -#ifdef JP - msg_format("%s¤ò%s¤Ç¹½¤¨¤¿¡£", o_name, (left_hander ? "º¸¼ê" : "±¦¼ê")); -#else - msg_format("You are wielding %s in your %s hand.", o_name, (left_hander ? "left":"right")); -#endif + 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()) -#ifdef JP - msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name); -#else - msg_format("You are wielding %s with both hands.", o_name); -#endif + msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name); } } } @@ -694,11 +623,7 @@ void kamaenaoshi(int item) if (buki_motteruka(INVEN_RARM)) { 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 + 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)) { @@ -707,23 +632,19 @@ void kamaenaoshi(int item) 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); -#else - msg_format("You switched hand of %s.", o_name); -#endif + msg_format(_("%sを持ち替えた。", "You switched hand of %s."), o_name); } } } /*! - * @brief ÁõÈ÷¤ò³°¤¹¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó / Take off an item - * @return ¤Ê¤· + * @brief 装備を外すコマンドのメインルーチン / Take off an item + * @return なし */ void do_cmd_takeoff(void) { - int item; + OBJECT_IDX item; object_type *o_ptr; @@ -737,8 +658,8 @@ void do_cmd_takeoff(void) 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."; @@ -765,11 +686,7 @@ void do_cmd_takeoff(void) 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; @@ -777,11 +694,7 @@ void do_cmd_takeoff(void) 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); @@ -797,26 +710,18 @@ void do_cmd_takeoff(void) /* 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); @@ -830,12 +735,13 @@ void do_cmd_takeoff(void) /*! - * @brief ¥¢¥¤¥Æ¥à¤òÍî¤È¤¹¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó / Drop an item - * @return ¤Ê¤· + * @brief アイテムを落とすコマンドのメインルーチン / Drop an item + * @return なし */ void do_cmd_drop(void) { - int item, amt = 1; + OBJECT_IDX item; + int amt = 1; object_type *o_ptr; @@ -849,8 +755,8 @@ void do_cmd_drop(void) 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."; @@ -875,13 +781,7 @@ void do_cmd_drop(void) 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; } @@ -899,7 +799,7 @@ void do_cmd_drop(void) /* Take a partial turn */ - energy_use = 50; + p_ptr->energy_use = 50; /* Drop (some of) the item */ inven_drop(item, amt); @@ -914,9 +814,9 @@ void do_cmd_drop(void) } /*! - * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬¹â°Ì¤ÎËâË¡½ñ¤«¤É¤¦¤«¤òȽÄꤹ¤ë - * @param ȽÄꤷ¤¿¤¤¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿ - * @return ¥ª¥Ö¥¸¥§¥¯¥È¤¬¹â°Ì¤ÎËâË¡½ñ¤Ê¤é¤ÐTRUE¤òÊÖ¤¹ + * @brief オブジェクトが高位の魔法書かどうかを判定する + * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ + * @return オブジェクトが高位の魔法書ならばTRUEを返す */ static bool high_level_book(object_type *o_ptr) { @@ -943,23 +843,23 @@ static bool high_level_book(object_type *o_ptr) /*! - * @brief ¥¢¥¤¥Æ¥à¤òÇ˲õ¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó / Destroy an item - * @return ¤Ê¤· + * @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; @@ -974,8 +874,8 @@ void do_cmd_destroy(void) /* Get an item */ #ifdef JP - q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò²õ¤·¤Þ¤¹¤«? "; - s = "²õ¤»¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£"; + q = "どのアイテムを壊しますか? "; + s = "壊せるアイテムを持っていない。"; #else q = "Destroy which item? "; s = "You have nothing to destroy."; @@ -1001,14 +901,7 @@ void do_cmd_destroy(void) 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); - + 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 */ @@ -1072,20 +965,15 @@ void do_cmd_destroy(void) o_ptr->number = old_number; /* 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; } @@ -1093,12 +981,7 @@ void do_cmd_destroy(void) 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 */ @@ -1150,12 +1033,7 @@ void do_cmd_destroy(void) 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) @@ -1187,15 +1065,13 @@ msg_print(" /*! - * @brief ¥¢¥¤¥Æ¥à¤òÄ´ºº¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó / Observe an item which has been *identify*-ed - * @return ¤Ê¤· + * @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; @@ -1203,8 +1079,8 @@ void do_cmd_observe(void) 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."; @@ -1228,12 +1104,7 @@ void do_cmd_observe(void) /* 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; } @@ -1242,40 +1113,29 @@ void do_cmd_observe(void) 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 (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£"); -#else - if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) 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."; @@ -1298,22 +1158,12 @@ void do_cmd_uninscribe(void) /* 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; @@ -1324,32 +1174,30 @@ void do_cmd_uninscribe(void) /* Window stuff */ p_ptr->window |= (PW_INVEN | PW_EQUIP); - /* .¤ä$¤Î´Ø·¸¤Ç, ºÆ·×»»¤¬É¬ÍפʤϤº -- henkma */ + /* .や$の関係で, 再計算が必要なはず -- henkma */ p_ptr->update |= (PU_BONUS); } -/* +/*! + * @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."; @@ -1373,12 +1221,7 @@ void do_cmd_inscribe(void) 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 */ @@ -1392,11 +1235,7 @@ void do_cmd_inscribe(void) } /* 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 = quark_add(out_val); @@ -1407,15 +1246,18 @@ void do_cmd_inscribe(void) /* 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) { @@ -1431,12 +1273,14 @@ 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; @@ -1449,8 +1293,8 @@ static void do_cmd_refill_lamp(void) /* Get an item */ #ifdef JP - q = "¤É¤ÎÌý¤Ä¤Ü¤«¤éÃí¤®¤Þ¤¹¤«? "; - s = "Ìý¤Ä¤Ü¤¬¤Ê¤¤¡£"; + q = "どの油つぼから注ぎますか? "; + s = "油つぼがない。"; #else q = "Refill with which flask? "; s = "You have no flasks of oil."; @@ -1472,7 +1316,7 @@ static void do_cmd_refill_lamp(void) /* Take a partial turn */ - energy_use = 50; + p_ptr->energy_use = 50; /* Access the lantern */ j_ptr = &inventory[INVEN_LITE]; @@ -1481,40 +1325,23 @@ static void do_cmd_refill_lamp(void) 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) */ @@ -1538,8 +1365,11 @@ static void do_cmd_refill_lamp(void) } -/* +/*! + * @brief オブジェクトが松明に束ねられるかどうかを判定する * An "item_tester_hook" for refilling torches + * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ + * @return オブジェクトが松明に束ねられるならばTRUEを返す */ static bool item_tester_refill_torch(object_type *o_ptr) { @@ -1552,12 +1382,14 @@ 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; @@ -1570,8 +1402,8 @@ static void do_cmd_refill_torch(void) /* Get an item */ #ifdef JP - q = "¤É¤Î¾¾ÌÀ¤ÇÌÀ¤«¤ê¤ò¶¯¤á¤Þ¤¹¤«? "; - s = "¾¤Ë¾¾ÌÀ¤¬¤Ê¤¤¡£"; + q = "どの松明で明かりを強めますか? "; + s = "他に松明がない。"; #else q = "Refuel with which torch? "; s = "You have no extra torches."; @@ -1593,7 +1425,7 @@ static void do_cmd_refill_torch(void) /* Take a partial turn */ - energy_use = 50; + p_ptr->energy_use = 50; /* Access the primary torch */ j_ptr = &inventory[INVEN_LITE]; @@ -1602,53 +1434,30 @@ static void do_cmd_refill_torch(void) 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) */ @@ -1672,8 +1481,10 @@ static void do_cmd_refill_torch(void) } -/* +/*! + * @brief 燃料を補充するコマンドのメインルーチン * Refill the players lamp, or restock his torches + * @return なし */ void do_cmd_refill(void) { @@ -1690,12 +1501,7 @@ 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 */ @@ -1713,48 +1519,37 @@ void do_cmd_refill(void) /* 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) { @@ -1766,19 +1561,15 @@ void do_cmd_look(void) /* 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) { @@ -1805,7 +1596,7 @@ void do_cmd_locate(void) if ((y2 == y1) && (x2 == x1)) { #ifdef JP - strcpy(tmp_val, "¿¿¾å"); + strcpy(tmp_val, "真上"); #else tmp_val[0] = '\0'; #endif @@ -1815,8 +1606,8 @@ void do_cmd_locate(void) { #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" : ""), @@ -1826,13 +1617,8 @@ void do_cmd_locate(void) } /* 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 - + 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); @@ -1884,9 +1670,14 @@ void do_cmd_locate(void) -/* +/*! + * @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". */ @@ -1958,9 +1749,15 @@ bool ang_sort_comp_hook(vptr u, vptr v, int a, int b) } -/* +/*! + * @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. */ @@ -1981,9 +1778,12 @@ void ang_sort_swap_hook(vptr u, vptr v, int a, int b) -/* +/*! + * @brief モンスターの思い出を見るコマンドのメインルーチン * Identify a character, allow recall of monsters - * + * @return なし + * @details + *
  * Several "special" responses recall "multiple" monsters:
  *   ^A (all monsters)
  *   ^U (all unique monsters)
@@ -1992,10 +1792,13 @@ void ang_sort_swap_hook(vptr u, vptr v, int a, int b)
  * The responses may be sorted in several ways, see below.
  *
  * Note that the player ghosts are ignored. XXX XXX XXX
+ * 
*/ 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]; @@ -2008,14 +1811,11 @@ void do_cmd_query_symbol(void) bool recall = FALSE; u16b why = 0; - u16b *who; + IDX *who; /* Get a character, or abort */ -#ifdef JP - 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 + 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) @@ -2027,57 +1827,33 @@ void do_cmd_query_symbol(void) 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; -#ifdef JP - strcpy(buf, "¾èÇϲÄǽ¥â¥ó¥¹¥¿¡¼¤Î¥ê¥¹¥È"); -#else - strcpy(buf, "Ridable monster list."); -#endif + 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]) { @@ -2085,18 +1861,14 @@ void do_cmd_query_symbol(void) } 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++) @@ -2126,7 +1898,7 @@ void do_cmd_query_symbol(void) #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 @@ -2135,14 +1907,14 @@ void do_cmd_query_symbol(void) 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 (my_strstr(temp2, temp) || my_strstr(r_name + r_ptr->name, temp) ) #else if (my_strstr(temp2, temp)) #endif - who[n++]=i; + who[n++] = i; } /* Collect "appropriate" monsters */ @@ -2153,18 +1925,14 @@ void do_cmd_query_symbol(void) 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 */ @@ -2193,7 +1961,7 @@ void do_cmd_query_symbol(void) if (query != 'y') { /* Free the "who" array */ - C_KILL(who, max_r_idx, u16b); + C_KILL(who, max_r_idx, IDX); return; } @@ -2242,11 +2010,7 @@ void do_cmd_query_symbol(void) 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 + Term_addstr(-1, TERM_WHITE, _(" ['r'思い出, ESC]", " [(r)ecall, ESC]")); /* Command */ query = inkey(); @@ -2290,10 +2054,190 @@ void do_cmd_query_symbol(void) } /* 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); } +/*! +* @brief オブジェクトをプレイヤーが簡易使用コマンドで利用できるかを判定する / +* Hook to determine if an object is useable +* @param o_ptr 判定したいオブジェクトの構造体参照ポインタ +* @return 利用可能ならばTRUEを返す +*/ +static bool item_tester_hook_use(object_type *o_ptr) +{ + u32b flgs[TR_FLAG_SIZE]; + + /* Ammo */ + if (o_ptr->tval == p_ptr->tval_ammo) + return (TRUE); + + /* Useable object */ + switch (o_ptr->tval) + { + case TV_SPIKE: + case TV_STAFF: + case TV_WAND: + case TV_ROD: + case TV_SCROLL: + case TV_POTION: + case TV_FOOD: + { + return (TRUE); + } + + default: + { + 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++) + { + if (&inventory[i] == o_ptr) + { + /* Extract the flags */ + object_flags(o_ptr, flgs); + + /* Check activation flag */ + if (have_flag(flgs, TR_ACTIVATE)) return (TRUE); + } + } + } + } + + /* Assume not */ + return (FALSE); +} + + +/*! + * @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; + + if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN)) + { + set_action(ACTION_NONE); + } + + item_tester_no_ryoute = TRUE; + /* Prepare the hook */ + item_tester_hook = item_tester_hook_use; + + /* Get an item */ + q = _("どれを使いますか?", "Use which item? "); + s = _("使えるものがありません。", "You have nothing to use."); + + if (!get_item(&item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR))) return; + + /* Get the item (in the pack) */ + if (item >= 0) + { + o_ptr = &inventory[item]; + } + /* Get the item (on the floor) */ + else + { + o_ptr = &o_list[0 - item]; + } + + switch (o_ptr->tval) + { + /* Spike a door */ + case TV_SPIKE: + { + do_cmd_spike(); + break; + } + + /* Eat some food */ + case TV_FOOD: + { + do_cmd_eat_food_aux(item); + break; + } + + /* Aim a wand */ + case TV_WAND: + { + do_cmd_aim_wand_aux(item); + break; + } + + /* Use a staff */ + case TV_STAFF: + { + do_cmd_use_staff_aux(item); + break; + } + + /* 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; + } + + /* Read a scroll */ + case TV_SCROLL: + { + /* Check some conditions */ + if (p_ptr->blind) + { + 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; + } + + do_cmd_read_scroll_aux(item, TRUE); + break; + } + + /* Fire ammo */ + case TV_SHOT: + case TV_ARROW: + case TV_BOLT: + { + do_cmd_fire_aux(item, &inventory[INVEN_BOW]); + break; + } + + /* Activate an artifact */ + default: + { + do_cmd_activate_aux(item); + break; + } + } +} +