OSDN Git Service

#37287 #37353 (2.2.0.89) 型の置換を継続中。 / Ongoing type replacement.
[hengband/hengband.git] / src / spells3.c
index c30f3af..ebcbf84 100644 (file)
@@ -1,25 +1,33 @@
-/* File: spells3.c */
-
-/*
+/*!
+ * @file spells3.c
+ * @brief 魔法効果の実装/ Spell code (part 3)
+ * @date 2014/07/26
+ * @author
+ * <pre>
  * 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.  Other copyrights may also apply.
+ * </pre>
  */
 
-/* Purpose: Spell code (part 3) */
-
 #include "angband.h"
 
-/* Maximum number of tries for teleporting */
+/*! テレポート先探索の試行数 / Maximum number of tries for teleporting */
 #define MAX_TRIES 100
 
-/* 1/x chance of reducing stats (for elemental attacks) */
+/*! 能力値現象の基本確率(1 / HURT_CHANCE) / 1/x chance of reducing stats (for elemental attacks) */
 #define HURT_CHANCE 16
 
-
-static bool cave_monster_teleportable_bold(int m_idx, int y, int x, u32b mode)
+/*!
+ * @brief 指定されたマスがモンスターのテレポート可能先かどうかを判定する。
+ * @param m_idx モンスターID
+ * @param y 移動先Y座標
+ * @param x 移動先X座標
+ * @param mode オプション
+ * @return テレポート先として妥当ならばtrue
+ */
+static bool cave_monster_teleportable_bold(MONSTER_IDX m_idx, int y, int x, u32b mode)
 {
        monster_type *m_ptr = &m_list[m_idx];
        cave_type    *c_ptr = &cave[y][x];
@@ -44,18 +52,22 @@ static bool cave_monster_teleportable_bold(int m_idx, int y, int x, u32b mode)
 }
 
 
-/*
+/*!
+ * @brief モンスターのテレポートアウェイ処理 /
  * Teleport a monster, normally up to "dis" grids away.
- *
+ * @param m_idx モンスターID
+ * @param dis テレポート距離
+ * @param mode オプション
+ * @return テレポートが実際に行われたらtrue
+ * @details
  * Attempt to move the monster at least "dis/2" grids away.
- *
  * But allow variation to prevent infinite loops.
  */
-bool teleport_away(int m_idx, int dis, u32b mode)
+bool teleport_away(MONSTER_IDX m_idx, int dis, u32b mode)
 {
        int oy, ox, d, i, min;
        int tries = 0;
-       int ny = 0, nx = 0;
+       POSITION ny = 0, nx = 0;
 
        bool look = TRUE;
 
@@ -156,11 +168,17 @@ bool teleport_away(int m_idx, int dis, u32b mode)
 }
 
 
-
-/*
+/*!
+ * @brief モンスターを指定された座標付近にテレポートする /
  * Teleport monster next to a grid near the given location
+ * @param m_idx モンスターID
+ * @param ty 目安Y座標
+ * @param tx 目安X座標
+ * @param power テレポート成功確率
+ * @param mode オプション
+ * @return なし
  */
-void teleport_monster_to(int m_idx, int ty, int tx, int power, u32b mode)
+void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power, u32b mode)
 {
        int ny, nx, oy, ox, d, i, min;
        int attempts = 500;
@@ -253,7 +271,13 @@ void teleport_monster_to(int m_idx, int ty, int tx, int power, u32b mode)
                p_ptr->update |= (PU_MON_LITE);
 }
 
-
+/*!
+ * @brief 指定されたマスにプレイヤーがテレポート可能かどうかを判定する。
+ * @param y 移動先Y座標
+ * @param x 移動先X座標
+ * @param mode オプション
+ * @return テレポート先として妥当ならばtrue
+ */
 bool cave_player_teleportable_bold(int y, int x, u32b mode)
 {
        cave_type    *c_ptr = &cave[y][x];
@@ -294,9 +318,17 @@ bool cave_player_teleportable_bold(int y, int x, u32b mode)
 }
 
 
-/*
+/*! テレポート最大距離 */
+#define MAX_TELEPORT_DISTANCE 200
+
+/*!
+ * @brief プレイヤーのテレポート先選定と移動処理 /
  * Teleport the player to a location up to "dis" grids away.
- *
+ * @param dis 基本移動距離
+ * @param mode オプション
+ * @return 実際にテレポート処理が行われたらtrue
+ * @details
+ * <pre>
  * If no such spaces are readily available, the distance may increase.
  * Try very hard to move the player at least a quarter that distance.
  *
@@ -309,31 +341,26 @@ bool cave_player_teleportable_bold(int y, int x, u32b mode)
  * candidates is selected first, which includes at least 50% of all
  * floor grids within the distance, and any single grid in this list
  * of candidates has equal possibility to be choosen as a destination.
+ * </pre>
  */
 
-#define MAX_TELEPORT_DISTANCE 200
-
 bool teleport_player_aux(int dis, u32b mode)
 {
        int candidates_at[MAX_TELEPORT_DISTANCE + 1];
        int total_candidates, cur_candidates;
-       int y = 0, x = 0, min, pick, i;
+       POSITION y = 0, x = 0;
+       int min, pick, i;
 
-       int left = MAX(1, px - dis);
-       int right = MIN(cur_wid - 2, px + dis);
-       int top = MAX(1, py - dis);
-       int bottom = MIN(cur_hgt - 2, py + dis);
+       int left = MAX(1, p_ptr->x - dis);
+       int right = MIN(cur_wid - 2, p_ptr->x + dis);
+       int top = MAX(1, p_ptr->y - dis);
+       int bottom = MIN(cur_hgt - 2, p_ptr->y + dis);
 
        if (p_ptr->wild_mode) return FALSE;
 
        if (p_ptr->anti_tele && !(mode & TELEPORT_NONMAGICAL))
        {
-#ifdef JP
-               msg_print("不思議な力がテレポートを防いだ!");
-#else
-               msg_print("A mysterious force prevents you from teleporting!");
-#endif
-
+               msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!"));
                return FALSE;
        }
 
@@ -356,7 +383,7 @@ bool teleport_player_aux(int dis, u32b mode)
                        if (!cave_player_teleportable_bold(y, x, mode)) continue;
 
                        /* Calculate distance */
-                       d = distance(py, px, y, x);
+                       d = distance(p_ptr->y, p_ptr->x, y, x);
 
                        /* Skip too far locations */
                        if (d > dis) continue;
@@ -395,7 +422,7 @@ bool teleport_player_aux(int dis, u32b mode)
                        if (!cave_player_teleportable_bold(y, x, mode)) continue;
 
                        /* Calculate distance */
-                       d = distance(py, px, y, x);
+                       d = distance(p_ptr->y, p_ptr->x, y, x);
 
                        /* Skip too far locations */
                        if (d > dis) continue;
@@ -419,7 +446,7 @@ bool teleport_player_aux(int dis, u32b mode)
 
 #ifdef JP
        if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
-               msg_format("『こっちだぁ、%s』", player_name);
+               msg_format("『こっちだぁ、%s』", p_ptr->name);
 #endif
 
        /* Move the player */
@@ -428,13 +455,19 @@ bool teleport_player_aux(int dis, u32b mode)
        return TRUE;
 }
 
+/*!
+ * @brief プレイヤーのテレポート処理メインルーチン
+ * @param dis 基本移動距離
+ * @param mode オプション
+ * @return なし
+ */
 void teleport_player(int dis, u32b mode)
 {
        int yy, xx;
 
        /* Save the old location */
-       int oy = py;
-       int ox = px;
+       int oy = p_ptr->y;
+       int ox = p_ptr->x;
 
        if (!teleport_player_aux(dis, mode)) return;
 
@@ -443,7 +476,7 @@ void teleport_player(int dis, u32b mode)
        {
                for (yy = -1; yy < 2; yy++)
                {
-                       int tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
+                       MONSTER_IDX tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
 
                        /* A monster except your mount may follow */
                        if (tmp_m_idx && (p_ptr->riding != tmp_m_idx))
@@ -455,10 +488,10 @@ void teleport_player(int dis, u32b mode)
                                 * The latter limitation is to avoid
                                 * totally unkillable suckers...
                                 */
-                               if ((r_ptr->flags6 & RF6_TPORT) &&
+                               if ((r_ptr->a_ability_flags2 & RF6_TPORT) &&
                                    !(r_ptr->flagsr & RFR_RES_TELE))
                                {
-                                       if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, py, px, r_ptr->level, 0L);
+                                       if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, p_ptr->y, p_ptr->x, r_ptr->level, 0L);
                                }
                        }
                }
@@ -466,13 +499,19 @@ void teleport_player(int dis, u32b mode)
 }
 
 
-void teleport_player_away(int m_idx, int dis)
+/*!
+ * @brief プレイヤーのテレポートアウェイ処理 /
+ * @param m_idx アウェイを試みたプレイヤーID
+ * @param dis テレポート距離
+ * @return なし
+ */
+void teleport_player_away(MONSTER_IDX m_idx, int dis)
 {
        int yy, xx;
 
        /* Save the old location */
-       int oy = py;
-       int ox = px;
+       int oy = p_ptr->y;
+       int ox = p_ptr->x;
 
        if (!teleport_player_aux(dis, TELEPORT_PASSIVE)) return;
 
@@ -481,7 +520,7 @@ void teleport_player_away(int m_idx, int dis)
        {
                for (yy = -1; yy < 2; yy++)
                {
-                       int tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
+                       IDX tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
 
                        /* A monster except your mount or caster may follow */
                        if (tmp_m_idx && (p_ptr->riding != tmp_m_idx) && (m_idx != tmp_m_idx))
@@ -493,10 +532,10 @@ void teleport_player_away(int m_idx, int dis)
                                 * The latter limitation is to avoid
                                 * totally unkillable suckers...
                                 */
-                               if ((r_ptr->flags6 & RF6_TPORT) &&
+                               if ((r_ptr->a_ability_flags2 & RF6_TPORT) &&
                                    !(r_ptr->flagsr & RFR_RES_TELE))
                                {
-                                       if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, py, px, r_ptr->level, 0L);
+                                       if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, p_ptr->y, p_ptr->x, r_ptr->level, 0L);
                                }
                        }
                }
@@ -504,24 +543,27 @@ void teleport_player_away(int m_idx, int dis)
 }
 
 
-/*
+/*!
+ * @brief プレイヤーを指定位置近辺にテレポートさせる
  * Teleport player to a grid near the given location
- *
+ * @param ny 目標Y座標
+ * @param nx 目標X座標
+ * @param mode オプションフラグ
+ * @return なし
+ * @details
+ * <pre>
  * This function is slightly obsessive about correctness.
  * This function allows teleporting into vaults (!)
+ * </pre>
  */
-void teleport_player_to(int ny, int nx, u32b mode)
+void teleport_player_to(POSITION ny, POSITION nx, u32b mode)
 {
-       int y, x, dis = 0, ctr = 0;
+       POSITION y, x;
+       int dis = 0, ctr = 0;
 
        if (p_ptr->anti_tele && !(mode & TELEPORT_NONMAGICAL))
        {
-#ifdef JP
-               msg_print("不思議な力がテレポートを防いだ!");
-#else
-               msg_print("A mysterious force prevents you from teleporting!");
-#endif
-
+               msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!"));
                return;
        }
 
@@ -531,8 +573,8 @@ void teleport_player_to(int ny, int nx, u32b mode)
                /* Pick a nearby legal location */
                while (1)
                {
-                       y = rand_spread(ny, dis);
-                       x = rand_spread(nx, dis);
+                       y = (POSITION)rand_spread(ny, dis);
+                       x = (POSITION)rand_spread(nx, dis);
                        if (in_bounds(y, x)) break;
                }
 
@@ -558,7 +600,7 @@ void teleport_player_to(int ny, int nx, u32b mode)
 }
 
 
