OSDN Git Service

[Refactor] #38824 get_item() を choose_object() に置換中。 / Replacing get_item() to choose...
[hengband/hengband.git] / src / birth.c
index 8eea88e..fef599c 100644 (file)
@@ -1592,7 +1592,7 @@ static void birth_put_stats(void)
 {
        int i, j, m, p;
        int col;
-       byte attr;
+       TERM_COLOR attr;
        char buf[80];
 
 
@@ -2012,11 +2012,8 @@ static void wield_all(void)
                if (slot == INVEN_LITE) continue; /* Does not wield toaches because buys a lantern soon */
                if (inventory[slot].k_idx) continue; 
  
-               /* Get local object */ 
                i_ptr = &object_type_body; 
                object_copy(i_ptr, o_ptr); 
-               /* Modify quantity */ 
                i_ptr->number = 1; 
  
                /* Decrease the item (from the pack) */ 
@@ -2033,14 +2030,9 @@ static void wield_all(void)
                        floor_item_optimize(0 - item); 
                } 
  
-               /* Get the wield slot */ 
                o_ptr = &inventory[slot]; 
-               /* Wear the new stuff */ 
-               object_copy(o_ptr, i_ptr); 
-               /* Increase the weight */ 
-               p_ptr->total_weight += i_ptr->weight; 
+               object_copy(o_ptr, i_ptr); 
+               p_ptr->total_weight += i_ptr->weight; 
  
                /* Increment the equip counter by hand */ 
                equip_cnt++;
@@ -2855,7 +2847,8 @@ static bool get_player_class(void)
  */
 static bool get_player_seikaku(void)
 {
-       int k, n, os, cs;
+       int k;
+       int n, os, cs;
        char c;
        char sym[MAX_SEIKAKU];
        char p2 = ')';
@@ -2863,14 +2856,9 @@ static bool get_player_seikaku(void)
        char tmp[64];
        cptr str;
 
-
        /* Extra info */
        clear_from(10);
-#ifdef JP
-       put_str("注意:《性格》によってキャラクターの能力やボーナスが変化します。", 23, 5);
-#else
-       put_str("Note: Your personality determines various intrinsic abilities and bonuses.", 23, 5);
-#endif
+       put_str(_("注意:《性格》によってキャラクターの能力やボーナスが変化します。", "Note: Your personality determines various intrinsic abilities and bonuses."), 23, 5);
 
        /* Dump seikakus */
        for (n = 0; n < MAX_SEIKAKU; n++)
@@ -3043,7 +3031,7 @@ static bool get_player_seikaku(void)
        }
 
        /* Set seikaku */
-       p_ptr->pseikaku = k;
+       p_ptr->pseikaku = (CHARACTER_IDX)k;
        ap_ptr = &seikaku_info[p_ptr->pseikaku];
 #ifdef JP
        strcpy(tmp, ap_ptr->title);
@@ -3055,7 +3043,6 @@ static bool get_player_seikaku(void)
 #endif
        strcat(tmp,p_ptr->name);
 
-       /* Display */
        c_put_str(TERM_L_BLUE, tmp, 1, 34);
 
        return TRUE;
@@ -3308,17 +3295,11 @@ static bool get_chara_limits(void)
                _("社会的地位", "social class")
        };
 
-       /* Clean up */
        clear_from(10);
        
        /* Prompt for the minimum stats */
