OSDN Git Service

[Feature] #37270 "各技能値に実値を表示する" オプションを追加。
[hengband/hengband.git] / src / files.c
index 8e571dd..c7dd742 100644 (file)
@@ -1929,16 +1929,23 @@ static byte likert_color = TERM_WHITE;
  */
 static cptr likert(int x, int y)
 {
-       static char dummy[20] = "";
+       static char dummy[20] = "", dummy2[20] = "";
+       memset(dummy, 0, strlen(dummy));
+       memset(dummy2, 0, strlen(dummy2));
 
        /* Paranoia */
        if (y <= 0) y = 1;
 
+       if(show_actual_value)
+       {
+               sprintf(dummy, "%3d-", x);
+       }
+
        /* Negative value */
        if (x < 0)
        {
                likert_color = TERM_L_DARK;
-               return _("最低", "Very Bad");
+               strcat(dummy, _("最低", "Very Bad"));
        }
 
        /* Analyze the value */
@@ -1947,29 +1954,34 @@ static cptr likert(int x, int y)
        case 0:
        case 1:
                likert_color = TERM_RED;
-               return _("悪い", "Bad");
-
+               strcat(dummy, _("悪い", "Bad"));
+               break;
        case 2:
                likert_color = TERM_L_RED;
-               return _("劣る", "Poor");
+               strcat(dummy, _("劣る", "Poor"));
+               break;
 
        case 3:
        case 4:
                likert_color = TERM_ORANGE;
-               return _("普通", "Fair");
+               strcat(dummy, _("普通", "Fair"));
+               break;
 
        case 5:
                likert_color = TERM_YELLOW;
-               return _("良い", "Good");
+               strcat(dummy, _("良い", "Good"));
+               break;
 
        case 6:
                likert_color = TERM_YELLOW;
-               return _("大変良い", "Very Good");
+               strcat(dummy, _("大変良い", "Very Good"));
+               break;
 
        case 7:
        case 8:
                likert_color = TERM_L_GREEN;
-               return _("卓越", "Excellent");
+               strcat(dummy, _("卓越", "Excellent"));
+               break;
 
        case 9:
        case 10:
@@ -1977,20 +1989,28 @@ static cptr likert(int x, int y)
        case 12:
        case 13:
                likert_color = TERM_GREEN;
-               return _("超越", "Superb");
+               strcat(dummy, _("超越", "Superb"));
+               break;
 
        case 14:
        case 15:
        case 16:
        case 17:
                likert_color = TERM_BLUE;
-               return _("英雄的", "Heroic");
+               strcat(dummy, _("英雄的", "Heroic"));
+               break;
 
        default:
                likert_color = TERM_VIOLET;
-               sprintf(dummy, _("伝説的[%d]", "Legendary[%d]"), (int)((((x / y) - 17) * 5) / 2));
-               return dummy;
+               sprintf(dummy2, _("伝説的[%d]", "Legendary[%d]"),
+                       (int)((((x / y) - 17) * 5) / 2));
+               strcat(dummy, dummy2);
+
+               break;
        }
+
+       return dummy;
+
 }