OSDN Git Service

[Refactor] #37353 マジックナンバー修正(A_MAX) / Fix magic number (A_MAX).
[hengband/hengband.git] / src / xtra1.c
index 4080edf..242b1f3 100644 (file)
@@ -1,23 +1,23 @@
-
-/* File: misc.c */
-
-/*
- * 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.
+/*!
+ * @file xtra1.c
+ * @brief プレイヤーのステータス処理 / status
+ * @date 2018/09/25
+ * @author
+ * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke\n
+ * This software may be copied and distributed for educational, research, and\n
+ * not for profit purposes provided that this copyright and statement are\n
+ * included in all such copies.\n
+ * 2014 Deskull rearranged comment for Doxygen.
  */
 
-/* Purpose: misc code */
-
 #include "angband.h"
+#include "world.h"
 
-
-
-
-/*
- * Converts stat num into a six-char (right justified) string
+/*!
+ * @brief 現在の修正後能力値を3~17及び18/xxx形式に変換する / Converts stat num into a six-char (right justified) string
+ * @param val 能力値
+ * @param out_val 出力先文字列ポインタ
+ * @return なし
  */
 void cnv_stat(int val, char *out_val)
 {
@@ -47,16 +47,19 @@ void cnv_stat(int val, char *out_val)
        }
 }
 
-
-
-/*
+/*!
+ * @brief 能力値現在値から3~17及び18/xxx様式に基づく加減算を行う。
  * Modify a stat value by a "modifier", return new value
- *
+ * @param value 現在値
+ * @param amount 加減算値
+ * @return 加減算後の値
+ * @details
+ * <pre>
  * Stats go up: 3,4,...,17,18,18/10,18/20,...,18/220
  * Or even: 18/13, 18/23, 18/33, ..., 18/220
- *
  * Stats go down: 18/220, 18/210,..., 18/10, 18, 17, ..., 3
  * Or even: 18/13, 18/03, 18, 17, ..., 3
+ * </pre>
  */
 s16b modify_stat_value(int value, int amount)
 {
@@ -94,15 +97,20 @@ s16b modify_stat_value(int value, int amount)
        }
 
        /* Return new value */
-       return (value);
+       return (s16b)(value);
 }
 
 
 
-/*
+/*!
+ * @brief 画面左の能力値表示を行うために指定位置から13キャラ分を空白消去後指定のメッセージを明るい青で描画する /
  * Print character info at given row, column in a 13 char field
+ * @param info 表示文字列
+ * @param row 描画列
+ * @param col 描画行
+ * @return なし
  */
-static void prt_field(cptr info, int row, int col)
+static void prt_field(cptr info, TERM_LEN row, TERM_LEN col)
 {
        /* Dump 13 spaces to clear */
        c_put_str(TERM_WHITE, "             ", row, col);
@@ -111,45 +119,10 @@ static void prt_field(cptr info, int row, int col)
        c_put_str(TERM_L_BLUE, info, row, col);
 }
 
-
-/*
- *  Whether daytime or not
- */
-bool is_daytime(void)
-{
-       s32b len = TURNS_PER_TICK * TOWN_DAWN;
-       if ((turn % len) < (len / 2))
-               return TRUE;
-       else
-               return FALSE;
-}
-
-/*
- * Extract day, hour, min
- */
-void extract_day_hour_min(int *day, int *hour, int *min)
-{
-       const s32b A_DAY = TURNS_PER_TICK * TOWN_DAWN;
-       s32b turn_in_today = (turn + A_DAY / 4) % A_DAY;
-
-       switch (p_ptr->start_race)
-       {
-       case RACE_VAMPIRE:
-       case RACE_SKELETON:
-       case RACE_ZOMBIE:
-       case RACE_SPECTRE:
-               *day = (turn - A_DAY * 3 / 4) / A_DAY + 1;
-               break;
-       default:
-               *day = (turn + A_DAY / 4) / A_DAY + 1;
-               break;
-       }
-       *hour = (24 * turn_in_today / A_DAY) % 24;
-       *min = (1440 * turn_in_today / A_DAY) % 60;
-}
-
-/*
+/*!
+ * @brief ゲーム時刻を表示する /
  * Print time
+ * @return なし
  */
 void prt_time(void)
 {
@@ -161,58 +134,41 @@ void prt_time(void)
        extract_day_hour_min(&day, &hour, &min);
 
        /* Dump the info itself */
-#ifdef JP
-       if (day < 1000) c_put_str(TERM_WHITE, format("%2dÆüÌÜ", day), ROW_DAY, COL_DAY);
-       else c_put_str(TERM_WHITE, "***ÆüÌÜ", ROW_DAY, COL_DAY);
-#else
-       if (day < 1000) c_put_str(TERM_WHITE, format("Day%3d", day), ROW_DAY, COL_DAY);
-       else c_put_str(TERM_WHITE, "Day***", ROW_DAY, COL_DAY);
-#endif
+       if (day < 1000) c_put_str(TERM_WHITE, format(_("%2d日目", "Day%3d"), day), ROW_DAY, COL_DAY);
+       else c_put_str(TERM_WHITE, _("***日目", "Day***"), ROW_DAY, COL_DAY);
 
        c_put_str(TERM_WHITE, format("%2d:%02d", hour, min), ROW_DAY, COL_DAY+7);
 }
 
-
+/*!
+ * @brief 現在のマップ名を返す /
+ * @return マップ名の文字列参照ポインタ
+ */
 cptr map_name(void)
 {
        if (p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)
            && (quest[p_ptr->inside_quest].flags & QUEST_FLAG_PRESET))
-#ifdef JP
-               return "¥¯¥¨¥¹¥È";
-#else
-               return "Quest";
-#endif
+               return _("クエスト", "Quest");
        else if (p_ptr->wild_mode)
-#ifdef JP
-               return "ÃϾå";
-#else
-               return "Surface";
-#endif
+               return _("地上", "Surface");
        else if (p_ptr->inside_arena)
-#ifdef JP
-               return "¥¢¥ê¡¼¥Ê";
-#else
-               return "Arena";
-#endif
+               return _("アリーナ", "Arena");
        else if (p_ptr->inside_battle)
-#ifdef JP
-               return "Æ®µ»¾ì";
-#else
-               return "Monster Arena";
-#endif
+               return _("闘技場", "Monster Arena");
        else if (!dun_level && p_ptr->town_num)
                return town[p_ptr->town_num].name;
        else
                return d_name+d_info[dungeon_type].name;
 }
 
-/*
- * Print dungeon
+/*!
+ * @brief 現在のマップ名を描画する / Print dungeon
+ * @return なし
  */
 static void prt_dungeon(void)
 {
        cptr dungeon_name;
-       int col;
+       TERM_LEN col;
 
        /* Dump 13 spaces to clear */
        c_put_str(TERM_WHITE, "             ", ROW_DUNGEON, COL_DUNGEON);
@@ -228,10 +184,10 @@ static void prt_dungeon(void)
 }
 
 