-#ifdef JP
-       put_str("2/4/6/8で項目選択、+/-で値の増減、Enterで次へ", 11, 10);
-       put_str("注意:身長と体重の最大値/最小値ぎりぎりの値は非常に出現確率が低くなります。", 23, 2);
-#else
-       put_str("2/4/6/8 for Select, +/- for Change value, Enter for Goto next", 11, 10);
-       put_str("Caution: Values near minimum or maximum is extremery rare.", 23, 5);
-#endif
+       put_str(_("2/4/6/8で項目選択、+/-で値の増減、Enterで次へ", "2/4/6/8 for Select, +/- for Change value, Enter for Goto next"), 11, 10);
+       put_str(_("注意:身長と体重の最大値/最小値ぎりぎりの値は非常に出現確率が低くなります。", "Caution: Values near minimum or maximum is extremery rare."), 23, 2);
        
        if (p_ptr->psex == SEX_MALE)
        {
@@ -3331,13 +3312,8 @@ static bool get_chara_limits(void)
                min_percent = (int)(rp_ptr->f_b_ht-rp_ptr->f_m_ht*4+1) * 100 / (int)(rp_ptr->f_b_ht);
        }
        
-#ifdef JP
-       put_str("体格/地位の最小値/最大値を設定して下さい。", 10, 10);
-       put_str("  項    目                 最小値  最大値", 13,20);
-#else
-       put_str(" Parameter                    Min     Max", 13,20);
-       put_str("Set minimum/maximum attribute.", 10, 10);
-#endif
+       put_str(_("体格/地位の最小値/最大値を設定して下さい。", "Set minimum/maximum attribute."), 10, 10);
+       put_str(_("  項    目                 最小値  最大値", " Parameter                    Min     Max"), 13,20);
 
        /* Output the maximum stats */
        for (i = 0; i < MAXITEMS; i++)
@@ -3559,12 +3535,7 @@ static bool get_chara_limits(void)
                        break;
                case '=':
                        screen_save();
-#ifdef JP
-                       do_cmd_options_aux(OPT_PAGE_BIRTH, "初期オプション((*)はスコアに影響)");
-#else
-                       do_cmd_options_aux(OPT_PAGE_BIRTH, "Birth Option((*)s effect score)");
-#endif
-
+                       do_cmd_options_aux(OPT_PAGE_BIRTH, _("初期オプション((*)はスコアに影響)", "Birth Option((*)s effect score)"));
                        screen_load();
                        break;
                default:
@@ -3616,11 +3587,7 @@ static bool do_cmd_histpref(void)
        char temp[64 * 4];
        char histbuf[HISTPREF_LIMIT];
 
-#ifdef JP
-       if (!get_check("生い立ち設定ファイルをロードしますか? ")) return FALSE;
-#else
-       if (!get_check("Load background history preference file? ")) return FALSE;
-#endif
+       if (!get_check(_("生い立ち設定ファイルをロードしますか? ", "Load background history preference file? "))) return FALSE;
 
        /* Prepare the buffer */
        histbuf[0] = '\0';
