OSDN Git Service

Merge branch 'master' of git.sourceforge.jp:/gitroot/hengband/hengband
[hengband/hengband.git] / src / avatar.c
index 3c285ff..f9c95e1 100644 (file)
  */
 cptr virtue[MAX_VIRTUE] =
 {
-#ifdef JP
-       "情",
-       "誉",
-       "正",
-       "犠",
-       "識",
-       "誠",
-       "啓",
-       "秘",
-       "運",
-       "然",
-       "調",
-       "活",
-       "死",
-       "忍",
-       "節",
-       "勤",
-       "勇",
-       "個",
-#else
-       "Compassion",
-       "Honour",
-       "Justice",
-       "Sacrifice",
-       "Knowledge",
-       "Faith",
-       "Enlightenment",
-       "Mysticism",
-       "Chance",
-       "Nature",
-       "Harmony",
-       "Vitality",
-       "Unlife",
-       "Patience",
-       "Temperance",
-       "Diligence",
-       "Valour",
-       "Individualism",
-#endif
+       _("情", "Compassion"),
+       _("誉", "Honour"),
+       _("正", "Justice"),
+       _("犠", "Sacrifice"),
+       _("識", "Knowledge"),
+       _("誠", "Faith"),
+       _("啓", "Enlightenment"),
+       _("秘", "Mysticism"),
+       _("運", "Chance"),
+       _("然", "Nature"),
+       _("調", "Harmony"),
+       _("活", "Vitality"),
+       _("死", "Unlife"),
+       _("忍", "Patience"),
+       _("節", "Temperance"),
+       _("勤", "Diligence"),
+       _("勇", "Valour"),
+       _("個", "Individualism"),
 };
 
 /*!
@@ -156,7 +135,7 @@ static void get_random_virtue(int which)
        }
 
        /* Chosen */
-       p_ptr->vir_types[which] = type;
+       p_ptr->vir_types[which] = (s16b)type;
 }
 
 /*!
@@ -164,7 +143,7 @@ static void get_random_virtue(int which)
  * @param realm 魔法領域のID
  * @return 対応する徳のID
  */