-
-
-/*
- * Print character stat in given row, column
+/*!
+ * @brief プレイヤー能力値を描画する / Print character stat in given row, column
+ * @param stat 描画するステータスのID
+ * @return なし
  */
 static void prt_stat(int stat)
 {
@@ -257,7 +213,7 @@ static void prt_stat(int stat)
        if (p_ptr->stat_max[stat] == p_ptr->stat_max_max[stat])
        {
 #ifdef JP
-               /* ÆüËܸì¤Ë¤«¤Ö¤é¤Ê¤¤¤è¤¦¤Ëɽ¼¨°ÌÃÖ¤òÊѹ¹ */
+               /* 日本語にかぶらないように表示位置を変更 */
                put_str("!", ROW_STAT + stat, 5);
 #else
                put_str("!", ROW_STAT + stat, 3);
@@ -268,151 +224,151 @@ static void prt_stat(int stat)
 
 
 /*
- *  Data structure for status bar
+ * 画面下部に表示する状態表示定義ID / Data structure for status bar
  */
-#define BAR_TSUYOSHI 0
-#define BAR_HALLUCINATION 1
-#define BAR_BLINDNESS 2
-#define BAR_PARALYZE 3
-#define BAR_CONFUSE 4
-#define BAR_POISONED 5
-#define BAR_AFRAID 6
-#define BAR_LEVITATE 7
-#define BAR_REFLECTION 8
-#define BAR_PASSWALL 9
-#define BAR_WRAITH 10
-#define BAR_PROTEVIL 11
-#define BAR_KAWARIMI 12
-#define BAR_MAGICDEFENSE 13
-#define BAR_EXPAND 14
-#define BAR_STONESKIN 15
-#define BAR_MULTISHADOW 16
-#define BAR_REGMAGIC 17
-#define BAR_ULTIMATE 18
-#define BAR_INVULN 19
-#define BAR_IMMACID 20
-#define BAR_RESACID 21
-#define BAR_IMMELEC 22
-#define BAR_RESELEC 23
-#define BAR_IMMFIRE 24
-#define BAR_RESFIRE 25
-#define BAR_IMMCOLD 26
-#define BAR_RESCOLD 27
-#define BAR_RESPOIS 28
-#define BAR_RESNETH 29
-#define BAR_RESTIME 30
-#define BAR_DUSTROBE 31
-#define BAR_SHFIRE 32
-#define BAR_TOUKI 33
-#define BAR_SHHOLY 34
-#define BAR_EYEEYE 35
-#define BAR_BLESSED 36
-#define BAR_HEROISM 37
-#define BAR_BERSERK 38
-#define BAR_ATTKFIRE 39
-#define BAR_ATTKCOLD 40
-#define BAR_ATTKELEC 41
-#define BAR_ATTKACID 42
-#define BAR_ATTKPOIS 43
-#define BAR_ATTKCONF 44
-#define BAR_SENSEUNSEEN 45
-#define BAR_TELEPATHY 46
-#define BAR_REGENERATION 47
-#define BAR_INFRAVISION 48
-#define BAR_STEALTH 49
-#define BAR_SUPERSTEALTH 50
-#define BAR_RECALL 51
-#define BAR_ALTER 52
-#define BAR_SHCOLD 53
-#define BAR_SHELEC 54
-#define BAR_SHSHADOW 55
-#define BAR_MIGHT 56
-#define BAR_BUILD 57
-#define BAR_ANTIMULTI 58
-#define BAR_ANTITELE 59
-#define BAR_ANTIMAGIC 60
-#define BAR_PATIENCE 61
-#define BAR_REVENGE 62
-#define BAR_RUNESWORD 63
-#define BAR_VAMPILIC 64
-#define BAR_CURE 65
-#define BAR_ESP_EVIL 66
+#define BAR_TSUYOSHI 0      /*!< 下部ステータス表示: オクレ兄さん状態 */
+#define BAR_HALLUCINATION 1 /*!< 下部ステータス表示: 幻覚 */
+#define BAR_BLINDNESS 2     /*!< 下部ステータス表示: 盲目 */
+#define BAR_PARALYZE 3      /*!< 下部ステータス表示: 麻痺 */
+#define BAR_CONFUSE 4       /*!< 下部ステータス表示: 混乱 */
+#define BAR_POISONED 5      /*!< 下部ステータス表示: 毒 */
+#define BAR_AFRAID 6        /*!< 下部ステータス表示: 恐怖 */
+#define BAR_LEVITATE 7      /*!< 下部ステータス表示: 浮遊 */
+#define BAR_REFLECTION 8    /*!< 下部ステータス表示: 反射 */
+#define BAR_PASSWALL 9      /*!< 下部ステータス表示: 壁抜け */
+#define BAR_WRAITH 10       /*!< 下部ステータス表示: 幽体化 */
+#define BAR_PROTEVIL 11     /*!< 下部ステータス表示: 対邪悪結界 */
+#define BAR_KAWARIMI 12     /*!< 下部ステータス表示: 変わり身 */
+#define BAR_MAGICDEFENSE 13 /*!< 下部ステータス表示: 魔法の鎧 */
+#define BAR_EXPAND 14       /*!< 下部ステータス表示: 横伸び */
+#define BAR_STONESKIN 15    /*!< 下部ステータス表示: 石肌化 */
+#define BAR_MULTISHADOW 16  /*!< 下部ステータス表示: 影分身 */
+#define BAR_REGMAGIC 17     /*!< 下部ステータス表示: 魔法防御 */
+#define BAR_ULTIMATE 18     /*!< 下部ステータス表示: 究極の耐性 */
+#define BAR_INVULN 19       /*!< 下部ステータス表示: 無敵化 */
+#define BAR_IMMACID 20      /*!< 下部ステータス表示: 酸免疫 */
+#define BAR_RESACID 21      /*!< 下部ステータス表示: 酸耐性 */
+#define BAR_IMMELEC 22      /*!< 下部ステータス表示: 電撃免疫 */
+#define BAR_RESELEC 23      /*!< 下部ステータス表示: 電撃耐性 */
+#define BAR_IMMFIRE 24      /*!< 下部ステータス表示: 火炎免疫 */
+#define BAR_RESFIRE 25      /*!< 下部ステータス表示: 火炎耐性 */
+#define BAR_IMMCOLD 26      /*!< 下部ステータス表示: 冷気免疫 */
+#define BAR_RESCOLD 27      /*!< 下部ステータス表示: 冷気耐性 */
+#define BAR_RESPOIS 28      /*!< 下部ステータス表示: 毒耐性 */
+#define BAR_RESNETH 29      /*!< 下部ステータス表示: 地獄耐性 */
+#define BAR_RESTIME 30      /*!< 下部ステータス表示: 時間逆転耐性 */
+#define BAR_DUSTROBE 31     /*!< 下部ステータス表示: 破片オーラ */
+#define BAR_SHFIRE 32       /*!< 下部ステータス表示: 火炎オーラ */
+#define BAR_TOUKI 33        /*!< 下部ステータス表示: 闘気 */
+#define BAR_SHHOLY 34       /*!< 下部ステータス表示: 聖なるオーラ */
+#define BAR_EYEEYE 35       /*!< 下部ステータス表示: 目には目を */
+#define BAR_BLESSED 36      /*!< 下部ステータス表示: 祝福 */
+#define BAR_HEROISM 37      /*!< 下部ステータス表示: 士気高揚 */
+#define BAR_BERSERK 38      /*!< 下部ステータス表示: 狂戦士化 */
+#define BAR_ATTKFIRE 39     /*!< 下部ステータス表示: 焼棄スレイ */
+#define BAR_ATTKCOLD 40     /*!< 下部ステータス表示: 冷凍スレイ */
+#define BAR_ATTKELEC 41     /*!< 下部ステータス表示: 電撃スレイ */
+#define BAR_ATTKACID 42     /*!< 下部ステータス表示: 溶解スレイ */
+#define BAR_ATTKPOIS 43     /*!< 下部ステータス表示: 毒殺スレイ */
+#define BAR_ATTKCONF 44     /*!< 下部ステータス表示: 混乱打撃 */
+#define BAR_SENSEUNSEEN 45  /*!< 下部ステータス表示: 透明視 */
+#define BAR_TELEPATHY 46    /*!< 下部ステータス表示: テレパシー */
+#define BAR_REGENERATION 47 /*!< 下部ステータス表示: 急回復 */
+#define BAR_INFRAVISION 48  /*!< 下部ステータス表示: 赤外線視力 */
+#define BAR_STEALTH 49      /*!< 下部ステータス表示: 隠密 */
+#define BAR_SUPERSTEALTH 50 /*!< 下部ステータス表示: 超隠密 */
+#define BAR_RECALL 51       /*!< 下部ステータス表示: 帰還待ち */
+#define BAR_ALTER 52        /*!< 下部ステータス表示: 現実変容待ち */
+#define BAR_SHCOLD 53       /*!< 下部ステータス表示: 冷気オーラ */
+#define BAR_SHELEC 54       /*!< 下部ステータス表示: 電撃オーラ */
+#define BAR_SHSHADOW 55     /*!< 下部ステータス表示: 影のオーラ */
+#define BAR_MIGHT 56        /*!< 下部ステータス表示: 腕力強化 */
+#define BAR_BUILD 57        /*!< 下部ステータス表示: 肉体強化 */
+#define BAR_ANTIMULTI 58    /*!< 下部ステータス表示: 反増殖 */
+#define BAR_ANTITELE 59     /*!< 下部ステータス表示: 反テレポート */
+#define BAR_ANTIMAGIC 60    /*!< 下部ステータス表示: 反魔法 */
+#define BAR_PATIENCE 61     /*!< 下部ステータス表示: 我慢 */
+#define BAR_REVENGE 62      /*!< 下部ステータス表示: 宣告 */
+#define BAR_RUNESWORD 63    /*!< 下部ステータス表示: 魔剣化 */
+#define BAR_VAMPILIC 64     /*!< 下部ステータス表示: 吸血 */
+#define BAR_CURE 65         /*!< 下部ステータス表示: 回復 */
+#define BAR_ESP_EVIL 66     /*!< 下部ステータス表示: 邪悪感知 */
 
 static struct {
-       byte attr;
+       TERM_COLOR attr;
        cptr sstr;
        cptr lstr;
 } bar[]
 #ifdef JP
 = {
-       {TERM_YELLOW, "¤Ä", "¤Ä¤è¤·"},
-       {TERM_VIOLET, "¸¸", "¸¸³Ð"},
-       {TERM_L_DARK, "ÌÕ", "ÌÕÌÜ"},
-       {TERM_RED, "áã", "Ëãáã"},
-       {TERM_VIOLET, "Íð", "º®Íð"},
-       {TERM_GREEN, "ÆÇ", "ÆÇ"},
-       {TERM_BLUE, "¶²", "¶²ÉÝ"},
-       {TERM_L_BLUE, "Éâ", "ÉâÍ·"},
-       {TERM_SLATE, "È¿", "È¿¼Í"},
-       {TERM_SLATE, "ÊÉ", "ÊÉÈ´¤±"},
-       {TERM_L_DARK, "Í©", "Í©ÂÎ"},
-       {TERM_SLATE, "¼Ù", "ËɼÙ"},
-       {TERM_VIOLET, "ÊÑ", "ÊѤï¤ê¿È"},
-       {TERM_YELLOW, "Ëâ", "ËâË¡³»"},
-       {TERM_L_UMBER, "¿­", "¿­¤Ó"},
-       {TERM_WHITE, "ÀÐ", "ÀÐÈ©"},
-       {TERM_L_BLUE, "ʬ", "ʬ¿È"},
-       {TERM_SLATE, "ËÉ", "ËâË¡Ëɸæ"},
-       {TERM_YELLOW, "µæ", "µæ¶Ë"},
-       {TERM_YELLOW, "̵", "̵Ũ"},
-       {TERM_L_GREEN, "»À", "»ÀÌȱÖ"},
-       {TERM_GREEN, "»À", "ÂÑ»À"},
-       {TERM_L_BLUE, "ÅÅ", "ÅÅÌȱÖ"},
-       {TERM_BLUE, "ÅÅ", "ÂÑÅÅ"},
-       {TERM_L_RED, "²Ð", "²ÐÌȱÖ"},
-       {TERM_RED, "²Ð", "ÂѲÐ"},
-       {TERM_WHITE, "Îä", "ÎäÌȱÖ"},
-       {TERM_SLATE, "Îä", "ÂÑÎä"},
-       {TERM_GREEN, "ÆÇ", "ÂÑÆÇ"},
-       {TERM_L_DARK, "¹ö", "ÂÑÃϹö"},
-       {TERM_L_BLUE, "»þ", "ÂÑ»þ´Ö"},
-       {TERM_L_DARK, "¶À", "¶À¥ª¡¼¥é"},
-       {TERM_L_RED, "¥ª", "²Ð¥ª¡¼¥é"},
-       {TERM_WHITE, "Æ®", "Æ®µ¤"},
-       {TERM_WHITE, "À»", "À»¥ª¡¼¥é"},
-       {TERM_VIOLET, "ÌÜ", "ÌܤˤÏÌÜ"},
-       {TERM_WHITE, "½Ë", "½ËÊ¡"},
-       {TERM_WHITE, "ͦ", "ͦ"},
-       {TERM_RED, "¶¸", "¶¸Íð"},
-       {TERM_L_RED, "²Ð", "Ëâ·õ²Ð"},
-       {TERM_WHITE, "Îä", "Ëâ·õÎä"},
-       {TERM_L_BLUE, "ÅÅ", "Ëâ·õÅÅ"},
-       {TERM_SLATE, "»À", "Ëâ·õ»À"},
-       {TERM_L_GREEN, "ÆÇ", "Ëâ·õÆÇ"},
-       {TERM_RED, "Íð", "º®ÍðÂÇ·â"},
-       {TERM_L_BLUE, "»ë", "Æ©ÌÀ»ë"},
-       {TERM_ORANGE, "¥Æ", "¥Æ¥ì¥Ñ¥·"},
-       {TERM_L_BLUE, "²ó", "²óÉü"},
-       {TERM_L_RED, "ÀÖ", "ÀÖ³°"},
-       {TERM_UMBER, "±£", "±£Ì©"},
-       {TERM_YELLOW, "±£", "Ķ±£Ì©"},
-       {TERM_WHITE, "µ¢", "µ¢´Ô"},
-       {TERM_WHITE, "¸½", "¸½¼ÂÊÑÍÆ"},
+       {TERM_YELLOW, "つ", "つよし"},
+       {TERM_VIOLET, "幻", "幻覚"},
+       {TERM_L_DARK, "盲", "盲目"},
+       {TERM_RED, "痺", "麻痺"},
+       {TERM_VIOLET, "乱", "混乱"},
+       {TERM_GREEN, "毒", "毒"},
+       {TERM_BLUE, "恐", "恐怖"},
+       {TERM_L_BLUE, "浮", "浮遊"},
+       {TERM_SLATE, "反", "反射"},
+       {TERM_SLATE, "壁", "壁抜け"},
+       {TERM_L_DARK, "幽", "幽体"},
+       {TERM_SLATE, "邪", "防邪"},
+       {TERM_VIOLET, "変", "変わり身"},
+       {TERM_YELLOW, "魔", "魔法鎧"},
+       {TERM_L_UMBER, "伸", "伸び"},
+       {TERM_WHITE, "石", "石肌"},
+       {TERM_L_BLUE, "分", "分身"},
+       {TERM_SLATE, "防", "魔法防御"},
+       {TERM_YELLOW, "究", "究極"},
+       {TERM_YELLOW, "無", "無敵"},
+       {TERM_L_GREEN, "酸", "酸免疫"},
+       {TERM_GREEN, "酸", "耐酸"},
+       {TERM_L_BLUE, "電", "電免疫"},
+       {TERM_BLUE, "電", "耐電"},
+       {TERM_L_RED, "火", "火免疫"},
+       {TERM_RED, "火", "耐火"},
+       {TERM_WHITE, "冷", "冷免疫"},
+       {TERM_SLATE, "冷", "耐冷"},
+       {TERM_GREEN, "毒", "耐毒"},
+       {TERM_L_DARK, "獄", "耐地獄"},
+       {TERM_L_BLUE, "時", "耐時間"},
+       {TERM_L_DARK, "鏡", "鏡オーラ"},
+       {TERM_L_RED, "オ", "火オーラ"},
+       {TERM_WHITE, "闘", "闘気"},
+       {TERM_WHITE, "聖", "聖オーラ"},
+       {TERM_VIOLET, "目", "目には目"},
+       {TERM_WHITE, "祝", "祝福"},
+       {TERM_WHITE, "勇", "勇"},
+       {TERM_RED, "狂", "狂乱"},
+       {TERM_L_RED, "火", "魔剣火"},
+       {TERM_WHITE, "冷", "魔剣冷"},
+       {TERM_L_BLUE, "電", "魔剣電"},
+       {TERM_SLATE, "酸", "魔剣酸"},
+       {TERM_L_GREEN, "毒", "魔剣毒"},
+       {TERM_RED, "乱", "混乱打撃"},
+       {TERM_L_BLUE, "視", "透明視"},
+       {TERM_ORANGE, "ã\83\86", "ã\83\86ã\83¬ã\83\91ã\82·"},
+       {TERM_L_BLUE, "回", "回復"},
+       {TERM_L_RED, "赤", "赤外"},
+       {TERM_UMBER, "隠", "隠密"},
+       {TERM_YELLOW, "隠", "超隠密"},
+       {TERM_WHITE, "帰", "帰還"},
+       {TERM_WHITE, "現", "現実変容"},
        /* Hex */
-       {TERM_WHITE, "¥ª", "ɹ¥ª¡¼¥é"},
-       {TERM_BLUE, "¥ª", "ÅÅ¥ª¡¼¥é"},
-       {TERM_L_DARK, "¥ª", "±Æ¥ª¡¼¥é"},
-       {TERM_YELLOW, "ÏÓ", "ÏÓÎ϶¯²½"},
-       {TERM_RED, "Æù", "ÆùÂζ¯²½"},
-       {TERM_L_DARK, "¿£", "È¿Áý¿£"},
-       {TERM_ORANGE, "¥Æ", "È¿¥Æ¥ì¥Ý"},
-       {TERM_RED, "Ëâ", "È¿ËâË¡"},
-       {TERM_SLATE, "²æ", "²æËý"},
-       {TERM_SLATE, "Àë", "Àë¹ð"},
-       {TERM_L_DARK, "·õ", "Ëâ·õ²½"},
-       {TERM_RED, "µÛ", "µÛ·ìÂÇ·â"},
-       {TERM_WHITE, "²ó", "²óÉü"},
-       {TERM_L_DARK, "´¶", "¼Ù°­´¶ÃÎ"},
+       {TERM_WHITE, "オ", "氷オーラ"},
+       {TERM_BLUE, "オ", "電オーラ"},
+       {TERM_L_DARK, "オ", "影オーラ"},
+       {TERM_YELLOW, "腕", "腕力強化"},
+       {TERM_RED, "肉", "肉体強化"},
+       {TERM_L_DARK, "殖", "反増殖"},
+       {TERM_ORANGE, "テ", "反テレポ"},
+       {TERM_RED, "魔", "反魔法"},
+       {TERM_SLATE, "我", "我慢"},
+       {TERM_SLATE, "宣", "宣告"},
+       {TERM_L_DARK, "剣", "魔剣化"},
+       {TERM_RED, "吸", "吸血打撃"},
+       {TERM_WHITE, "回", "回復"},
+       {TERM_L_DARK, "感", "邪悪感知"},
        {0, NULL, NULL}
 };
 #else
@@ -489,18 +445,31 @@ static struct {
 };
 #endif
 
+/*!
+ * @brief 32ビット変数配列の指定位置のビットフラグを1にする。
+ * @param FLG フラグ位置(ビット)
+ * @return なし
+ */
 #define ADD_FLG(FLG) (bar_flags[FLG / 32] |= (1L << (FLG % 32)))
+
+/*!
+ * @brief 32ビット変数配列の指定位置のビットフラグが1かどうかを返す。
+ * @param FLG フラグ位置(ビット)
+ * @return 1ならば0以外を返す
+ */
 #define IS_FLG(FLG) (bar_flags[FLG / 32] & (1L << (FLG % 32)))
 
 
-/*
- *  Show status bar
+/*!
+ * @brief 下部に状態表示を行う / Show status bar
+ * @return なし
  */
 static void prt_status(void)
 {
-       u32b bar_flags[3];
-       int wid, hgt, row_statbar, max_col_statbar;
-       int i, col = 0, num = 0;
+       BIT_FLAGS bar_flags[3];
+       TERM_LEN wid, hgt, row_statbar, max_col_statbar;
+       int i;
+       TERM_LEN col = 0, num = 0;
        int space = 2;
 
        Term_get_size(&wid, &hgt);
@@ -664,10 +633,10 @@ static void prt_status(void)
                        hex_spelling(HEX_CURE_SERIOUS) ||
                        hex_spelling(HEX_CURE_CRITICAL)) ADD_FLG(BAR_CURE);
 
-               if (p_ptr->magic_num2[2])
+               if (HEX_REVENGE_TURN(p_ptr))
                {
-                       if (p_ptr->magic_num2[1] == 1) ADD_FLG(BAR_PATIENCE);
-                       if (p_ptr->magic_num2[1] == 2) ADD_FLG(BAR_REVENGE);
+                       if (HEX_REVENGE_TYPE(p_ptr) == 1) ADD_FLG(BAR_PATIENCE);
+                       if (HEX_REVENGE_TYPE(p_ptr) == 2) ADD_FLG(BAR_REVENGE);
                }
        }
 
@@ -725,47 +694,28 @@ static void prt_status(void)
 }
 
 
-
-/*
- * Prints "title", including "wizard" or "winner" as needed.
+/*!
+ * @brief プレイヤーの称号を表示する / Prints "title", including "wizard" or "winner" as needed.
+ * @return なし
  */
 static void prt_title(void)
 {
        cptr p = "";
-       char str[14];
+       GAME_TEXT str[14];
 
-       /* Wizard */
        if (p_ptr->wizard)
        {
-#ifdef JP
-               /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½ ¾Î¹æ */
-               p = "[¥¦¥£¥¶¡¼¥É]";
-#else
-               p = "[=-WIZARD-=]";
-#endif
-
+               p = _("[ウィザード]", "[=-WIZARD-=]");
        }
-
-       /* Winner */
        else if (p_ptr->total_winner || (p_ptr->lev > PY_MAX_LEVEL))
        {
                if (p_ptr->arena_number > MAX_ARENA_MONS + 2)
                {
-#ifdef JP
-                       /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½ ¾Î¹æ */
-                       p = "*¿¿¡¦¾¡Íø¼Ô*";
-#else
-                       p = "*TRUEWINNER*";
-#endif
+                       p = _("*真・勝利者*", "*TRUEWINNER*");
                }
                else
                {
-#ifdef JP
-                       /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½ ¾Î¹æ */
-                       p = "***¾¡Íø¼Ô***";
-#else
-                       p = "***WINNER***";
-#endif
+                       p = _("***勝利者***", "***WINNER***");
                }
        }
 
@@ -780,47 +730,32 @@ static void prt_title(void)
 }
 
 
-/*
- * Prints level
+/*!
+ * @brief プレイヤーのレベルを表示する / Prints level
+ * @return なし
  */
 static void prt_level(void)
 {
        char tmp[32];
 
-#ifdef JP
-       sprintf(tmp, "%5d", p_ptr->lev);
-#else
-       sprintf(tmp, "%6d", p_ptr->lev);
-#endif
-
+       sprintf(tmp, _("%5d", "%6d"), p_ptr->lev);
 
        if (p_ptr->lev >= p_ptr->max_plv)
        {
-#ifdef JP
-               put_str("¥ì¥Ù¥ë ", ROW_LEVEL, 0);
+               put_str(_("レベル ", "LEVEL "), ROW_LEVEL, 0);
                c_put_str(TERM_L_GREEN, tmp, ROW_LEVEL, COL_LEVEL + 7);
-#else
-               put_str("LEVEL ", ROW_LEVEL, 0);
-               c_put_str(TERM_L_GREEN, tmp, ROW_LEVEL, COL_LEVEL + 6);
-#endif
-
        }
        else
        {
-#ifdef JP
-               put_str("x¥ì¥Ù¥ë", ROW_LEVEL, 0);
+               put_str(_("xレベル", "Level "), ROW_LEVEL, 0);
                c_put_str(TERM_YELLOW, tmp, ROW_LEVEL, COL_LEVEL + 7);
-#else
-               put_str("Level ", ROW_LEVEL, 0);
-               c_put_str(TERM_YELLOW, tmp, ROW_LEVEL, COL_LEVEL + 6);
-#endif
-
        }
 }
 
 
-/*
- * Display the experience
+/*!
+ * @brief プレイヤーの経験値を表示する / Display the experience
+ * @return なし
  */
 static void prt_exp(void)
 {
@@ -828,11 +763,7 @@ static void prt_exp(void)
 
        if ((!exp_need)||(p_ptr->prace == RACE_ANDROID))
        {
-#ifdef JP
-       (void)sprintf(out_val, "%7ld", (long)p_ptr->exp);
-#else
-       (void)sprintf(out_val, "%8ld", (long)p_ptr->exp);
-#endif
+               (void)sprintf(out_val, "%8ld", (long)p_ptr->exp);
        }
        else
        {
@@ -842,69 +773,47 @@ static void prt_exp(void)
                }
                else
                {
-#ifdef JP
-                       (void)sprintf(out_val, "%7ld", (long)(player_exp [p_ptr->lev - 1] * p_ptr->expfact / 100L) - p_ptr->exp);
-#else      
                        (void)sprintf(out_val, "%8ld", (long)(player_exp [p_ptr->lev - 1] * p_ptr->expfact / 100L) - p_ptr->exp);
-#endif
                }
        }
 
        if (p_ptr->exp >= p_ptr->max_exp)
        {
-#ifdef JP
-               if (p_ptr->prace == RACE_ANDROID) put_str("¶¯²½ ", ROW_EXP, 0);
-               else put_str("·Ð¸³ ", ROW_EXP, 0);
-               c_put_str(TERM_L_GREEN, out_val, ROW_EXP, COL_EXP + 5);
-#else
-               if (p_ptr->prace == RACE_ANDROID) put_str("Cst ", ROW_EXP, 0);
-               else put_str("EXP ", ROW_EXP, 0);
+               if (p_ptr->prace == RACE_ANDROID) put_str(_("強化 ", "Cst "), ROW_EXP, 0);
+               else put_str(_("経験 ", "EXP "), ROW_EXP, 0);
                c_put_str(TERM_L_GREEN, out_val, ROW_EXP, COL_EXP + 4);
-#endif
-
        }
        else
        {
-#ifdef JP
-               put_str("x·Ð¸³", ROW_EXP, 0);
-               c_put_str(TERM_YELLOW, out_val, ROW_EXP, COL_EXP + 5);
-#else
-               put_str("Exp ", ROW_EXP, 0);
+               put_str(_("x経験", "Exp "), ROW_EXP, 0);
                c_put_str(TERM_YELLOW, out_val, ROW_EXP, COL_EXP + 4);
-#endif
-
        }
 }
 