@@ -3646,11 +3613,7 @@ static bool do_cmd_histpref(void)
 
        if (err)
        {
-#ifdef JP
-               msg_print("生い立ち設定ファイルの読み込みに失敗しました。");
-#else
-               msg_print("Failed to load background history preference.");
-#endif
+               msg_print(_("生い立ち設定ファイルの読み込みに失敗しました。", "Failed to load background history preference."));
                msg_print(NULL);
 
                /* Kill the buffer */
@@ -3660,11 +3623,7 @@ static bool do_cmd_histpref(void)
        }
        else if (!histpref_buf[0])
        {
-#ifdef JP
-               msg_print("有効な生い立ち設定はこのファイルにありません。");
-#else
-               msg_print("There does not exist valid background history preference.");
-#endif
+               msg_print(_("有効な生い立ち設定はこのファイルにありません。", "There does not exist valid background history preference."));
                msg_print(NULL);
 
                /* Kill the buffer */
@@ -4426,7 +4385,6 @@ static bool player_birth_aux(void)
                /* Flush input */
                flush();
 
-
                /*** Display ***/
 
                /* Mode */
@@ -4446,7 +4404,7 @@ static bool player_birth_aux(void)
                {
                        /* Calculate the bonuses and hitpoints */
                        p_ptr->update |= (PU_BONUS | PU_HP);
-                       handle_stuff();
+                       update_creature(p_ptr);
 
                        p_ptr->chp = p_ptr->mhp;
                        p_ptr->csp = p_ptr->msp;
@@ -4631,15 +4589,9 @@ static bool ask_quick_start(void)
        /* Calc hitdie, but don't roll */
        get_extra(FALSE);
 
-       /* Calculate the bonuses and hitpoints */
        p_ptr->update |= (PU_BONUS | PU_HP);
-
-       handle_stuff();
-
-       /* Fully healed */
+       update_creature(p_ptr);
        p_ptr->chp = p_ptr->mhp;
-
-       /* Fully rested */
        p_ptr->csp = p_ptr->msp;
 
        /* Process the player name */
@@ -4697,49 +4649,25 @@ void player_birth(void)
        message_add(" ");
        message_add("  ");
 
-#ifdef JP
-       do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- 新規ゲーム開始 --------");
-#else
-       do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- Start New Game --------");
-#endif
+       do_cmd_write_nikki(NIKKI_GAMESTART, 1, _("-------- 新規ゲーム開始 --------", "-------- Start New Game --------"));
        do_cmd_write_nikki(NIKKI_HIGAWARI, 0, NULL);
 
-#ifdef JP
-       sprintf(buf,"                            性別に%sを選択した。", sex_info[p_ptr->psex].title);
-#else
-       sprintf(buf,"                            choose %s personality.", sex_info[p_ptr->psex].title);
-#endif
+       sprintf(buf,_("                            性別に%sを選択した。", "                            choose %s personality."), sex_info[p_ptr->psex].title);
        do_cmd_write_nikki(NIKKI_BUNSHOU, 1, buf);
 
-#ifdef JP
-       sprintf(buf,"                            種族に%sを選択した。", race_info[p_ptr->prace].title);
-#else
-       sprintf(buf,"                            choose %s race.", race_info[p_ptr->prace].title);
-#endif
+       sprintf(buf,_("                            種族に%sを選択した。", "                            choose %s race."), race_info[p_ptr->prace].title);
        do_cmd_write_nikki(NIKKI_BUNSHOU, 1, buf);
 
-#ifdef JP
-       sprintf(buf,"                            職業に%sを選択した。", class_info[p_ptr->pclass].title);
-#else
-       sprintf(buf,"                            choose %s class.", class_info[p_ptr->pclass].title);
-#endif
+       sprintf(buf,_("                            職業に%sを選択した。", "                            choose %s class."), class_info[p_ptr->pclass].title);
        do_cmd_write_nikki(NIKKI_BUNSHOU, 1, buf);
 
        if (p_ptr->realm1)
        {
-#ifdef JP
-               sprintf(buf,"                            魔法の領域に%s%sを選択した。",realm_names[p_ptr->realm1], p_ptr->realm2 ? format("と%s",realm_names[p_ptr->realm2]) : "");
-#else
-               sprintf(buf,"                            choose %s%s realm.",realm_names[p_ptr->realm1], p_ptr->realm2 ? format(" realm and %s",realm_names[p_ptr->realm2]) : "");
-#endif
+               sprintf(buf,_("                            魔法の領域に%s%sを選択した。", "                            choose %s%s realm."),realm_names[p_ptr->realm1], p_ptr->realm2 ? format("と%s",realm_names[p_ptr->realm2]) : "");
                do_cmd_write_nikki(NIKKI_BUNSHOU, 1, buf);
        }
 
-#ifdef JP
-       sprintf(buf,"                            性格に%sを選択した。", seikaku_info[p_ptr->pseikaku].title);
-#else
-       sprintf(buf,"                            choose %s.", seikaku_info[p_ptr->pseikaku].title);
-#endif
+       sprintf(buf,_("                            性格に%sを選択した。", "                            choose %s."), seikaku_info[p_ptr->pseikaku].title);
        do_cmd_write_nikki(NIKKI_BUNSHOU, 1, buf);
 
        /* Init the shops */