-static s16b get_realm_virtues(byte realm)
+static VIRTUES_IDX get_realm_virtues(REALM_IDX realm)
 {
        switch (realm)
        {
@@ -420,13 +399,13 @@ void get_virtues(void)
  * @param amount 加減量
  * @return なし
  */
-void chg_virtue(int virtue, int amount)
+void chg_virtue(int virtue_id, int amount)
 {
        int i = 0;
 
        for (i = 0; i < 8; i++)
        {
-               if (p_ptr->vir_types[i] == virtue)
+               if (p_ptr->vir_types[i] == virtue_id)
                {
                        if (amount > 0)
                        {
@@ -484,15 +463,15 @@ void chg_virtue(int virtue, int amount)
  * @param amount セットしたい値。
  * @return なし
  */
-void set_virtue(int virtue, int amount)
+void set_virtue(int virtue_id, int amount)
 {
        int i = 0;
 
        for (i = 0; i < 8; i++)
        {
-               if (p_ptr->vir_types[i] == virtue)
+               if (p_ptr->vir_types[i] == virtue_id)
                {
-                       p_ptr->virtues[i] = amount;
+                       p_ptr->virtues[i] = (s16b)amount;
                        return;
                }
        }
@@ -511,122 +490,40 @@ void dump_virtues(FILE *OutFile)
 
        for (v_nr = 0; v_nr < 8; v_nr++)
        {
-               char v_name [20];
+               char vir_name [20];
                int tester = p_ptr->virtues[v_nr];
 
-               strcpy(v_name, virtue[(p_ptr->vir_types[v_nr])-1]);
+               strcpy(vir_name, virtue[(p_ptr->vir_types[v_nr])-1]);
 
                if (p_ptr->vir_types[v_nr] == 0 || p_ptr->vir_types[v_nr] > MAX_VIRTUE)
-#ifdef JP
-                       fprintf(OutFile, "おっと。%sの情報なし。", v_name);
-#else
-                       fprintf(OutFile, "Oops. No info about %s.", v_name);
-#endif
+                       fprintf(OutFile, _("おっと。%sの情報なし。", "Oops. No info about %s."), vir_name);
 
                else if (tester < -100)
-#ifdef JP
-                       fprintf(OutFile, "[%s]の対極",
-#else
-                       fprintf(OutFile, "You are the polar opposite of %s.",
-#endif
-
-                               v_name);
+                       fprintf(OutFile, _("[%s]の対極", "You are the polar opposite of %s."), vir_name);
                else if (tester < -80)
-#ifdef JP
-                       fprintf(OutFile, "[%s]の大敵",
-#else
-                       fprintf(OutFile, "You are an arch-enemy of %s.",
-#endif
-
-                               v_name);
+                       fprintf(OutFile, _("[%s]の大敵", "You are an arch-enemy of %s."), vir_name);
                else if (tester < -60)
-#ifdef JP
-                       fprintf(OutFile, "[%s]の強敵",
-#else
-                       fprintf(OutFile, "You are a bitter enemy of %s.",
-#endif
-
-                               v_name);
+                       fprintf(OutFile, _("[%s]の強敵", "You are a bitter enemy of %s."), vir_name);
                else if (tester < -40)
-#ifdef JP
-                       fprintf(OutFile, "[%s]の敵",
-#else
-                       fprintf(OutFile, "You are an enemy of %s.",
-#endif
-
-                               v_name);
+                       fprintf(OutFile, _("[%s]の敵", "You are an enemy of %s."), vir_name);
                else if (tester < -20)
-#ifdef JP
-                       fprintf(OutFile, "[%s]の罪者",
-#else
-                       fprintf(OutFile, "You have sinned against %s.",
-#endif
-
-                               v_name);
+                       fprintf(OutFile, _("[%s]の罪者", "You have sinned against %s."), vir_name);
                else if (tester < 0)
-#ifdef JP
-                       fprintf(OutFile, "[%s]の迷道者",
-#else
-                       fprintf(OutFile, "You have strayed from the path of %s.",
-#endif
-
-                               v_name);
+                       fprintf(OutFile, _("[%s]の迷道者", "You have strayed from the path of %s."), vir_name);
                else if (tester == 0)
-#ifdef JP
-                       fprintf(OutFile,"[%s]の中立者",
-#else
-                       fprintf(OutFile,"You are neutral to %s.",
-#endif
-
-                               v_name);
+                       fprintf(OutFile,_("[%s]の中立者", "You are neutral to %s."), vir_name);
                else if (tester < 20)
-#ifdef JP
-                       fprintf(OutFile,"[%s]の小徳者",
-#else
-                       fprintf(OutFile,"You are somewhat virtuous in %s.",
-#endif
-
-                               v_name);
+                       fprintf(OutFile,_("[%s]の小徳者", "You are somewhat virtuous in %s."), vir_name);
                else if (tester < 40)
-#ifdef JP
-                       fprintf(OutFile,"[%s]の中徳者",
-#else
-                       fprintf(OutFile,"You are virtuous in %s.",
-#endif
-
-                               v_name);
+                       fprintf(OutFile,_("[%s]の中徳者", "You are virtuous in %s."), vir_name);
                else if (tester < 60)
-#ifdef JP
-                       fprintf(OutFile,"[%s]の高徳者",
-#else
-                       fprintf(OutFile,"You are very virtuous in %s.",
-#endif
-
-                               v_name);
+                       fprintf(OutFile,_("[%s]の高徳者", "You are very virtuous in %s."), vir_name);
                else if (tester < 80)
-#ifdef JP
-                       fprintf(OutFile,"[%s]の覇者",
-#else
-                       fprintf(OutFile,"You are a champion of %s.",
-#endif
-
-                               v_name);
+                       fprintf(OutFile,_("[%s]の覇者", "You are a champion of %s."), vir_name);
                else if (tester < 100)
-#ifdef JP
-                       fprintf(OutFile,"[%s]の偉大な覇者",
-#else
-                       fprintf(OutFile,"You are a great champion of %s.",
-#endif
-
-                               v_name);
+                       fprintf(OutFile,_("[%s]の偉大な覇者", "You are a great champion of %s."), vir_name);
                else
-#ifdef JP
-                       fprintf(OutFile,"[%s]の具現者",
-#else
-                       fprintf(OutFile,"You are the living embodiment of %s.",
-#endif
-
-                               v_name);
+                       fprintf(OutFile,_("[%s]の具現者", "You are the living embodiment of %s."), vir_name);
 
            fprintf(OutFile, "\n");
        }