-/*
- * Prints current gold
+/*!
+ * @brief プレイヤーの所持金を表示する / Prints current gold
+ * @return なし
  */
 static void prt_gold(void)
 {
        char tmp[32];
-
-#ifdef JP
-       put_str("¡ð ", ROW_GOLD, COL_GOLD);
-#else
-       put_str("AU ", ROW_GOLD, COL_GOLD);
-#endif
-
+       put_str(_("$ ", "AU "), ROW_GOLD, COL_GOLD);
        sprintf(tmp, "%9ld", (long)p_ptr->au);
        c_put_str(TERM_L_GREEN, tmp, ROW_GOLD, COL_GOLD + 3);
 }
 
 
-
-/*
- * Prints current AC
+/*!
+ * @brief プレイヤーのACを表示する / Prints current AC
+ * @return なし
  */
 static void prt_ac(void)
 {
        char tmp[32];
 
 #ifdef JP
-/* AC ¤Îɽ¼¨Êý¼°¤òÊѹ¹¤·¤Æ¤¤¤ë */
-       put_str(" £Á£Ã(     )", ROW_AC, COL_AC);
+/* AC の表示方式を変更している */
+       put_str(" AC(     )", ROW_AC, COL_AC);
        sprintf(tmp, "%5d", p_ptr->dis_ac + p_ptr->dis_to_a);
        c_put_str(TERM_L_GREEN, tmp, ROW_AC, COL_AC + 6);
 #else
@@ -916,22 +825,21 @@ static void prt_ac(void)
 }
 
 
-/*
- * Prints Cur/Max hit points
+/*!
+ * @brief プレイヤーのHPを表示する / Prints Cur/Max hit points
+ * @return なし
  */
 static void prt_hp(void)
 {
-/* ¥Ò¥Ã¥È¥Ý¥¤¥ó¥È¤Îɽ¼¨ÊýË¡¤òÊѹ¹ */
+       /* ヒットポイントの表示方法を変更 */
        char tmp[32];
   
-       byte color;
+       TERM_COLOR color;
   
-       /* ¥¿¥¤¥È¥ë */
-/*     put_str(" £È£Ð¡¦£Í£Ð", ROW_HPMP, COL_HPMP); */
-
+       /* タイトル */
        put_str("HP", ROW_CURHP, COL_CURHP);
 
-       /* ¸½ºß¤Î¥Ò¥Ã¥È¥Ý¥¤¥ó¥È */
+       /* 現在のヒットポイント */
        sprintf(tmp, "%4ld", (long int)p_ptr->chp);
 
        if (p_ptr->chp >= p_ptr->mhp)
@@ -949,10 +857,10 @@ static void prt_hp(void)
 
        c_put_str(color, tmp, ROW_CURHP, COL_CURHP+3);
 
-       /* ¶èÀÚ¤ê */
+       /* 区切り */
        put_str( "/", ROW_CURHP, COL_CURHP + 7 );
 
-       /* ºÇÂç¥Ò¥Ã¥È¥Ý¥¤¥ó¥È */
+       /* 最大ヒットポイント */
        sprintf(tmp, "%4ld", (long int)p_ptr->mhp);
        color = TERM_L_GREEN;
 
@@ -960,12 +868,13 @@ static void prt_hp(void)
 }
 
 
-/*
- * Prints players max/cur spell points
+/*!
+ * @brief プレイヤーのMPを表示する / Prints players max/cur spell points
+ * @return なし
  */
 static void prt_sp(void)
 {
-/* ¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È¤Îɽ¼¨ÊýË¡¤òÊѹ¹¤·¤Æ¤¤¤ë */
+/* マジックポイントの表示方法を変更している */
        char tmp[32];
        byte color;
 
@@ -973,16 +882,10 @@ static void prt_sp(void)
        /* Do not show mana unless it matters */
        if (!mp_ptr->spell_book) return;
 
-       /* ¥¿¥¤¥È¥ë */
-/*     put_str(" £Í£Ð / ºÇÂç", ROW_MAXSP, COL_MAXSP); */
-
-#ifdef JP
-       put_str("MP", ROW_CURSP, COL_CURSP);
-#else
-       put_str("SP", ROW_CURSP, COL_CURSP);
-#endif
+       /* タイトル */
+       put_str(_("MP", "SP"), ROW_CURSP, COL_CURSP);
 
-       /* ¸½ºß¤Î¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È */
+       /* 現在のマジックポイント */
        sprintf(tmp, "%4ld", (long int)p_ptr->csp);
 
        if (p_ptr->csp >= p_ptr->msp)
@@ -1000,10 +903,10 @@ static void prt_sp(void)
 
        c_put_str(color, tmp, ROW_CURSP, COL_CURSP+3);
 
-       /* ¶èÀÚ¤ê */
+       /* 区切り */
        put_str( "/", ROW_CURSP, COL_CURSP + 7 );
 
-       /* ºÇÂç¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È */
+       /* 最大マジックポイント */
        sprintf(tmp, "%4ld", (long int)p_ptr->msp);
        color = TERM_L_GREEN;
 
@@ -1011,14 +914,15 @@ static void prt_sp(void)
 }
 
 
-/*
- * Prints depth in stat area
+/*!
+ * @brief 現在のフロアの深さを表示する / Prints depth in stat area
+ * @return なし
  */
 static void prt_depth(void)
 {
        char depths[32];
-       int wid, hgt, row_depth, col_depth;
-       byte attr = TERM_WHITE;
+       TERM_LEN wid, hgt, row_depth, col_depth;
+       TERM_COLOR attr = TERM_WHITE;
 
        Term_get_size(&wid, &hgt);
        col_depth = wid + COL_DEPTH;
@@ -1026,30 +930,16 @@ static void prt_depth(void)
 
        if (!dun_level)
        {
-#ifdef JP
-               strcpy(depths, "ÃϾå");
-#else
-               strcpy(depths, "Surf.");
-#endif
+               strcpy(depths, _("地上", "Surf."));
        }
        else if (p_ptr->inside_quest && !dungeon_type)
        {
-#ifdef JP
-               strcpy(depths, "ÃϾå");
-#else
-               strcpy(depths, "Quest");
-#endif
+               strcpy(depths, _("地上", "Quest"));
        }
        else
        {
-#ifdef JP
-               if (depth_in_feet) (void)sprintf(depths, "%d ft", dun_level * 50);
-               else (void)sprintf(depths, "%d ³¬", dun_level);
-#else
-               if (depth_in_feet) (void)sprintf(depths, "%d ft", dun_level * 50);
-               else (void)sprintf(depths, "Lev %d", dun_level);
-#endif
-
+               if (depth_in_feet) (void)sprintf(depths, _("%d ft", "%d ft"), (int)dun_level * 50);
+               else (void)sprintf(depths, _("%d 階", "Lev %d"), (int)dun_level);
 
                /* Get color of level based on feeling  -JSV- */
                switch (p_ptr->feeling)
@@ -1073,8 +963,9 @@ static void prt_depth(void)
 }
 
 
-/*
- * Prints status of hunger
+/*!
+ * @brief プレイヤーの空腹状態を表示する / Prints status of hunger
+ * @return なし
  */
 static void prt_hunger(void)
 {
@@ -1083,34 +974,19 @@ static void prt_hunger(void)
        /* Fainting / Starving */
        if (p_ptr->food < PY_FOOD_FAINT)
        {
-#ifdef JP
-               c_put_str(TERM_RED, "¿ê¼å  ", ROW_HUNGRY, COL_HUNGRY);
-#else
-               c_put_str(TERM_RED, "Weak  ", ROW_HUNGRY, COL_HUNGRY);
-#endif
-
+               c_put_str(TERM_RED, _("衰弱  ", "Weak  "), ROW_HUNGRY, COL_HUNGRY);
        }
 
        /* Weak */
        else if (p_ptr->food < PY_FOOD_WEAK)
        {
-#ifdef JP
-               c_put_str(TERM_ORANGE, "¿ê¼å  ", ROW_HUNGRY, COL_HUNGRY);
-#else
-               c_put_str(TERM_ORANGE, "Weak  ", ROW_HUNGRY, COL_HUNGRY);
-#endif
-
+               c_put_str(TERM_ORANGE, _("衰弱  ", "Weak  "), ROW_HUNGRY, COL_HUNGRY);
        }
 
        /* Hungry */
        else if (p_ptr->food < PY_FOOD_ALERT)
        {
-#ifdef JP
-               c_put_str(TERM_YELLOW, "¶õÊ¢  ", ROW_HUNGRY, COL_HUNGRY);
-#else
-               c_put_str(TERM_YELLOW, "Hungry", ROW_HUNGRY, COL_HUNGRY);
-#endif
-
+               c_put_str(TERM_YELLOW, _("空腹  ", "Hungry"), ROW_HUNGRY, COL_HUNGRY);
        }
 
        /* Normal */
@@ -1122,60 +998,40 @@ static void prt_hunger(void)
        /* Full */
        else if (p_ptr->food < PY_FOOD_MAX)
        {
-#ifdef JP
-               c_put_str(TERM_L_GREEN, "ËþÊ¢  ", ROW_HUNGRY, COL_HUNGRY);
-#else
-               c_put_str(TERM_L_GREEN, "Full  ", ROW_HUNGRY, COL_HUNGRY);
-#endif
-
+               c_put_str(TERM_L_GREEN, _("満腹  ", "Full  "), ROW_HUNGRY, COL_HUNGRY);
        }
 
        /* Gorged */
        else
        {
-#ifdef JP
-               c_put_str(TERM_GREEN, "¿©²á¤®", ROW_HUNGRY, COL_HUNGRY);
-#else
-               c_put_str(TERM_GREEN, "Gorged", ROW_HUNGRY, COL_HUNGRY);
-#endif
-
+               c_put_str(TERM_GREEN, _("食過ぎ", "Gorged"), ROW_HUNGRY, COL_HUNGRY);
        }
 }
 
 
-/*
- * Prints Searching, Resting, Paralysis, or 'count' status
+/*!
+ * @brief プレイヤーの行動状態を表示する / Prints Searching, Resting, Paralysis, or 'count' status
+ * @return なし
+ * @details
  * Display is always exactly 10 characters wide (see below)
- *
  * This function was a major bottleneck when resting, so a lot of
  * the text formatting code was optimized in place below.
  */
 static void prt_state(void)
 {
-       byte attr = TERM_WHITE;
-
-       char text[5];
+       TERM_COLOR attr = TERM_WHITE;
+       GAME_TEXT text[16];
 
        /* Repeating */
        if (command_rep)
        {
                if (command_rep > 999)
                {
-#ifdef JP
-sprintf(text, "%2d00", command_rep / 100);
-#else
                        (void)sprintf(text, "%2d00", command_rep / 100);
-#endif
-
                }
                else
                {
-#ifdef JP
-sprintf(text, "  %2d", command_rep);
-#else
                        (void)sprintf(text, "  %2d", command_rep);
-#endif
-
                }
        }
 
@@ -1186,11 +1042,7 @@ sprintf(text, "  %2d", command_rep);
                {
                        case ACTION_SEARCH:
                        {
-#ifdef JP
-                               strcpy(text, "õº÷");
-#else
-                               strcpy(text, "Sear");
-#endif
+                               strcpy(text, _("探索", "Sear"));
                                break;
                        }
                        case ACTION_REST:
@@ -1198,12 +1050,7 @@ sprintf(text, "  %2d", command_rep);
                                int i;
 
                                /* Start with "Rest" */
-#ifdef JP
-                               strcpy(text, "    ");
-#else
-                               strcpy(text, "    ");
-#endif
-
+                               strcpy(text, _("    ", "    "));
 
                                /* Extensive (timed) rest */
                                if (resting >= 1000)
@@ -1241,13 +1088,13 @@ sprintf(text, "  %2d", command_rep);
                                }
 
                                /* Rest until healed */
-                               else if (resting == -1)
+                               else if (resting == COMMAND_ARG_REST_FULL_HEALING)
                                {
                                        text[0] = text[1] = text[2] = text[3] = '*';
                                }
 
                                /* Rest until done */
-                               else if (resting == -2)
+                               else if (resting == COMMAND_ARG_REST_UNTIL_DONE)
                                {
                                        text[0] = text[1] = text[2] = text[3] = '&';
                                }
@@ -1255,21 +1102,13 @@ sprintf(text, "  %2d", command_rep);
                        }
                        case ACTION_LEARN:
                        {
-#ifdef JP
-                               strcpy(text, "³Ø½¬");
-#else
-                               strcpy(text, "lear");
-#endif
+                               strcpy(text, _("学習", "lear"));
                                if (new_mane) attr = TERM_L_RED;
                                break;
                        }
                        case ACTION_FISH:
                        {
-#ifdef JP
-                               strcpy(text, "Äà¤ê");
-#else
-                               strcpy(text, "fish");
-#endif
+                               strcpy(text, _("釣り", "fish"));
                                break;
                        }
                        case ACTION_KAMAE:
@@ -1297,29 +1136,17 @@ sprintf(text, "  %2d", command_rep);
                        }
                        case ACTION_SING:
                        {
-#ifdef JP
-                               strcpy(text, "²Î  ");
-#else
-                               strcpy(text, "Sing");
-#endif
+                               strcpy(text, _("歌  ", "Sing"));
                                break;
                        }
                        case ACTION_HAYAGAKE:
                        {
-#ifdef JP
-                               strcpy(text, "®¶î");
-#else
-                               strcpy(text, "Fast");
-#endif
+                               strcpy(text, _("速駆", "Fast"));
                                break;
                        }
                        case ACTION_SPELL:
                        {
-#ifdef JP
-                               strcpy(text, "±Ó¾§");
-#else
-                               strcpy(text, "Spel");
-#endif
+                               strcpy(text, _("詠唱", "Spel"));
                                break;
                        }
                        default:
@@ -1335,17 +1162,18 @@ sprintf(text, "  %2d", command_rep);
 }
 
 
-/*
- * Prints the speed of a character.                    -CJS-
+/*!
+ * @brief プレイヤーの行動速度を表示する / Prints the speed of a character.                     -CJS-
+ * @return なし
  */
 static void prt_speed(void)
 {
        int i = p_ptr->pspeed;
        bool is_fast = IS_FAST();
 
-       byte attr = TERM_WHITE;
+       TERM_COLOR attr = TERM_WHITE;
        char buf[32] = "";
-       int wid, hgt, row_speed, col_speed;
+       TERM_LEN wid, hgt, row_speed, col_speed;
 
        Term_get_size(&wid, &hgt);
        col_speed = wid + COL_SPEED;
@@ -1368,7 +1196,7 @@ static void prt_speed(void)
                else if (p_ptr->slow && !is_fast) attr = TERM_VIOLET;
                else attr = TERM_L_GREEN;
 #ifdef JP
-               sprintf(buf, "%s(+%d)", (p_ptr->riding ? "¾èÇÏ" : "²Ã®"), (i - 110));
+               sprintf(buf, "%s(+%d)", (p_ptr->riding ? "乗馬" : "加速"), (i - 110));
 #else
                sprintf(buf, "Fast(+%d)", (i - 110));
 #endif
@@ -1389,7 +1217,7 @@ static void prt_speed(void)
                else if (p_ptr->slow && !is_fast) attr = TERM_VIOLET;
                else attr = TERM_L_UMBER;
 #ifdef JP
-               sprintf(buf, "%s(-%d)", (p_ptr->riding ? "¾èÇÏ" : "¸ºÂ®"), (110 - i));
+               sprintf(buf, "%s(-%d)", (p_ptr->riding ? "乗馬" : "減速"), (110 - i));
 #else
                sprintf(buf, "Slow(-%d)", (110 - i));
 #endif
@@ -1397,11 +1225,7 @@ static void prt_speed(void)
        else if (p_ptr->riding)
        {
                attr = TERM_GREEN;
-#ifdef JP
-               strcpy(buf, "¾èÇÏÃæ");
-#else
-               strcpy(buf, "Riding");
-#endif
+               strcpy(buf, _("乗馬中", "Riding"));
        }
 
        /* Display the speed */
@@ -1409,9 +1233,13 @@ static void prt_speed(void)
 }
 
 