-void teleport_away_followable(int m_idx)
+void teleport_away_followable(MONSTER_IDX m_idx)
 {
        monster_type *m_ptr = &m_list[m_idx];
        int          oldfy = m_ptr->fy;
@@ -568,7 +610,7 @@ void teleport_away_followable(int m_idx)
 
        teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
 
-       if (old_ml && (old_cdis <= MAX_SIGHT) && !world_monster && !p_ptr->inside_battle && los(py, px, oldfy, oldfx))
+       if (old_ml && (old_cdis <= MAX_SIGHT) && !world_monster && !p_ptr->inside_battle && los(p_ptr->y, p_ptr->x, oldfy, oldfx))
        {
                bool follow = FALSE;
 
@@ -596,20 +638,12 @@ void teleport_away_followable(int m_idx)
 
                if (follow)
                {
-#ifdef JP
-                       if (get_check_strict("ついていきますか?", CHECK_OKAY_CANCEL))
-#else
-                       if (get_check_strict("Do you follow it? ", CHECK_OKAY_CANCEL))
-#endif
+                       if (get_check_strict(_("ついていきますか?", "Do you follow it? "), CHECK_OKAY_CANCEL))
                        {
                                if (one_in_(3))
                                {
                                        teleport_player(200, TELEPORT_PASSIVE);
-#ifdef JP
-                                       msg_print("失敗!");
-#else
-                                       msg_print("Failed!");
-#endif
+                                       msg_print(_("失敗!", "Failed!"));
                                }
                                else teleport_player_to(m_ptr->fy, m_ptr->fx, 0L);
                                p_ptr->energy_need += ENERGY_NEED();
@@ -619,11 +653,13 @@ void teleport_away_followable(int m_idx)
 }
 
 
-/*
+/*!
+ * @brief プレイヤー及びモンスターをレベルテレポートさせる /
  * Teleport the player one level up or down (random when legal)
- * Note: If m_idx <= 0, target is player.
+ * @param m_idx テレポートの対象となるモンスターID(0ならばプレイヤー) / If m_idx <= 0, target is player.
+ * @return なし
  */
-void teleport_level(int m_idx)
+void teleport_level(MONSTER_IDX m_idx)
 {
        bool         go_up;
        char         m_name[160];
@@ -631,11 +667,7 @@ void teleport_level(int m_idx)
 
        if (m_idx <= 0) /* To player */
        {
-#ifdef JP
-               strcpy(m_name, "あなた");
-#else
-               strcpy(m_name, "you");
-#endif
+               strcpy(m_name, _("あなた", "you"));
        }
        else /* To monster */
        {
@@ -650,22 +682,13 @@ void teleport_level(int m_idx)
        /* No effect in some case */
        if (TELE_LEVEL_IS_INEFF(m_idx))
        {
-#ifdef JP
-               if (see_m) msg_print("効果がなかった。");
-#else
-               if (see_m) msg_print("There is no effect.");
-#endif
-
+               if (see_m) msg_print(_("効果がなかった。", "There is no effect."));
                return;
        }
 
        if ((m_idx <= 0) && p_ptr->anti_tele) /* To player */
        {
-#ifdef JP
-               msg_print("不思議な力がテレポートを防いだ!");
-#else
-               msg_print("A mysterious force prevents you from teleporting!");
-#endif
+               msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!"));
                return;
        }
 
@@ -691,9 +714,9 @@ void teleport_level(int m_idx)
                {
                        if (!dun_level)
                        {
-                               dungeon_type = p_ptr->recall_dungeon;
-                               p_ptr->oldpy = py;
-                               p_ptr->oldpx = px;
+                               dungeon_type = ironman_downward ? DUNGEON_ANGBAND : p_ptr->recall_dungeon;
+                               p_ptr->oldpy = p_ptr->y;
+                               p_ptr->oldpx = p_ptr->x;
                        }
 
                        if (record_stair) do_cmd_write_nikki(NIKKI_TELE_LEV, 1, NULL);
@@ -809,10 +832,16 @@ void teleport_level(int m_idx)
 }
 
 
-
-int choose_dungeon(cptr note, int y, int x)
+/*!
+ * @brief これまでに入ったダンジョンの一覧を表示し、選択させる。
+ * @param note ダンジョンに施す処理記述
+ * @param y コンソールY座標
+ * @param x コンソールX座標
+ * @return 選択されたダンジョンID
+ */
+DUNGEON_IDX choose_dungeon(cptr note, POSITION y, POSITION x)
 {
-       int select_dungeon;
+       DUNGEON_IDX select_dungeon;
        int i, num = 0;
        s16b *dun;
 
@@ -822,11 +851,7 @@ int choose_dungeon(cptr note, int y, int x)
                if (max_dlv[DUNGEON_ANGBAND]) return DUNGEON_ANGBAND;
                else
                {
-#ifdef JP
-                       msg_format("まだ%sに入ったことはない。", d_name + d_info[DUNGEON_ANGBAND].name);
-#else
-                       msg_format("You haven't entered %s yet.", d_name + d_info[DUNGEON_ANGBAND].name);
-#endif
+                       msg_format(_("まだ%sに入ったことはない。", "You haven't entered %s yet."), d_name + d_info[DUNGEON_ANGBAND].name);
                        msg_print(NULL);
                        return 0;
                }
@@ -849,29 +874,18 @@ int choose_dungeon(cptr note, int y, int x)
                }
                else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
 
-#ifdef JP
-               sprintf(buf,"      %c) %c%-12s : 最大 %d 階", 'a'+num, seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
-#else
-               sprintf(buf,"      %c) %c%-16s : Max level %d", 'a'+num, seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
-#endif
+               sprintf(buf,_("      %c) %c%-12s : 最大 %d 階", "      %c) %c%-16s : Max level %d"), 
+                                       'a'+num, seiha ? '!' : ' ', d_name + d_info[i].name, (int)max_dlv[i]);
                prt(buf, y + num, x);
                dun[num++] = i;
        }
 
        if (!num)
        {
-#ifdef JP
-               prt("      選べるダンジョンがない。", y, x);
-#else
-               prt("      No dungeon is available.", y, x);
-#endif
+               prt(_("      選べるダンジョンがない。", "      No dungeon is available."), y, x);
        }
 
-#ifdef JP
-       prt(format("どのダンジョン%sしますか:", note), 0, 0);
-#else
-       prt(format("Which dungeon do you %s?: ", note), 0, 0);
-#endif
+       prt(format(_("どのダンジョン%sしますか:", "Which dungeon do you %s?: "), note), 0, 0);
        while(1)
        {
                i = inkey();
@@ -899,10 +913,13 @@ int choose_dungeon(cptr note, int y, int x)
 }
 
 
-/*
+/*!
+ * @brief プレイヤーの帰還発動及び中止処理 /
  * Recall the player to town or dungeon
+ * @param turns 発動までのターン数
+ * @return 常にTRUEを返す
  */
-bool recall_player(int turns)
+bool recall_player(TIME_EFFECT turns)
 {
        /*
         * TODO: Recall the player to the last
@@ -912,30 +929,17 @@ bool recall_player(int turns)
        /* Ironman option */
        if (p_ptr->inside_arena || ironman_downward)
        {
-#ifdef JP
-msg_print("何も起こらなかった。");
-#else
-               msg_print("Nothing happens.");
-#endif
-
+               msg_print(_("何も起こらなかった。", "Nothing happens."));
                return TRUE;
        }
 
        if (dun_level && (max_dlv[dungeon_type] > dun_level) && !p_ptr->inside_quest && !p_ptr->word_recall)
        {
-#ifdef JP
-if (get_check("ここは最深到達階より浅い階です。この階に戻って来ますか? "))
-#else
-               if (get_check("Reset recall depth? "))
-#endif
+               if (get_check(_("ここは最深到達階より浅い階です。この階に戻って来ますか? ", "Reset recall depth? ")))
                {
                        max_dlv[dungeon_type] = dun_level;
                        if (record_maxdepth)
-#ifdef JP
-                               do_cmd_write_nikki(NIKKI_TRUMP, dungeon_type, "帰還のときに");
-#else
-                               do_cmd_write_nikki(NIKKI_TRUMP, dungeon_type, "when recall from dungeon");
-#endif
+                               do_cmd_write_nikki(NIKKI_TRUMP, dungeon_type, _("帰還のときに", "when recall from dungeon"));
                }
 
        }
@@ -943,80 +947,59 @@ if (get_check("ここは最深到達階より浅い階です。この階に戻
        {
                if (!dun_level)
                {
-                       int select_dungeon;
-#ifdef JP
-                       select_dungeon = choose_dungeon("に帰還", 2, 14);
-#else
-                       select_dungeon = choose_dungeon("recall", 2, 14);
-#endif
+                       DUNGEON_IDX select_dungeon;
+                       select_dungeon = choose_dungeon(_("に帰還", "recall"), 2, 14);
                        if (!select_dungeon) return FALSE;
                        p_ptr->recall_dungeon = select_dungeon;
                }
                p_ptr->word_recall = turns;
-#ifdef JP
-msg_print("回りの大気が張りつめてきた...");
-#else
-               msg_print("The air about you becomes charged...");
-#endif
-
+               msg_print(_("回りの大気が張りつめてきた...", "The air about you becomes charged..."));
                p_ptr->redraw |= (PR_STATUS);
        }
        else
        {
                p_ptr->word_recall = 0;
-#ifdef JP
-msg_print("張りつめた大気が流れ去った...");
-#else
-               msg_print("A tension leaves the air around you...");
-#endif
-
+               msg_print(_("張りつめた大気が流れ去った...", "A tension leaves the air around you..."));
                p_ptr->redraw |= (PR_STATUS);
        }
        return TRUE;
 }
 
-
+/*!
+ * @brief 帰還用メインルーチン
+ * @return 常にTRUEを返す
+ */
 bool word_of_recall(void)
 {
        return(recall_player(randint0(21) + 15));
 }
 
-
+/*!
+ * @brief フロア・リセット処理
+ * @return リセット処理が実際に行われたらTRUEを返す
+ */
 bool reset_recall(void)
 {
        int select_dungeon, dummy = 0;
        char ppp[80];
        char tmp_val[160];
 
-#ifdef JP
-       select_dungeon = choose_dungeon("をセット", 2, 14);
-#else
-       select_dungeon = choose_dungeon("reset", 2, 14);
-#endif
+       select_dungeon = choose_dungeon(_("をセット", "reset"), 2, 14);
 
        /* Ironman option */
        if (ironman_downward)
        {
-#ifdef JP
-               msg_print("何も起こらなかった。");
-#else
-               msg_print("Nothing happens.");
-#endif
-
+               msg_print(_("何も起こらなかった。", "Nothing happens."));
                return TRUE;
        }
 
        if (!select_dungeon) return FALSE;
        /* Prompt */
-#ifdef JP
-sprintf(ppp, "何階にセットしますか (%d-%d):", d_info[select_dungeon].mindepth, max_dlv[select_dungeon]);
-#else
-       sprintf(ppp, "Reset to which level (%d-%d): ", d_info[select_dungeon].mindepth, max_dlv[select_dungeon]);
-#endif
-
+       sprintf(ppp, _("何階にセットしますか (%d-%d):", "Reset to which level (%d-%d): "),
+               (int)d_info[select_dungeon].mindepth, (int)max_dlv[select_dungeon]);
 
        /* Default */
-       sprintf(tmp_val, "%d", MAX(dun_level, 1));
+       sprintf(tmp_val, "%d", (int)MAX(dun_level, 1));
 
        /* Ask for a level */
        if (get_string(ppp, tmp_val, 10))
@@ -1034,11 +1017,7 @@ sprintf(ppp, "何階にセットしますか (%d-%d):", d_info[select_dungeon].m
                max_dlv[select_dungeon] = dummy;
 
                if (record_maxdepth)
-#ifdef JP
-                       do_cmd_write_nikki(NIKKI_TRUMP, select_dungeon, "フロア・リセットで");
-#else
-                       do_cmd_write_nikki(NIKKI_TRUMP, select_dungeon, "using a scroll of reset recall");
-#endif
+                       do_cmd_write_nikki(NIKKI_TRUMP, select_dungeon, _("フロア・リセットで", "using a scroll of reset recall"));
                                        /* Accept request */
 #ifdef JP
 msg_format("%sの帰還レベルを %d 階にセット。", d_name+d_info[select_dungeon].name, dummy, dummy * 50);
@@ -1055,11 +1034,11 @@ msg_format("%sの帰還レベルを %d 階にセット。", d_name+d_info[select
 }
 
 
-/*
+/*!
+ * @brief プレイヤーの装備劣化処理 /
  * Apply disenchantment to the player's stuff
- *
- * XXX XXX XXX This function is also called from the "melee" code
- *
+ * @param mode 最下位ビットが1ならば劣化処理が若干低減される
+ * @return 劣化処理に関するメッセージが発せられた場合はTRUEを返す /
  * Return "TRUE" if the player notices anything
  */
 bool apply_disenchant(int mode)
@@ -1173,10 +1152,14 @@ msg_format("%s(%c)は劣化を跳ね返した!",o_name, index_to_label(t) );
        return (TRUE);
 }
 
-
+/*!
+ * @brief プレイヤーの突然変異処理
+ * @return なし
+ */
 void mutate_player(void)
 {
-       int max1, cur1, max2, cur2, ii, jj, i;
+       BASE_STATUS max1, cur1, max2, cur2;
+       int ii, jj, i;
 
        /* Pick a pair of stats */
        ii = randint0(6);
@@ -1202,8 +1185,10 @@ void mutate_player(void)
 }
 
 
-/*
- * Apply Nexus
+/*!
+ * @brief プレイヤーの因果混乱処理 / Apply Nexus
+ * @param m_ptr 因果混乱をプレイヤーに与えたモンスターの情報参照ポインタ
+ * @return なし
  */
 void apply_nexus(monster_type *m_ptr)
 {
@@ -1225,12 +1210,7 @@ void apply_nexus(monster_type *m_ptr)
                {
                        if (randint0(100) < p_ptr->skill_sav)
                        {
-#ifdef JP
-msg_print("しかし効力を跳ね返した!");
-#else
-                               msg_print("You resist the effects!");
-#endif
-
+                               msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
                                break;
                        }
 
@@ -1243,21 +1223,11 @@ msg_print("しかし効力を跳ね返した!");
                {
                        if (randint0(100) < p_ptr->skill_sav)
                        {
-#ifdef JP
-msg_print("しかし効力を跳ね返した!");
-#else
-                               msg_print("You resist the effects!");
-#endif
-
+                               msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
                                break;
                        }
 
-#ifdef JP
-msg_print("体がねじれ始めた...");
-#else
-                       msg_print("Your body starts to scramble...");
-#endif
-
+                       msg_print(_("体がねじれ始めた...", "Your body starts to scramble..."));
                        mutate_player();
                        break;
                }
@@ -1265,8 +1235,10 @@ msg_print("体がねじれ始めた...");
 }
 
 
-/*
+/*!
+ * @brief 寿命つき光源の燃素追加処理 /
  * Charge a lite (torch or latern)
+ * @return なし
  */
 void phlogiston(void)
 {
@@ -1288,23 +1260,13 @@ void phlogiston(void)
        /* No torch to refill */
        else
        {
-#ifdef JP
-msg_print("燃素を消費するアイテムを装備していません。");
-#else
-               msg_print("You are not wielding anything which uses phlogiston.");
-#endif
-
+               msg_print(_("燃素を消費するアイテムを装備していません。", "You are not wielding anything which uses phlogiston."));
                return;
        }
 
        if (o_ptr->xtra4 >= max_flog)
        {
-#ifdef JP
-msg_print("このアイテムにはこれ以上燃素を補充できません。");
-#else
-               msg_print("No more phlogiston can be put in this item.");
-#endif
-
+               msg_print(_("このアイテムにはこれ以上燃素を補充できません。", "No more phlogiston can be put in this item."));
                return;
        }
 
@@ -1312,23 +1274,13 @@ msg_print("このアイテムにはこれ以上燃素を補充できません。
        o_ptr->xtra4 += (max_flog / 2);
 
        /* Message */
-#ifdef JP
-msg_print("照明用アイテムに燃素を補充した。");
-#else
-       msg_print("You add phlogiston to your light item.");
-#endif
-
+       msg_print(_("照明用アイテムに燃素を補充した。", "You add phlogiston to your light item."));
 
        /* Comment */
        if (o_ptr->xtra4 >= max_flog)
        {
                o_ptr->xtra4 = max_flog;
-#ifdef JP
-msg_print("照明用アイテムは満タンになった。");
-#else
-               msg_print("Your light item is full.");
-#endif
-
+               msg_print(_("照明用アイテムは満タンになった。", "Your light item is full."));
        }
 
        /* Recalculate torch */
@@ -1336,12 +1288,15 @@ msg_print("照明用アイテムは満タンになった。");
 }
 
 
-/*
+/*!
+ * @brief 武器へのエゴ付加処理 /
  * Brand the current weapon
+ * @param brand_type エゴ化ID(e_info.txtとは連動していない)
+ * @return なし
  */
 void brand_weapon(int brand_type)
 {
-       int         item;
+       OBJECT_IDX item;
        object_type *o_ptr;
        cptr        q, s;
 
@@ -1351,13 +1306,8 @@ void brand_weapon(int brand_type)
        item_tester_no_ryoute = TRUE;
 
        /* Get an item */
-#ifdef JP
-q = "どの武器を強化しますか? ";
-s = "強化できる武器がない。";
-#else
-       q = "Enchant which weapon? ";
-       s = "You have nothing to enchant.";
-#endif
+       q = _("どの武器を強化しますか? ", "Enchant which weapon? ");
+       s = _("強化できる武器がない。", "You have nothing to enchant.");
 
        if (!get_item(&item, q, s, (USE_EQUIP))) return;
 
@@ -1394,11 +1344,7 @@ s = "強化できる武器がない。";
                case 17:
                        if (o_ptr->tval == TV_SWORD)
                        {
-#ifdef JP
-act = "は鋭さを増した!";
-#else
-                               act = "becomes very sharp!";
-#endif
+                               act = _("は鋭さを増した!", "becomes very sharp!");
 
                                o_ptr->name2 = EGO_SHARPNESS;
                                o_ptr->pval = m_bonus(5, dun_level) + 1;
@@ -1408,179 +1354,83 @@ act = "は鋭さを増した!";
                        }
                        else
                        {
-#ifdef JP
-act = "は破壊力を増した!";
-#else
-                               act = "seems very powerful.";
-#endif
-
+                               act = _("は破壊力を増した!", "seems very powerful.");
                                o_ptr->name2 = EGO_EARTHQUAKES;
                                o_ptr->pval = m_bonus(3, dun_level);
                        }
                        break;
                case 16:
-#ifdef JP
-act = "は人間の血を求めている!";
-#else
-                       act = "seems to be looking for humans!";
-#endif
-
+                       act = _("は人間の血を求めている!", "seems to be looking for humans!");
                        o_ptr->name2 = EGO_KILL_HUMAN;
                        break;
                case 15:
-#ifdef JP
-act = "は電撃に覆われた!";
-#else
-                       act = "covered with lightning!";
-#endif
-
+                       act = _("は電撃に覆われた!", "covered with lightning!");
                        o_ptr->name2 = EGO_BRAND_ELEC;
                        break;
                case 14:
-#ifdef JP
-act = "は酸に覆われた!";
-#else
-                       act = "coated with acid!";
-#endif
-
+                       act = _("は酸に覆われた!", "coated with acid!");
                        o_ptr->name2 = EGO_BRAND_ACID;
                        break;
                case 13:
-#ifdef JP
-act = "は邪悪なる怪物を求めている!";
-#else
-                       act = "seems to be looking for evil monsters!";
-#endif
-
+                       act = _("は邪悪なる怪物を求めている!", "seems to be looking for evil monsters!");
                        o_ptr->name2 = EGO_KILL_EVIL;
                        break;
                case 12:
-#ifdef JP
-act = "は異世界の住人の肉体を求めている!";
-#else
-                       act = "seems to be looking for demons!";
-#endif
-
+                       act = _("は異世界の住人の肉体を求めている!", "seems to be looking for demons!");
                        o_ptr->name2 = EGO_KILL_DEMON;
                        break;
                case 11:
-#ifdef JP
-act = "は屍を求めている!";
-#else
-                       act = "seems to be looking for undead!";
-#endif
-
+                       act = _("は屍を求めている!", "seems to be looking for undead!");
                        o_ptr->name2 = EGO_KILL_UNDEAD;
                        break;
                case 10:
-#ifdef JP
-act = "は動物の血を求めている!";
-#else
-                       act = "seems to be looking for animals!";
-#endif
-
+                       act = _("は動物の血を求めている!", "seems to be looking for animals!");
                        o_ptr->name2 = EGO_KILL_ANIMAL;
                        break;
                case 9:
-#ifdef JP
-act = "はドラゴンの血を求めている!";
-#else
-                       act = "seems to be looking for dragons!";
-#endif
-
+                       act = _("はドラゴンの血を求めている!", "seems to be looking for dragons!");
                        o_ptr->name2 = EGO_KILL_DRAGON;
                        break;
                case 8:
-#ifdef JP
-act = "はトロルの血を求めている!";
-#else
-                       act = "seems to be looking for troll!s";
-#endif
-
+                       act = _("はトロルの血を求めている!", "seems to be looking for troll!s");
                        o_ptr->name2 = EGO_KILL_TROLL;
                        break;
                case 7:
-#ifdef JP
-act = "はオークの血を求めている!";
-#else
-                       act = "seems to be looking for orcs!";
-#endif
-
+                       act = _("はオークの血を求めている!", "seems to be looking for orcs!");
                        o_ptr->name2 = EGO_KILL_ORC;
                        break;
                case 6:
-#ifdef JP
-act = "は巨人の血を求めている!";
-#else
-                       act = "seems to be looking for giants!";
-#endif
-
+                       act = _("は巨人の血を求めている!", "seems to be looking for giants!");
                        o_ptr->name2 = EGO_KILL_GIANT;
                        break;
                case 5:
-#ifdef JP
-act = "は非常に不安定になったようだ。";
-#else
-                       act = "seems very unstable now.";
-#endif
-
+                       act = _("は非常に不安定になったようだ。", "seems very unstable now.");
                        o_ptr->name2 = EGO_TRUMP;
                        o_ptr->pval = randint1(2);
                        break;
                case 4:
-#ifdef JP
-act = "は血を求めている!";
-#else
-                       act = "thirsts for blood!";
-#endif
-
+                       act = _("は血を求めている!", "thirsts for blood!");
                        o_ptr->name2 = EGO_VAMPIRIC;
                        break;
                case 3:
-#ifdef JP
-act = "は毒に覆われた。";
-#else
-                       act = "is coated with poison.";
-#endif
-
+                       act = _("は毒に覆われた。", "is coated with poison.");
                        o_ptr->name2 = EGO_BRAND_POIS;
                        break;
                case 2:
-#ifdef JP
-act = "は純ログルスに飲み込まれた。";
-#else
-                       act = "is engulfed in raw Logrus!";
-#endif
-
+                       act = _("は純ログルスに飲み込まれた。", "is engulfed in raw Logrus!");
                        o_ptr->name2 = EGO_CHAOTIC;
                        break;
                case 1:
-#ifdef JP
-act = "は炎のシールドに覆われた!";
-#else
-                       act = "is covered in a fiery shield!";
-#endif
-
+                       act = _("は炎のシールドに覆われた!", "is covered in a fiery shield!");
                        o_ptr->name2 = EGO_BRAND_FIRE;
                        break;
                default:
-#ifdef JP
-act = "は深く冷たいブルーに輝いた!";
-#else
-                       act = "glows deep, icy blue!";
-#endif
-
+                       act = _("は深く冷たいブルーに輝いた!", "glows deep, icy blue!");
                        o_ptr->name2 = EGO_BRAND_COLD;
                        break;
                }
 
-#ifdef JP
-msg_format("あなたの%s%s", o_name, act);
-#else
-               msg_format("Your %s %s", o_name, act);
-#endif
-
-
+               msg_format(_("あなたの%s%s", "Your %s %s"), o_name, act);
                enchant(o_ptr, randint0(3) + 4, ENCH_TOHIT | ENCH_TODAM);
 
                o_ptr->discount = 99;
@@ -1590,20 +1440,17 @@ msg_format("あなたの%s%s", o_name, act);
        {
                if (flush_failure) flush();
 
-#ifdef JP
-msg_print("属性付加に失敗した。");
-#else
-               msg_print("The Branding failed.");
-#endif
-
+               msg_print(_("属性付加に失敗した。", "The Branding failed."));
                chg_virtue(V_ENCHANT, -2);
        }
        calc_android_exp();
 }
 
 
-/*
+/*!
+ * @brief 虚無招来によるフロア中の全壁除去処理 /
  * Vanish all walls in this floor
+ * @return 実際に処理が反映された場合TRUE
  */
 static bool vanish_dungeon(void)
 {
@@ -1647,11 +1494,7 @@ static bool vanish_dungeon(void)
                                        monster_desc(m_name, m_ptr, 0);
 
                                        /* Dump a message */
-#ifdef JP
-                                       msg_format("%^sが目を覚ました。", m_name);
-#else
-                                       msg_format("%^s wakes up.", m_name);
-#endif
+                                       msg_format(_("%^sが目を覚ました。", "%^s wakes up."), m_name);
                                }
                        }
 
@@ -1746,7 +1589,10 @@ static bool vanish_dungeon(void)
        return TRUE;
 }
 
-
+/*!
+ * @brief 虚無招来処理 /
+ * @return なし
+ */
 void call_the_(void)
 {
        int i;
@@ -1755,7 +1601,7 @@ void call_the_(void)
 
        for (i = 0; i < 9; i++)
        {
-               c_ptr = &cave[py + ddy_ddd[i]][px + ddx_ddd[i]];
+               c_ptr = &cave[p_ptr->y + ddy_ddd[i]][p_ptr->x + ddx_ddd[i]];
 
                if (!cave_have_flag_grid(c_ptr, FF_PROJECT))
                {
@@ -1789,11 +1635,7 @@ void call_the_(void)
        /* Prevent destruction of quest levels and town */
        else if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level)
        {
-#ifdef JP
-               msg_print("地面が揺れた。");
-#else
-               msg_print("The ground trembles.");
-#endif
+               msg_print(_("地面が揺れた。", "The ground trembles."));
        }
 
        else
@@ -1811,57 +1653,41 @@ void call_the_(void)
 
                if (one_in_(666))
                {
-#ifdef JP
-                       if (!vanish_dungeon()) msg_print("ダンジョンは一瞬静まり返った。");
-#else
-                       if (!vanish_dungeon()) msg_print("The dungeon silences a moment.");
-#endif
+                       if (!vanish_dungeon()) msg_print(_("ダンジョンは一瞬静まり返った。", "The dungeon silences a moment."));
                }
                else
                {
-                       if (destroy_area(py, px, 15 + p_ptr->lev + randint0(11), FALSE))
-#ifdef JP
-                               msg_print("ダンジョンが崩壊した...");
-#else
-                               msg_print("The dungeon collapses...");
-#endif
-
+                       if (destroy_area(p_ptr->y, p_ptr->x, 15 + p_ptr->lev + randint0(11), FALSE))
+                               msg_print(_("ダンジョンが崩壊した...", "The dungeon collapses..."));
                        else
-#ifdef JP
-                               msg_print("ダンジョンは大きく揺れた。");
-#else
-                               msg_print("The dungeon trembles.");
-#endif
+                               msg_print(_("ダンジョンは大きく揺れた。", "The dungeon trembles."));
                }
 
-#ifdef JP
-               take_hit(DAMAGE_NOESCAPE, 100 + randint1(150), "自殺的な虚無招来", -1);
-#else
-               take_hit(DAMAGE_NOESCAPE, 100 + randint1(150), "a suicidal Call the Void", -1);
-#endif
+               take_hit(DAMAGE_NOESCAPE, 100 + randint1(150), _("自殺的な虚無招来", "a suicidal Call the Void"), -1);
        }
 }
 
 
-/*
+/*!
+ * @brief アイテム引き寄せ処理 /
  * Fetch an item (teleport it right underneath the caster)
+ * @param dir 魔法の発動方向
+ * @param wgt 許容重量
+ * @param require_los 射線の通りを要求するならばTRUE
+ * @return なし
  */
 void fetch(int dir, int wgt, bool require_los)
 {
-       int             ty, tx, i;
+       int             ty, tx;
+       DEPTH i;
        cave_type       *c_ptr;
        object_type     *o_ptr;
        char            o_name[MAX_NLEN];
 
        /* Check to see if an object is already there */
-       if (cave[py][px].o_idx)
+       if (cave[p_ptr->y][p_ptr->x].o_idx)
        {
-#ifdef JP
-msg_print("自分の足の下にある物は取れません。");
-#else
-               msg_print("You can't fetch when you're already standing on something.");
-#endif
-
+               msg_print(_("自分の足の下にある物は取れません。", "You can't fetch when you're already standing on something."));
                return;
        }
 
@@ -1871,14 +1697,9 @@ msg_print("自分の足の下にある物は取れません。");
                tx = target_col;
                ty = target_row;
 
-               if (distance(py, px, ty, tx) > MAX_RANGE)
+               if (distance(p_ptr->y, p_ptr->x, ty, tx) > MAX_RANGE)
                {
-#ifdef JP
-msg_print("そんなに遠くにある物は取れません!");
-#else
-                       msg_print("You can't fetch something that far away!");
-#endif
-
+                       msg_print(_("そんなに遠くにある物は取れません!", "You can't fetch something that far away!"));
                        return;
                }
 
@@ -1887,24 +1708,14 @@ msg_print("そんなに遠くにある物は取れません!");
                /* We need an item to fetch */
                if (!c_ptr->o_idx)
                {
-#ifdef JP
-msg_print("そこには何もありません。");
-#else
-                       msg_print("There is no object at this place.");
-#endif
-
+                       msg_print(_("そこには何もありません。", "There is no object at this place."));
                        return;
                }
 
                /* No fetching from vault */
                if (c_ptr->info & CAVE_ICKY)
                {
-#ifdef JP
-msg_print("アイテムがコントロールを外れて落ちた。");
-#else
-                       msg_print("The item slips from your control.");
-#endif
-
+                       msg_print(_("アイテムがコントロールを外れて落ちた。", "The item slips from your control."));
                        return;
                }
 
@@ -1913,22 +1724,12 @@ msg_print("アイテムがコントロールを外れて落ちた。");
                {
                        if (!player_has_los_bold(ty, tx))
                        {
-#ifdef JP
-                               msg_print("そこはあなたの視界に入っていません。");
-#else
-                               msg_print("You have no direct line of sight to that location.");
-#endif
-
+                               msg_print(_("そこはあなたの視界に入っていません。", "You have no direct line of sight to that location."));
                                return;
                        }
-                       else if (!projectable(py, px, ty, tx))
+                       else if (!projectable(p_ptr->y, p_ptr->x, ty, tx))
                        {
-#ifdef JP
-                               msg_print("そこは壁の向こうです。");
-#else
-                               msg_print("You have no direct line of sight to that location.");
-#endif
-
+                               msg_print(_("そこは壁の向こうです。", "You have no direct line of sight to that location."));
                                return;
                        }
                }
@@ -1936,8 +1737,8 @@ msg_print("アイテムがコントロールを外れて落ちた。");
        else
        {
                /* Use a direction */
-               ty = py; /* Where to drop the item */
-               tx = px;
+               ty = p_ptr->y; /* Where to drop the item */
+               tx = p_ptr->x;
 
                do
                {
@@ -1945,7 +1746,7 @@ msg_print("アイテムがコントロールを外れて落ちた。");
                        tx += ddx[dir];
                        c_ptr = &cave[ty][tx];
 
-                       if ((distance(py, px, ty, tx) > MAX_RANGE) ||
+                       if ((distance(p_ptr->y, p_ptr->x, ty, tx) > MAX_RANGE) ||
                                !cave_have_flag_bold(ty, tx, FF_PROJECT)) return;
                }
                while (!c_ptr->o_idx);
@@ -1956,173 +1757,148 @@ msg_print("アイテムがコントロールを外れて落ちた。");
        if (o_ptr->weight > wgt)
        {
                /* Too heavy to 'fetch' */
-#ifdef JP
-msg_print("そのアイテムは重過ぎます。");
-#else
-               msg_print("The object is too heavy.");
-#endif
-
+               msg_print(_("そのアイテムは重過ぎます。", "The object is too heavy."));
                return;
        }
 
        i = c_ptr->o_idx;
        c_ptr->o_idx = o_ptr->next_o_idx;
-       cave[py][px].o_idx = i; /* 'move' it */
+       cave[p_ptr->y][p_ptr->x].o_idx = i; /* 'move' it */
        o_ptr->next_o_idx = 0;
-       o_ptr->iy = (byte)py;
-       o_ptr->ix = (byte)px;
+       o_ptr->iy = (byte)p_ptr->y;
+       o_ptr->ix = (byte)p_ptr->x;
 
        object_desc(o_name, o_ptr, OD_NAME_ONLY);
-#ifdef JP
-msg_format("%^sがあなたの足元に飛んできた。", o_name);
-#else
-       msg_format("%^s flies through the air to your feet.", o_name);
-#endif
-
+       msg_format(_("%^sがあなたの足元に飛んできた。", "%^s flies through the air to your feet."), o_name);
 
-       note_spot(py, px);
+       note_spot(p_ptr->y, p_ptr->x);
        p_ptr->redraw |= PR_MAP;
 }
 
-
+/*!
+ * @brief 現実変容処理
+ * @return なし
+ */
 void alter_reality(void)
 {
        /* Ironman option */
        if (p_ptr->inside_arena || ironman_downward)
        {
-#ifdef JP
-               msg_print("何も起こらなかった。");
-#else
-               msg_print("Nothing happens.");
-#endif
+               msg_print(_("何も起こらなかった。", "Nothing happens."));
                return;
        }
 
        if (!p_ptr->alter_reality)
        {
-               int turns = randint0(21) + 15;
+               TIME_EFFECT turns = randint0(21) + 15;
 
                p_ptr->alter_reality = turns;
-#ifdef JP
-               msg_print("回りの景色が変わり始めた...");
-#else
-               msg_print("The view around you begins to change...");
-#endif
+               msg_print(_("回りの景色が変わり始めた...", "The view around you begins to change..."));
 
                p_ptr->redraw |= (PR_STATUS);
        }
        else
        {
                p_ptr->alter_reality = 0;
-#ifdef JP
-               msg_print("景色が元に戻った...");
-#else
-               msg_print("The view around you got back...");
-#endif
-
+               msg_print(_("景色が元に戻った...", "The view around you got back..."));
                p_ptr->redraw |= (PR_STATUS);
        }
        return;
 }
 
 
-/*
+/*!
+ * @brief 守りのルーン設置処理 /
  * Leave a "glyph of warding" which prevents monster movement
+ * @return 実際に設置が行われた場合TRUEを返す
  */
 bool warding_glyph(void)
 {
        /* XXX XXX XXX */
-       if (!cave_clean_bold(py, px))
+       if (!cave_clean_bold(p_ptr->y, p_ptr->x))
        {
-#ifdef JP
-msg_print("床上のアイテムが呪文を跳ね返した。");
-#else
-               msg_print("The object resists the spell.");
-#endif
-
+               msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
                return FALSE;
        }
 
        /* Create a glyph */
-       cave[py][px].info |= CAVE_OBJECT;
-       cave[py][px].mimic = feat_glyph;
+       cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+       cave[p_ptr->y][p_ptr->x].mimic = feat_glyph;
 
        /* Notice */
-       note_spot(py, px);
+       note_spot(p_ptr->y, p_ptr->x);
 
        /* Redraw */
-       lite_spot(py, px);
+       lite_spot(p_ptr->y, p_ptr->x);
 
        return TRUE;
 }
 
+/*!
+ * @brief 鏡設置処理
+ * @return 実際に設置が行われた場合TRUEを返す
+ */
 bool place_mirror(void)
 {
        /* XXX XXX XXX */
-       if (!cave_clean_bold(py, px))
+       if (!cave_clean_bold(p_ptr->y, p_ptr->x))
        {
-#ifdef JP
-msg_print("床上のアイテムが呪文を跳ね返した。");
-#else
-               msg_print("The object resists the spell.");
-#endif
-
+               msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
                return FALSE;
        }
 
        /* Create a mirror */
-       cave[py][px].info |= CAVE_OBJECT;
-       cave[py][px].mimic = feat_mirror;
+       cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+       cave[p_ptr->y][p_ptr->x].mimic = feat_mirror;
 
        /* Turn on the light */
-       cave[py][px].info |= CAVE_GLOW;
+       cave[p_ptr->y][p_ptr->x].info |= CAVE_GLOW;
 
        /* Notice */
-       note_spot(py, px);
+       note_spot(p_ptr->y, p_ptr->x);
 
        /* Redraw */
-       lite_spot(py, px);
+       lite_spot(p_ptr->y, p_ptr->x);
 
-       update_local_illumination(py, px);
+       update_local_illumination(p_ptr->y, p_ptr->x);
 
        return TRUE;
 }
 
 
-/*
+/*!
+ * @brief 爆発のルーン設置処理 /
  * Leave an "explosive rune" which prevents monster movement
+ * @return 実際に設置が行われた場合TRUEを返す
  */
 bool explosive_rune(void)
 {
        /* XXX XXX XXX */
-       if (!cave_clean_bold(py, px))
+       if (!cave_clean_bold(p_ptr->y, p_ptr->x))
        {
-#ifdef JP
-msg_print("床上のアイテムが呪文を跳ね返した。");
-#else
-               msg_print("The object resists the spell.");
-#endif
-
+               msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
                return FALSE;
        }
 
        /* Create a glyph */
-       cave[py][px].info |= CAVE_OBJECT;
-       cave[py][px].mimic = feat_explosive_rune;
+       cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+       cave[p_ptr->y][p_ptr->x].mimic = feat_explosive_rune;
 
        /* Notice */
-       note_spot(py, px);
+       note_spot(p_ptr->y, p_ptr->x);
        
        /* Redraw */
-       lite_spot(py, px);
+       lite_spot(p_ptr->y, p_ptr->x);
 
        return TRUE;
 }
 
 
-/*
+/*!
+ * @brief 全所持アイテム鑑定処理 /
  * Identify everything being carried.
  * Done by a potion of "self knowledge".
+ * @return なし
  */
 void identify_pack(void)
 {
@@ -2145,9 +1921,11 @@ void identify_pack(void)
 }
 
 
-/*
+/*!
+ * @brief 装備強化処理の失敗率定数(千分率) /
  * Used by the "enchant" function (chance of failure)
  * (modified for Zangband, we need better stuff there...) -- TY
+ * @return なし
  */
 static int enchant_table[16] =
 {
@@ -2158,15 +1936,20 @@ static int enchant_table[16] =
 };
 
 
-/*
+/*!
+ * @brief 装備の解呪処理 /
  * Removes curses from items in inventory
- *
+ * @param all 軽い呪いまでの解除ならば0
+ * @return 解呪されたアイテムの数
+ * @details
+ * <pre>
  * Note that Items which are "Perma-Cursed" (The One Ring,
  * The Crown of Morgoth) can NEVER be uncursed.
  *
  * Note that if "all" is FALSE, then Items which are
  * "Heavy-Cursed" (Mormegil, Calris, and Weapons of Morgul)
  * will not be uncursed.
+ * </pre>
  */
 static int remove_curse_aux(int all)
 {
@@ -2218,31 +2001,38 @@ static int remove_curse_aux(int all)
 }
 
 
-/*
+/*!
+ * @brief 装備の軽い呪い解呪処理 /
  * Remove most curses
+ * @return 解呪に成功した装備数
  */
-bool remove_curse(void)
+int remove_curse(void)
 {
        return (remove_curse_aux(FALSE));
 }
 
-/*
+/*!
+ * @brief 装備の重い呪い解呪処理 /
  * Remove all curses
+ * @return 解呪に成功した装備数
  */
-bool remove_all_curse(void)
+int remove_all_curse(void)
 {
        return (remove_curse_aux(TRUE));
 }
 
 
-/*
+/*!
+ * @brief アイテムの価値に応じた錬金術処理 /
  * Turns an object into gold, gain some of its value in a shop
+ * @return 処理が実際に行われたらTRUEを返す
  */
 bool alchemy(void)
 {
-       int item, amt = 1;
-       int old_number;
-       long price;
+       OBJECT_IDX item;
+       int amt = 1;
+       ITEM_NUMBER old_number;
+       PRICE price;
        bool force = FALSE;
        object_type *o_ptr;
        char o_name[MAX_NLEN];
@@ -2254,13 +2044,8 @@ bool alchemy(void)
        if (command_arg > 0) force = TRUE;
 
        /* Get an item */
-#ifdef JP
-q = "どのアイテムを金に変えますか?";
-s = "金に変えられる物がありません。";
-#else
-       q = "Turn which item to gold? ";
-       s = "You have nothing to turn to gold.";
-#endif
+       q = _("どのアイテムを金に変えますか?", "Turn which item to gold? ");
+       s = _("金に変えられる物がありません。", "You have nothing to turn to gold.");
 
        if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return (FALSE);
 
@@ -2300,12 +2085,7 @@ s = "金に変えられる物がありません。";
                if (confirm_destroy || (object_value(o_ptr) > 0))
                {
                        /* Make a verification */
-#ifdef JP
-sprintf(out_val, "本当に%sを金に変えますか?", o_name);
-#else
-                       sprintf(out_val, "Really turn %s to gold? ", o_name);
-#endif
-
+                       sprintf(out_val, _("本当に%sを金に変えますか?", "Really turn %s to gold? "), o_name);
                        if (!get_check(out_val)) return FALSE;
                }
        }
@@ -2314,11 +2094,7 @@ sprintf(out_val, "本当に%sを金に変えますか?", o_name);
        if (!can_player_destroy_object(o_ptr))
        {
                /* Message */
-#ifdef JP
-               msg_format("%sを金に変えることに失敗した。", o_name);
-#else
-               msg_format("You fail to turn %s to gold!", o_name);
-#endif
+               msg_format(_("%sを金に変えることに失敗した。", "You fail to turn %s to gold!"), o_name);
 
                /* Done */
                return FALSE;
@@ -2329,12 +2105,7 @@ sprintf(out_val, "本当に%sを金に変えますか?", o_name);
        if (price <= 0)
        {
                /* Message */
-#ifdef JP
-msg_format("%sをニセの金に変えた。", o_name);
-#else
-               msg_format("You turn %s to fool's gold.", o_name);
-#endif
-
+               msg_format(_("%sをニセの金に変えた。", "You turn %s to fool's gold."), o_name);
        }
        else
        {
@@ -2343,11 +2114,7 @@ msg_format("%sをニセの金に変えた。", o_name);
                if (amt > 1) price *= amt;
 
                if (price > 30000) price = 30000;
-#ifdef JP
-msg_format("%sを$%d の金に変えた。", o_name, price);
-#else
-               msg_format("You turn %s to %ld coins worth of gold.", o_name, price);
-#endif
+               msg_format(_("%sを$%d の金に変えた。", "You turn %s to %ld coins worth of gold."), o_name, price);
 
                p_ptr->au += price;
 
@@ -2379,31 +2146,34 @@ msg_format("%sを$%d の金に変えた。", o_name, price);
 }
 
 
-/*
+/*!
+ * @brief 呪いの打ち破り処理 /
  * Break the curse of an item
+ * @param o_ptr 呪い装備情報の参照ポインタ
+ * @return なし
  */
 static void break_curse(object_type *o_ptr)
 {
        if (object_is_cursed(o_ptr) && !(o_ptr->curse_flags & TRC_PERMA_CURSE) && !(o_ptr->curse_flags & TRC_HEAVY_CURSE) && (randint0(100) < 25))
        {
-#ifdef JP
-msg_print("かけられていた呪いが打ち破られた!");
-#else
-               msg_print("The curse is broken!");
-#endif
+               msg_print(_("かけられていた呪いが打ち破られた!", "The curse is broken!"));
 
                o_ptr->curse_flags = 0L;
-
                o_ptr->ident |= (IDENT_SENSE);
-
                o_ptr->feeling = FEEL_NONE;
        }
 }
 
 
-/*
+/*!
+ * @brief 装備修正強化処理 /
  * Enchants a plus onto an item. -RAK-
- *
+ * @param o_ptr 強化するアイテムの参照ポインタ
+ * @param n 強化基本量
+ * @param eflag 強化オプション(命中/ダメージ/AC)
+ * @return 強化に成功した場合TRUEを返す
+ * @details
+ * <pre>
  * Revamped!  Now takes item pointer, number of times to try enchanting,
  * and a flag of what to try enchanting.  Artifacts resist enchantment
  * some of the time, and successful enchantment to at least +0 might
@@ -2415,6 +2185,7 @@ msg_print("かけられていた呪いが打ち破られた!");
  *
  * Note that this function can now be used on "piles" of items, and
  * the larger the pile, the lower the chance of success.
+ * </pre>
  */
 bool enchant(object_type *o_ptr, int n, int eflag)
 {
@@ -2515,15 +2286,20 @@ bool enchant(object_type *o_ptr, int n, int eflag)
 }
 
 
-
-/*
+/*!
+ * @brief 装備修正強化処理のメインルーチン /
  * Enchant an item (in the inventory or on the floor)
+ * @param num_hit 命中修正量
+ * @param num_dam ダメージ修正量
+ * @param num_ac AC修正量
+ * @return 強化に成功した場合TRUEを返す
+ * @details
  * Note that "num_ac" requires armour, else weapon
  * Returns TRUE if attempted, FALSE if cancelled
  */
 bool enchant_spell(int num_hit, int num_dam, int num_ac)
 {
-       int         item;
+       OBJECT_IDX item;
        bool        okay = FALSE;
        object_type *o_ptr;
        char        o_name[MAX_NLEN];
@@ -2538,13 +2314,8 @@ bool enchant_spell(int num_hit, int num_dam, int num_ac)
        if (num_ac) item_tester_hook = object_is_armour;
 
        /* Get an item */
-#ifdef JP
-q = "どのアイテムを強化しますか? ";
-s = "強化できるアイテムがない。";
-#else
-       q = "Enchant which item? ";
-       s = "You have nothing to enchant.";
-#endif
+       q = _("どのアイテムを強化しますか? ", "Enchant which item? ");
+       s = _("強化できるアイテムがない。", "You have nothing to enchant.");
 
        if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
 
@@ -2587,11 +2358,7 @@ msg_format("%s は明るく輝いた!",
                if (flush_failure) flush();
 
                /* Message */
-#ifdef JP
-msg_print("強化に失敗した。");
-#else
-               msg_print("The enchantment failed.");
-#endif
+               msg_print(_("強化に失敗した。", "The enchantment failed."));
 
                if (one_in_(3)) chg_virtue(V_ENCHANT, -1);
        }
@@ -2605,8 +2372,11 @@ msg_print("強化に失敗した。");
 }
 
 
-/*
+/*!
+ * @brief アイテムが並の価値のアイテムかどうか判定する /
  * Check if an object is nameless weapon or armour
+ * @param o_ptr 判定するアイテムの情報参照ポインタ
+ * @return 並ならばTRUEを返す
  */
 static bool item_tester_hook_nameless_weapon_armour(object_type *o_ptr)
 {
@@ -2620,10 +2390,13 @@ static bool item_tester_hook_nameless_weapon_armour(object_type *o_ptr)
        return TRUE;
 }
 
-
+/*!
+ * @brief アーティファクト生成の巻物処理 /
+ * @return 生成が実際に試みられたらTRUEを返す
+ */
 bool artifact_scroll(void)
 {
-       int             item;
+       OBJECT_IDX item;
        bool            okay = FALSE;
        object_type     *o_ptr;
        char            o_name[MAX_NLEN];
@@ -2636,13 +2409,8 @@ bool artifact_scroll(void)
        item_tester_hook = item_tester_hook_nameless_weapon_armour;
 
        /* Get an item */
-#ifdef JP
-       q = "どのアイテムを強化しますか? ";
-       s = "強化できるアイテムがない。";
-#else
-       q = "Enchant which item? ";
-       s = "You have nothing to enchant.";
-#endif
+       q = _("どのアイテムを強化しますか? ", "Enchant which item? ");
+       s = _("強化できるアイテムがない。", "You have nothing to enchant.");
 
        if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
 
@@ -2739,16 +2507,20 @@ bool artifact_scroll(void)
                if (flush_failure) flush();
 
                /* Message */
-#ifdef JP
-               msg_print("強化に失敗した。");
-#else
-               msg_print("The enchantment failed.");
-#endif
+               msg_print(_("強化に失敗した。", "The enchantment failed."));
 
                if (one_in_(3)) chg_virtue(V_ENCHANT, -1);
        }
        else
+       {
+               if (record_rand_art)
+               {
+                       /* Description */
+                       object_desc(o_name, o_ptr, OD_NAME_ONLY);
+                       do_cmd_write_nikki(NIKKI_ART_SCROLL, 0, o_name);
+               }
                chg_virtue(V_ENCHANT, 1);
+       }
 
        calc_android_exp();
 
@@ -2757,8 +2529,11 @@ bool artifact_scroll(void)
 }
 
 
-/*
+/*!
+ * @brief アイテム鑑定処理 /
  * Identify an object
+ * @param o_ptr 鑑定されるアイテムの情報参照ポインタ
+ * @return 実際に鑑定できたらTRUEを返す
  */
 bool identify_item(object_type *o_ptr)
 {
@@ -2807,12 +2582,21 @@ bool identify_item(object_type *o_ptr)
        return old_known;
 }
 
-
+/*!
+ * @brief アイテムが鑑定済みかを判定する /
+ * @param o_ptr 判定するアイテムの情報参照ポインタ
+ * @return 実際に鑑定済みならばTRUEを返す
+ */
 static bool item_tester_hook_identify(object_type *o_ptr)
 {
        return (bool)!object_is_known(o_ptr);
 }
 
+/*!
+ * @brief アイテムが鑑定済みの武器防具かを判定する /
+ * @param o_ptr 判定するアイテムの情報参照ポインタ
+ * @return 実際に鑑定済みならばTRUEを返す
+ */
 static bool item_tester_hook_identify_weapon_armour(object_type *o_ptr)
 {
        if (object_is_known(o_ptr))
@@ -2820,14 +2604,18 @@ static bool item_tester_hook_identify_weapon_armour(object_type *o_ptr)
        return object_is_weapon_armour_ammo(o_ptr);
 }
 
-/*
+/*!
+ * @brief アイテム鑑定のメインルーチン処理 /
  * Identify an object in the inventory (or on the floor)
+ * @param only_equip 装備品のみを対象とするならばTRUEを返す
+ * @return 実際に鑑定を行ったならばTRUEを返す
+ * @details
  * This routine does *not* automatically combine objects.
  * Returns TRUE if something was identified, else FALSE.
  */
 bool ident_spell(bool only_equip)
 {
-       int             item;
+       OBJECT_IDX item;
        object_type     *o_ptr;
        char            o_name[MAX_NLEN];
        cptr            q, s;
@@ -2842,11 +2630,7 @@ bool ident_spell(bool only_equip)
 
        if (can_get_item())
        {
-#ifdef JP
-               q = "どのアイテムを鑑定しますか? ";
-#else
-               q = "Identify which item? ";
-#endif
+               q = _("どのアイテムを鑑定しますか? ", "Identify which item? ");
        }
        else
        {
@@ -2855,19 +2639,11 @@ bool ident_spell(bool only_equip)
                else
                        item_tester_hook = NULL;
 
-#ifdef JP
-               q = "すべて鑑定済みです。 ";
-#else
-               q = "All items are identified. ";
-#endif
+               q = _("すべて鑑定済みです。 ", "All items are identified. ");
        }
 
        /* Get an item */
-#ifdef JP
-       s = "鑑定するべきアイテムがない。";
-#else
-       s = "You have nothing to identify.";
-#endif
+       s = _("鑑定するべきアイテムがない。", "You have nothing to identify.");
 
        if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
 
@@ -2892,27 +2668,15 @@ bool ident_spell(bool only_equip)
        /* Describe */
        if (item >= INVEN_RARM)
        {
-#ifdef JP
-               msg_format("%^s: %s(%c)。", describe_use(item), o_name, index_to_label(item));
-#else
-               msg_format("%^s: %s (%c).", describe_use(item), o_name, index_to_label(item));
-#endif
+               msg_format(_("%^s: %s(%c)。", "%^s: %s (%c)."), describe_use(item), o_name, index_to_label(item));
        }
        else if (item >= 0)
        {
-#ifdef JP
-               msg_format("ザック中: %s(%c)。", o_name, index_to_label(item));
-#else
-               msg_format("In your pack: %s (%c).", o_name, index_to_label(item));
-#endif
+               msg_format(_("ザック中: %s(%c)。", "In your pack: %s (%c)."), o_name, index_to_label(item));
        }
        else
        {
-#ifdef JP
-               msg_format("床上: %s。", o_name);
-#else
-               msg_format("On the ground: %s.", o_name);
-#endif
+               msg_format(_("床上: %s。", "On the ground: %s."), o_name);
        }
 
        /* Auto-inscription/destroy */
@@ -2923,14 +2687,21 @@ bool ident_spell(bool only_equip)
 }
 
 
-/*
+/*!
+ * @brief アイテム凡庸化のメインルーチン処理 /
+ * Identify an object in the inventory (or on the floor)
+ * @param only_equip 装備品のみを対象とするならばTRUEを返す
+ * @return 実際に凡庸化をを行ったならばTRUEを返す
+ * @details
+ * <pre>
  * Mundanify an object in the inventory (or on the floor)
  * This routine does *not* automatically combine objects.
  * Returns TRUE if something was mundanified, else FALSE.
+ * </pre>
  */
 bool mundane_spell(bool only_equip)
 {
-       int             item;
+       OBJECT_IDX item;
        object_type     *o_ptr;
        cptr            q, s;
 
@@ -2938,13 +2709,8 @@ bool mundane_spell(bool only_equip)
        item_tester_no_ryoute = TRUE;
 
        /* Get an item */
-#ifdef JP
-q = "どれを使いますか?";
-s = "使えるものがありません。";
-#else
-       q = "Use which item? ";
-       s = "You have nothing you can use.";
-#endif
+       q = _("どれを使いますか?", "Use which item? ");
+       s = _("使えるものがありません。", "You have nothing you can use.");
 
        if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
 
@@ -2961,14 +2727,10 @@ s = "使えるものがありません。";
        }
 
        /* Oops */
-#ifdef JP
-       msg_print("まばゆい閃光が走った!");
-#else
-       msg_print("There is a bright flash of light!");
-#endif
+       msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
        {
-               byte iy = o_ptr->iy;                 /* Y-position on map, or zero */
-               byte ix = o_ptr->ix;                 /* X-position on map, or zero */
+               POSITION iy = o_ptr->iy;                 /* Y-position on map, or zero */
+               POSITION ix = o_ptr->ix;                 /* X-position on map, or zero */
                s16b next_o_idx = o_ptr->next_o_idx; /* Next object in stack (if any) */
                byte marked = o_ptr->marked;         /* Object is marked */
                s16b weight = o_ptr->number * o_ptr->weight;
@@ -2990,13 +2752,21 @@ s = "使えるものがありません。";
        return TRUE;
 }
 
-
-
+/*!
+ * @brief アイテムが*鑑定*済みかを判定する /
+ * @param o_ptr 判定するアイテムの情報参照ポインタ
+ * @return 実際に鑑定済みならばTRUEを返す
+ */
 static bool item_tester_hook_identify_fully(object_type *o_ptr)
 {
        return (bool)(!object_is_known(o_ptr) || !(o_ptr->ident & IDENT_MENTAL));
 }
 
+/*!
+ * @brief アイテムが*鑑定*済みの武器防具かを判定する /
+ * @param o_ptr 判定するアイテムの情報参照ポインタ
+ * @return 実際に鑑定済みならばTRUEを返す
+ */
 static bool item_tester_hook_identify_fully_weapon_armour(object_type *o_ptr)
 {
        if (!item_tester_hook_identify_fully(o_ptr))
@@ -3004,13 +2774,18 @@ static bool item_tester_hook_identify_fully_weapon_armour(object_type *o_ptr)
        return object_is_weapon_armour_ammo(o_ptr);
 }
 
-/*
+/*!
+ * @brief アイテム*鑑定*のメインルーチン処理 /
+ * Identify an object in the inventory (or on the floor)
+ * @param only_equip 装備品のみを対象とするならばTRUEを返す
+ * @return 実際に鑑定を行ったならばTRUEを返す
+ * @details
  * Fully "identify" an object in the inventory  -BEN-
  * This routine returns TRUE if an item was identified.
  */
 bool identify_fully(bool only_equip)
 {
-       int             item;
+       OBJECT_IDX item;
        object_type     *o_ptr;
        char            o_name[MAX_NLEN];
        cptr            q, s;
@@ -3024,11 +2799,7 @@ bool identify_fully(bool only_equip)
 
        if (can_get_item())
        {
-#ifdef JP
-               q = "どのアイテムを*鑑定*しますか? ";
-#else
-               q = "*Identify* which item? ";
-#endif
+               q = _("どのアイテムを*鑑定*しますか? ", "*Identify* which item? ");
        }
        else
        {
@@ -3037,19 +2808,11 @@ bool identify_fully(bool only_equip)
                else
                        item_tester_hook = NULL;
 
-#ifdef JP
-               q = "すべて*鑑定*済みです。 ";
-#else
-               q = "All items are *identified*. ";
-#endif
+               q = _("すべて*鑑定*済みです。 ", "All items are *identified*. ");
        }
 
        /* Get an item */
-#ifdef JP
-       s = "*鑑定*するべきアイテムがない。";
-#else
-       s = "You have nothing to *identify*.";
-#endif
+       s = _("*鑑定*するべきアイテムがない。", "You have nothing to *identify*.");
 
        if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
 
@@ -3080,29 +2843,15 @@ bool identify_fully(bool only_equip)
        /* Describe */
        if (item >= INVEN_RARM)
        {
-#ifdef JP
-               msg_format("%^s: %s(%c)。", describe_use(item), o_name, index_to_label(item));
-#else
-               msg_format("%^s: %s (%c).", describe_use(item), o_name, index_to_label(item));
-#endif
-
-
+               msg_format(_("%^s: %s(%c)。", "%^s: %s (%c)."), describe_use(item), o_name, index_to_label(item));
        }
        else if (item >= 0)
        {
-#ifdef JP
-               msg_format("ザック中: %s(%c)。", o_name, index_to_label(item));
-#else
-               msg_format("In your pack: %s (%c).", o_name, index_to_label(item));
-#endif
+               msg_format(_("ザック中: %s(%c)。", "In your pack: %s (%c)."), o_name, index_to_label(item));
        }
        else
        {
-#ifdef JP
-               msg_format("床上: %s。", o_name);
-#else
-               msg_format("On the ground: %s.", o_name);
-#endif
+               msg_format(_("床上: %s。", "On the ground: %s."), o_name);
        }
 
        /* Describe it fully */
@@ -3116,10 +2865,11 @@ bool identify_fully(bool only_equip)
 }
 
 
-
-
-/*
+/*!
+ * @brief 魔力充填が可能なアイテムかどうか判定する /
  * Hook for "get_item()".  Determine if something is rechargable.
+ * @param o_ptr 判定するアイテムの情報参照ポインタ
+ * @return 魔力充填が可能ならばTRUEを返す
  */
 bool item_tester_hook_recharge(object_type *o_ptr)
 {
@@ -3137,9 +2887,12 @@ bool item_tester_hook_recharge(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief 魔力充填処理 /
  * Recharge a wand/staff/rod from the pack or on the floor.
  * This function has been rewritten in Oangband and ZAngband.
+ * @param power 充填パワー
+ * @return ターン消費を要する処理まで進んだらTRUEを返す
  *
  * Sorcery/Arcane -- Recharge  --> recharge(plev * 4)
  * Chaos -- Arcane Binding     --> recharge(90)
@@ -3156,8 +2909,10 @@ bool item_tester_hook_recharge(object_type *o_ptr)
  */
 bool recharge(int power)
 {
-       int item, lev;
-       int recharge_strength, recharge_amount;
+       OBJECT_IDX item;
+       int lev;
+       int recharge_strength;
+       TIME_EFFECT recharge_amount;
 
        object_type *o_ptr;
        object_kind *k_ptr;
@@ -3172,13 +2927,8 @@ bool recharge(int power)
        item_tester_hook = item_tester_hook_recharge;
 
        /* Get an item */
-#ifdef JP
-q = "どのアイテムに魔力を充填しますか? ";
-s = "魔力を充填すべきアイテムがない。";
-#else
-       q = "Recharge which item? ";
-       s = "You have nothing to recharge.";
-#endif
+       q = _("どのアイテムに魔力を充填しますか? ", "Recharge which item? ");
+       s = _("魔力を充填すべきアイテムがない。", "You have nothing to recharge.");
 
        if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return (FALSE);
 
@@ -3298,12 +3048,7 @@ s = "魔力を充填すべきアイテムがない。";
                if (object_is_fixed_artifact(o_ptr))
                {
                        object_desc(o_name, o_ptr, OD_NAME_ONLY);
-#ifdef JP
-msg_format("魔力が逆流した!%sは完全に魔力を失った。", o_name);
-#else
-                       msg_format("The recharging backfires - %s is completely drained!", o_name);
-#endif
-
+                       msg_format(_("魔力が逆流した!%sは完全に魔力を失った。", "The recharging backfires - %s is completely drained!"), o_name);
 
                        /* Artifact rods. */
                        if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout < 10000))
@@ -3372,23 +3117,14 @@ msg_format("魔力が逆流した!%sは完全に魔力を失った。", o_name
                        {
                                if (o_ptr->tval == TV_ROD)
                                {
-#ifdef JP
-msg_print("魔力が逆噴射して、ロッドからさらに魔力を吸い取ってしまった!");
-#else
-                                       msg_print("The recharge backfires, draining the rod further!");
-#endif
+                                       msg_print(_("魔力が逆噴射して、ロッドからさらに魔力を吸い取ってしまった!", "The recharge backfires, draining the rod further!"));
 
                                        if (o_ptr->timeout < 10000)
                                                o_ptr->timeout = (o_ptr->timeout + 100) * 2;
                                }
                                else if (o_ptr->tval == TV_WAND)
                                {
-#ifdef JP
-msg_format("%sは破損を免れたが、魔力が全て失われた。", o_name);
-#else
-                                       msg_format("You save your %s from destruction, but all charges are lost.", o_name);
-#endif
-
+                                       msg_format(_("%sは破損を免れたが、魔力が全て失われた。", "You save your %s from destruction, but all charges are lost."), o_name);
                                        o_ptr->pval = 0;
                                }
                                /* Staffs aren't drained. */
@@ -3398,19 +3134,9 @@ msg_format("%sは破損を免れたが、魔力が全て失われた。", o_name
                        if (fail_type == 2)
                        {
                                if (o_ptr->number > 1)
-#ifdef JP
-msg_format("乱暴な魔法のために%sが一本壊れた!", o_name);
-#else
-                                       msg_format("Wild magic consumes one of your %s!", o_name);
-#endif
-
+                                       msg_format(_("乱暴な魔法のために%sが一本壊れた!", "Wild magic consumes one of your %s!"), o_name);
                                else
-#ifdef JP
-msg_format("乱暴な魔法のために%sが壊れた!", o_name);
-#else
-                                       msg_format("Wild magic consumes your %s!", o_name);
-#endif
-
+                                       msg_format(_("乱暴な魔法のために%sが壊れた!", "Wild magic consumes your %s!"), o_name);
 
                                /* Reduce rod stack maximum timeout, drain wands. */
                                if (o_ptr->tval == TV_ROD) o_ptr->timeout = (o_ptr->number - 1) * k_ptr->pval;
@@ -3437,20 +3163,9 @@ msg_format("乱暴な魔法のために%sが壊れた!", o_name);
                        if (fail_type == 3)
                        {
                                if (o_ptr->number > 1)
-#ifdef JP
-msg_format("乱暴な魔法のために%sが全て壊れた!", o_name);
-#else
-                                       msg_format("Wild magic consumes all your %s!", o_name);
-#endif
-
+                                       msg_format(_("乱暴な魔法のために%sが全て壊れた!", "Wild magic consumes all your %s!"), o_name);
                                else
-#ifdef JP
-msg_format("乱暴な魔法のために%sが壊れた!", o_name);
-#else
-                                       msg_format("Wild magic consumes your %s!", o_name);
-#endif
-
-
+                                       msg_format(_("乱暴な魔法のために%sが壊れた!", "Wild magic consumes your %s!"), o_name);
 
                                /* Reduce and describe inventory */
                                if (item >= 0)
@@ -3482,14 +3197,16 @@ msg_format("乱暴な魔法のために%sが壊れた!", o_name);
 }
 
 
-/*
+/*!
+ * @brief 武器の祝福処理 /
  * Bless a weapon
+ * @return ターン消費を要する処理を行ったならばTRUEを返す
  */
 bool bless_weapon(void)
 {
-       int             item;
+       OBJECT_IDX item;
        object_type     *o_ptr;
-       u32b flgs[TR_FLAG_SIZE];
+       BIT_FLAGS flgs[TR_FLAG_SIZE];
        char            o_name[MAX_NLEN];
        cptr            q, s;
 
@@ -3499,13 +3216,8 @@ bool bless_weapon(void)
        item_tester_hook = object_is_weapon;
 
        /* Get an item */
-#ifdef JP
-q = "どのアイテムを祝福しますか?";
-s = "祝福できる武器がありません。";
-#else
-       q = "Bless which weapon? ";
-       s = "You have weapon to bless.";
-#endif
+       q = _("どのアイテムを祝福しますか?", "Bless which weapon? ");
+       s = _("祝福できる武器がありません。", "You have weapon to bless.");
 
        if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR)))
                return FALSE;
@@ -3612,13 +3324,7 @@ msg_format("%sは輝いた!",
        else
        {
                bool dis_happened = FALSE;
-
-#ifdef JP
-msg_print("その武器は祝福を嫌っている!");
-#else
-               msg_print("The weapon resists your blessing!");
-#endif
-
+               msg_print(_("その武器は祝福を嫌っている!", "The weapon resists your blessing!"));
 
                /* Disenchant tohit */
                if (o_ptr->to_h > 0)
@@ -3649,11 +3355,7 @@ msg_print("その武器は祝福を嫌っている!");
 
                if (dis_happened)
                {
-#ifdef JP
-msg_print("周囲が凡庸な雰囲気で満ちた...");
-#else
-                       msg_print("There is a static feeling in the air...");
-#endif
+                       msg_print(_("周囲が凡庸な雰囲気で満ちた...", "There is a static feeling in the air..."));
 
 #ifdef JP
 msg_format("%s は劣化した!",
@@ -3679,12 +3381,14 @@ msg_format("%s は劣化した!",
 }
 
 
-/*
+/*!
+ * @brief 盾磨き処理 /
  * pulish shield
+ * @return ターン消費を要する処理を行ったならばTRUEを返す
  */
 bool pulish_shield(void)
 {
-       int             item;
+       OBJECT_IDX item;
        object_type     *o_ptr;
        u32b flgs[TR_FLAG_SIZE];
        char            o_name[MAX_NLEN];
@@ -3695,13 +3399,8 @@ bool pulish_shield(void)
        item_tester_tval = TV_SHIELD;
 
        /* Get an item */
-#ifdef JP
-q = "どの盾を磨きますか?";
-s = "磨く盾がありません。";
-#else
-       q = "Pulish which weapon? ";
-       s = "You have weapon to pulish.";
-#endif
+       q = _("どの盾を磨きますか?", "Pulish which weapon? ");
+       s = _("磨く盾がありません。", "You have weapon to pulish.");
 
        if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR)))
                return FALSE;
@@ -3747,12 +3446,7 @@ msg_format("%sは輝いた!", o_name);
        {
                if (flush_failure) flush();
 
-#ifdef JP
-msg_print("失敗した。");
-#else
-               msg_print("Failed.");
-#endif
-
+               msg_print(_("失敗した。", "Failed."));
                chg_virtue(V_ENCHANT, -2);
        }
        calc_android_exp();
@@ -3761,8 +3455,16 @@ msg_print("失敗した。");
 }
 
 
-/*
+/*!
+ * @brief 薬の破損効果処理 /
  * Potions "smash open" and cause an area effect when
+ * @param who 薬破損の主体ID(プレイヤー所持アイテムが壊れた場合0、床上のアイテムの場合モンスターID)
+ * @param y 破壊時のY座標
+ * @param x 破壊時のX座標
+ * @param k_idx 破損した薬のアイテムID
+ * @return 薬を浴びたモンスターが起こるならばTRUEを返す
+ * @details
+ * <pre>
  * (1) they are shattered while in the player's inventory,
  * due to cold (etc) attacks;
  * (2) they are thrown at a monster, or obstacle;
@@ -3778,8 +3480,9 @@ msg_print("失敗した。");
  *    y, x  --- coordinates of the potion (or player if
  *          the potion was in her inventory);
  *    o_ptr --- pointer to the potion object.
+ * </pre>
  */
-bool potion_smash_effect(int who, int y, int x, int k_idx)
+bool potion_smash_effect(MONSTER_IDX who, POSITION y, POSITION x, KIND_OBJECT_IDX k_idx)
 {
        int     radius = 2;
        int     dt = 0;
@@ -3920,11 +3623,12 @@ bool potion_smash_effect(int who, int y, int x, int k_idx)
 }
 
 
-/*
+/*!
+ * @brief プレイヤーの全既知呪文を表示する /
  * Hack -- Display all known spells in a window
- *
+ * return なし
+ * @details
  * XXX XXX XXX Need to analyze size of the window.
- *
  * XXX XXX XXX Need more color coding.
  */
 void display_spell_list(void)
@@ -3958,9 +3662,6 @@ void display_spell_list(void)
            (p_ptr->pclass == CLASS_MIRROR_MASTER) ||
            (p_ptr->pclass == CLASS_FORCETRAINER))
        {
-               int             i;
-               int             y = 1;
-               int             x = 1;
                int             minfail = 0;
                int             plev = p_ptr->lev;
                int             chance = 0;
@@ -3970,15 +3671,13 @@ void display_spell_list(void)
                int             use_mind;
                bool use_hp = FALSE;
 
+               y = 1;
+               x = 1;
+
                /* Display a list of spells */
                prt("", y, x);
-#ifdef JP
-put_str("名前", y, x + 5);
-put_str("Lv   MP 失率 効果", y, x + 35);
-#else
-               put_str("Name", y, x + 5);
-               put_str("Lv Mana Fail Info", y, x + 35);
-#endif
+               put_str(_("名前", "Name"), y, x + 5);
+               put_str(_("Lv   MP 失率 効果", "Lv Mana Fail Info"), y, x + 35);
 
                switch(p_ptr->pclass)
                {
@@ -4093,12 +3792,7 @@ put_str("Lv   MP 失率 効果", y, x + 35);
                        if (s_ptr->slevel >= 99)
                        {
                                /* Illegible */
-#ifdef JP
-strcpy(name, "(判読不能)");
-#else
-                               strcpy(name, "(illegible)");
-#endif
-
+                               strcpy(name, _("(判読不能)", "(illegible)"));
 
                                /* Unusable */
                                a = TERM_L_DARK;
@@ -4148,8 +3842,12 @@ strcpy(name, "(判読不能)");
 }
 
 
-/*
+/*!
+ * @brief 呪文の経験値を返す /
  * Returns experience of a spell
+ * @param spell 呪文ID
+ * @param use_realm 魔法領域
+ * @return 経験値
  */
 s16b experience_of_spell(int spell, int use_realm)
 {
@@ -4161,8 +3859,13 @@ s16b experience_of_spell(int spell, int use_realm)
 }
 
 
-/*
+/*!
+ * @brief 呪文の消費MPを返す /
  * Modify mana consumption rate using spell exp and p_ptr->dec_mana
+ * @param need_mana 基本消費MP
+ * @param spell 呪文ID
+ * @param realm 魔法領域
+ * @return 消費MP
  */
 int mod_need_mana(int need_mana, int spell, int realm)
 {
@@ -4197,9 +3900,13 @@ int mod_need_mana(int need_mana, int spell, int realm)
 }
 
 
-/*
+/*!
+ * @brief 呪文の失敗率修正処理1(呪い、消費魔力減少、呪文簡易化) /
  * Modify spell fail rate
  * Using p_ptr->to_m_chance, p_ptr->dec_mana, p_ptr->easy_spell and p_ptr->heavy_spell
+ * @param chance 修正前失敗率
+ * @return 失敗率(%)
+ * @todo 統合を検討
  */
 int mod_spell_chance_1(int chance)
 {
@@ -4215,10 +3922,16 @@ int mod_spell_chance_1(int chance)
 }
 
 
-/*
+/*!
+ * @brief 呪文の失敗率修正処理2(消費魔力減少、呪い、負値修正) /
+ * Modify spell fail rate
+ * Using p_ptr->to_m_chance, p_ptr->dec_mana, p_ptr->easy_spell and p_ptr->heavy_spell
+ * @param chance 修正前失敗率
+ * @return 失敗率(%)
  * Modify spell fail rate (as "suffix" process)
  * Using p_ptr->dec_mana, p_ptr->easy_spell and p_ptr->heavy_spell
  * Note: variable "chance" cannot be negative.
+ * @todo 統合を検討
  */
 int mod_spell_chance_2(int chance)
 {
@@ -4230,8 +3943,12 @@ int mod_spell_chance_2(int chance)
 }
 
 
-/*
+/*!
+ * @brief 呪文の失敗率計算メインルーチン /
  * Returns spell chance of failure for spell -RAK-
+ * @param spell 呪文ID
+ * @param use_realm 魔法領域ID
+ * @return 失敗率(%)
  */
 s16b spell_chance(int spell, int use_realm)
 {
@@ -4334,11 +4051,16 @@ s16b spell_chance(int spell, int use_realm)
 }
 
 
-
-/*
+/*!
+ * @brief 魔法が利用可能かどうかを返す /
  * Determine if a spell is "okay" for the player to cast or study
  * The spell must be legible, not forgotten, and also, to cast,
  * it must be known, and to study, it must not be known.
+ * @param spell 呪文ID
+ * @param learned 使用可能な判定ならばTRUE、学習可能かどうかの判定ならばFALSE
+ * @param study_pray 祈りの学習判定目的ならばTRUE
+ * @param use_realm 魔法領域ID
+ * @return 失敗率(%)
  */
 bool spell_okay(int spell, bool learned, bool study_pray, int use_realm)
 {
@@ -4383,10 +4105,19 @@ bool spell_okay(int spell, bool learned, bool study_pray, int use_realm)
 }
 
 
-/*
+
+/*!
+ * @brief 呪文情報の表示処理 /
  * Print a list of spells (for browsing or casting or viewing)
+ * @param target_spell 呪文ID                    
+ * @param spells 表示するスペルID配列の参照ポインタ
+ * @param num 表示するスペルの数(spellsの要素数)
+ * @param y 表示メッセージ左上Y座標
+ * @param x 表示メッセージ左上X座標
+ * @param use_realm 魔法領域ID
+ * @return なし
  */
-void print_spells(int target_spell, byte *spells, int num, int y, int x, int use_realm)
+void print_spells(SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_POSITION y, TERM_POSITION x, REALM_IDX use_realm)
 {
        int             i, spell, exp_level, increment = 64;
        const magic_type *s_ptr;
@@ -4401,35 +4132,17 @@ void print_spells(int target_spell, byte *spells, int num, int y, int x, int use
 
 
        if (((use_realm <= REALM_NONE) || (use_realm > MAX_REALM)) && p_ptr->wizard)
-#ifdef JP
-msg_print("警告! print_spell が領域なしに呼ばれた");
-#else
-               msg_print("Warning! print_spells called with null realm");
-#endif
-
+       msg_print(_("警告! print_spell が領域なしに呼ばれた", "Warning! print_spells called with null realm"));
 
        /* Title the list */
        prt("", y, x);
        if (use_realm == REALM_HISSATSU)
-#ifdef JP
-               strcpy(buf,"  Lv   MP");
-#else
-               strcpy(buf,"  Lv   SP");
-#endif
+               strcpy(buf,_("  Lv   MP", "  Lv   SP"));
        else
-#ifdef JP
-               strcpy(buf,"熟練度 Lv   MP 失率 効果");
-#else
-               strcpy(buf,"Profic Lv   SP Fail Effect");
-#endif
+               strcpy(buf,_("熟練度 Lv   MP 失率 効果", "Profic Lv   SP Fail Effect"));
 
-#ifdef JP
-put_str("名前", y, x + 5);
-put_str(buf, y, x + 29);
-#else
-       put_str("Name", y, x + 5);
+       put_str(_("名前", "Name"), y, x + 5);
        put_str(buf, y, x + 29);
-#endif
 
        if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE)) increment = 0;
        else if (use_realm == p_ptr->realm1) increment = 0;
@@ -4477,11 +4190,7 @@ put_str(buf, y, x + 29);
                if (use_menu && target_spell)
                {
                        if (i == (target_spell-1))
-#ifdef JP
-                               strcpy(out_val, "  》 ");
-#else
-                               strcpy(out_val, "  >  ");
-#endif
+                               strcpy(out_val, _("  》 ", "  >  "));
                        else
                                strcpy(out_val, "     ");
                }
@@ -4489,14 +4198,9 @@ put_str(buf, y, x + 29);
                /* Skip illegible spells */
                if (s_ptr->slevel >= 99)
                {
-#ifdef JP
-strcat(out_val, format("%-30s", "(判読不能)"));
-#else
-                               strcat(out_val, format("%-30s", "(illegible)"));
-#endif
-
-                               c_prt(TERM_L_DARK, out_val, y + i + 1, x);
-                               continue;
+                       strcat(out_val, format("%-30s", _("(判読不能)", "(illegible)")));
+                       c_prt(TERM_L_DARK, out_val, y + i + 1, x);
+                       continue;
                }
 
                /* XXX XXX Could label spells above the players level */
@@ -4515,69 +4219,39 @@ strcat(out_val, format("%-30s", "(判読不能)"));
                {
                        if (s_ptr->slevel > p_ptr->max_plv)
                        {
-#ifdef JP
-comment = "未知";
-#else
-                               comment = "unknown";
-#endif
-
+                               comment = _("未知", "unknown");
                                line_attr = TERM_L_BLUE;
                        }
                        else if (s_ptr->slevel > p_ptr->lev)
                        {
-#ifdef JP
-comment = "忘却";
-#else
-                               comment = "forgotten";
-#endif
-
+                               comment = _("忘却", "forgotten");
                                line_attr = TERM_YELLOW;
                        }
                }
                else if ((use_realm != p_ptr->realm1) && (use_realm != p_ptr->realm2))
                {
-#ifdef JP
-comment = "未知";
-#else
-                       comment = "unknown";
-#endif
-
+                       comment = _("未知", "unknown");
                        line_attr = TERM_L_BLUE;
                }
                else if ((use_realm == p_ptr->realm1) ?
                    ((p_ptr->spell_forgotten1 & (1L << spell))) :
                    ((p_ptr->spell_forgotten2 & (1L << spell))))
                {
-#ifdef JP
-comment = "忘却";
-#else
-                       comment = "forgotten";
-#endif
-
+                       comment = _("忘却", "forgotten");
                        line_attr = TERM_YELLOW;
                }
                else if (!((use_realm == p_ptr->realm1) ?
                    (p_ptr->spell_learned1 & (1L << spell)) :
                    (p_ptr->spell_learned2 & (1L << spell))))
                {
-#ifdef JP
-comment = "未知";
-#else
-                       comment = "unknown";
-#endif
-
+                       comment = _("未知", "unknown");
                        line_attr = TERM_L_BLUE;
                }
                else if (!((use_realm == p_ptr->realm1) ?
                    (p_ptr->spell_worked1 & (1L << spell)) :
                    (p_ptr->spell_worked2 & (1L << spell))))
                {
-#ifdef JP
-comment = "未経験";
-#else
-                       comment = "untried";
-#endif
-
+                       comment = _("未経験", "untried");
                        line_attr = TERM_L_GREEN;
                }
 
@@ -4603,13 +4277,12 @@ comment = "未経験";
 }
 
 
-/*
+/*!
+ * @brief アイテムが酸で破損するかどうかを判定する
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
  * Note that amulets, rods, and high-level spell books are immune
  * to "inventory damage" of any kind.  Also sling ammo and shovels.
- */
-
-
-/*
  * Does a given class of objects (usually) hate acid?
  * Note that acid can either melt or corrode something.
  */
@@ -4664,8 +4337,11 @@ bool hates_acid(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief アイテムが電撃で破損するかどうかを判定する /
  * Does a given object (usually) hate electricity?
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
  */
 bool hates_elec(object_type *o_ptr)
 {
@@ -4682,8 +4358,12 @@ bool hates_elec(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief アイテムが火炎で破損するかどうかを判定する /
  * Does a given object (usually) hate fire?
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
+ * @details
  * Hafted/Polearm weapons have wooden shafts.
  * Arrows/Bows are mostly wooden.
  */
@@ -4742,8 +4422,11 @@ bool hates_fire(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief アイテムが冷気で破損するかどうかを判定する /
  * Does a given object (usually) hate cold?
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
  */
 bool hates_cold(object_type *o_ptr)
 {
@@ -4761,8 +4444,12 @@ bool hates_cold(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief アイテムが酸で破損するかどうかを判定する(メインルーチン) /
  * Melt something
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
+ * @todo 統合を検討
  */
 int set_acid_destroy(object_type *o_ptr)
 {
@@ -4774,8 +4461,12 @@ int set_acid_destroy(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief アイテムが電撃で破損するかどうかを判定する(メインルーチン) /
  * Electrical damage
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
+ * @todo 統合を検討
  */
 int set_elec_destroy(object_type *o_ptr)
 {
@@ -4787,8 +4478,12 @@ int set_elec_destroy(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief アイテムが火炎で破損するかどうかを判定する(メインルーチン) /
  * Burn something
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
+ * @todo 統合を検討
  */
 int set_fire_destroy(object_type *o_ptr)
 {
@@ -4800,8 +4495,12 @@ int set_fire_destroy(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief アイテムが冷気で破損するかどうかを判定する(メインルーチン) /
  * Freeze things
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
+ * @todo 統合を検討
  */
 int set_cold_destroy(object_type *o_ptr)
 {
@@ -4813,8 +4512,13 @@ int set_cold_destroy(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief アイテムが指定確率で破損するかどうかを判定する /
  * Destroys a type of item on a given percent chance
+ * @param typ 破損判定関数ポインタ
+ * @param perc 基本確率
+ * @return 破損したアイテムの数
+ * @details
  * Note that missiles are no longer necessarily all destroyed
  * Destruction taken from "melee.c" code for "stealing".
  * New-style wands and rods handled correctly. -LM-
@@ -4860,11 +4564,7 @@ int inven_damage(inven_func typ, int perc)
                                object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
 
                                /* Message */
-#ifdef JP
-msg_format("%s(%c)が%s壊れてしまった!",
-#else
-                               msg_format("%sour %s (%c) %s destroyed!",
-#endif
+                               msg_format(_("%s(%c)が%s壊れてしまった!", "%sour %s (%c) %s destroyed!"),
 
 #ifdef JP
 o_name, index_to_label(i),
@@ -4887,7 +4587,7 @@ o_name, index_to_label(i),
                                /* Potions smash open */
                                if (object_is_potion(o_ptr))
                                {
-                                       (void)potion_smash_effect(0, py, px, o_ptr->k_idx);
+                                       (void)potion_smash_effect(0, p_ptr->y, p_ptr->x, o_ptr->k_idx);
                                }
 
                                /* Reduce the charges of rods/wands */
@@ -4908,11 +4608,12 @@ o_name, index_to_label(i),
 }
 
 
-/*
+/*!
+ * @brief 酸攻撃による装備のAC劣化処理 /
  * Acid has hit the player, attempt to affect some armor.
- *
+ * @return ACが実際に劣化したらTRUEを返す
+ * @details
  * Note that the "base armor" of an object never changes.
- *
  * If any armor is damaged (or resists), the player takes less damage.
  */
 static int minus_ac(void)
@@ -4952,23 +4653,12 @@ static int minus_ac(void)
        /* Object resists */
        if (have_flag(flgs, TR_IGNORE_ACID))
        {
-#ifdef JP
-msg_format("しかし%sには効果がなかった!", o_name);
-#else
-               msg_format("Your %s is unaffected!", o_name);
-#endif
-
-
+               msg_format(_("しかし%sには効果がなかった!", "Your %s is unaffected!"), o_name);
                return (TRUE);
        }
 
        /* Message */
-#ifdef JP
-msg_format("%sがダメージを受けた!", o_name);
-#else
-       msg_format("Your %s is damaged!", o_name);
-#endif
-
+       msg_format(_("%sがダメージを受けた!", "Your %s is damaged!"), o_name);
 
        /* Damage the item */
        o_ptr->to_a--;
@@ -4986,8 +4676,14 @@ msg_format("%sがダメージを受けた!", o_name);
 }
 
 
-/*
+/*!
+ * @brief 酸属性によるプレイヤー損害処理 /
  * Hurt the player with Acid
+ * @param dam 基本ダメージ量
+ * @param kb_str ダメージ原因記述
+ * @param monspell 原因となったモンスター特殊攻撃ID
+ * @param aura オーラよるダメージが原因ならばTRUE
+ * @return 修正HPダメージ量
  */
 int acid_dam(int dam, cptr kb_str, int monspell, bool aura)
 {
@@ -5030,8 +4726,14 @@ int acid_dam(int dam, cptr kb_str, int monspell, bool aura)
 }
 
 
-/*
+/*!
+ * @brief 電撃属性によるプレイヤー損害処理 /
  * Hurt the player with electricity
+ * @param dam 基本ダメージ量
+ * @param kb_str ダメージ原因記述
+ * @param monspell 原因となったモンスター特殊攻撃ID
+ * @param aura オーラよるダメージが原因ならばTRUE
+ * @return 修正HPダメージ量
  */
 int elec_dam(int dam, cptr kb_str, int monspell, bool aura)
 {
@@ -5073,8 +4775,14 @@ int elec_dam(int dam, cptr kb_str, int monspell, bool aura)
 }
 
 
-/*
+/*!
+ * @brief 火炎属性によるプレイヤー損害処理 /
  * Hurt the player with Fire
+ * @param dam 基本ダメージ量
+ * @param kb_str ダメージ原因記述
+ * @param monspell 原因となったモンスター特殊攻撃ID
+ * @param aura オーラよるダメージが原因ならばTRUE
+ * @return 修正HPダメージ量
  */
 int fire_dam(int dam, cptr kb_str, int monspell, bool aura)
 {
@@ -5116,8 +4824,14 @@ int fire_dam(int dam, cptr kb_str, int monspell, bool aura)
 }
 
 
-/*
+/*!
+ * @brief 冷気属性によるプレイヤー損害処理 /
  * Hurt the player with Cold
+ * @param dam 基本ダメージ量
+ * @param kb_str ダメージ原因記述
+ * @param monspell 原因となったモンスター特殊攻撃ID
+ * @param aura オーラよるダメージが原因ならばTRUE
+ * @return 修正HPダメージ量
  */
 int cold_dam(int dam, cptr kb_str, int monspell, bool aura)
 {
@@ -5157,10 +4871,13 @@ int cold_dam(int dam, cptr kb_str, int monspell, bool aura)
        return get_damage;
 }
 
-
+/*!
+ * @brief 防具の錆止め防止処理
+ * @return ターン消費を要する処理を行ったならばTRUEを返す
+ */
 bool rustproof(void)
 {
-       int         item;
+       OBJECT_IDX item;
        object_type *o_ptr;
        char        o_name[MAX_NLEN];
        cptr        q, s;
@@ -5170,13 +4887,8 @@ bool rustproof(void)
        item_tester_hook = object_is_armour;
 
        /* Get an item */
-#ifdef JP
-q = "どの防具に錆止めをしますか?";
-s = "錆止めできるものがありません。";
-#else
-       q = "Rustproof which piece of armour? ";
-       s = "You have nothing to rustproof.";
-#endif
+       q = _("どの防具に錆止めをしますか?", "Rustproof which piece of armour? ");
+       s = _("錆止めできるものがありません。", "You have nothing to rustproof.");
 
        if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return FALSE;
 
@@ -5226,8 +4938,10 @@ msg_format("%sは腐食しなくなった。", o_name);
 }
 
 
-/*
+/*!
+ * @brief 防具呪縛処理 /
  * Curse the players armor
+ * @return 実際に呪縛されたらTRUEを返す
  */
 bool curse_armor(void)
 {
@@ -5265,12 +4979,7 @@ msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返し
        else
        {
                /* Oops */
-#ifdef JP
-msg_format("恐怖の暗黒オーラがあなたの%sを包み込んだ!", o_name);
-#else
-               msg_format("A terrible black aura blasts your %s!", o_name);
-#endif
-
+               msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
                chg_virtue(V_ENCHANT, -5);
 
                /* Blast the armor */
@@ -5305,9 +5014,12 @@ msg_format("恐怖の暗黒オーラがあなたの%sを包み込んだ!", o_n
        return (TRUE);
 }
 
-
-/*
+/*!
+ * @brief 武器呪縛処理 /
  * Curse the players weapon
+ * @param force 無条件に呪縛を行うならばTRUE
+ * @param o_ptr 呪縛する武器のアイテム情報参照ポインタ
+ * @return 実際に呪縛されたらTRUEを返す
  */
 bool curse_weapon_object(bool force, object_type *o_ptr)
 {
@@ -5337,11 +5049,7 @@ bool curse_weapon_object(bool force, object_type *o_ptr)
        else
        {
                /* Oops */
-#ifdef JP
-               if (!force) msg_format("恐怖の暗黒オーラがあなたの%sを包み込んだ!", o_name);
-#else
-               if (!force) msg_format("A terrible black aura blasts your %s!", o_name);
-#endif
+               if (!force) msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
                chg_virtue(V_ENCHANT, -5);
 
                /* Shatter the weapon */
@@ -5377,6 +5085,13 @@ bool curse_weapon_object(bool force, object_type *o_ptr)
        return (TRUE);
 }
 
+/*!
+ * @brief 武器呪縛処理のメインルーチン /
+ * Curse the players weapon
+ * @param force 無条件に呪縛を行うならばTRUE
+ * @param slot 呪縛する武器の装備スロット
+ * @return 実際に呪縛されたらTRUEを返す
+ */
 bool curse_weapon(bool force, int slot)
 {
        /* Curse the weapon */
@@ -5384,8 +5099,10 @@ bool curse_weapon(bool force, int slot)
 }
 
 
-/*
+/*!
+ * @brief ボルトのエゴ化処理(火炎エゴのみ) /
  * Enchant some bolts
+ * @return 常にTRUEを返す
  */
 bool brand_bolts(void)
 {
@@ -5410,12 +5127,7 @@ bool brand_bolts(void)
                if (randint0(100) < 75) continue;
 
                /* Message */
-#ifdef JP
-msg_print("クロスボウの矢が炎のオーラに包まれた!");
-#else
-               msg_print("Your bolts are covered in a fiery aura!");
-#endif
-
+               msg_print(_("クロスボウの矢が炎のオーラに包まれた!", "Your bolts are covered in a fiery aura!"));
 
                /* Ego-item */
                o_ptr->name2 = EGO_FLAME;
@@ -5431,28 +5143,28 @@ msg_print("クロスボウの矢が炎のオーラに包まれた!");
        if (flush_failure) flush();
 
        /* Fail */
-#ifdef JP
-msg_print("炎で強化するのに失敗した。");
-#else
-       msg_print("The fiery enchantment failed.");
-#endif
-
+       msg_print(_("炎で強化するのに失敗した。", "The fiery enchantment failed."));
 
        /* Notice */
        return (TRUE);
 }
 
 
-/*
+/*!
+ * @brief 変身処理向けにモンスターの近隣レベル帯モンスターを返す /
  * Helper function -- return a "nearby" race for polymorphing
- *
+ * @param r_idx 基準となるモンスター種族ID
+ * @return 変更先のモンスター種族ID
+ * @details
  * Note that this function is one of the more "dangerous" ones...
  */
-static s16b poly_r_idx(int r_idx)
+static IDX poly_r_idx(MONRACE_IDX r_idx)
 {
        monster_race *r_ptr = &r_info[r_idx];
 
-       int i, r, lev1, lev2;
+       int i;
+       MONRACE_IDX r;
+       DEPTH lev1, lev2;
 
        /* Hack -- Uniques/Questors never polymorph */
        if ((r_ptr->flags1 & RF1_UNIQUE) ||
@@ -5492,14 +5204,20 @@ static s16b poly_r_idx(int r_idx)
        return (r_idx);
 }
 
-
-bool polymorph_monster(int y, int x)
+/*!
+ * @brief 指定座標にいるモンスターを変身させる /
+ * Helper function -- return a "nearby" race for polymorphing
+ * @param y 指定のY座標
+ * @param x 指定のX座標
+ * @return 実際に変身したらTRUEを返す
+ */
+bool polymorph_monster(POSITION y, POSITION x)
 {
        cave_type *c_ptr = &cave[y][x];
        monster_type *m_ptr = &m_list[c_ptr->m_idx];
        bool polymorphed = FALSE;
-       int new_r_idx;
-       int old_r_idx = m_ptr->r_idx;
+       MONRACE_IDX new_r_idx;
+       MONRACE_IDX old_r_idx = m_ptr->r_idx;
        bool targeted = (target_who == c_ptr->m_idx) ? TRUE : FALSE;
        bool health_tracked = (p_ptr->health_who == c_ptr->m_idx) ? TRUE : FALSE;
        monster_type back_m;
@@ -5590,18 +5308,21 @@ bool polymorph_monster(int y, int x)
        return polymorphed;
 }
 
-
-/*
+/*!
+ * @brief 次元の扉処理 /
  * Dimension Door
+ * @param x テレポート先のX座標
+ * @param y テレポート先のY座標
+ * @return 目標に指定通りテレポートできたならばTRUEを返す
  */
-static bool dimension_door_aux(int x, int y)
+static bool dimension_door_aux(DEPTH x, DEPTH y)
 {
-       int     plev = p_ptr->lev;
+       PLAYER_LEVEL plev = p_ptr->lev;
 
        p_ptr->energy_need += (s16b)((s32b)(60 - plev) * ENERGY_NEED() / 100L);
 
        if (!cave_player_teleportable_bold(y, x, 0L) ||
-           (distance(y, x, py, px) > plev / 2 + 10) ||
+           (distance(y, x, p_ptr->y, p_ptr->x) > plev / 2 + 10) ||
            (!randint0(plev / 10 + 10)))
        {
                p_ptr->energy_need += (s16b)((s32b)(60 - plev) * ENERGY_NEED() / 100L);
@@ -5620,55 +5341,56 @@ static bool dimension_door_aux(int x, int y)
 }
 
 
-/*
+/*!
+ * @brief 次元の扉処理のメインルーチン /
  * Dimension Door
+ * @return ターンを消費した場合TRUEを返す
  */
 bool dimension_door(void)
 {
-       int x = 0, y = 0;
+       DEPTH x = 0, y = 0;
 
        /* Rerutn FALSE if cancelled */
        if (!tgt_pt(&x, &y)) return FALSE;
 
        if (dimension_door_aux(x, y)) return TRUE;
 
-#ifdef JP
-       msg_print("精霊界から物質界に戻る時うまくいかなかった!");
-#else
-       msg_print("You fail to exit the astral plane correctly!");
-#endif
+       msg_print(_("精霊界から物質界に戻る時うまくいかなかった!", "You fail to exit the astral plane correctly!"));
 
        return TRUE;
 }
 
 
-/*
+/*!
+ * @brief 鏡抜け処理のメインルーチン /
  * Mirror Master's Dimension Door
+ * @return ターンを消費した場合TRUEを返す
  */
 bool mirror_tunnel(void)
 {
-       int x = 0, y = 0;
+       POSITION x = 0, y = 0;
 
        /* Rerutn FALSE if cancelled */
        if (!tgt_pt(&x, &y)) return FALSE;
 
        if (dimension_door_aux(x, y)) return TRUE;
 
-#ifdef JP
-       msg_print("鏡の世界をうまく通れなかった!");
-#else
-       msg_print("You fail to pass the mirror plane correctly!");
-#endif
+       msg_print(_("鏡の世界をうまく通れなかった!", "You fail to pass the mirror plane correctly!"));
 
        return TRUE;
 }
 
-
+/*!
+ * @brief 魔力食い処理
+ * @param power 基本効力
+ * @return ターンを消費した場合TRUEを返す
+ */
 bool eat_magic(int power)
 {
        object_type * o_ptr;
        object_kind *k_ptr;
-       int lev, item;
+       int lev;
+       OBJECT_IDX item;
        int recharge_strength = 0;
 
        bool fail = FALSE;
@@ -5680,13 +5402,8 @@ bool eat_magic(int power)
        item_tester_hook = item_tester_hook_recharge;
 
        /* Get an item */
-#ifdef JP
-q = "どのアイテムから魔力を吸収しますか?";
-s = "魔力を吸収できるアイテムがありません。";
-#else
-       q = "Drain which item? ";
-       s = "You have nothing to drain.";
-#endif
+       q = _("どのアイテムから魔力を吸収しますか?", "Drain which item? ");
+       s = _("魔力を吸収できるアイテムがありません。", "You have nothing to drain.");
 
        if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return FALSE;
 
@@ -5716,12 +5433,7 @@ s = "魔力を吸収できるアイテムがありません。";
                {
                        if (o_ptr->timeout > (o_ptr->number - 1) * k_ptr->pval)
                        {
-#ifdef JP
-msg_print("充填中のロッドから魔力を吸収することはできません。");
-#else
-                               msg_print("You can't absorb energy from a discharged rod.");
-#endif
-
+                               msg_print(_("充填中のロッドから魔力を吸収することはできません。", "You can't absorb energy from a discharged rod."));
                        }
                        else
                        {
@@ -5775,22 +5487,12 @@ msg_print("充填中のロッドから魔力を吸収することはできませ
                                        item = inven_carry(q_ptr);
 
                                        /* Message */
-#ifdef JP
-                                       msg_print("杖をまとめなおした。");
-#else
-                                       msg_print("You unstack your staff.");
-#endif
-
+                                       msg_print(_("杖をまとめなおした。", "You unstack your staff."));
                                }
                        }
                        else
                        {
-#ifdef JP
-msg_print("吸収できる魔力がありません!");
-#else
-                               msg_print("There's no energy there to absorb!");
-#endif
-
+                               msg_print(_("吸収できる魔力がありません!", "There's no energy there to absorb!"));
                        }
                        if (!o_ptr->pval) o_ptr->ident |= IDENT_EMPTY;
                }
@@ -5803,12 +5505,7 @@ msg_print("吸収できる魔力がありません!");
                if (object_is_fixed_artifact(o_ptr))
                {
                        object_desc(o_name, o_ptr, OD_NAME_ONLY);
-#ifdef JP
-msg_format("魔力が逆流した!%sは完全に魔力を失った。", o_name);
-#else
-                       msg_format("The recharging backfires - %s is completely drained!", o_name);
-#endif
-
+                       msg_format(_("魔力が逆流した!%sは完全に魔力を失った。", "The recharging backfires - %s is completely drained!"), o_name);
 
                        /* Artifact rods. */
                        if (o_ptr->tval == TV_ROD)
@@ -5877,22 +5574,13 @@ msg_format("魔力が逆流した!%sは完全に魔力を失った。", o_name
                        {
                                if (o_ptr->tval == TV_ROD)
                                {
-#ifdef JP
-msg_print("ロッドは破損を免れたが、魔力は全て失なわれた。");
-#else
-                                       msg_format("You save your rod from destruction, but all charges are lost.", o_name);
-#endif
-
+                                       msg_format(_("ロッドは破損を免れたが、魔力は全て失なわれた。",
+                                                                "You save your rod from destruction, but all charges are lost."), o_name);
                                        o_ptr->timeout = k_ptr->pval * o_ptr->number;
                                }
                                else if (o_ptr->tval == TV_WAND)
                                {
-#ifdef JP
-msg_format("%sは破損を免れたが、魔力が全て失われた。", o_name);
-#else
-                                       msg_format("You save your %s from destruction, but all charges are lost.", o_name);
-#endif
-
+                                       msg_format(_("%sは破損を免れたが、魔力が全て失われた。", "You save your %s from destruction, but all charges are lost."), o_name);
                                        o_ptr->pval = 0;
                                }
                                /* Staffs aren't drained. */
@@ -5903,24 +5591,16 @@ msg_format("%sは破損を免れたが、魔力が全て失われた。", o_name
                        {
                                if (o_ptr->number > 1)
                                {
-#ifdef JP
-msg_format("乱暴な魔法のために%sが一本壊れた!", o_name);
-#else
-                                       msg_format("Wild magic consumes one of your %s!", o_name);
-#endif
-
+                                       msg_format(_("乱暴な魔法のために%sが一本壊れた!", "Wild magic consumes one of your %s!"), o_name);
                                        /* Reduce rod stack maximum timeout, drain wands. */
                                        if (o_ptr->tval == TV_ROD) o_ptr->timeout = MIN(o_ptr->timeout, k_ptr->pval * (o_ptr->number - 1));
                                        else if (o_ptr->tval == TV_WAND) o_ptr->pval = o_ptr->pval * (o_ptr->number - 1) / o_ptr->number;
-
                                }
                                else
-#ifdef JP
-msg_format("乱暴な魔法のために%sが何本か壊れた!", o_name);
-#else
-                                       msg_format("Wild magic consumes your %s!", o_name);
-#endif
-
+                               {
+                                       msg_format(_("乱暴な魔法のために%sが何本か壊れた!", "Wild magic consumes your %s!"), o_name);
+                               }
+                               
                                /* Reduce and describe inventory */
                                if (item >= 0)
                                {
@@ -5942,20 +5622,9 @@ msg_format("乱暴な魔法のために%sが何本か壊れた!", o_name);
                        if (fail_type == 3)
                        {
                                if (o_ptr->number > 1)
-#ifdef JP
-msg_format("乱暴な魔法のために%sが全て壊れた!", o_name);
-#else
-                                       msg_format("Wild magic consumes all your %s!", o_name);
-#endif
-
+                                       msg_format(_("乱暴な魔法のために%sが全て壊れた!", "Wild magic consumes all your %s!"), o_name);
                                else
-#ifdef JP
-msg_format("乱暴な魔法のために%sが壊れた!", o_name);
-#else
-                                       msg_format("Wild magic consumes your %s!", o_name);
-#endif
-
-
+                                       msg_format(_("乱暴な魔法のために%sが壊れた!", "Wild magic consumes your %s!"), o_name);
 
                                /* Reduce and describe inventory */
                                if (item >= 0)
@@ -5990,7 +5659,14 @@ msg_format("乱暴な魔法のために%sが壊れた!", o_name);
        return TRUE;
 }
 
-
+/*!
+ * @brief 同族召喚(援軍)処理
+ * @param level 召喚基準レベル
+ * @param y 召喚先Y座標
+ * @param x 召喚先X座標
+ * @param mode 召喚オプション
+ * @return ターンを消費した場合TRUEを返す
+ */
 bool summon_kin_player(int level, int y, int x, u32b mode)
 {
        bool pet = (bool)(mode & PM_FORCE_PET);
@@ -6099,7 +5775,13 @@ bool summon_kin_player(int level, int y, int x, u32b mode)
        return summon_specific((pet ? -1 : 0), y, x, level, SUMMON_KIN, mode);
 }
 
-void massacre(int py, int px)
+/*!
+ * @brief 皆殺し(全方向攻撃)処理
+ * @param py プレイヤーY座標
+ * @param px プレイヤーX座標
+ * @return なし
+ */
+void massacre(void)
 {
        int x, y;
        cave_type       *c_ptr;
@@ -6108,8 +5790,8 @@ void massacre(int py, int px)
 
        for (dir = 0; dir < 8; dir++)
        {
-               y = py + ddy_ddd[dir];
-               x = px + ddx_ddd[dir];
+               y = p_ptr->y + ddy_ddd[dir];
+               x = p_ptr->x + ddx_ddd[dir];
                c_ptr = &cave[y][x];
 
                /* Get the monster */