OSDN Git Service

Merge remote-tracking branch 'remotes/origin/feature/Fix-English-Bugs' into develop
[hengband/hengband.git] / src / birth / birth-wizard.c
index 2983dca..d8127d5 100644 (file)
 #include "io/input-key-acceptor.h"
 #include "main/sound-definitions-table.h"
 #include "main/sound-of-music.h"
-#include "player/avatar.h"
+#include "player-info/avatar.h"
 #include "player/patron.h"
 #include "player/player-class.h"
 #include "player/player-race.h"
 #include "player/player-sex.h"
 #include "player/process-name.h"
+#include "player/player-status-table.h"
 #include "system/game-option-types.h"
 #include "term/screen-processor.h"
 #include "term/term-color-types.h"
@@ -43,7 +44,7 @@
  * system may have problems because the user can't stop the
  * autoroller for this number of rolls.
  */
-#define AUTOROLLER_STEP 5431L
+#define AUTOROLLER_STEP 54321L
 
 static void display_initial_birth_message(player_type *creature_ptr)
 {
@@ -53,7 +54,7 @@ static void display_initial_birth_message(player_type *creature_ptr)
     put_str(_("種族        :", "Race        :"), 4, 1);
     put_str(_("職業        :", "Class       :"), 5, 1);
     c_put_str(TERM_L_BLUE, creature_ptr->name, 1, 34);
-    put_str(_("キャラクターを作成します。('S'やり直す, 'Q'終了, '?'ヘルプ)", "Make your charactor. ('S' Restart, 'Q' Quit, '?' Help)"), 8, 10);
+    put_str(_("キャラクターを作成します。('S'やり直す, 'Q'終了, '?'ヘルプ)", "Make your character. ('S' Restart, 'Q' Quit, '?' Help)"), 8, 10);
     put_str(_("注意:《性別》の違いはゲーム上ほとんど影響を及ぼしません。", "Note: Your 'sex' does not have any significant gameplay effects."), 23, 5);
 }
 
@@ -280,16 +281,30 @@ static void display_auto_roller_success_rate(const int col)
     if (!autoroller)
         return;
 
-    put_str(_("最小値", " Limit"), 2, col + 5);
-    put_str(_("成功率", "  Freq"), 2, col + 13);
+    put_str(_("最小値", " Limit"), 2, col + 13);
     put_str(_("現在値", "  Roll"), 2, col + 24);
+
+    char buf[32];
+
+    if (autoroll_chance >= 1)
+        sprintf(buf, _("確率 :  1/%8d00", "Prob :  1/%8d00"), autoroll_chance);
+    else if (autoroll_chance == -999)
+        sprintf(buf, _("確率 :     不可能", "Prob :     Impossible"));
+    else
+        sprintf(buf, _("確率 :     1/10000以上", "Prob :     >1/10000"));
+    put_str(buf, 11, col + 10);
+
+    put_str(_(
+        "注意 : 体格等のオートローラを併用時は、上記確率より困難です。",
+        "Note : Prob may be lower when you use the 'autochara' option."
+        ), 22, 5);
+
     for (int i = 0; i < A_MAX; i++) {
-        put_str(stat_names[i], 3 + i, col);
+        put_str(stat_names[i], 3 + i, col + 8);
         int j = rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i];
         int m = adjust_stat(stat_limit[i], j);
-        char buf[32];
         cnv_stat(m, buf);
-        c_put_str(TERM_L_BLUE, buf, 3 + i, col + 5);
+        c_put_str(TERM_L_BLUE, buf, 3 + i, col + 13);
     }
 }
 
@@ -302,9 +317,7 @@ static void auto_roller_count(void)
     if (!autoroller)
         return;
 
-    for (int i = 0; i < A_MAX; i++) {
-        stat_match[i] = 0;
-    }
+    auto_upper_round++;
 }
 
 static bool decide_initial_stat(player_type *creature_ptr)
@@ -314,10 +327,10 @@ static bool decide_initial_stat(player_type *creature_ptr)
 
     bool accept = TRUE;
     for (int i = 0; i < A_MAX; i++) {
-        if (creature_ptr->stat_max[i] >= stat_limit[i])
-            stat_match[i]++;
-        else
+        if (creature_ptr->stat_max[i] < stat_limit[i]) {
             accept = FALSE;
+            break;
+        }
     }
 
     return accept;
@@ -351,7 +364,10 @@ static bool display_auto_roller_count(player_type *creature_ptr, const int col)
         return FALSE;
 
     birth_put_stats(creature_ptr);
-    put_str(format("%10ld", auto_round), 10, col + 20);
+    if (auto_upper_round)
+        put_str(format("%ld%09ld", auto_upper_round, auto_round), 10, col + 20);
+    else
+        put_str(format("%10ld", auto_round), 10, col + 20);
     term_fresh();
     inkey_scan = TRUE;
     if (inkey()) {
@@ -432,14 +448,22 @@ static bool display_auto_roller_result(player_type *creature_ptr, bool prev, cha
     return TRUE;
 }
 
+/*
+ * @brief オートロールを回して結果を表示し、その数値に決めるかさらに回すか確認する。
+ * @param creature_ptr プレーヤーへの参照ポインタ
+ * @param chara_limit 社会的地位の要求水準
+ * @detail 2つめの結果以降は、'p'キーで1つ前のロール結果に戻せる。
+ */
 static bool display_auto_roller(player_type *creature_ptr, chara_limit_type chara_limit)
 {
+    bool prev = FALSE;
+
     while (TRUE) {
-        int col = 42;
+        int col = 22;
         if (autoroller || autochara) {
             term_clear();
-            put_str(_("回数 :", "Round:"), 10, col + 13);
-            put_str(_("(ESCで停止)", "(Hit ESC to stop)"), 12, col + 13);
+            put_str(_("回数 :", "Round:"), 10, col + 10);
+            put_str(_("(ESCで停止)", "(Hit ESC to stop)"), 13, col + 13);
         } else {
             get_stats(creature_ptr);
             get_ahw(creature_ptr);
@@ -456,7 +480,7 @@ static bool display_auto_roller(player_type *creature_ptr, chara_limit_type char
         get_extra(creature_ptr, TRUE);
         get_money(creature_ptr);
         creature_ptr->chaos_patron = (s16b)randint0(MAX_PATRON);
-        bool prev = FALSE;
+
         char c;
         if (!display_auto_roller_result(creature_ptr, prev, &c))
             return FALSE;
@@ -513,8 +537,11 @@ bool player_birth_wizard(player_type *creature_ptr, void (*process_autopick_file
         return FALSE;
 
     display_initial_options(creature_ptr);
-    if (autoroller || autochara)
+    if (autoroller || autochara) {
         auto_round = 0L;
+        auto_upper_round = 0L;
+        autoroll_chance = 0L;
+    }
 
     if (autoroller)
         if (!get_stat_limits(creature_ptr))