+/*!
+ * @brief プレイヤーの呪文学習可能状態を表示する
+ * @return なし
+ */
 static void prt_study(void)
 {
-       int wid, hgt, row_study, col_study;
+       TERM_LEN wid, hgt, row_study, col_study;
 
        Term_get_size(&wid, &hgt);
        col_study = wid + COL_STUDY;
@@ -1419,12 +1247,7 @@ static void prt_study(void)
 
        if (p_ptr->new_spells)
        {
-#ifdef JP
-               put_str("³Ø½¬", row_study, col_study);
-#else
-               put_str("Stud", row_study, col_study);
-#endif
-
+               put_str(_("学習", "Stud"), row_study, col_study);
        }
        else
        {
@@ -1433,9 +1256,13 @@ static void prt_study(void)
 }
 
 
+/*!
+ * @brief プレイヤーのものまね可能状態を表示する
+ * @return なし
+ */
 static void prt_imitation(void)
 {
-       int wid, hgt, row_study, col_study;
+       TERM_LEN wid, hgt, row_study, col_study;
 
        Term_get_size(&wid, &hgt);
        col_study = wid + COL_STUDY;
@@ -1445,14 +1272,10 @@ static void prt_imitation(void)
        {
                if (p_ptr->mane_num)
                {
-                       byte attr;
+                       TERM_COLOR attr;
                        if (new_mane) attr = TERM_L_RED;
                        else attr = TERM_WHITE;
-#ifdef JP
-                       c_put_str(attr, "¤Þ¤Í", row_study, col_study);
-#else
-                       c_put_str(attr, "Imit", row_study, col_study);
-#endif
+                       c_put_str(attr, _("まね", "Imit"), row_study, col_study);
                }
                else
                {
@@ -1461,73 +1284,41 @@ static void prt_imitation(void)
        }
 }
 
-
+/*!
+ * @brief プレイヤーの負傷状態を表示する
+ * @return なし
+ */
 static void prt_cut(void)
 {
        int c = p_ptr->cut;
 
        if (c > 1000)
        {
-#ifdef JP
-               c_put_str(TERM_L_RED, "Ã×Ì¿½ý      ", ROW_CUT, COL_CUT);
-#else
-               c_put_str(TERM_L_RED, "Mortal wound", ROW_CUT, COL_CUT);
-#endif
-
+               c_put_str(TERM_L_RED, _("致命傷      ", "Mortal wound"), ROW_CUT, COL_CUT);
        }
        else if (c > 200)
        {
-#ifdef JP
-               c_put_str(TERM_RED, "¤Ò¤É¤¤¿¼¼ê  ", ROW_CUT, COL_CUT);
-#else
-               c_put_str(TERM_RED, "Deep gash   ", ROW_CUT, COL_CUT);
-#endif
-
+               c_put_str(TERM_RED, _("ひどい深手  ", "Deep gash   "), ROW_CUT, COL_CUT);
        }
        else if (c > 100)
        {
-#ifdef JP
-               c_put_str(TERM_RED, "½Å½ý        ", ROW_CUT, COL_CUT);
-#else
-               c_put_str(TERM_RED, "Severe cut  ", ROW_CUT, COL_CUT);
-#endif
-
+               c_put_str(TERM_RED, _("重傷        ", "Severe cut  "), ROW_CUT, COL_CUT);
        }
        else if (c > 50)
        {
-#ifdef JP
-               c_put_str(TERM_ORANGE, "ÂçÊѤʽý    ", ROW_CUT, COL_CUT);
-#else
-               c_put_str(TERM_ORANGE, "Nasty cut   ", ROW_CUT, COL_CUT);
-#endif
-
+               c_put_str(TERM_ORANGE, _("大変な傷    ", "Nasty cut   "), ROW_CUT, COL_CUT);
        }
        else if (c > 25)
        {
-#ifdef JP
-               c_put_str(TERM_ORANGE, "¤Ò¤É¤¤½ý    ", ROW_CUT, COL_CUT);
-#else
-               c_put_str(TERM_ORANGE, "Bad cut     ", ROW_CUT, COL_CUT);
-#endif
-
+               c_put_str(TERM_ORANGE, _("ひどい傷    ", "Bad cut     "), ROW_CUT, COL_CUT);
        }
        else if (c > 10)
        {
-#ifdef JP
-               c_put_str(TERM_YELLOW, "·Ú½ý        ", ROW_CUT, COL_CUT);
-#else
-               c_put_str(TERM_YELLOW, "Light cut   ", ROW_CUT, COL_CUT);
-#endif
-
+               c_put_str(TERM_YELLOW, _("軽傷        ", "Light cut   "), ROW_CUT, COL_CUT);
        }
        else if (c)
        {
-#ifdef JP
-               c_put_str(TERM_YELLOW, "¤«¤¹¤ê½ý    ", ROW_CUT, COL_CUT);
-#else
-               c_put_str(TERM_YELLOW, "Graze       ", ROW_CUT, COL_CUT);
-#endif
-
+               c_put_str(TERM_YELLOW, _("かすり傷    ", "Graze       "), ROW_CUT, COL_CUT);
        }
        else
        {
@@ -1536,37 +1327,25 @@ static void prt_cut(void)
 }
 
 
-
+/*!
+ * @brief プレイヤーの朦朧状態を表示する
+ * @return なし
+ */
 static void prt_stun(void)
 {
        int s = p_ptr->stun;
 
        if (s > 100)
        {
-#ifdef JP
-               c_put_str(TERM_RED, "°Õ¼±ÉÔÌÀÎÆ  ", ROW_STUN, COL_STUN);
-#else
-               c_put_str(TERM_RED, "Knocked out ", ROW_STUN, COL_STUN);
-#endif
-
+               c_put_str(TERM_RED, _("意識不明瞭  ", "Knocked out "), ROW_STUN, COL_STUN);
        }
        else if (s > 50)
        {
-#ifdef JP
-               c_put_str(TERM_ORANGE, "¤Ò¤É¤¯Û¯Û°  ", ROW_STUN, COL_STUN);
-#else
-               c_put_str(TERM_ORANGE, "Heavy stun  ", ROW_STUN, COL_STUN);
-#endif
-
+               c_put_str(TERM_ORANGE, _("ひどく朦朧  ", "Heavy stun  "), ROW_STUN, COL_STUN);
        }
        else if (s)
        {
-#ifdef JP
-               c_put_str(TERM_ORANGE, "ۯ۰        ", ROW_STUN, COL_STUN);
-#else
-               c_put_str(TERM_ORANGE, "Stun        ", ROW_STUN, COL_STUN);
-#endif
-
+               c_put_str(TERM_ORANGE, _("朦朧        ", "Stun        "), ROW_STUN, COL_STUN);
        }
        else
        {
@@ -1576,7 +1355,12 @@ static void prt_stun(void)
 
 
 
-/*
+/*!
+ * @brief モンスターの体力ゲージを表示する
+ * @param riding TRUEならば騎乗中のモンスターの体力、FALSEならターゲットモンスターの体力を表示する。表示位置は固定。
+ * @return なし
+ * @details
+ * <pre>
  * Redraw the "monster health bar"     -DRS-
  * Rather extensive modifications by   -BEN-
  *
@@ -1589,6 +1373,7 @@ static void prt_stun(void)
  * "health-o-meter").  Clear health bar if nothing is being tracked.
  * Auto-track current target monster when bored.  Note that the
  * health-bar stops tracking any monster that "disappears".
+ * </pre>
  */
 static void health_redraw(bool riding)
 {
@@ -1684,14 +1469,14 @@ static void health_redraw(bool riding)
                else
                {
                        /* Extract the "percent" of health */
-                       int pct = 100L * m_ptr->hp / m_ptr->maxhp;
-                       int pct2 = 100L * m_ptr->hp / m_ptr->max_maxhp;
+                       int pct = m_ptr->maxhp > 0 ? 100L * m_ptr->hp / m_ptr->maxhp : 0;
+                       int pct2 = m_ptr->maxhp > 0 ? 100L * m_ptr->hp / m_ptr->max_maxhp: 0;
 
                        /* Convert percent into "health" */
                        int len = (pct2 < 10) ? 1 : (pct2 < 90) ? (pct2 / 10 + 1) : 10;
 
                        /* Default to almost dead */
-                       byte attr = TERM_RED;
+                       TERM_COLOR attr = TERM_RED;
 
                        /* Invulnerable */
                        if (MON_INVULNER(m_ptr)) attr = TERM_WHITE;
@@ -1725,8 +1510,9 @@ static void health_redraw(bool riding)
 
 
 
-/*
- * Display basic info (mostly left of map)
+/*!
+ * @brief プレイヤーのステータスを一括表示する(左側部分) / Display basic info (mostly left of map)
+ * @return なし
  */
 static void prt_frame_basic(void)
 {
@@ -1753,7 +1539,7 @@ static void prt_frame_basic(void)
        prt_exp();
 
        /* All Stats */
-       for (i = 0; i < 6; i++) prt_stat(i);
+       for (i = 0; i < A_MAX; i++) prt_stat(i);
 
        /* Armor */
        prt_ac();
@@ -1776,8 +1562,9 @@ static void prt_frame_basic(void)
 }
 
 
-/*
- * Display extra info (mostly below map)
+/*!
+ * @brief プレイヤーのステータスを一括表示する(下部分) / Display extra info (mostly below map)
+ * @return なし
  */
 static void prt_frame_extra(void)
 {
@@ -1803,8 +1590,9 @@ static void prt_frame_extra(void)
 }
 
 
-/*
- * Hack -- display inventory in sub-windows
+/*!
+ * @brief サブウィンドウに所持品一覧を表示する / Hack -- display inventory in sub-windows
+ * @return なし
  */
 static void fix_inven(void)
 {
@@ -1826,8 +1614,6 @@ static void fix_inven(void)
 
                /* Display inventory */
                display_inven();
-
-               /* Fresh */
                Term_fresh();
 
                /* Restore */
@@ -1836,18 +1622,26 @@ static void fix_inven(void)
 }
 
 
-/*
- * Print monster info in line
+/*!
+ * @brief モンスターの現在数を一行で表現する / Print monster info in line
+ * @param x 表示列
+ * @param y 表示行
+ * @param m_ptr 思い出を表示するモンスター情報の参照ポインタ
+ * @param n_same モンスターの数の現在数
+ * @details
+ * <pre>
  * nnn X LV name
  *  nnn : number or unique(U) or wanted unique(W)
  *  X   : symbol of monster
  *  LV  : monster lv if known
  *  name: name of monster
+ * @return なし
+ * </pre>
  */
-static void print_monster_line(int x, int y, monster_type* m_ptr, int n_same){
+static void print_monster_line(TERM_LEN x, TERM_LEN y, monster_type* m_ptr, int n_same){
        char buf[256];
        int i;
-       int r_idx = m_ptr->ap_r_idx;
+       MONRACE_IDX r_idx = m_ptr->ap_r_idx;
        monster_race* r_ptr = &r_info[r_idx];
  
        Term_gotoxy(x, y);
@@ -1873,7 +1667,7 @@ static void print_monster_line(int x, int y, monster_type* m_ptr, int n_same){
        Term_add_bigch(r_ptr->x_attr, r_ptr->x_char);
        //LV
        if (r_ptr->r_tkills && !(m_ptr->mflag2 & MFLAG2_KAGE)){
-               sprintf(buf, " %2d", r_ptr->level);
+               sprintf(buf, " %2d", (int)r_ptr->level);
        }else{
                strcpy(buf, " ??");
        }
@@ -1885,11 +1679,14 @@ static void print_monster_line(int x, int y, monster_type* m_ptr, int n_same){
        //Term_addstr(-1, TERM_WHITE, look_mon_desc(m_ptr, 0));
 }
 
- /*
-       max_lines : ºÇÂ粿¹ÔÉÁ²è¤¹¤ë¤«¡¥
-*/
-void print_monster_list(int x, int y, int max_lines){
-       int line = y;
+/*!
+ * @brief モンスターの出現リストを表示する / Print monster info in line
+ * @param x 表示列
+ * @param y 表示行
+ * @param max_lines 最大何行描画するか
+ */
+void print_monster_list(TERM_LEN x, TERM_LEN y, TERM_LEN max_lines){
+       TERM_LEN line = y;
        monster_type* last_mons = NULL;
        monster_type* m_ptr = NULL;
        int n_same = 0;
@@ -1903,24 +1700,24 @@ void print_monster_list(int x, int y, int max_lines){
                if(!m_ptr->r_idx)continue;//dead?
                {
                        /*
-                       int r_idx = m_ptr->ap_r_idx;
+                       MONRACE_IDX r_idx = m_ptr->ap_r_idx;
                        monster_race* r_ptr = &r_info[r_idx];
                        cptr name = (r_name + r_ptr->name);
                        cptr ename = (r_name + r_ptr->name);
-                       //¥ß¥ß¥Ã¥¯Îà¤ä¡Ö¤½¤ì¡×Åù¤Ï¡¢°ìÍ÷¤Ë½Ð¤Æ¤Ï¤¤¤±¤Ê¤¤
+                       //ミミック類や「それ」等は、一覧に出てはいけない
                        if(r_ptr->flags1&RF1_CHAR_CLEAR)continue;
                        if((r_ptr->flags1&RF1_NEVER_MOVE)&&(r_ptr->flags2&RF2_CHAR_MULTI))continue;
-                       //¡Ø¥Ì¥ë¡Ù¤Ï¡¢°ìÍ÷¤Ë½Ð¤Æ¤Ï¤¤¤±¤Ê¤¤
-                       if((strcmp(name, "À¸¤±¤ëµõ̵¡Ø¥Ì¥ë¡Ù")==0)||
+                       //『ヌル』は、一覧に出てはいけない
+                       if((strcmp(name, "生ける虚無『ヌル』")==0)||
                           (strcmp(ename, "Null the Living Void")==0))continue;
-                       //"¶â̵¹¤¤Î»ØÎØ"¤Ï¡¢°ìÍ÷¤Ë½Ð¤Æ¤Ï¤¤¤±¤Ê¤¤
-                       if((strcmp(name, "¶â̵¹¤¤Î»ØÎØ")==0)||
+                       //"金無垢の指輪"は、一覧に出てはいけない
+                       if((strcmp(name, "金無垢の指輪")==0)||
                                (strcmp(ename, "Plain Gold Ring")==0))continue;
                        */
                }
 
-               //¥½¡¼¥ÈºÑ¤ß¤Ê¤Î¤ÇƱ¤¸¥â¥ó¥¹¥¿¡¼¤ÏϢ³¤¹¤ë¡¥¤³¤ì¤òÍøÍѤ·¤ÆƱ¤¸¥â¥ó¥¹¥¿¡¼¤ò¥«¥¦¥ó¥È¡¤¤Þ¤È¤á¤Æɽ¼¨¤¹¤ë¡¥
-               if(!last_mons){//ÀèƬ¥â¥ó¥¹¥¿¡¼
+               //ソート済みなので同じモンスターは連続する.これを利用して同じモンスターをカウント,まとめて表示する.
+               if(!last_mons){//å\85\88é ­ã\83¢ã\83³ã\82¹ã\82¿ã\83¼
                        last_mons = m_ptr;
                        n_same = 1;
                        continue;
@@ -1928,13 +1725,13 @@ void print_monster_list(int x, int y, int max_lines){
                //same race?
                if(last_mons->ap_r_idx == m_ptr->ap_r_idx){
                        n_same++;
-                       continue;//ɽ¼¨½èÍý¤ò¼¡¤Ë²ó¤¹
+                       continue;//表示処理を次に回す
                }
                //print last mons info
                print_monster_line(x, line++, last_mons, n_same);
                n_same = 1;
                last_mons = m_ptr;
-               if(line-y-1==max_lines){//»Ä¤ê1¹Ô
+               if(line-y-1==max_lines){//残り1行
                        break;
                }
        }
@@ -1945,8 +1742,10 @@ void print_monster_list(int x, int y, int max_lines){
                if(last_mons)print_monster_line(x, line++, last_mons, n_same);
        }
 }
-/*
- * Hack -- display monster list in sub-windows
+
+/*!
+ * @brief 出現中モンスターのリストをサブウィンドウに表示する / Hack -- display monster list in sub-windows
+ * @return なし
  */
 static void fix_monster_list(void)
 {
@@ -1970,10 +1769,8 @@ static void fix_monster_list(void)
 
                Term_clear();
 
-               target_set_prepare_look();//¥â¥ó¥¹¥¿¡¼°ìÍ÷¤òÀ¸À®¡¤¥½¡¼¥È
+               target_set_prepare_look();//モンスター一覧を生成,ソート
                print_monster_list(0, 0, h);
-
-               /* Fresh */
                Term_fresh();
 
                /* Restore */
@@ -1983,9 +1780,10 @@ static void fix_monster_list(void)
 
 
 
-
-/*
+/*!
+ * @brief 現在の装備品をサブウィンドウに表示する / 
  * Hack -- display equipment in sub-windows
+ * @return なし
  */
 static void fix_equip(void)
 {
@@ -2007,8 +1805,6 @@ static void fix_equip(void)
 
                /* Display equipment */
                display_equip();
-
-               /* Fresh */
                Term_fresh();
 
                /* Restore */
@@ -2017,8 +1813,10 @@ static void fix_equip(void)
 }
 
 
-/*
- * Hack -- display equipment in sub-windows
+/*!
+ * @brief 現在の習得済魔法をサブウィンドウに表示する / 
+ * Hack -- display spells in sub-windows
+ * @return なし
  */
 static void fix_spell(void)
 {
@@ -2040,8 +1838,6 @@ static void fix_spell(void)
 
                /* Display spell list */
                display_spell_list();
-
-               /* Fresh */
                Term_fresh();
 
                /* Restore */
@@ -2050,8 +1846,10 @@ static void fix_spell(void)
 }
 
 
-/*
+/*!
+ * @brief 現在のプレイヤーステータスをサブウィンドウに表示する / 
  * Hack -- display character in sub-windows
+ * @return なし
  */
 static void fix_player(void)
 {
@@ -2072,11 +1870,7 @@ static void fix_player(void)
                Term_activate(angband_term[j]);
 
                update_playtime();
-
-               /* Display player */
                display_player(0);
-
-               /* Fresh */
                Term_fresh();
 
                /* Restore */
@@ -2084,18 +1878,17 @@ static void fix_player(void)
        }
 }
 
-
-
-/*
+/*!
+ * @brief ゲームメッセージ履歴をサブウィンドウに表示する / 
  * Hack -- display recent messages in sub-windows
- *
- * XXX XXX XXX Adjust for width and split messages
+ * Adjust for width and split messages
+ * @return なし
  */
 static void fix_message(void)
 {
        int j, i;
-       int w, h;
-       int x, y;
+       TERM_LEN w, h;
+       TERM_LEN x, y;
 
        /* Scan windows */
        for (j = 0; j < 8; j++)
@@ -2111,7 +1904,6 @@ static void fix_message(void)
                /* Activate */
                Term_activate(angband_term[j]);
 
-               /* Get size */
                Term_get_size(&w, &h);
 
                /* Dump messages */
@@ -2126,8 +1918,6 @@ static void fix_message(void)
                        /* Clear to end of line */
                        Term_erase(x, y, 255);
                }
-
-               /* Fresh */
                Term_fresh();
 
                /* Restore */
@@ -2136,22 +1926,24 @@ static void fix_message(void)
 }
 
 
-/*
+/*!
+ * @brief 簡易マップをサブウィンドウに表示する / 
  * Hack -- display overhead view in sub-windows
- *
+ * Adjust for width and split messages
+ * @return なし
+ * @details
  * Note that the "player" symbol does NOT appear on the map.
  */
 static void fix_overhead(void)
 {
        int j;
-
        int cy, cx;
 
        /* Scan windows */
        for (j = 0; j < 8; j++)
        {
                term *old = Term;
-               int wid, hgt;
+               TERM_LEN wid, hgt;
 
                /* No window */
                if (!angband_term[j]) continue;
@@ -2166,10 +1958,8 @@ static void fix_overhead(void)
                Term_get_size(&wid, &hgt);
                if (wid > COL_MAP + 2 && hgt > ROW_MAP + 2)
                {
-                       /* Redraw map */
-                       display_map(&cy, &cx);
 
-                       /* Fresh */
+                       display_map(&cy, &cx);
                        Term_fresh();
                }
 
@@ -2179,8 +1969,10 @@ static void fix_overhead(void)
 }
 
 
-/*
+/*!
+ * @brief ダンジョンの地形をサブウィンドウに表示する / 
  * Hack -- display dungeon view in sub-windows
+ * @return なし
  */
 static void fix_dungeon(void)
 {
@@ -2202,8 +1994,6 @@ static void fix_dungeon(void)
 
                /* Redraw dungeon view */
                display_dungeon();
-
-               /* Fresh */
                Term_fresh();
 
                /* Restore */
@@ -2212,8 +2002,10 @@ static void fix_dungeon(void)
 }
 
 
-/*
- * Hack -- display monster recall in sub-windows
+/*!
+ * @brief モンスターの思い出をサブウィンドウに表示する / 
+ * Hack -- display dungeon view in sub-windows
+ * @return なし
  */
 static void fix_monster(void)
 {
@@ -2235,8 +2027,6 @@ static void fix_monster(void)
 
                /* Display monster race info */
                if (p_ptr->monster_race_idx) display_roff(p_ptr->monster_race_idx);
-
-               /* Fresh */
                Term_fresh();
 
                /* Restore */
@@ -2245,8 +2035,10 @@ static void fix_monster(void)
 }
 
 
-/*
+/*!
+ * @brief ベースアイテム情報をサブウィンドウに表示する / 
  * Hack -- display object recall in sub-windows
+ * @return なし
  */
 static void fix_object(void)
 {
@@ -2268,8 +2060,6 @@ static void fix_object(void)
 
                /* Display monster race info */
                if (p_ptr->object_kind_idx) display_koff(p_ptr->object_kind_idx);
-
-               /* Fresh */
                Term_fresh();
 
                /* Restore */
@@ -2278,21 +2068,24 @@ static void fix_object(void)
 }
 
 
-/*
+
+/*!
+ * @brief プレイヤーの現在学習可能な魔法数を計算し、増減に応じて魔法の忘却、再学習を処置する。 /
  * Calculate number of spells player should have, and forget,
  * or remember, spells until that number is properly reflected.
- *
+ * @return なし
+ * @details
  * Note that this function induces various "status" messages,
  * which must be bypasses until the character is created.
  */
 static void calc_spells(void)
 {
-       int                     i, j, k, levels;
-       int                     num_allowed;
-       int         num_boukyaku = 0;
+       int i, j, k, levels;
+       int num_allowed;
+       int num_boukyaku = 0;
 
        const magic_type        *s_ptr;
-       int which;
+       REALM_IDX which;
        int bonus = 0;
 
 
@@ -2419,13 +2212,10 @@ static void calc_spells(void)
                                which = p_ptr->realm2;
                        }
 
-                       /* Message */
 #ifdef JP
-                       msg_format("%s¤Î%s¤ò˺¤ì¤Æ¤·¤Þ¤Ã¤¿¡£",
-                                  do_spell(which, j%32, SPELL_NAME), p );
+                       msg_format("%sの%sを忘れてしまった。", do_spell(which, j%32, SPELL_NAME), p );
 #else
-                       msg_format("You have forgotten the %s of %s.", p,
-                       do_spell(which, j%32, SPELL_NAME));
+                       msg_format("You have forgotten the %s of %s.", p, do_spell(which, j%32, SPELL_NAME));
 #endif
 
 
@@ -2479,9 +2269,8 @@ static void calc_spells(void)
                                which = p_ptr->realm2;
                        }
 
-                       /* Message */
 #ifdef JP
-                       msg_format("%s¤Î%s¤ò˺¤ì¤Æ¤·¤Þ¤Ã¤¿¡£",
+                       msg_format("%sの%sを忘れてしまった。",
                                   do_spell(which, j%32, SPELL_NAME), p );
 #else
                        msg_format("You have forgotten the %s of %s.", p,
@@ -2555,13 +2344,10 @@ static void calc_spells(void)
                                which = p_ptr->realm2;
                        }
 
-                       /* Message */
 #ifdef JP
-                       msg_format("%s¤Î%s¤ò»×¤¤½Ð¤·¤¿¡£",
-                                  do_spell(which, j%32, SPELL_NAME), p );
+                       msg_format("%sの%sを思い出した。", do_spell(which, j%32, SPELL_NAME), p );
 #else
-                       msg_format("You have remembered the %s of %s.",
-                                  p, do_spell(which, j%32, SPELL_NAME));
+                       msg_format("You have remembered the %s of %s.", p, do_spell(which, j%32, SPELL_NAME));
 #endif
 
 
@@ -2593,7 +2379,11 @@ static void calc_spells(void)
                        k++;
                }
                if (k > 32) k = 32;
-               if ((p_ptr->new_spells > k) && ((mp_ptr->spell_book == TV_LIFE_BOOK) || (mp_ptr->spell_book == TV_HISSATSU_BOOK))) p_ptr->new_spells = k;
+               if ((p_ptr->new_spells > k) &&
+                       ((mp_ptr->spell_book == TV_LIFE_BOOK) || (mp_ptr->spell_book == TV_HISSATSU_BOOK)))
+               {
+                       p_ptr->new_spells = (s16b)k;
+               }
        }
 
        if (p_ptr->new_spells < 0) p_ptr->new_spells = 0;
@@ -2604,12 +2394,11 @@ static void calc_spells(void)
                /* Message if needed */
                if (p_ptr->new_spells)
                {
-                       /* Message */
 #ifdef JP
                        if( p_ptr->new_spells < 10 ){
-                               msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
+                               msg_format("あと %d つの%sを学べる。", p_ptr->new_spells, p);
                        }else{
-                               msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p);
+                               msg_format("あと %d 個の%sを学べる。", p_ptr->new_spells, p);
                        }
 #else
                        msg_format("You can learn %d more %s%s.",
@@ -2630,16 +2419,17 @@ static void calc_spells(void)
        }
 }
 
-
-/*
+/*!
+ * @brief プレイヤーの最大MPを計算する /
  * Calculate maximum mana.  You do not need to know any spells.
  * Note that mana is lowered by heavy (or inappropriate) armor.
- *
+ * @return なし
+ * @details
  * This function induces status messages.
  */
 static void calc_mana(void)
 {
-       int             msp, levels, cur_wgt, max_wgt;
+       int msp, levels, cur_wgt, max_wgt;
 
        object_type     *o_ptr;
 
@@ -2695,7 +2485,7 @@ static void calc_mana(void)
        /* Only mages are affected */
        if (mp_ptr->spell_xtra & MAGIC_GLOVE_REDUCE_MANA)
        {
-               u32b flgs[TR_FLAG_SIZE];
+               BIT_FLAGS flgs[TR_FLAG_SIZE];
 
                /* Assume player is not encumbered by gloves */
                p_ptr->cumber_glove = FALSE;
@@ -2889,11 +2679,10 @@ static void calc_mana(void)
                }
 
 #ifdef JP
-               /* ¥ì¥Ù¥ë¥¢¥Ã¥×¤Î»þ¤Ï¾å¾ºÎ̤òɽ¼¨¤¹¤ë */
+               /* レベルアップの時は上昇量を表示する */
                if ((level_up == 1) && (msp > p_ptr->msp))
                {
-                       msg_format("ºÇÂç¥Þ¥¸¥Ã¥¯¡¦¥Ý¥¤¥ó¥È¤¬ %d Áý²Ã¤·¤¿¡ª",
-                                  (msp - p_ptr->msp));
+                       msg_format("最大マジック・ポイントが %d 増加した!", (msp - p_ptr->msp));
                }
 #endif
                /* Save new mana */
@@ -2902,7 +2691,6 @@ static void calc_mana(void)
                /* Display mana later */
                p_ptr->redraw |= (PR_MANA);
 
-               /* Window stuff */
                p_ptr->window |= (PW_PLAYER);
                p_ptr->window |= (PW_SPELL);
        }
@@ -2914,24 +2702,13 @@ static void calc_mana(void)
        /* Take note when "glove state" changes */
        if (p_ptr->old_cumber_glove != p_ptr->cumber_glove)
        {
-               /* Message */
                if (p_ptr->cumber_glove)
                {
-#ifdef JP
-                       msg_print("¼ê¤¬Ê¤¤ï¤ì¤Æ¼öʸ¤¬¾§¤¨¤Ë¤¯¤¤´¶¤¸¤¬¤¹¤ë¡£");
-#else
-                       msg_print("Your covered hands feel unsuitable for spellcasting.");
-#endif
-
+                       msg_print(_("手が覆われて呪文が唱えにくい感じがする。", "Your covered hands feel unsuitable for spellcasting."));
                }
                else
                {
-#ifdef JP
-                       msg_print("¤³¤Î¼ê¤Î¾õÂ֤ʤ顢¤°¤Ã¤È¼öʸ¤¬¾§¤¨¤ä¤¹¤¤´¶¤¸¤À¡£");
-#else
-                       msg_print("Your hands feel more suitable for spellcasting.");
-#endif
-
+                       msg_print(_("この手の状態なら、ぐっと呪文が唱えやすい感じだ。", "Your hands feel more suitable for spellcasting."));
                }
 
                /* Save it */
@@ -2942,24 +2719,13 @@ static void calc_mana(void)
        /* Take note when "armor state" changes */
        if (p_ptr->old_cumber_armor != p_ptr->cumber_armor)
        {
-               /* Message */
                if (p_ptr->cumber_armor)
                {
-#ifdef JP
-                       msg_print("ÁõÈ÷¤Î½Å¤µ¤ÇÆ°¤­¤¬Æߤ¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤Æ¤¤¤ë¡£");
-#else
-                       msg_print("The weight of your equipment encumbers your movement.");
-#endif
-
+                       msg_print(_("装備の重さで動きが鈍くなってしまっている。", "The weight of your equipment encumbers your movement."));
                }
                else
                {
-#ifdef JP
-                       msg_print("¤°¤Ã¤È³Ú¤ËÂΤòÆ°¤«¤»¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
-#else
-                       msg_print("You feel able to move more freely.");
-#endif
-
+                       msg_print(_("ぐっと楽に体を動かせるようになった。", "You feel able to move more freely."));
                }
 
                /* Save it */
@@ -2969,9 +2735,12 @@ static void calc_mana(void)
 
 
 
-/*
+/*!
+ * @brief プレイヤーの最大HPを計算する /
  * Calculate the players (maximal) hit points
  * Adjust current hitpoints if necessary
+ * @return なし
+ * @details
  */
 static void calc_hitpoints(void)
 {
@@ -3032,11 +2801,10 @@ static void calc_hitpoints(void)
                }
 
 #ifdef JP
-               /* ¥ì¥Ù¥ë¥¢¥Ã¥×¤Î»þ¤Ï¾å¾ºÎ̤òɽ¼¨¤¹¤ë */
+               /* レベルアップの時は上昇量を表示する */
                if ((level_up == 1) && (mhp > p_ptr->mhp))
                {
-                       msg_format("ºÇÂç¥Ò¥Ã¥È¡¦¥Ý¥¤¥ó¥È¤¬ %d Áý²Ã¤·¤¿¡ª",
-                                  (mhp - p_ptr->mhp) );
+                       msg_format("最大ヒット・ポイントが %d 増加した!", (mhp - p_ptr->mhp) );
                }
 #endif
                /* Save the new max-hitpoints */
@@ -3045,24 +2813,21 @@ static void calc_hitpoints(void)
                /* Display hitpoints (later) */
                p_ptr->redraw |= (PR_HP);
 
-               /* Window stuff */
                p_ptr->window |= (PW_PLAYER);
        }
 }
 
-
-
-/*
- * Extract and set the current "lite radius"
- *
+/*!
+ * @brief プレイヤーの光源半径を計算する / Extract and set the current "lite radius"
+ * @return なし
+ * @details
  * SWD: Experimental modification: multiple light sources have additive effect.
- *
  */
 static void calc_torch(void)
 {
        int i, rad;
        object_type *o_ptr;
-       u32b flgs[TR_FLAG_SIZE];
+       BIT_FLAGS flgs[TR_FLAG_SIZE];
 
        /* Assume no light */
        p_ptr->cur_lite = 0;
@@ -3098,7 +2863,7 @@ static void calc_torch(void)
                if (have_flag(flgs, TR_LITE_M1)) rad -= 1;
                if (have_flag(flgs, TR_LITE_M2)) rad -= 2;
                if (have_flag(flgs, TR_LITE_M3)) rad -= 3;
-               p_ptr->cur_lite += rad;
+               p_ptr->cur_lite += (s16b)rad;
        }
 
        /* max radius is 14 (was 5) without rewriting other code -- */
@@ -3120,7 +2885,6 @@ static void calc_torch(void)
        /* Notice changes in the "lite radius" */
        if (p_ptr->old_lite != p_ptr->cur_lite)
        {
-               /* Update stuff */
                /* Hack -- PU_MON_LITE for monsters' darkness */
                p_ptr->update |= (PU_LITE | PU_MON_LITE | PU_MONSTERS);
 
@@ -3133,28 +2897,38 @@ static void calc_torch(void)
 }
 
 
-
-/*
+/*!
+ * @brief プレイヤーの所持重量制限を計算する /
  * Computes current weight limit.
+ * @return 制限重量(ポンド)
  */
-u32b weight_limit(void)
+WEIGHT weight_limit(void)
 {
-       u32b i;
+       WEIGHT i;
 
        /* Weight limit based only on strength */
-       i = (u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]] * 50; /* Constant was 100 */
+       i = (WEIGHT)adj_str_wgt[p_ptr->stat_ind[A_STR]] * 50; /* Constant was 100 */
        if (p_ptr->pclass == CLASS_BERSERKER) i = i * 3 / 2;
 
        /* Return the result */
        return i;
 }
 
-
+/*!
+ * @brief プレイヤーが現在右手/左手に武器を持っているか判定する /
+ * @param i 判定する手のID(右手:0 左手:1)
+ * @return 持っているならばTRUE
+ */
 bool buki_motteruka(int i)
 {
        return ((inventory[i].k_idx && object_is_melee_weapon(&inventory[i])) ? TRUE : FALSE);
 }
 
+/*!
+ * @brief 射撃武器がプレイヤーにとって重すぎるかどうかの判定 /
+ * @param o_ptr 判定する射撃武器のアイテム情報参照ポインタ
+ * @return 重すぎるならばTRUE
+ */
 bool is_heavy_shoot(object_type *o_ptr)
 {
        int hold = adj_str_hold[p_ptr->stat_ind[A_STR]];
@@ -3162,6 +2936,11 @@ bool is_heavy_shoot(object_type *o_ptr)
        return (hold < o_ptr->weight / 10);
 }
 
+/*!
+ * @brief 射撃武器に対応する矢/弾薬のベースアイテムIDを返す /
+ * @param o_ptr 判定する射撃武器のアイテム情報参照ポインタ
+ * @return 対応する矢/弾薬のベースアイテムID
+ */
 int bow_tval_ammo(object_type *o_ptr)
 {
        /* Analyze the launcher */
@@ -3185,6 +2964,7 @@ int bow_tval_ammo(object_type *o_ptr)
                        return TV_BOLT;
                }
                case SV_CRIMSON:
+               case SV_HARP:
                {
                        return TV_NO_AMMO;
                }
@@ -3193,15 +2973,20 @@ int bow_tval_ammo(object_type *o_ptr)
        return 0;
 }
 
-/* calcurate the fire rate of target object */
+/*!
+ * @brief 装備中の射撃武器の威力倍率を返す /
+ * calcurate the fire rate of target object
+ * @param o_ptr 計算する射撃武器のアイテム情報参照ポインタ
+ * @return 射撃倍率の値(100で1.00倍)
+ */
 s16b calc_num_fire(object_type *o_ptr)
 {
        int extra_shots = 0;
        int i;
        int num = 0;
-       int tval_ammo = bow_tval_ammo(o_ptr);
+       OBJECT_TYPE_VALUE tval_ammo = bow_tval_ammo(o_ptr);
        object_type *q_ptr;
-       u32b flgs[TR_FLAG_SIZE];
+       BIT_FLAGS flgs[TR_FLAG_SIZE];
        
        /* Scan the usable inventory */
        for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
@@ -3267,14 +3052,17 @@ s16b calc_num_fire(object_type *o_ptr)
                        num += (p_ptr->lev * 4);
                }
        }
-       return num;
+       return (s16b)num;
 }
 
-/*
+/*!
+ * @brief プレイヤーの全ステータスを更新する / 
  * Calculate the players current "state", taking into account
  * not only race/class intrinsics, but also objects being worn
  * and temporary spell effects.
- *
+ * @return なし
+ * @details
+ * <pre>
  * See also calc_mana() and calc_hitpoints().
  *
  * Take note of the new "speed code", in particular, a very strong
@@ -3289,6 +3077,7 @@ s16b calc_num_fire(object_type *o_ptr)
  * are actually added in later, at the appropriate place.
  *
  * This function induces various "status" messages.
+ * </pre>
  */
 void calc_bonuses(void)
 {
@@ -3298,7 +3087,7 @@ void calc_bonuses(void)
        int             empty_hands_status = empty_hands(TRUE);
        int             extra_blows[2];
        object_type     *o_ptr;
-       u32b flgs[TR_FLAG_SIZE];
+       BIT_FLAGS flgs[TR_FLAG_SIZE];
        bool            omoi = FALSE;
        bool            yoiyami = FALSE;
        bool            down_saving = FALSE;
@@ -3308,7 +3097,7 @@ void calc_bonuses(void)
        bool            have_sw = FALSE, have_kabe = FALSE;
        bool            easy_2weapon = FALSE;
        bool            riding_levitation = FALSE;
-       s16b this_o_idx, next_o_idx = 0;
+       OBJECT_IDX this_o_idx, next_o_idx = 0;
        const player_race *tmp_rp_ptr;
 
        /* Save the old vision stuff */
@@ -3329,15 +3118,15 @@ void calc_bonuses(void)
        bool old_mighty_throw = p_ptr->mighty_throw;
 
        /* Save the old armor class */
-       bool old_dis_ac = p_ptr->dis_ac;
-       bool old_dis_to_a = p_ptr->dis_to_a;
+       s16b old_dis_ac = p_ptr->dis_ac;
+       s16b old_dis_to_a = p_ptr->dis_to_a;
 
 
        /* Clear extra blows/shots */
        extra_blows[0] = extra_blows[1] = 0;
 
        /* Clear the stat modifiers */
-       for (i = 0; i < 6; i++) p_ptr->stat_add[i] = 0;
+       for (i = 0; i < A_MAX; i++) p_ptr->stat_add[i] = 0;
 
 
        /* Clear the Displayed/Real armor class */
@@ -3392,7 +3181,7 @@ void calc_bonuses(void)
        p_ptr->regenerate = FALSE;
        p_ptr->can_swim = FALSE;
        p_ptr->levitation = FALSE;
-       p_ptr->hold_life = FALSE;
+       p_ptr->hold_exp = FALSE;
        p_ptr->telepathy = FALSE;
        p_ptr->esp_animal = FALSE;
        p_ptr->esp_undead = FALSE;
@@ -3654,7 +3443,7 @@ void calc_bonuses(void)
                switch (p_ptr->mimic_form)
                {
                case MIMIC_DEMON:
-                       p_ptr->hold_life = TRUE;
+                       p_ptr->hold_exp = TRUE;
                        p_ptr->resist_chaos = TRUE;
                        p_ptr->resist_neth = TRUE;
                        p_ptr->resist_fire = TRUE;
@@ -3667,7 +3456,7 @@ void calc_bonuses(void)
                        p_ptr->align -= 200;
                        break;
                case MIMIC_DEMON_LORD:
-                       p_ptr->hold_life = TRUE;
+                       p_ptr->hold_exp = TRUE;
                        p_ptr->resist_chaos = TRUE;
                        p_ptr->resist_neth = TRUE;
                        p_ptr->immune_fire = TRUE;
@@ -3692,7 +3481,7 @@ void calc_bonuses(void)
                        break;
                case MIMIC_VAMPIRE:
                        p_ptr->resist_dark = TRUE;
-                       p_ptr->hold_life = TRUE;
+                       p_ptr->hold_exp = TRUE;
                        p_ptr->resist_neth = TRUE;
                        p_ptr->resist_cold = TRUE;
                        p_ptr->resist_pois = TRUE;
@@ -3712,7 +3501,7 @@ void calc_bonuses(void)
                        p_ptr->resist_lite = TRUE;
                        break;
                case RACE_HOBBIT:
-                       p_ptr->hold_life = TRUE;
+                       p_ptr->hold_exp = TRUE;
                        break;
                case RACE_GNOME:
                        p_ptr->free_act = TRUE;
@@ -3812,18 +3601,18 @@ void calc_bonuses(void)
                        p_ptr->free_act = TRUE;
                        p_ptr->see_inv = TRUE;
                        p_ptr->resist_pois = TRUE;
-                       if (p_ptr->lev > 34) p_ptr->hold_life = TRUE;
+                       if (p_ptr->lev > 34) p_ptr->hold_exp = TRUE;
                        break;
                case RACE_SKELETON:
                        p_ptr->resist_shard = TRUE;
-                       p_ptr->hold_life = TRUE;
+                       p_ptr->hold_exp = TRUE;
                        p_ptr->see_inv = TRUE;
                        p_ptr->resist_pois = TRUE;
                        if (p_ptr->lev > 9) p_ptr->resist_cold = TRUE;
                        break;
                case RACE_ZOMBIE:
                        p_ptr->resist_neth = TRUE;
-                       p_ptr->hold_life = TRUE;
+                       p_ptr->hold_exp = TRUE;
                        p_ptr->see_inv = TRUE;
                        p_ptr->resist_pois = TRUE;
                        p_ptr->slow_digest = TRUE;
@@ -3831,7 +3620,7 @@ void calc_bonuses(void)
                        break;
                case RACE_VAMPIRE:
                        p_ptr->resist_dark = TRUE;
-                       p_ptr->hold_life = TRUE;
+                       p_ptr->hold_exp = TRUE;
                        p_ptr->resist_neth = TRUE;
                        p_ptr->resist_cold = TRUE;
                        p_ptr->resist_pois = TRUE;
@@ -3841,7 +3630,7 @@ void calc_bonuses(void)
                        p_ptr->levitation = TRUE;
                        p_ptr->free_act = TRUE;
                        p_ptr->resist_neth = TRUE;
-                       p_ptr->hold_life = TRUE;
+                       p_ptr->hold_exp = TRUE;
                        p_ptr->see_inv = TRUE;
                        p_ptr->resist_pois = TRUE;
                        p_ptr->slow_digest = TRUE;
@@ -3885,7 +3674,7 @@ void calc_bonuses(void)
                case RACE_DEMON:
                        p_ptr->resist_fire  = TRUE;
                        p_ptr->resist_neth  = TRUE;
-                       p_ptr->hold_life = TRUE;
+                       p_ptr->hold_exp = TRUE;
                        if (p_ptr->lev > 9) p_ptr->see_inv = TRUE;
                        if (p_ptr->lev > 44)
                        {
@@ -3907,7 +3696,7 @@ void calc_bonuses(void)
                        p_ptr->slow_digest = TRUE;
                        p_ptr->free_act = TRUE;
                        p_ptr->resist_pois = TRUE;
-                       p_ptr->hold_life = TRUE;
+                       p_ptr->hold_exp = TRUE;
                        break;
                default:
                        /* Do nothing */
@@ -3922,7 +3711,7 @@ void calc_bonuses(void)
                p_ptr->slow_digest = TRUE;
                p_ptr->regenerate = TRUE;
                p_ptr->levitation = TRUE;
-               p_ptr->hold_life = TRUE;
+               p_ptr->hold_exp = TRUE;
                p_ptr->telepathy = TRUE;
                p_ptr->lite = TRUE;
                p_ptr->sustain_str = TRUE;
@@ -3987,7 +3776,7 @@ void calc_bonuses(void)
        {
                p_ptr->resist_blind = TRUE;
                p_ptr->resist_conf  = TRUE;
-               p_ptr->hold_life = TRUE;
+               p_ptr->hold_exp = TRUE;
                if (p_ptr->pclass != CLASS_NINJA) p_ptr->lite = TRUE;
 
                if ((p_ptr->prace != RACE_KLACKON) && (p_ptr->prace != RACE_SPRITE))
@@ -4002,7 +3791,7 @@ void calc_bonuses(void)
 
        /* Hack -- apply racial/class stat maxes */
        /* Apply the racial modifiers */
-       for (i = 0; i < 6; i++)
+       for (i = 0; i < A_MAX; i++)
        {
                /* Modify the stats for "race" */
                p_ptr->stat_add[i] += (tmp_rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i]);
@@ -4277,7 +4066,7 @@ void calc_bonuses(void)
                if (have_flag(flgs, TR_SEE_INVIS))   p_ptr->see_inv = TRUE;
                if (have_flag(flgs, TR_LEVITATION))     p_ptr->levitation = TRUE;
                if (have_flag(flgs, TR_FREE_ACT))    p_ptr->free_act = TRUE;
-               if (have_flag(flgs, TR_HOLD_LIFE))   p_ptr->hold_life = TRUE;
+               if (have_flag(flgs, TR_HOLD_EXP))   p_ptr->hold_exp = TRUE;
                if (have_flag(flgs, TR_WARNING)){
                        if (!o_ptr->inscription || !(my_strchr(quark_str(o_ptr->inscription),'$')))
                          p_ptr->warning = TRUE;
@@ -4441,25 +4230,25 @@ void calc_bonuses(void)
                /* To Bow and Natural attack */
 
                /* Apply the bonuses to hit/damage */
-               p_ptr->to_h_b += bonus_to_h;
-               p_ptr->to_h_m += bonus_to_h;
-               p_ptr->to_d_m += bonus_to_d;
+               p_ptr->to_h_b += (s16b)bonus_to_h;
+               p_ptr->to_h_m += (s16b)bonus_to_h;
+               p_ptr->to_d_m += (s16b)bonus_to_d;
 
                /* Apply the mental bonuses tp hit/damage, if known */
-               if (object_is_known(o_ptr)) p_ptr->dis_to_h_b += bonus_to_h;
+               if (object_is_known(o_ptr)) p_ptr->dis_to_h_b += (s16b)bonus_to_h;
 
                /* To Melee */
                if ((i == INVEN_LEFT || i == INVEN_RIGHT) && !p_ptr->ryoute)
                {
                        /* Apply the bonuses to hit/damage */
-                       p_ptr->to_h[i-INVEN_RIGHT] += bonus_to_h;
-                       p_ptr->to_d[i-INVEN_RIGHT] += bonus_to_d;
+                       p_ptr->to_h[i-INVEN_RIGHT] += (s16b)bonus_to_h;
+                       p_ptr->to_d[i-INVEN_RIGHT] += (s16b)bonus_to_d;
 
                        /* Apply the mental bonuses tp hit/damage, if known */
                        if (object_is_known(o_ptr))
                        {
-                               p_ptr->dis_to_h[i-INVEN_RIGHT] += bonus_to_h;
-                               p_ptr->dis_to_d[i-INVEN_RIGHT] += bonus_to_d;
+                               p_ptr->dis_to_h[i-INVEN_RIGHT] += (s16b)bonus_to_h;
+                               p_ptr->dis_to_d[i-INVEN_RIGHT] += (s16b)bonus_to_d;
                        }
                }
                else if (p_ptr->migite && p_ptr->hidarite)
@@ -4482,14 +4271,14 @@ void calc_bonuses(void)
                else
                {
                        /* Apply the bonuses to hit/damage */
-                       p_ptr->to_h[default_hand] += bonus_to_h;
-                       p_ptr->to_d[default_hand] += bonus_to_d;
+                       p_ptr->to_h[default_hand] += (s16b)bonus_to_h;
+                       p_ptr->to_d[default_hand] += (s16b)bonus_to_d;
 
                        /* Apply the mental bonuses to hit/damage, if known */
                        if (object_is_known(o_ptr))
                        {
-                               p_ptr->dis_to_h[default_hand] += bonus_to_h;
-                               p_ptr->dis_to_d[default_hand] += bonus_to_d;
+                               p_ptr->dis_to_h[default_hand] += (s16b)bonus_to_h;
+                               p_ptr->dis_to_d[default_hand] += (s16b)bonus_to_d;
                        }
                }
        }
@@ -4563,7 +4352,7 @@ void calc_bonuses(void)
 
        if (p_ptr->special_defense & KATA_KOUKIJIN)
        {
-               for (i = 0; i < 6; i++)
+               for (i = 0; i < A_MAX; i++)
                        p_ptr->stat_add[i] += 5;
                p_ptr->to_a -= 50;
                p_ptr->dis_to_a -= 50;
@@ -4582,7 +4371,7 @@ void calc_bonuses(void)
        /* Hex bonuses */
        if (p_ptr->realm1 == REALM_HEX)
        {
-               if (hex_spelling_any()) p_ptr->skill_stl -= (1 + p_ptr->magic_num2[0]);
+               if (hex_spelling_any()) p_ptr->skill_stl -= (1 + CASTING_HEX_NUM(p_ptr));
                if (hex_spelling(HEX_DETECT_EVIL)) p_ptr->esp_evil = TRUE;
                if (hex_spelling(HEX_XTRA_MIGHT)) p_ptr->stat_add[A_STR] += 4;
                if (hex_spelling(HEX_BUILDING))
@@ -4609,7 +4398,7 @@ void calc_bonuses(void)
                }
                for (i = INVEN_RARM; i <= INVEN_FEET; i++)
                {
-                       int ac = 0;
+                       ARMOUR_CLASS ac = 0;
                        o_ptr = &inventory[i];
                        if (!o_ptr->k_idx) continue;
                        if (!object_is_armour(o_ptr)) continue;
@@ -4617,13 +4406,13 @@ void calc_bonuses(void)
                        ac += 5;
                        if (o_ptr->curse_flags & TRC_HEAVY_CURSE) ac += 7;
                        if (o_ptr->curse_flags & TRC_PERMA_CURSE) ac += 13;
-                       p_ptr->to_a += ac;
-                       p_ptr->dis_to_a += ac;
+                       p_ptr->to_a += (s16b)ac;
+                       p_ptr->dis_to_a += (s16b)ac;
                }
        }
 
        /* Calculate stats */
-       for (i = 0; i < 6; i++)
+       for (i = 0; i < A_MAX; i++)
        {
                int top, use, ind;
 
@@ -4634,12 +4423,11 @@ void calc_bonuses(void)
                if (p_ptr->stat_top[i] != top)
                {
                        /* Save the new value */
-                       p_ptr->stat_top[i] = top;
+                       p_ptr->stat_top[i] = (s16b)top;
 
                        /* Redisplay the stats later */
                        p_ptr->redraw |= (PR_STATS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_PLAYER);
                }
 
@@ -4660,12 +4448,11 @@ void calc_bonuses(void)
                if (p_ptr->stat_use[i] != use)
                {
                        /* Save the new value */
-                       p_ptr->stat_use[i] = use;
+                       p_ptr->stat_use[i] = (s16b)use;
 
                        /* Redisplay the stats later */
                        p_ptr->redraw |= (PR_STATS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_PLAYER);
                }
 
@@ -4683,7 +4470,7 @@ void calc_bonuses(void)
                if (p_ptr->stat_ind[i] != ind)
                {
                        /* Save the new index */
-                       p_ptr->stat_ind[i] = ind;
+                       p_ptr->stat_ind[i] = (s16b)ind;
 
                        /* Change in CON affects Hitpoints */
                        if (i == A_CON)
@@ -4718,7 +4505,6 @@ void calc_bonuses(void)
                                }
                        }
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_PLAYER);
                }
        }
@@ -4975,10 +4761,10 @@ void calc_bonuses(void)
                }
                if (inventory[INVEN_RARM].tval == TV_POLEARM) penalty1 += 10;
                if (inventory[INVEN_LARM].tval == TV_POLEARM) penalty2 += 10;
-               p_ptr->to_h[0] -= penalty1;
-               p_ptr->to_h[1] -= penalty2;
-               p_ptr->dis_to_h[0] -= penalty1;
-               p_ptr->dis_to_h[1] -= penalty2;
+               p_ptr->to_h[0] -= (s16b)penalty1;
+               p_ptr->to_h[1] -= (s16b)penalty2;
+               p_ptr->dis_to_h[0] -= (s16b)penalty1;
+               p_ptr->dis_to_h[1] -= (s16b)penalty2;
        }
 
        /* Extract the current weight (in tenth pounds) */
@@ -4993,7 +4779,7 @@ void calc_bonuses(void)
        {
                monster_type *riding_m_ptr = &m_list[p_ptr->riding];
                monster_race *riding_r_ptr = &r_info[riding_m_ptr->r_idx];
-               int speed = riding_m_ptr->mspeed;
+               SPEED speed = riding_m_ptr->mspeed;
 
                if (riding_m_ptr->mspeed > 110)
                {
@@ -5019,7 +4805,7 @@ void calc_bonuses(void)
                i = 1500 + riding_r_ptr->level * 25;
        }
 
-       /* XXX XXX XXX Apply "encumbrance" from weight */
+       /* Apply "encumbrance" from weight */
        if (j > i) new_speed -= ((j - i) / (i / 5));
 
        /* Searching slows the player down */
@@ -5070,7 +4856,7 @@ void calc_bonuses(void)
        /* Compute "extra shots" if needed */
        if (o_ptr->k_idx)
        {
-               p_ptr->tval_ammo = bow_tval_ammo(o_ptr);
+               p_ptr->tval_ammo = (byte_hack)bow_tval_ammo(o_ptr);
 
                /* Apply special flags */
                if (o_ptr->k_idx && !p_ptr->heavy_shoot)
@@ -5088,8 +4874,7 @@ void calc_bonuses(void)
                }
        }
 
-       if (p_ptr->ryoute)
-               hold *= 2;
+       if (p_ptr->ryoute) hold *= 2;
 
        for(i = 0 ; i < 2 ; i++)
        {
@@ -5103,7 +4888,11 @@ void calc_bonuses(void)
                p_ptr->icky_wield[i] = FALSE;
                p_ptr->riding_wield[i] = FALSE;
 
-               if (!buki_motteruka(INVEN_RARM+i)) {p_ptr->num_blow[i]=1;continue;}
+               if (!buki_motteruka(INVEN_RARM+i))
+               {
+                       p_ptr->num_blow[i] = 1;
+                       continue;
+               }
                /* It is hard to hold a heavy weapon */
                if (hold < o_ptr->weight / 10)
                {
@@ -5248,10 +5037,10 @@ void calc_bonuses(void)
                        p_ptr->num_blow[i] = blows_table[str_index][dex_index];
 
                        /* Maximal value */
-                       if (p_ptr->num_blow[i] > num) p_ptr->num_blow[i] = num;
+                       if (p_ptr->num_blow[i] > num) p_ptr->num_blow[i] = (s16b)num;
 
                        /* Add in the "bonus blows" */
-                       p_ptr->num_blow[i] += extra_blows[i];
+                       p_ptr->num_blow[i] += (s16b)extra_blows[i];
 
 
                        if (p_ptr->pclass == CLASS_WARRIOR) p_ptr->num_blow[i] += (p_ptr->lev / 40);
@@ -5367,8 +5156,8 @@ void calc_bonuses(void)
                                        penalty += 30;
                                        if (penalty < 30) penalty = 30;
                                }
-                               p_ptr->to_h[i] -= penalty;
-                               p_ptr->dis_to_h[i] -= penalty;
+                               p_ptr->to_h[i] -= (s16b)penalty;
+                               p_ptr->dis_to_h[i] -= (s16b)penalty;
 
                                /* Riding weapon */
                                p_ptr->riding_wield[i] = TRUE;
@@ -5407,8 +5196,8 @@ void calc_bonuses(void)
                        if (penalty < 30) penalty = 30;
                }
                if (p_ptr->tval_ammo == TV_BOLT) penalty *= 2;
-               p_ptr->to_h_b -= penalty;
-               p_ptr->dis_to_h_b -= penalty;
+               p_ptr->to_h_b -= (s16b)penalty;
+               p_ptr->dis_to_h_b -= (s16b)penalty;
        }
 
        /* Different calculation for monks with empty hands */
@@ -5424,10 +5213,10 @@ void calc_bonuses(void)
                        if (blow_base > 31) p_ptr->num_blow[0]++;
                        if (blow_base > 44) p_ptr->num_blow[0]++;
                        if (blow_base > 58) p_ptr->num_blow[0]++;
-                       if (p_ptr->magic_num1[0])
+                       if (P_PTR_KI)
                        {
-                               p_ptr->to_d[0] += (p_ptr->magic_num1[0]/5);
-                               p_ptr->dis_to_d[0] += (p_ptr->magic_num1[0]/5);
+                               p_ptr->to_d[0] += P_PTR_KI / 5;
+                               p_ptr->dis_to_d[0] += P_PTR_KI / 5;
                        }
                }
                else
@@ -5508,8 +5297,8 @@ void calc_bonuses(void)
        {
                if (buki_motteruka(INVEN_RARM+i))
                {
-                       int tval = inventory[INVEN_RARM+i].tval - TV_WEAPON_BEGIN;
-                       int sval = inventory[INVEN_RARM+i].sval;
+                       OBJECT_TYPE_VALUE tval = inventory[INVEN_RARM+i].tval - TV_WEAPON_BEGIN;
+                       OBJECT_SUBTYPE_VALUE sval = inventory[INVEN_RARM+i].sval;
 
                        p_ptr->to_h[i] += (p_ptr->weapon_exp[tval][sval] - WEAPON_EXP_BEGINNER) / 200;
                        p_ptr->dis_to_h[i] += (p_ptr->weapon_exp[tval][sval] - WEAPON_EXP_BEGINNER) / 200;
@@ -5566,14 +5355,10 @@ void calc_bonuses(void)
        /* Redraw armor (if needed) */
        if ((p_ptr->dis_ac != old_dis_ac) || (p_ptr->dis_to_a != old_dis_to_a))
        {
-               /* Redraw */
                p_ptr->redraw |= (PR_ARMOR);
-
-               /* Window stuff */
                p_ptr->window |= (PW_PLAYER);
        }
 
-
        if (p_ptr->ryoute && !omoi)
        {
                int bonus_to_h=0, bonus_to_d=0;
@@ -5705,33 +5490,17 @@ void calc_bonuses(void)
        /* Take note when "heavy bow" changes */
        if (p_ptr->old_heavy_shoot != p_ptr->heavy_shoot)
        {
-               /* Message */
                if (p_ptr->heavy_shoot)
                {
-#ifdef JP
-                       msg_print("¤³¤ó¤Ê½Å¤¤µÝ¤òÁõÈ÷¤·¤Æ¤¤¤ë¤Î¤ÏÂçÊѤÀ¡£");
-#else
-                       msg_print("You have trouble wielding such a heavy bow.");
-#endif
-
+                       msg_print(_("こんな重い弓を装備しているのは大変だ。", "You have trouble wielding such a heavy bow."));
                }
                else if (inventory[INVEN_BOW].k_idx)
                {
-#ifdef JP
-                       msg_print("¤³¤ÎµÝ¤Ê¤éÁõÈ÷¤·¤Æ¤¤¤Æ¤â¿É¤¯¤Ê¤¤¡£");
-#else
-                       msg_print("You have no trouble wielding your bow.");
-#endif
-
+                       msg_print(_("この弓なら装備していても辛くない。", "You have no trouble wielding your bow."));
                }
                else
                {
-#ifdef JP
-                       msg_print("½Å¤¤µÝ¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤ÆÂΤ¬³Ú¤Ë¤Ê¤Ã¤¿¡£");
-#else
-                       msg_print("You feel relieved to put down your heavy bow.");
-#endif
-
+                       msg_print(_("重い弓を装備からはずして体が楽になった。", "You feel relieved to put down your heavy bow."));
                }
 
                /* Save it */
@@ -5743,42 +5512,21 @@ void calc_bonuses(void)
                /* Take note when "heavy weapon" changes */
                if (p_ptr->old_heavy_wield[i] != p_ptr->heavy_wield[i])
                {
-                       /* Message */
                        if (p_ptr->heavy_wield[i])
                        {
-#ifdef JP
-                               msg_print("¤³¤ó¤Ê½Å¤¤Éð´ï¤òÁõÈ÷¤·¤Æ¤¤¤ë¤Î¤ÏÂçÊѤÀ¡£");
-#else
-                               msg_print("You have trouble wielding such a heavy weapon.");
-#endif
-
+                               msg_print(_("こんな重い武器を装備しているのは大変だ。", "You have trouble wielding such a heavy weapon."));
                        }
                        else if (buki_motteruka(INVEN_RARM+i))
                        {
-#ifdef JP
-                               msg_print("¤³¤ì¤Ê¤éÁõÈ÷¤·¤Æ¤¤¤Æ¤â¿É¤¯¤Ê¤¤¡£");
-#else
-                               msg_print("You have no trouble wielding your weapon.");
-#endif
-
+                               msg_print(_("これなら装備していても辛くない。", "You have no trouble wielding your weapon."));
                        }
                        else if (p_ptr->heavy_wield[1-i])
                        {
-#ifdef JP
-                               msg_print("¤Þ¤ÀÉð´ï¤¬½Å¤¤¡£");
-#else
-                               msg_print("You have still trouble wielding a heavy weapon.");
-#endif
-
+                               msg_print(_("まだ武器が重い。", "You have still trouble wielding a heavy weapon."));
                        }
                        else
                        {
-#ifdef JP
-                               msg_print("½Å¤¤Éð´ï¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤ÆÂΤ¬³Ú¤Ë¤Ê¤Ã¤¿¡£");
-#else
-                               msg_print("You feel relieved to put down your heavy weapon.");
-#endif
-
+                               msg_print(_("重い武器を装備からはずして体が楽になった。", "You feel relieved to put down your heavy weapon."));
                        }
 
                        /* Save it */
@@ -5788,33 +5536,17 @@ void calc_bonuses(void)
                /* Take note when "heavy weapon" changes */
                if (p_ptr->old_riding_wield[i] != p_ptr->riding_wield[i])
                {
-                       /* Message */
                        if (p_ptr->riding_wield[i])
                        {
-#ifdef JP
-                               msg_print("¤³¤ÎÉð´ï¤Ï¾èÇÏÃæ¤Ë»È¤¦¤Ë¤Ï¤à¤«¤Ê¤¤¤è¤¦¤À¡£");
-#else
-                               msg_print("This weapon is not suitable for use while riding.");
-#endif
-
+                               msg_print(_("この武器は乗馬中に使うにはむかないようだ。", "This weapon is not suitable for use while riding."));
                        }
                        else if (!p_ptr->riding)
                        {
-#ifdef JP
-                               msg_print("¤³¤ÎÉð´ï¤ÏÅÌÊâ¤Ç»È¤¤¤ä¤¹¤¤¡£");
-#else
-                               msg_print("This weapon was not suitable for use while riding.");
-#endif
-
+                               msg_print(_("この武器は徒歩で使いやすい。", "This weapon was not suitable for use while riding."));
                        }
                        else if (buki_motteruka(INVEN_RARM+i))
                        {
-#ifdef JP
-                               msg_print("¤³¤ì¤Ê¤é¾èÇÏÃæ¤Ë¤Ô¤Ã¤¿¤ê¤À¡£");
-#else
-                               msg_print("This weapon is suitable for use while riding.");
-#endif
-
+                               msg_print(_("これなら乗馬中にぴったりだ。", "This weapon is suitable for use while riding."));
                        }
                        /* Save it */
                        p_ptr->old_riding_wield[i] = p_ptr->riding_wield[i];
@@ -5823,36 +5555,21 @@ void calc_bonuses(void)
                /* Take note when "illegal weapon" changes */
                if (p_ptr->old_icky_wield[i] != p_ptr->icky_wield[i])
                {
-                       /* Message */
                        if (p_ptr->icky_wield[i])
                        {
-#ifdef JP
-                               msg_print("º£¤ÎÁõÈ÷¤Ï¤É¤¦¤â¼«Ê¬¤Ë¤Õ¤µ¤ï¤·¤¯¤Ê¤¤µ¤¤¬¤¹¤ë¡£");
-#else
-                               msg_print("You do not feel comfortable with your weapon.");
-#endif
-                               if (hack_mind)
+                               msg_print(_("今の装備はどうも自分にふさわしくない気がする。", "You do not feel comfortable with your weapon."));
+                               if (is_loading_now)
                                {
                                        chg_virtue(V_FAITH, -1);
                                }
                        }
                        else if (buki_motteruka(INVEN_RARM+i))
                        {
-#ifdef JP
-                               msg_print("º£¤ÎÁõÈ÷¤Ï¼«Ê¬¤Ë¤Õ¤µ¤ï¤·¤¤µ¤¤¬¤¹¤ë¡£");
-#else
-                               msg_print("You feel comfortable with your weapon.");
-#endif
-
+                               msg_print(_("今の装備は自分にふさわしい気がする。", "You feel comfortable with your weapon."));
                        }
                        else
                        {
-#ifdef JP
-                               msg_print("ÁõÈ÷¤ò¤Ï¤º¤·¤¿¤é¿ïʬ¤Èµ¤¤¬³Ú¤Ë¤Ê¤Ã¤¿¡£");
-#else
-                               msg_print("You feel more comfortable after removing your weapon.");
-#endif
-
+                               msg_print(_("装備をはずしたら随分と気が楽になった。", "You feel more comfortable after removing your weapon."));
                        }
 
                        /* Save it */
@@ -5862,11 +5579,10 @@ void calc_bonuses(void)
 
        if (p_ptr->riding && (p_ptr->old_riding_ryoute != p_ptr->riding_ryoute))
        {
-               /* Message */
                if (p_ptr->riding_ryoute)
                {
 #ifdef JP
-                       msg_format("%sÇϤòÁà¤ì¤Ê¤¤¡£", (empty_hands(FALSE) == EMPTY_HAND_NONE) ? "ξ¼ê¤¬¤Õ¤µ¤¬¤Ã¤Æ¤¤¤Æ" : "");
+                       msg_format("%s馬を操れない。", (empty_hands(FALSE) == EMPTY_HAND_NONE) ? "両手がふさがっていて" : "");
 #else
                        msg_print("You are using both hand for fighting, and you can't control a riding pet.");
 #endif
@@ -5874,7 +5590,7 @@ void calc_bonuses(void)
                else
                {
 #ifdef JP
-                       msg_format("%sÇϤòÁà¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£", (empty_hands(FALSE) == EMPTY_HAND_NONE) ? "¼ê¤¬¶õ¤¤¤Æ" : "");
+                       msg_format("%s馬を操れるようになった。", (empty_hands(FALSE) == EMPTY_HAND_NONE) ? "手が空いて" : "");
 #else
                        msg_print("You began to control riding pet with one hand.");
 #endif
@@ -5887,24 +5603,17 @@ void calc_bonuses(void)
        {
                if (heavy_armor())
                {
-#ifdef JP
-msg_print("ÁõÈ÷¤¬½Å¤¯¤Æ¥Ð¥é¥ó¥¹¤ò¼è¤ì¤Ê¤¤¡£");
-#else
-                       msg_print("The weight of your armor disrupts your balance.");
-#endif
-
-                       if (hack_mind)
+                       msg_print(_("装備が重くてバランスを取れない。", "The weight of your armor disrupts your balance."));
+                       if (is_loading_now)
                        {
                                chg_virtue(V_HARMONY, -1);
                        }
                }
                else
-#ifdef JP
-msg_print("¥Ð¥é¥ó¥¹¤¬¤È¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
-#else
-                       msg_print("You regain your balance.");
-#endif
-
+               {
+                       msg_print(_("バランスがとれるようになった。", "You regain your balance."));
+               }
+               
                monk_notify_aux = monk_armour_aux;
        }
 
@@ -5917,11 +5626,9 @@ msg_print("
                if ((inventory[i].tval == TV_NATURE_BOOK) && (inventory[i].sval == 2)) have_sw = TRUE;
                if ((inventory[i].tval == TV_CRAFT_BOOK) && (inventory[i].sval == 2)) have_kabe = TRUE;
        }
-       for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx)
-       {
-               object_type *o_ptr;
 
-               /* Acquire object */
+       for (this_o_idx = cave[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+       {
                o_ptr = &o_list[this_o_idx];
 
                /* Acquire next object */
@@ -5963,170 +5670,21 @@ msg_print("
 }
 
 
-
-/*
- * Handle "p_ptr->notice"
- */
-void notice_stuff(void)
-{
-       /* Notice stuff */
-       if (!p_ptr->notice) return;
-
-
-       /* Actually do auto-destroy */
-       if (p_ptr->notice & (PN_AUTODESTROY))
-       {
-               p_ptr->notice &= ~(PN_AUTODESTROY);
-               autopick_delayed_alter();
-       }
-
-       /* Combine the pack */
-       if (p_ptr->notice & (PN_COMBINE))
-       {
-               p_ptr->notice &= ~(PN_COMBINE);
-               combine_pack();
-       }
-
-       /* Reorder the pack */
-       if (p_ptr->notice & (PN_REORDER))
-       {
-               p_ptr->notice &= ~(PN_REORDER);
-               reorder_pack();
-       }
-}
-
-
-/*
- * Handle "p_ptr->update"
- */
-void update_stuff(void)
-{
-       /* Update stuff */
-       if (!p_ptr->update) return;
-
-
-       if (p_ptr->update & (PU_BONUS))
-       {
-               p_ptr->update &= ~(PU_BONUS);
-               calc_bonuses();
-       }
-
-       if (p_ptr->update & (PU_TORCH))
-       {
-               p_ptr->update &= ~(PU_TORCH);
-               calc_torch();
-       }
-
-       if (p_ptr->update & (PU_HP))
-       {
-               p_ptr->update &= ~(PU_HP);
-               calc_hitpoints();
-       }
-
-       if (p_ptr->update & (PU_MANA))
-       {
-               p_ptr->update &= ~(PU_MANA);
-               calc_mana();
-       }
-
-       if (p_ptr->update & (PU_SPELLS))
-       {
-               p_ptr->update &= ~(PU_SPELLS);
-               calc_spells();
-       }
-
-
-       /* Character is not ready yet, no screen updates */
-       if (!character_generated) return;
-
-
-       /* Character is in "icky" mode, no screen updates */
-       if (character_icky) return;
-
-
-       if (p_ptr->update & (PU_UN_LITE))
-       {
-               p_ptr->update &= ~(PU_UN_LITE);
-               forget_lite();
-       }
-
-       if (p_ptr->update & (PU_UN_VIEW))
-       {
-               p_ptr->update &= ~(PU_UN_VIEW);
-               forget_view();
-       }
-
-       if (p_ptr->update & (PU_VIEW))
-       {
-               p_ptr->update &= ~(PU_VIEW);
-               update_view();
-       }
-
-       if (p_ptr->update & (PU_LITE))
-       {
-               p_ptr->update &= ~(PU_LITE);
-               update_lite();
-       }
-
-
-       if (p_ptr->update & (PU_FLOW))
-       {
-               p_ptr->update &= ~(PU_FLOW);
-               update_flow();
-       }
-
-       if (p_ptr->update & (PU_DISTANCE))
-       {
-               p_ptr->update &= ~(PU_DISTANCE);
-
-               /* Still need to call update_monsters(FALSE) after update_mon_lite() */ 
-               /* p_ptr->update &= ~(PU_MONSTERS); */
-
-               update_monsters(TRUE);
-       }
-
-       if (p_ptr->update & (PU_MON_LITE))
-       {
-               p_ptr->update &= ~(PU_MON_LITE);
-               update_mon_lite();
-       }
-
-       /*
-        * Mega-Hack -- Delayed visual update
-        * Only used if update_view(), update_lite() or update_mon_lite() was called
-        */
-       if (p_ptr->update & (PU_DELAY_VIS))
-       {
-               p_ptr->update &= ~(PU_DELAY_VIS);
-               delayed_visual_update();
-       }
-
-       if (p_ptr->update & (PU_MONSTERS))
-       {
-               p_ptr->update &= ~(PU_MONSTERS);
-               update_monsters(FALSE);
-       }
-}
-
-
-/*
- * Handle "p_ptr->redraw"
+/*! 
+ * @brief p_ptr->redraw のフラグに応じた更新をまとめて行う / Handle "p_ptr->redraw"
+ * @return なし
+ * @details 更新処理の対象はゲーム中の全描画処理
  */
-void redraw_stuff(void)
+static void redraw_stuff(void)
 {
-       /* Redraw stuff */
        if (!p_ptr->redraw) return;
 
-
        /* Character is not ready yet, no screen updates */
        if (!character_generated) return;
 
-
        /* Character is in "icky" mode, no screen updates */
        if (character_icky) return;
 
-
-
        /* Hack -- clear the screen */
        if (p_ptr->redraw & (PR_WIPE))
        {
@@ -6135,14 +5693,12 @@ void redraw_stuff(void)
                Term_clear();
        }
 
-
        if (p_ptr->redraw & (PR_MAP))
        {
                p_ptr->redraw &= ~(PR_MAP);
                prt_map();
        }
 
-
        if (p_ptr->redraw & (PR_BASIC))
        {
                p_ptr->redraw &= ~(PR_BASIC);
@@ -6166,7 +5722,6 @@ void redraw_stuff(void)
                p_ptr->redraw &= ~(PR_MISC);
                prt_field(rp_ptr->title, ROW_RACE, COL_RACE);
 /*             prt_field(cp_ptr->title, ROW_CLASS, COL_CLASS); */
-
        }
 
        if (p_ptr->redraw & (PR_TITLE))
@@ -6246,7 +5801,6 @@ void redraw_stuff(void)
                health_redraw(TRUE);
        }
 
-
        if (p_ptr->redraw & (PR_EXTRA))
        {
                p_ptr->redraw &= ~(PR_EXTRA);
@@ -6301,16 +5855,15 @@ void redraw_stuff(void)
        }
 }
 
-
-/*
- * Handle "p_ptr->window"
+/*! 
+ * @brief p_ptr->window のフラグに応じた更新をまとめて行う / Handle "p_ptr->window"
+ * @return なし
+ * @details 更新処理の対象はサブウィンドウ全般
  */
-void window_stuff(void)
+static void window_stuff(void)
 {
        int j;
-
-       u32b mask = 0L;
-
+       BIT_FLAGS mask = 0L;
 
        /* Nothing to do */
        if (!p_ptr->window) return;
@@ -6328,7 +5881,6 @@ void window_stuff(void)
        /* Nothing to do */
        if (!p_ptr->window) return;
 
-
        /* Display inventory */
        if (p_ptr->window & (PW_INVEN))
        {
@@ -6401,25 +5953,162 @@ void window_stuff(void)
 }
 
 
-/*
+/*!
+ * @brief 全更新処理をチェックして処理していく
  * Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window"
+ * @return なし
  */
 void handle_stuff(void)
 {
-       /* Update stuff */
-       if (p_ptr->update) update_stuff();
-
-       /* Redraw stuff */
+       if (p_ptr->update) update_creature(p_ptr);
        if (p_ptr->redraw) redraw_stuff();
+       if (p_ptr->window) window_stuff();
+}
 
-       /* Window stuff */
+void update_output(void)
+{
+       if (p_ptr->redraw) redraw_stuff();
        if (p_ptr->window) window_stuff();
 }
 
+/*!
+ * @brief p_ptr->update のフラグに応じた更新をまとめて行う / Handle "p_ptr->update"
+ * @return なし
+ * @details 更新処理の対象はプレイヤーの能力修正/光源寿命/HP/MP/魔法の学習状態、他多数の外界の状態判定。
+ */
+void update_creature(player_type *creature_ptr)
+{
+       if (!creature_ptr->update) return;
 
-s16b empty_hands(bool riding_control)
+       /* Actually do auto-destroy */
+       if (creature_ptr->update & (PU_AUTODESTROY))
+       {
+               creature_ptr->update &= ~(PU_AUTODESTROY);
+               autopick_delayed_alter();
+       }
+
+       /* Combine the pack */
+       if (creature_ptr->update & (PU_COMBINE))
+       {
+               creature_ptr->update &= ~(PU_COMBINE);
+               combine_pack();
+       }
+
+       /* Reorder the pack */
+       if (creature_ptr->update & (PU_REORDER))
+       {
+               creature_ptr->update &= ~(PU_REORDER);
+               reorder_pack();
+       }
+
+       if (creature_ptr->update & (PU_BONUS))
+       {
+               creature_ptr->update &= ~(PU_BONUS);
+               calc_bonuses();
+       }
+
+       if (creature_ptr->update & (PU_TORCH))
+       {
+               creature_ptr->update &= ~(PU_TORCH);
+               calc_torch();
+       }
+
+       if (creature_ptr->update & (PU_HP))
+       {
+               creature_ptr->update &= ~(PU_HP);
+               calc_hitpoints();
+       }
+
+       if (creature_ptr->update & (PU_MANA))
+       {
+               creature_ptr->update &= ~(PU_MANA);
+               calc_mana();
+       }
+
+       if (creature_ptr->update & (PU_SPELLS))
+       {
+               creature_ptr->update &= ~(PU_SPELLS);
+               calc_spells();
+       }
+
+       /* Character is not ready yet, no screen updates */
+       if (!character_generated) return;
+
+       /* Character is in "icky" mode, no screen updates */
+       if (character_icky) return;
+
+       if (creature_ptr->update & (PU_UN_LITE))
+       {
+               creature_ptr->update &= ~(PU_UN_LITE);
+               forget_lite();
+       }
+
+       if (creature_ptr->update & (PU_UN_VIEW))
+       {
+               creature_ptr->update &= ~(PU_UN_VIEW);
+               forget_view();
+       }
+
+       if (creature_ptr->update & (PU_VIEW))
+       {
+               creature_ptr->update &= ~(PU_VIEW);
+               update_view();
+       }
+
+       if (creature_ptr->update & (PU_LITE))
+       {
+               creature_ptr->update &= ~(PU_LITE);
+               update_lite();
+       }
+
+
+       if (creature_ptr->update & (PU_FLOW))
+       {
+               creature_ptr->update &= ~(PU_FLOW);
+               update_flow();
+       }
+
+       if (creature_ptr->update & (PU_DISTANCE))
+       {
+               creature_ptr->update &= ~(PU_DISTANCE);
+
+               /* Still need to call update_monsters(FALSE) after update_mon_lite() */
+               /* creature_ptr->update &= ~(PU_MONSTERS); */
+
+               update_monsters(TRUE);
+       }
+
+       if (creature_ptr->update & (PU_MON_LITE))
+       {
+               creature_ptr->update &= ~(PU_MON_LITE);
+               update_mon_lite();
+       }
+
+       /*
+        * Mega-Hack -- Delayed visual update
+        * Only used if update_view(), update_lite() or update_mon_lite() was called
+        */
+       if (creature_ptr->update & (PU_DELAY_VIS))
+       {
+               creature_ptr->update &= ~(PU_DELAY_VIS);
+               delayed_visual_update();
+       }
+
+       if (creature_ptr->update & (PU_MONSTERS))
+       {
+               creature_ptr->update &= ~(PU_MONSTERS);
+               update_monsters(FALSE);
+       }
+}
+
+/*!
+ * @brief プレイヤーの現在開いている手の状態を返す
+ * @param riding_control 乗馬中により片手を必要としている状態ならばTRUEを返す。
+ * @return 開いている手のビットフラグ
+ */
+BIT_FLAGS16 empty_hands(bool riding_control)
 {
-       s16b status = EMPTY_HAND_NONE;
+       BIT_FLAGS16 status = EMPTY_HAND_NONE;
 
        if (!inventory[INVEN_RARM].k_idx) status |= EMPTY_HAND_RARM;
        if (!inventory[INVEN_LARM].k_idx) status |= EMPTY_HAND_LARM;
@@ -6434,9 +6123,13 @@ s16b empty_hands(bool riding_control)
 }
 
 
+/*!
+ * @brief プレイヤーが防具重量制限のある職業時にペナルティを受ける状態にあるかどうかを返す。
+ * @return ペナルティが適用されるならばTRUE。
+ */
 bool heavy_armor(void)
 {
-       u16b monk_arm_wgt = 0;
+       WEIGHT monk_arm_wgt = 0;
 
        if ((p_ptr->pclass != CLASS_MONK) && (p_ptr->pclass != CLASS_FORCETRAINER) && (p_ptr->pclass != CLASS_NINJA)) return FALSE;
 
@@ -6452,12 +6145,15 @@ bool heavy_armor(void)
        return (monk_arm_wgt > (100 + (p_ptr->lev * 4)));
 }
 
+/*!
+ * @brief 実ゲームプレイ時間を更新する
+ */
 void update_playtime(void)
 {
        /* Check if the game has started */
        if (start_time != 0)
        {
-               u32b tmp = time(NULL);
+               u32b tmp = (u32b)time(NULL);
                playtime += (tmp - start_time);
                start_time = tmp;
        }