OSDN Git Service

[Refactor] #37353 型の置換。 / Type replacement.
[hengband/hengband.git] / src / cmd-zaprod.c
index ae1bc7b..45352cd 100644 (file)
@@ -1,20 +1,20 @@
-#include "angband.h"
+#include "angband.h"
 
 /*!
- * @brief \83\8d\83b\83h\82Ì\8cø\89Ê\82ð\94­\93®\82·\82é
- * @param sval \83I\83u\83W\83F\83N\83g\82Ìsval
- * @param dir \94­\93®\96Ú\95W\82Ì\95û\8cüID
- * @param use_charge \83`\83\83\81[\83W\82ð\8fÁ\94ï\82µ\82½\82©\82Ç\82¤\82©\82ð\95Ô\82·\8eQ\8fÆ\83|\83C\83\93\83^
- * @param powerful \8b­\97Í\94­\93®\8fã\82Ì\8f\88\97\9d\82È\82ç\82ÎTRUE
- * @param magic \96\82\93¹\8bï\8fp\8fã\82Ì\8f\88\97\9d\82È\82ç\82ÎTRUE
- * @return \94­\93®\82É\82æ\82è\8cø\89Ê\93à\97e\82ª\8am\92è\82µ\82½\82È\82ç\82ÎTRUE\82ð\95Ô\82·
+ * @brief ロッドの効果を発動する
+ * @param sval オブジェクトのsval
+ * @param dir 発動目標の方向ID
+ * @param use_charge チャージを消費したかどうかを返す参照ポインタ
+ * @param powerful 強力発動上の処理ならばTRUE
+ * @param magic 魔道具術上の処理ならばTRUE
+ * @return 発動により効果内容が確定したならばTRUEを返す
  */
-int rod_effect(OBJECT_SUBTYPE_VALUE sval, int dir, bool *use_charge, bool powerful, bool magic)
+int rod_effect(OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool *use_charge, bool powerful, bool magic)
 {
        int ident = FALSE;
-       int lev = powerful ? p_ptr->lev * 2 : p_ptr->lev;
-       int detect_rad = powerful ? DETECT_RAD_DEFAULT * 3 / 2 : DETECT_RAD_DEFAULT;
-       int rad = powerful ? 3 : 2;
+       PLAYER_LEVEL lev = powerful ? p_ptr->lev * 2 : p_ptr->lev;
+       POSITION detect_rad = powerful ? DETECT_RAD_DEFAULT * 3 / 2 : DETECT_RAD_DEFAULT;
+       POSITION rad = powerful ? 3 : 2;
 
        /* Unused */
        (void)magic;
@@ -130,7 +130,7 @@ int rod_effect(OBJECT_SUBTYPE_VALUE sval, int dir, bool *use_charge, bool powerf
        case SV_ROD_LITE:
        {
                HIT_POINT dam = damroll((powerful ? 12 : 6), 8);
-               msg_print(_("\90Â\82­\8bP\82­\8cõ\90ü\82ª\95ú\82½\82ê\82½\81B", "A line of blue shimmering light appears."));
+               msg_print(_("青く輝く光線が放たれた。", "A line of blue shimmering light appears."));
                (void)lite_line(dir, dam);
                ident = TRUE;
                break;
@@ -241,10 +241,10 @@ int rod_effect(OBJECT_SUBTYPE_VALUE sval, int dir, bool *use_charge, bool powerf
 }
 
 /*!
-* @brief \83\8d\83b\83h\82ð\8eg\82¤\83R\83}\83\93\83h\82Ì\83T\83u\83\8b\81[\83`\83\93 /
+* @brief ロッドを使うコマンドのサブルーチン /
 * Activate (zap) a Rod
-* @param item \8eg\82¤\83I\83u\83W\83F\83N\83g\82Ì\8f\8a\8e\9d\95iID
-* @return \82È\82µ
+* @param item 使うオブジェクトの所持品ID
+* @return なし
 * @details
 * <pre>
 * Unstack fully charged rods as needed.
@@ -253,10 +253,10 @@ int rod_effect(OBJECT_SUBTYPE_VALUE sval, int dir, bool *use_charge, bool powerf
 * pvals are defined for each rod in k_info. -LM-
 * </pre>
 */
-void do_cmd_zap_rod_aux(int item)
+void do_cmd_zap_rod_aux(INVENTORY_IDX item)
 {
        int ident, chance, lev, fail;
-       int dir = 0;
+       DIRECTION dir = 0;
        object_type *o_ptr;
        bool success;
 
@@ -281,7 +281,7 @@ void do_cmd_zap_rod_aux(int item)
        /* Mega-Hack -- refuse to zap a pile from the ground */
        if ((item < 0) && (o_ptr->number > 1))
        {
-               msg_print(_("\82Ü\82¸\82Í\83\8d\83b\83h\82ð\8fE\82í\82È\82¯\82ê\82Î\81B", "You must first pick up the rods."));
+               msg_print(_("まずはロッドを拾わなければ。", "You must first pick up the rods."));
                return;
        }
 
@@ -295,7 +295,6 @@ void do_cmd_zap_rod_aux(int item)
        }
 
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Extract the item level */
@@ -316,7 +315,7 @@ void do_cmd_zap_rod_aux(int item)
        if (world_player)
        {
                if (flush_failure) flush();
-               msg_print(_("\8e~\82Ü\82Á\82½\8e\9e\82Ì\92\86\82Å\82Í\82¤\82Ü\82­\93­\82©\82È\82¢\82æ\82¤\82¾\81B", "Nothing happen. Maybe this rod is freezing too."));
+               msg_print(_("止まった時の中ではうまく働かないようだ。", "Nothing happen. Maybe this rod is freezing too."));
                sound(SOUND_FAIL);
                return;
        }
@@ -337,7 +336,7 @@ void do_cmd_zap_rod_aux(int item)
        if (!success)
        {
                if (flush_failure) flush();
-               msg_print(_("\82¤\82Ü\82­\83\8d\83b\83h\82ð\8eg\82¦\82È\82©\82Á\82½\81B", "You failed to use the rod properly."));
+               msg_print(_("うまくロッドを使えなかった。", "You failed to use the rod properly."));
                sound(SOUND_FAIL);
                return;
        }
@@ -348,18 +347,17 @@ void do_cmd_zap_rod_aux(int item)
        if ((o_ptr->number == 1) && (o_ptr->timeout))
        {
                if (flush_failure) flush();
-               msg_print(_("\82±\82Ì\83\8d\83b\83h\82Í\82Ü\82¾\96\82\97Í\82ð\8f[\93U\82µ\82Ä\82¢\82é\8dÅ\92\86\82¾\81B", "The rod is still charging."));
+               msg_print(_("このロッドはまだ魔力を充填している最中だ。", "The rod is still charging."));
                return;
        }
        /* A stack of rods lacks enough energy. */
        else if ((o_ptr->number > 1) && (o_ptr->timeout > k_ptr->pval * (o_ptr->number - 1)))
        {
                if (flush_failure) flush();
-               msg_print(_("\82»\82Ì\83\8d\83b\83h\82Í\82Ü\82¾\8f[\93U\92\86\82Å\82·\81B", "The rods are all still charging."));
+               msg_print(_("そのロッドはまだ充填中です。", "The rods are all still charging."));
                return;
        }
 
-       /* Sound */
        sound(SOUND_ZAP);
 
        ident = rod_effect(o_ptr->sval, dir, &use_charge, FALSE, FALSE);
@@ -387,13 +385,12 @@ void do_cmd_zap_rod_aux(int item)
                gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
        }
 
-       /* Window stuff */
        p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
 }
 
 /*!
-* @brief \83\8d\83b\83h\82ð\8eg\82¤\83R\83}\83\93\83h\82Ì\83\81\83C\83\93\83\8b\81[\83`\83\93 /
-* @return \82È\82µ
+* @brief ロッドを使うコマンドのメインルーチン /
+* @return なし
 */
 void do_cmd_zap_rod(void)
 {
@@ -408,9 +405,8 @@ void do_cmd_zap_rod(void)
        /* Restrict choices to rods */
        item_tester_tval = TV_ROD;
 
-       /* Get an item */
-       q = _("\82Ç\82Ì\83\8d\83b\83h\82ð\90U\82è\82Ü\82·\82©? ", "Zap which rod? ");
-       s = _("\8eg\82¦\82é\83\8d\83b\83h\82ª\82È\82¢\81B", "You have no rod to zap.");
+       q = _("どのロッドを振りますか? ", "Zap which rod? ");
+       s = _("使えるロッドがない。", "You have no rod to zap.");
 
        if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;