3 * @brief プレイヤーの作成を行う / Create a player character
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
8 * This software may be copied and distributed for educational, research,\n
9 * and not for profit purposes provided that this copyright and statement\n
10 * are included in all such copies. Other copyrights may also apply.\n
11 * 2013 Deskull Doxygen向けのコメント整理\n
15 #include "core/system-variables.h"
16 #include "core/show-file.h"
18 #include "io/read-pref-file.h"
19 #include "main/music-definitions-table.h"
20 #include "main/sound-definitions-table.h"
21 #include "market/building.h"
25 #include "autopick/autopick.h"
27 #include "birth/birth.h"
28 #include "birth/birth-explanations-table.h"
30 #include "cmd/cmd-dump.h"
31 #include "cmd/cmd-help.h"
32 #include "dungeon/dungeon-file.h"
33 #include "dungeon/dungeon.h"
34 #include "floor/floor-town.h"
35 #include "floor/floor.h"
37 #include "io/write-diary.h"
39 #include "market/store.h"
41 #include "monsterrace-hook.h"
42 #include "monsterrace.h"
43 #include "object-ego.h"
44 #include "object/object-kind.h"
46 #include "player-class.h"
47 #include "player-personality.h"
48 #include "player-sex.h"
49 #include "player-skill.h"
50 #include "player-status.h"
51 #include "player/process-name.h"
52 #include "player/race-info-table.h"
54 #include "realm/realm.h"
56 #include "spell/spells-util.h"
57 #include "spells-status.h"
58 #include "view/display-main-window.h" // 暫定。後で消す.
59 #include "view/display-player.h" // 暫定。後で消す.
61 #include "world/world.h"
64 * The last character rolled,
65 * holded for quick start
67 birther previous_char;
71 * How often the autoroller will update the display and pause
72 * to check for user interuptions.
73 * Bigger values will make the autoroller faster, but slower
74 * system may have problems because the user can't stop the
75 * autoroller for this number of rolls.
77 #define AUTOROLLER_STEP 5431L
80 * ランダムクエストのモンスターを確定するために試行する回数 / Maximum number of tries for selection of a proper quest monster
85 #define MAX_CLASS_CHOICE MAX_CLASS
87 /*! オートローラの能力値的要求水準 / Autoroll limit */
88 static s16b stat_limit[6];
90 /*! オートローラの年齢、身長、体重、社会的地位の要求水準 */
98 /*! オートローラ中、各能力値が水準を超えた回数 / Autoroll matches */
99 static s32b stat_match[6];
101 /*! オートローラの試行回数 / Autoroll round */
102 static s32b auto_round;
105 * @brief プレイヤー作成を中断して変愚蛮怒を終了する
108 static void birth_quit(void)
114 * @brief 指定されたヘルプファイルを表示する / Show specific help file
115 * @param creature_ptr プレーヤーへの参照ポインタ
116 * @param helpfile ファイル名
119 static void show_help(player_type* creature_ptr, concptr helpfile)
122 (void)show_file(creature_ptr, TRUE, helpfile, NULL, 0, 0);
127 * @brief プレイヤーの魔法領域を選択する / Choose from one of the available magical realms
128 * @param choices 選択可能な魔法領域のビット配列
129 * @param count 選択可能な魔法領域を返すポインタ群。
130 * @return 選択した魔法領域のID
132 static byte choose_realm(player_type* creature_ptr, s32b choices, int* count)
134 int picks[VALID_REALM] = { 0 };
136 byte auto_select = REALM_NONE;
139 char sym[VALID_REALM];
141 char buf[80], cur[80];
143 /* Count the choices */
144 if (choices & CH_LIFE) {
146 auto_select = REALM_LIFE;
149 if (choices & CH_SORCERY) {
151 auto_select = REALM_SORCERY;
154 if (choices & CH_NATURE) {
156 auto_select = REALM_NATURE;
159 if (choices & CH_CHAOS) {
161 auto_select = REALM_CHAOS;
164 if (choices & CH_DEATH) {
166 auto_select = REALM_DEATH;
169 if (choices & CH_TRUMP) {
171 auto_select = REALM_TRUMP;
174 if (choices & CH_ARCANE) {
176 auto_select = REALM_ARCANE;
179 if (choices & CH_ENCHANT) {
181 auto_select = REALM_CRAFT;
184 if (choices & CH_DAEMON) {
186 auto_select = REALM_DAEMON;
189 if (choices & CH_CRUSADE) {
191 auto_select = REALM_CRUSADE;
194 if (choices & CH_MUSIC) {
196 auto_select = REALM_MUSIC;
199 if (choices & CH_HISSATSU) {
201 auto_select = REALM_HISSATSU;
204 if (choices & CH_HEX) {
206 auto_select = REALM_HEX;
211 /* Auto-select the realm */
215 /* Constraint to the 1st realm */
216 if (creature_ptr->realm2 != 255) {
217 if (creature_ptr->pclass == CLASS_PRIEST) {
218 if (is_good_realm(creature_ptr->realm1)) {
219 choices &= ~(CH_DEATH | CH_DAEMON);
221 choices &= ~(CH_LIFE | CH_CRUSADE);
227 put_str(_("注意:魔法の領域の選択によりあなたが習得する呪文のタイプが決まります。",
228 "Note: The realm of magic will determine which spells you can learn."), 23, 5);
231 for (i = 0; i < 32; i++) {
233 if (choices & (1L << i)) {
234 if (creature_ptr->realm1 == i + 1) {
235 if (creature_ptr->realm2 == 255)
240 if (creature_ptr->realm2 == i + 1)
245 sprintf(buf, "%c%c %s", sym[n], p2, realm_names[i + 1]);
246 put_str(buf, 12 + (n / 5), 2 + 15 * (n % 5));
250 sprintf(cur, "%c%c %s", '*', p2, _("ランダム", "Random"));
258 c_put_str(TERM_WHITE, cur, 12 + (os / 5), 2 + 15 * (os % 5));
261 sprintf(cur, "%c%c %s", '*', p2, _("ランダム", "Random"));
263 sprintf(cur, "%c%c %s", sym[cs], p2, realm_names[picks[cs]]);
264 sprintf(buf, "%s", realm_names[picks[cs]]);
265 c_put_str(TERM_L_BLUE, buf, 3, 40);
266 prt(_("の特徴", ": Characteristic"), 3, 40 + strlen(buf));
267 prt(realm_subinfo[technic2magic(picks[cs]) - 1], 4, 40);
269 c_put_str(TERM_YELLOW, cur, 12 + (cs / 5), 2 + 15 * (cs % 5));
276 sprintf(buf, _("領域を選んで下さい(%c-%c) ('='初期オプション設定): ", "Choose a realm (%c-%c) ('=' for options): "), sym[0], sym[n - 1]);
278 put_str(buf, 10, 10);
286 if (c == ' ' || c == '\r' || c == '\n') {
321 k = (islower(c) ? A2I(c) : -1);
322 if ((k >= 0) && (k < n)) {
327 k = (isupper(c) ? (26 + c - 'A') : -1);
328 if ((k >= 26) && (k < n)) {
335 show_help(creature_ptr, _("jmagic.txt#MagicRealms", "magic.txt#MagicRealms"));
336 } else if (c == '=') {
338 do_cmd_options_aux(OPT_PAGE_BIRTH, _("初期オプション((*)はスコアに影響)", "Birth option((*)s effect score)"));
341 } else if (c != '2' && c != '4' && c != '6' && c != '8')
346 return (byte)(picks[k]);
350 * @brief 選択した魔法領域の解説を表示する / Choose the magical realms
351 * @return ユーザが魔法領域の確定を選んだらTRUEを返す。
353 static bool get_player_realms(player_type* creature_ptr)
357 /* Clean up infomation of modifications */
362 /* Select the first realm */
363 creature_ptr->realm1 = REALM_NONE;
364 creature_ptr->realm2 = 255;
369 creature_ptr->realm1 = choose_realm(creature_ptr, realm_choices1[creature_ptr->pclass], &count);
371 if (255 == creature_ptr->realm1)
373 if (!creature_ptr->realm1)
382 roff_to_buf(realm_explanations[technic2magic(creature_ptr->realm1) - 1], 74, temp, sizeof(temp));
384 for (i = 0; i < 10; i++) {
394 prt(_("何かキーを押してください", "Hit any key."), 0, 0);
398 } else if (get_check_strict(_("よろしいですか?", "Are you sure? "), CHECK_DEFAULT_Y))
402 /* Select the second realm */
403 creature_ptr->realm2 = REALM_NONE;
404 if (creature_ptr->realm1) {
405 /* Print the realm */
406 put_str(_("魔法 :", "Magic :"), 6, 1);
407 c_put_str(TERM_L_BLUE, realm_names[creature_ptr->realm1], 6, 15);
409 /* Select the second realm */
415 creature_ptr->realm2 = choose_realm(creature_ptr, realm_choices2[creature_ptr->pclass], &count);
417 if (255 == creature_ptr->realm2)
419 if (!creature_ptr->realm2)
428 roff_to_buf(realm_explanations[technic2magic(creature_ptr->realm2) - 1], 74, temp, sizeof(temp));
430 for (i = 0; i < A_MAX; i++) {
440 prt(_("何かキーを押してください", "Hit any key."), 0, 0);
444 } else if (get_check_strict(_("よろしいですか?", "Are you sure? "), CHECK_DEFAULT_Y))
447 if (creature_ptr->realm2) {
448 /* Print the realm */
449 c_put_str(TERM_L_BLUE, format("%s, %s", realm_names[creature_ptr->realm1], realm_names[creature_ptr->realm2]), 6, 15);
457 * @brief プレイヤーのクイックスタート情報をプレイヤー構造体から保存する / Save the current data for later
458 * @param birther_ptr クイックスタート構造体の参照ポインタ
461 static void save_prev_data(player_type* creature_ptr, birther* birther_ptr)
466 birther_ptr->psex = creature_ptr->psex;
467 birther_ptr->prace = creature_ptr->prace;
468 birther_ptr->pclass = creature_ptr->pclass;
469 birther_ptr->pseikaku = creature_ptr->pseikaku;
470 birther_ptr->realm1 = creature_ptr->realm1;
471 birther_ptr->realm2 = creature_ptr->realm2;
472 birther_ptr->age = creature_ptr->age;
473 birther_ptr->ht = creature_ptr->ht;
474 birther_ptr->wt = creature_ptr->wt;
475 birther_ptr->sc = creature_ptr->sc;
476 birther_ptr->au = creature_ptr->au;
479 for (i = 0; i < A_MAX; i++) {
480 birther_ptr->stat_max[i] = creature_ptr->stat_max[i];
481 birther_ptr->stat_max_max[i] = creature_ptr->stat_max_max[i];
485 for (i = 0; i < PY_MAX_LEVEL; i++) {
486 birther_ptr->player_hp[i] = creature_ptr->player_hp[i];
489 birther_ptr->chaos_patron = creature_ptr->chaos_patron;
491 /* Save the virtues */
492 for (i = 0; i < 8; i++) {
493 birther_ptr->vir_types[i] = creature_ptr->vir_types[i];
496 /* Save the history */
497 for (i = 0; i < 4; i++) {
498 strcpy(birther_ptr->history[i], creature_ptr->history[i]);
503 * @brief プレイヤーのクイックスタート情報をプレイヤー構造体へ読み込む / Load the previous data
504 * @param swap TRUEならば現在のプレイヤー構造体上との内容をスワップする形で読み込む。
507 static void load_prev_data(player_type* creature_ptr, bool swap)
513 /*** Save the current data ***/
515 save_prev_data(creature_ptr, &temp);
517 /*** Load the previous data ***/
520 creature_ptr->psex = previous_char.psex;
521 creature_ptr->prace = previous_char.prace;
522 creature_ptr->pclass = previous_char.pclass;
523 creature_ptr->pseikaku = previous_char.pseikaku;
524 creature_ptr->realm1 = previous_char.realm1;
525 creature_ptr->realm2 = previous_char.realm2;
526 creature_ptr->age = previous_char.age;
527 creature_ptr->ht = previous_char.ht;
528 creature_ptr->wt = previous_char.wt;
529 creature_ptr->sc = previous_char.sc;
530 creature_ptr->au = previous_char.au;
533 for (i = 0; i < A_MAX; i++) {
534 creature_ptr->stat_cur[i] = creature_ptr->stat_max[i] = previous_char.stat_max[i];
535 creature_ptr->stat_max_max[i] = previous_char.stat_max_max[i];
539 for (i = 0; i < PY_MAX_LEVEL; i++) {
540 creature_ptr->player_hp[i] = previous_char.player_hp[i];
542 creature_ptr->mhp = creature_ptr->player_hp[0];
543 creature_ptr->chp = creature_ptr->player_hp[0];
545 creature_ptr->chaos_patron = previous_char.chaos_patron;
547 for (i = 0; i < 8; i++) {
548 creature_ptr->vir_types[i] = previous_char.vir_types[i];
551 /* Load the history */
552 for (i = 0; i < 4; i++) {
553 strcpy(creature_ptr->history[i], previous_char.history[i]);
556 /*** Save the previous data ***/
558 (void)COPY(&previous_char, &temp, birther);
563 * @brief プレイヤーの能力値表現に基づいて加減算を行う。
564 * @param value 現在の能力値
565 * @param amount 加減算する値
568 static int adjust_stat(int value, int amount)
572 /* Negative amounts */
575 for (i = 0; i < (0 - amount); i++) {
576 if (value >= 18 + 10) {
578 } else if (value > 18) {
580 } else if (value > 3) {
586 /* Positive amounts */
587 else if (amount > 0) {
589 for (i = 0; i < amount; i++) {
598 /* Return the result */
603 * @brief プレイヤーの能力値を一通りロールする。 / Roll for a characters stats
605 * calc_bonuses()による、独立ステータスからの副次ステータス算出も行っている。
606 * For efficiency, we include a chunk of "calc_bonuses()".\n
609 static void get_stats(player_type* creature_ptr)
611 /* Roll and verify some stats */
617 for (i = 0; i < 2; i++) {
618 s32b tmp = randint0(60 * 60 * 60);
621 /* Extract 5 + 1d3 + 1d4 + 1d5 */
630 /* Save that value */
632 creature_ptr->stat_cur[3 * i] = creature_ptr->stat_max[3 * i] = val;
634 /* Extract 5 + 1d3 + 1d4 + 1d5 */
643 /* Save that value */
645 creature_ptr->stat_cur[3 * i + 1] = creature_ptr->stat_max[3 * i + 1] = val;
647 /* Extract 5 + 1d3 + 1d4 + 1d5 */
653 val += (BASE_STATUS)tmp;
655 /* Save that value */
657 creature_ptr->stat_cur[3 * i + 2] = creature_ptr->stat_max[3 * i + 2] = val;
661 if ((sum > 42 + 5 * 6) && (sum < 57 + 5 * 6))
663 /* 57 was 54... I hate 'magic numbers' :< TY */
668 * @brief プレイヤーの限界ステータスを決める。
671 void get_max_stats(player_type* creature_ptr)
676 /* Roll and verify some stats */
679 for (j = i = 0; i < A_MAX; i++) {
681 dice[i] = randint1(7);
683 /* Collect the maximum */
692 /* Acquire the stats */
693 for (i = 0; i < A_MAX; i++) {
694 BASE_STATUS max_max = 18 + 60 + dice[i] * 10;
696 /* Save that value */
697 creature_ptr->stat_max_max[i] = max_max;
698 if (creature_ptr->stat_max[i] > max_max)
699 creature_ptr->stat_max[i] = max_max;
700 if (creature_ptr->stat_cur[i] > max_max)
701 creature_ptr->stat_cur[i] = max_max;
703 creature_ptr->knowledge &= ~(KNOW_STAT);
704 creature_ptr->redraw |= (PR_STATS);
708 * @brief その他「オートローラ中は算出の対象にしない」副次ステータスを処理する / Roll for some info that the auto-roller ignores
711 static void get_extra(player_type* creature_ptr, bool roll_hitdie)
715 /* Experience factor */
716 if (creature_ptr->prace == RACE_ANDROID)
717 creature_ptr->expfact = rp_ptr->r_exp;
719 creature_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
721 if (((creature_ptr->pclass == CLASS_MONK) ||
722 (creature_ptr->pclass == CLASS_FORCETRAINER) ||
723 (creature_ptr->pclass == CLASS_NINJA)) && ((creature_ptr->prace == RACE_KLACKON) ||
724 (creature_ptr->prace == RACE_SPRITE)))
725 creature_ptr->expfact -= 15;
727 /* Reset record of race/realm changes */
728 creature_ptr->start_race = creature_ptr->prace;
729 creature_ptr->old_race1 = 0L;
730 creature_ptr->old_race2 = 0L;
731 creature_ptr->old_realm = 0;
733 for (i = 0; i < 64; i++) {
734 if (creature_ptr->pclass == CLASS_SORCERER)
735 creature_ptr->spell_exp[i] = SPELL_EXP_MASTER;
736 else if (creature_ptr->pclass == CLASS_RED_MAGE)
737 creature_ptr->spell_exp[i] = SPELL_EXP_SKILLED;
739 creature_ptr->spell_exp[i] = SPELL_EXP_UNSKILLED;
742 for (i = 0; i < 5; i++)
743 for (j = 0; j < 64; j++)
744 creature_ptr->weapon_exp[i][j] = s_info[creature_ptr->pclass].w_start[i][j];
745 if ((creature_ptr->pseikaku == SEIKAKU_SEXY) && (creature_ptr->weapon_exp[TV_HAFTED - TV_WEAPON_BEGIN][SV_WHIP] < WEAPON_EXP_BEGINNER)) {
746 creature_ptr->weapon_exp[TV_HAFTED - TV_WEAPON_BEGIN][SV_WHIP] = WEAPON_EXP_BEGINNER;
749 for (i = 0; i < GINOU_MAX; i++)
750 creature_ptr->skill_exp[i] = s_info[creature_ptr->pclass].s_start[i];
753 if (creature_ptr->pclass == CLASS_SORCERER)
754 creature_ptr->hitdie = rp_ptr->r_mhp / 2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
756 creature_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
758 /* Roll for hit point unless quick-start */
760 roll_hitdice(creature_ptr, SPOP_NO_UPDATE);
762 /* Initial hitpoints */
763 creature_ptr->mhp = creature_ptr->player_hp[0];
767 * @brief プレイヤーの生い立ちの自動生成を行う。 / Get the racial history, and social class, using the "history charts".
770 static void get_history(player_type* creature_ptr)
772 int i, n, chart, roll, social_class;
778 /* Clear the previous history strings */
779 for (i = 0; i < 4; i++)
780 creature_ptr->history[i][0] = '\0';
782 /* Clear the history text */
785 /* Initial social class */
786 social_class = randint1(4);
789 switch (creature_ptr->prace) {
790 case RACE_AMBERITE: {
800 case RACE_HALF_ELF: {
805 case RACE_HIGH_ELF: {
821 case RACE_HALF_ORC: {
825 case RACE_HALF_TROLL: {
829 case RACE_DARK_ELF: {
833 case RACE_HALF_OGRE: {
837 case RACE_HALF_GIANT: {
841 case RACE_HALF_TITAN: {
861 case RACE_NIBELUNG: {
865 case RACE_DRACONIAN: {
869 case RACE_MIND_FLAYER: {
881 case RACE_SKELETON: {
901 case RACE_BEASTMAN: {
939 /* Process the history */
944 /* Roll for nobility */
945 roll = randint1(100);
947 /* Access the proper entry in the table */
948 while ((chart != bg[i].chart) || (roll > bg[i].roll)) {
952 /* Acquire the textual history */
953 (void)strcat(buf, bg[i].info);
955 /* Add in the social class */
956 social_class += (int)(bg[i].bonus) - 50;
958 /* Enter the next chart */
962 /* Verify social class */
963 if (social_class > 100)
965 else if (social_class < 1)
968 /* Save the social class */
969 creature_ptr->sc = (s16b)social_class;
971 /* Skip leading spaces */
972 for (s = buf; *s == ' '; s++) /* loop */
975 /* Get apparent length */
978 /* Kill trailing spaces */
980 while ((n > 0) && (s[n - 1] == ' '))
985 roff_to_buf(s, 60, temp, sizeof(temp));
987 for (i = 0; i < 4; i++) {
991 strcpy(creature_ptr->history[i], t);
999 * @brief プレイヤーの身長体重を決める / Get character's height and weight
1002 void get_height_weight(player_type* creature_ptr)
1004 int h_percent; /* 身長が平均にくらべてどのくらい違うか. */
1006 /* Calculate the height/weight for males */
1007 if (creature_ptr->psex == SEX_MALE) {
1008 creature_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
1009 h_percent = (int)(creature_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
1010 creature_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent / 100, (int)(rp_ptr->m_m_wt) * h_percent / 300);
1013 /* Calculate the height/weight for females */
1014 else if (creature_ptr->psex == SEX_FEMALE) {
1015 creature_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
1016 h_percent = (int)(creature_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
1017 creature_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent / 100, (int)(rp_ptr->f_m_wt) * h_percent / 300);
1022 * @brief プレイヤーの年齢を決める。 / Computes character's age, height, and weight by henkma
1023 * @details 内部でget_height_weight()も呼び出している。
1026 static void get_ahw(player_type* creature_ptr)
1028 /* Get character's age */
1029 creature_ptr->age = rp_ptr->b_age + randint1(rp_ptr->m_age);
1031 /* Get character's height and weight */
1032 get_height_weight(creature_ptr);
1036 * @brief プレイヤーの初期所持金を決める。 / Get the player's starting money
1039 static void get_money(player_type* creature_ptr)
1043 /* Social Class determines starting gold */
1044 gold = (creature_ptr->sc * 6) + randint1(100) + 300;
1045 if (creature_ptr->pclass == CLASS_TOURIST)
1048 /* Process the stats */
1049 for (i = 0; i < A_MAX; i++) {
1050 /* Mega-Hack -- reduce gold for high stats */
1051 if (creature_ptr->stat_max[i] >= 18 + 50)
1053 else if (creature_ptr->stat_max[i] >= 18 + 20)
1055 else if (creature_ptr->stat_max[i] > 18)
1058 gold -= (creature_ptr->stat_max[i] - 8) * 10;
1061 /* Minimum 100 gold */
1065 if (creature_ptr->pseikaku == SEIKAKU_NAMAKE)
1067 else if (creature_ptr->pseikaku == SEIKAKU_MUNCHKIN)
1069 if (creature_ptr->prace == RACE_ANDROID)
1073 creature_ptr->au = gold;
1077 * @brief put_stats()のサブルーチンとして、オートロール中のステータスを表示する / Display stat values, subset of "put_stats()"
1078 * @details See 'display_player(p_ptr, )' for screen layout constraints.
1081 static void birth_put_stats(player_type* creature_ptr)
1090 /* Put the stats (and percents) */
1091 for (i = 0; i < A_MAX; i++) {
1092 /* Race/Class bonus */
1093 j = rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i];
1095 /* Obtain the current stat */
1096 m = adjust_stat(creature_ptr->stat_max[i], j);
1100 c_put_str(TERM_L_GREEN, buf, 3 + i, col + 24);
1102 /* Put the percent */
1103 if (stat_match[i]) {
1104 if (stat_match[i] > 1000000L) {
1105 /* Prevent overflow */
1106 p = stat_match[i] / (auto_round / 1000L);
1108 p = 1000L * stat_match[i] / auto_round;
1111 attr = (p < 100) ? TERM_YELLOW : TERM_L_GREEN;
1112 sprintf(buf, "%3d.%d%%", p / 10, p % 10);
1113 c_put_str(attr, buf, 3 + i, col + 13);
1116 /* Never happened */
1118 c_put_str(TERM_RED, _("(なし)", "(NONE)"), 3 + i, col + 13);
1125 * @brief ベースアイテム構造体の鑑定済みフラグをリセットする。
1128 static void k_info_reset(void)
1132 /* Reset the "objects" */
1133 for (i = 1; i < max_k_idx; i++) {
1134 object_kind* k_ptr = &k_info[i];
1137 k_ptr->tried = FALSE;
1140 k_ptr->aware = FALSE;
1145 * @brief プレイヤー構造体の内容を初期値で消去する(名前を除く) / Clear all the global "character" data (without name)
1148 static void player_wipe_without_name(player_type* creature_ptr)
1153 /* Temporary copy for migration - written back later */
1154 COPY(&tmp, creature_ptr, player_type);
1156 /* Hack -- free the "last message" string */
1157 if (creature_ptr->last_message)
1158 string_free(creature_ptr->last_message);
1160 if (creature_ptr->inventory_list != NULL)
1161 C_WIPE(creature_ptr->inventory_list, INVEN_TOTAL, object_type);
1163 /* Hack -- zero the struct */
1164 (void)WIPE(creature_ptr, player_type);
1166 //TODO: キャラ作成からゲーム開始までに current_floor_ptr を参照しなければならない処理は今後整理して外す。
1167 creature_ptr->current_floor_ptr = &floor_info;
1169 C_MAKE(creature_ptr->inventory_list, INVEN_TOTAL, object_type);
1171 /* Wipe the history */
1172 for (i = 0; i < 4; i++) {
1173 strcpy(creature_ptr->history[i], "");
1176 /* Wipe the quests */
1177 for (i = 0; i < max_q_idx; i++) {
1178 quest_type* const q_ptr = &quest[i];
1180 q_ptr->status = QUEST_STATUS_UNTAKEN;
1188 q_ptr->comptime = 0;
1192 creature_ptr->total_weight = 0;
1195 creature_ptr->inven_cnt = 0;
1196 creature_ptr->equip_cnt = 0;
1198 /* Clear the inventory */
1199 for (i = 0; i < INVEN_TOTAL; i++) {
1200 object_wipe(&creature_ptr->inventory_list[i]);
1203 /* Start with no artifacts made yet */
1204 for (i = 0; i < max_a_idx; i++) {
1205 artifact_type* a_ptr = &a_info[i];
1209 /* Reset the objects */
1212 /* Reset the "monsters" */
1213 for (i = 1; i < max_r_idx; i++) {
1214 monster_race* r_ptr = &r_info[i];
1216 /* Hack -- Reset the counter */
1219 /* Hack -- Reset the max counter */
1220 r_ptr->max_num = 100;
1222 /* Hack -- Reset the max counter */
1223 if (r_ptr->flags1 & RF1_UNIQUE)
1226 /* Hack -- Non-unique Nazguls are semi-unique */
1227 else if (r_ptr->flags7 & RF7_NAZGUL)
1228 r_ptr->max_num = MAX_NAZGUL_NUM;
1230 /* Clear visible kills in this life */
1231 r_ptr->r_pkills = 0;
1233 /* Clear all kills in this life */
1234 r_ptr->r_akills = 0;
1237 /* Hack -- Well fed player */
1238 creature_ptr->food = PY_FOOD_FULL - 1;
1240 /* Wipe the spells */
1241 if (creature_ptr->pclass == CLASS_SORCERER) {
1242 creature_ptr->spell_learned1 = creature_ptr->spell_learned2 = 0xffffffffL;
1243 creature_ptr->spell_worked1 = creature_ptr->spell_worked2 = 0xffffffffL;
1245 creature_ptr->spell_learned1 = creature_ptr->spell_learned2 = 0L;
1246 creature_ptr->spell_worked1 = creature_ptr->spell_worked2 = 0L;
1248 creature_ptr->spell_forgotten1 = creature_ptr->spell_forgotten2 = 0L;
1249 for (i = 0; i < 64; i++)
1250 creature_ptr->spell_order[i] = 99;
1251 creature_ptr->learned_spells = 0;
1252 creature_ptr->add_spells = 0;
1253 creature_ptr->knowledge = 0;
1255 /* Clean the mutation count */
1256 creature_ptr->mutant_regenerate_mod = 100;
1258 /* Clear "cheat" options */
1266 cheat_diary_output = FALSE;
1269 /* Assume no winning game */
1270 current_world_ptr->total_winner = FALSE;
1272 creature_ptr->timewalk = FALSE;
1274 /* Assume no panic save */
1275 creature_ptr->panic_save = 0;
1277 /* Assume no cheating */
1278 current_world_ptr->noscore = 0;
1279 current_world_ptr->wizard = FALSE;
1281 /* Not waiting to report score */
1282 creature_ptr->wait_report_score = FALSE;
1284 /* Default pet command settings */
1285 creature_ptr->pet_follow_distance = PET_FOLLOW_DIST;
1286 creature_ptr->pet_extra_flags = (PF_TELEPORT | PF_ATTACK_SPELL | PF_SUMMON_SPELL);
1288 /* Wipe the recall depths */
1289 for (i = 0; i < current_world_ptr->max_d_idx; i++) {
1293 creature_ptr->visit = 1;
1295 /* Reset wild_mode to FALSE */
1296 creature_ptr->wild_mode = FALSE;
1298 for (i = 0; i < 108; i++) {
1299 creature_ptr->magic_num1[i] = 0;
1300 creature_ptr->magic_num2[i] = 0;
1304 creature_ptr->max_plv = creature_ptr->lev = 1;
1306 /* Initialize arena and rewards information -KMW- */
1307 creature_ptr->arena_number = 0;
1308 creature_ptr->current_floor_ptr->inside_arena = FALSE;
1309 creature_ptr->current_floor_ptr->inside_quest = 0;
1310 for (i = 0; i < MAX_MANE; i++) {
1311 creature_ptr->mane_spell[i] = -1;
1312 creature_ptr->mane_dam[i] = 0;
1315 creature_ptr->mane_num = 0;
1316 creature_ptr->exit_bldg = TRUE; /* only used for arena now -KMW- */
1319 creature_ptr->today_mon = 0;
1321 /* Reset monster arena */
1322 update_gambling_monsters(creature_ptr);
1324 /* Reset mutations */
1325 creature_ptr->muta1 = 0;
1326 creature_ptr->muta2 = 0;
1327 creature_ptr->muta3 = 0;
1330 for (i = 0; i < 8; i++)
1331 creature_ptr->virtues[i] = 0;
1333 creature_ptr->dungeon_idx = 0;
1335 /* Set the recall dungeon accordingly */
1336 if (vanilla_town || ironman_downward) {
1337 creature_ptr->recall_dungeon = DUNGEON_ANGBAND;
1339 creature_ptr->recall_dungeon = DUNGEON_GALGALS;
1342 /* Data migration */
1343 memcpy(creature_ptr->name, tmp.name, sizeof(tmp.name));
1347 * @brief ダンジョン内部のクエストを初期化する / Initialize random quests and final quests
1348 * @param creature_ptr プレーヤーへの参照ポインタ
1351 static void init_dungeon_quests(player_type* creature_ptr)
1353 int number_of_quests = MAX_RANDOM_QUEST - MIN_RANDOM_QUEST + 1;
1356 /* Init the random quests */
1357 init_flags = INIT_ASSIGN;
1358 floor_type* floor_ptr = creature_ptr->current_floor_ptr;
1359 floor_ptr->inside_quest = MIN_RANDOM_QUEST;
1361 process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
1363 floor_ptr->inside_quest = 0;
1365 /* Generate quests */
1366 for (i = MIN_RANDOM_QUEST + number_of_quests - 1; i >= MIN_RANDOM_QUEST; i--) {
1367 quest_type* q_ptr = &quest[i];
1368 monster_race* quest_r_ptr;
1370 q_ptr->status = QUEST_STATUS_TAKEN;
1371 determine_random_questor(creature_ptr, q_ptr);
1374 quest_r_ptr = &r_info[q_ptr->r_idx];
1375 quest_r_ptr->flags1 |= RF1_QUESTOR;
1380 /* Init the two main quests (Oberon + Serpent) */
1381 init_flags = INIT_ASSIGN;
1382 floor_ptr->inside_quest = QUEST_OBERON;
1384 process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
1386 quest[QUEST_OBERON].status = QUEST_STATUS_TAKEN;
1388 floor_ptr->inside_quest = QUEST_SERPENT;
1390 process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
1392 quest[QUEST_SERPENT].status = QUEST_STATUS_TAKEN;
1393 floor_ptr->inside_quest = 0;
1397 * @brief ゲームターンを初期化する / Reset turn
1398 * @details アンデッド系種族は開始時刻を夜からにする。
1401 static void init_turn(player_type* creature_ptr)
1403 if ((creature_ptr->prace == RACE_VAMPIRE) || (creature_ptr->prace == RACE_SKELETON) || (creature_ptr->prace == RACE_ZOMBIE) || (creature_ptr->prace == RACE_SPECTRE)) {
1404 /* Undead start just after midnight */
1405 current_world_ptr->game_turn = (TURNS_PER_TICK * 3 * TOWN_DAWN) / 4 + 1;
1406 current_world_ptr->game_turn_limit = TURNS_PER_TICK * TOWN_DAWN * MAX_DAYS + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
1408 current_world_ptr->game_turn = 1;
1409 current_world_ptr->game_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
1412 current_world_ptr->dungeon_turn = 1;
1413 current_world_ptr->dungeon_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
1417 * @brief 所持状態にあるアイテムの中から一部枠の装備可能なものを装備させる。
1420 static void wield_all(player_type* creature_ptr)
1424 object_type object_type_body;
1429 /* Scan through the slots backwards */
1430 for (item = INVEN_PACK - 1; item >= 0; item--) {
1431 o_ptr = &creature_ptr->inventory_list[item];
1433 /* Skip non-objects */
1437 /* Make sure we can wield it and that there's nothing else in that slot */
1438 slot = wield_slot(creature_ptr, o_ptr);
1439 if (slot < INVEN_RARM)
1441 if (slot == INVEN_LITE)
1442 continue; /* Does not wield toaches because buys a lantern soon */
1443 if (creature_ptr->inventory_list[slot].k_idx)
1446 i_ptr = &object_type_body;
1447 object_copy(i_ptr, o_ptr);
1450 /* Decrease the item (from the pack) */
1452 inven_item_increase(creature_ptr, item, -1);
1453 inven_item_optimize(creature_ptr, item);
1456 /* Decrease the item (from the floor) */
1458 floor_item_increase(creature_ptr->current_floor_ptr, 0 - item, -1);
1459 floor_item_optimize(creature_ptr, 0 - item);
1462 o_ptr = &creature_ptr->inventory_list[slot];
1463 object_copy(o_ptr, i_ptr);
1464 creature_ptr->total_weight += i_ptr->weight;
1466 /* Increment the equip counter by hand */
1467 creature_ptr->equip_cnt++;
1473 * プレイヤーの職業毎の初期装備テーブル。/\n
1474 * Each player starts out with a few items, given as tval/sval pairs.\n
1475 * In addition, he always has some food and a few torches.\n
1477 static byte player_init[MAX_CLASS][3][2] = {
1479 { TV_RING, SV_RING_RES_FEAR }, /* Warriors need it! */
1480 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1481 { TV_SWORD, SV_BROAD_SWORD } },
1484 { TV_SORCERY_BOOK, 0 }, /* Hack: for realm1 book */
1485 { TV_DEATH_BOOK, 0 }, /* Hack: for realm2 book */
1486 { TV_SWORD, SV_DAGGER } },
1489 { TV_SORCERY_BOOK, 0 }, /* Hack: for Life / Death book */
1490 { TV_DEATH_BOOK, 0 }, /* Hack: for realm2 book */
1491 { TV_HAFTED, SV_MACE } },
1494 { TV_SORCERY_BOOK, 0 }, /* Hack: for realm1 book */
1495 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1496 { TV_SWORD, SV_DAGGER } },
1499 { TV_NATURE_BOOK, 0 },
1500 { TV_DEATH_BOOK, 0 }, /* Hack: for realm2 book */
1501 { TV_SWORD, SV_DAGGER } },
1504 { TV_SORCERY_BOOK, 0 },
1505 { TV_SCROLL, SV_SCROLL_PROTECTION_FROM_EVIL },
1506 { TV_SWORD, SV_BROAD_SWORD } },
1508 { /* Warrior-Mage */
1509 { TV_SORCERY_BOOK, 0 }, /* Hack: for realm1 book */
1510 { TV_DEATH_BOOK, 0 }, /* Hack: for realm2 book */
1511 { TV_SWORD, SV_SHORT_SWORD } },
1513 { /* Chaos Warrior */
1514 { TV_SORCERY_BOOK, 0 }, /* Hack: For realm1 book */
1515 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1516 { TV_SWORD, SV_BROAD_SWORD } },
1519 { TV_SORCERY_BOOK, 0 },
1520 { TV_POTION, SV_POTION_SPEED },
1521 { TV_POTION, SV_POTION_HEROISM } },
1524 { TV_POTION, SV_POTION_SPEED },
1525 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1526 { TV_SWORD, SV_SMALL_SWORD } },
1529 { TV_SORCERY_BOOK, 0 }, /* Hack: for realm1 book */
1530 { TV_RING, SV_RING_SUSTAIN_INT },
1531 { TV_SWORD, SV_DAGGER } },
1534 { TV_FOOD, SV_FOOD_JERKY },
1535 { TV_SCROLL, SV_SCROLL_MAPPING },
1536 { TV_BOW, SV_SLING } },
1539 { TV_POTION, SV_POTION_SPEED },
1540 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1541 { TV_SWORD, SV_SHORT_SWORD } },
1544 { TV_TRUMP_BOOK, 0 },
1545 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1546 { TV_POLEARM, SV_SPEAR } },
1549 { TV_HAFTED, SV_WIZSTAFF }, /* Hack: for realm1 book */
1550 { TV_RING, SV_RING_SUSTAIN_INT },
1551 { TV_WAND, SV_WAND_MAGIC_MISSILE } },
1555 { TV_BOW, SV_SHORT_BOW },
1556 { TV_SOFT_ARMOR, SV_LEATHER_SCALE_MAIL },
1557 { TV_SWORD, SV_SHORT_SWORD },
1562 { TV_WAND, SV_WAND_MAGIC_MISSILE },
1563 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1564 { TV_SWORD, SV_SHORT_SWORD },
1569 { TV_MUSIC_BOOK, 0 },
1570 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1571 { TV_SWORD, SV_SHORT_SWORD },
1576 { TV_ARCANE_BOOK, 0 },
1577 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1578 { TV_SWORD, SV_SHORT_SWORD },
1582 { TV_HISSATSU_BOOK, 0 },
1583 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1584 { TV_SWORD, SV_BROAD_SWORD } },
1586 { /* ForceTrainer */
1587 { TV_SORCERY_BOOK, 0 },
1588 { TV_POTION, SV_POTION_SPEED },
1589 { TV_POTION, SV_POTION_RESTORE_MANA } },
1592 { TV_SOFT_ARMOR, SV_ROBE },
1593 { TV_WAND, SV_WAND_MAGIC_MISSILE },
1594 { TV_SWORD, SV_DAGGER } },
1597 { TV_BOW, SV_SHORT_BOW },
1598 { TV_SOFT_ARMOR, SV_LEATHER_SCALE_MAIL },
1599 { TV_POLEARM, SV_BROAD_SPEAR } },
1602 { TV_POTION, SV_POTION_HEALING },
1603 { TV_HARD_ARMOR, SV_AUGMENTED_CHAIN_MAIL },
1604 { TV_POLEARM, SV_BROAD_AXE } },
1607 { TV_RING, SV_RING_RES_FEAR }, /* Warriors need it! */
1608 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1609 { TV_POLEARM, SV_BROAD_AXE } },
1610 { /* Mirror-Master */
1611 { TV_POTION, SV_POTION_SPEED },
1612 { TV_RING, SV_RING_SUSTAIN_INT },
1613 { TV_SWORD, SV_DAGGER } },
1615 { TV_POTION, SV_POTION_SPEED },
1616 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1617 { TV_SWORD, SV_DAGGER } },
1619 { TV_BOW, SV_LIGHT_XBOW },
1620 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1621 { TV_SWORD, SV_DAGGER } },
1625 * @brief 初期所持アイテムの処理 / Add an outfit object
1626 * @details アイテムを既知のものとした上でwield_all()関数により装備させる。
1627 * @param o_ptr 処理したいオブジェクト構造体の参照ポインタ
1630 static void add_outfit(player_type* creature_ptr, object_type* o_ptr)
1634 object_aware(creature_ptr, o_ptr);
1635 object_known(o_ptr);
1636 slot = inven_carry(creature_ptr, o_ptr);
1638 /* Auto-inscription */
1639 autopick_alter_item(creature_ptr, slot, FALSE);
1641 /* Now try wielding everything */
1642 wield_all(creature_ptr);
1646 * @brief 種族/職業/性格などに基づき初期所持アイテムを設定するメインセット関数。 / Init players with some belongings
1647 * @details Having an item makes the player "aware" of its purpose.
1650 void player_outfit(player_type* creature_ptr)
1653 OBJECT_TYPE_VALUE tv;
1654 OBJECT_SUBTYPE_VALUE sv;
1661 /* Give the player some food */
1662 switch (creature_ptr->prace) {
1665 /* Vampires can drain blood of creatures */
1669 /* Demon can drain vitality from humanoid corpse */
1670 get_mon_num_prep(creature_ptr, monster_hook_human, NULL);
1672 for (i = rand_range(3, 4); i > 0; i--) {
1673 object_prep(q_ptr, lookup_kind(TV_CORPSE, SV_CORPSE));
1674 q_ptr->pval = get_mon_num(creature_ptr, 2, 0);
1677 add_outfit(creature_ptr, q_ptr);
1686 /* Staff (of Nothing) */
1687 object_prep(q_ptr, lookup_kind(TV_STAFF, SV_STAFF_NOTHING));
1690 add_outfit(creature_ptr, q_ptr);
1694 /* Potions of Water */
1695 object_prep(q_ptr, lookup_kind(TV_POTION, SV_POTION_WATER));
1696 q_ptr->number = (ITEM_NUMBER)rand_range(15, 23);
1697 add_outfit(creature_ptr, q_ptr);
1703 object_prep(q_ptr, lookup_kind(TV_FLASK, SV_ANY));
1705 /* Fuel with oil (move pval to xtra4) */
1706 apply_magic(creature_ptr, q_ptr, 1, AM_NO_FIXED_ART);
1708 q_ptr->number = (ITEM_NUMBER)rand_range(7, 12);
1709 add_outfit(creature_ptr, q_ptr);
1715 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
1716 q_ptr->number = (ITEM_NUMBER)rand_range(3, 7);
1718 add_outfit(creature_ptr, q_ptr);
1722 if ((creature_ptr->prace == RACE_VAMPIRE) && (creature_ptr->pclass != CLASS_NINJA)) {
1723 /* Hack -- Give the player scrolls of DARKNESS! */
1724 object_prep(q_ptr, lookup_kind(TV_SCROLL, SV_SCROLL_DARKNESS));
1726 q_ptr->number = (ITEM_NUMBER)rand_range(2, 5);
1728 add_outfit(creature_ptr, q_ptr);
1729 } else if (creature_ptr->pclass != CLASS_NINJA) {
1730 /* Hack -- Give the player some torches */
1731 object_prep(q_ptr, lookup_kind(TV_LITE, SV_LITE_TORCH));
1732 q_ptr->number = (ITEM_NUMBER)rand_range(3, 7);
1733 q_ptr->xtra4 = rand_range(3, 7) * 500;
1735 add_outfit(creature_ptr, q_ptr);
1739 if (creature_ptr->prace == RACE_MERFOLK) {
1740 object_prep(q_ptr, lookup_kind(TV_RING, SV_RING_LEVITATION_FALL));
1742 add_outfit(creature_ptr, q_ptr);
1745 if ((creature_ptr->pclass == CLASS_RANGER) || (creature_ptr->pclass == CLASS_CAVALRY)) {
1746 /* Hack -- Give the player some arrows */
1747 object_prep(q_ptr, lookup_kind(TV_ARROW, SV_AMMO_NORMAL));
1748 q_ptr->number = (byte)rand_range(15, 20);
1750 add_outfit(creature_ptr, q_ptr);
1752 if (creature_ptr->pclass == CLASS_RANGER) {
1753 /* Hack -- Give the player some arrows */
1754 object_prep(q_ptr, lookup_kind(TV_BOW, SV_SHORT_BOW));
1756 add_outfit(creature_ptr, q_ptr);
1757 } else if (creature_ptr->pclass == CLASS_ARCHER) {
1758 /* Hack -- Give the player some arrows */
1759 object_prep(q_ptr, lookup_kind(TV_ARROW, SV_AMMO_NORMAL));
1760 q_ptr->number = (ITEM_NUMBER)rand_range(15, 20);
1762 add_outfit(creature_ptr, q_ptr);
1763 } else if (creature_ptr->pclass == CLASS_HIGH_MAGE) {
1764 /* Hack -- Give the player some arrows */
1765 object_prep(q_ptr, lookup_kind(TV_WAND, SV_WAND_MAGIC_MISSILE));
1767 q_ptr->pval = (PARAMETER_VALUE)rand_range(25, 30);
1769 add_outfit(creature_ptr, q_ptr);
1770 } else if (creature_ptr->pclass == CLASS_SORCERER) {
1771 OBJECT_TYPE_VALUE book_tval;
1772 for (book_tval = TV_LIFE_BOOK; book_tval <= TV_LIFE_BOOK + MAX_MAGIC - 1; book_tval++) {
1773 /* Hack -- Give the player some arrows */
1774 object_prep(q_ptr, lookup_kind(book_tval, 0));
1777 add_outfit(creature_ptr, q_ptr);
1779 } else if (creature_ptr->pclass == CLASS_TOURIST) {
1780 if (creature_ptr->pseikaku != SEIKAKU_SEXY) {
1781 /* Hack -- Give the player some arrows */
1782 object_prep(q_ptr, lookup_kind(TV_SHOT, SV_AMMO_LIGHT));
1783 q_ptr->number = rand_range(15, 20);
1785 add_outfit(creature_ptr, q_ptr);
1788 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_BISCUIT));
1789 q_ptr->number = rand_range(2, 4);
1791 add_outfit(creature_ptr, q_ptr);
1793 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_WAYBREAD));
1794 q_ptr->number = rand_range(2, 4);
1796 add_outfit(creature_ptr, q_ptr);
1798 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_JERKY));
1799 q_ptr->number = rand_range(1, 3);
1801 add_outfit(creature_ptr, q_ptr);
1803 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_PINT_OF_ALE));
1804 q_ptr->number = rand_range(2, 4);
1806 add_outfit(creature_ptr, q_ptr);
1808 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_PINT_OF_WINE));
1809 q_ptr->number = rand_range(2, 4);
1811 add_outfit(creature_ptr, q_ptr);
1812 } else if (creature_ptr->pclass == CLASS_NINJA) {
1813 /* Hack -- Give the player some arrows */
1814 object_prep(q_ptr, lookup_kind(TV_SPIKE, 0));
1815 q_ptr->number = rand_range(15, 20);
1817 add_outfit(creature_ptr, q_ptr);
1818 } else if (creature_ptr->pclass == CLASS_SNIPER) {
1819 /* Hack -- Give the player some bolts */
1820 object_prep(q_ptr, lookup_kind(TV_BOLT, SV_AMMO_NORMAL));
1821 q_ptr->number = rand_range(15, 20);
1823 add_outfit(creature_ptr, q_ptr);
1826 if (creature_ptr->pseikaku == SEIKAKU_SEXY) {
1827 player_init[creature_ptr->pclass][2][0] = TV_HAFTED;
1828 player_init[creature_ptr->pclass][2][1] = SV_WHIP;
1831 /* Hack -- Give the player three useful objects */
1832 for (i = 0; i < 3; i++) {
1833 /* Look up standard equipment */
1834 tv = player_init[creature_ptr->pclass][i][0];
1835 sv = player_init[creature_ptr->pclass][i][1];
1837 if ((creature_ptr->prace == RACE_ANDROID) && ((tv == TV_SOFT_ARMOR) || (tv == TV_HARD_ARMOR)))
1839 /* Hack to initialize spellbooks */
1840 if (tv == TV_SORCERY_BOOK)
1841 tv = TV_LIFE_BOOK + creature_ptr->realm1 - 1;
1842 else if (tv == TV_DEATH_BOOK)
1843 tv = TV_LIFE_BOOK + creature_ptr->realm2 - 1;
1845 else if (tv == TV_RING && sv == SV_RING_RES_FEAR && creature_ptr->prace == RACE_BARBARIAN)
1846 /* Barbarians do not need a ring of resist fear */
1847 sv = SV_RING_SUSTAIN_STR;
1849 else if (tv == TV_RING && sv == SV_RING_SUSTAIN_INT && creature_ptr->prace == RACE_MIND_FLAYER) {
1851 sv = SV_POTION_RESTORE_MANA;
1855 /* Hack -- Give the player an object */
1856 object_prep(q_ptr, lookup_kind(tv, sv));
1858 /* Assassins begin the game with a poisoned dagger */
1859 if ((tv == TV_SWORD || tv == TV_HAFTED) && (creature_ptr->pclass == CLASS_ROGUE && creature_ptr->realm1 == REALM_DEATH)) /* Only assassins get a poisoned weapon */
1861 q_ptr->name2 = EGO_BRAND_POIS;
1864 add_outfit(creature_ptr, q_ptr);
1867 /* Hack -- make aware of the water */
1868 k_info[lookup_kind(TV_POTION, SV_POTION_WATER)].aware = TRUE;
1872 * @brief プレイヤーの種族選択を行う / Player race
1875 static bool get_player_race(player_type* creature_ptr)
1880 char sym[MAX_RACES];
1882 char buf[80], cur[80];
1886 put_str(_("注意:《種族》によってキャラクターの先天的な資質やボーナスが変化します。",
1887 "Note: Your 'race' determines various intrinsic factors and bonuses."),
1891 for (n = 0; n < MAX_RACES; n++) {
1893 rp_ptr = &race_info[n];
1894 str = rp_ptr->title;
1900 sym[n] = ('A' + n - 26);
1901 sprintf(buf, "%c%c%s", sym[n], p2, str);
1902 put_str(buf, 12 + (n / 5), 1 + 16 * (n % 5));
1905 sprintf(cur, "%c%c%s", '*', p2, _("ランダム", "Random"));
1909 cs = creature_ptr->prace;
1914 c_put_str(TERM_WHITE, cur, 12 + (os / 5), 1 + 16 * (os % 5));
1915 put_str(" ", 3, 40);
1916 if (cs == MAX_RACES) {
1917 sprintf(cur, "%c%c%s", '*', p2, _("ランダム", "Random"));
1918 put_str(" ", 4, 40);
1919 put_str(" ", 5, 40);
1921 rp_ptr = &race_info[cs];
1922 str = rp_ptr->title;
1923 sprintf(cur, "%c%c%s", sym[cs], p2, str);
1924 c_put_str(TERM_L_BLUE, rp_ptr->title, 3, 40);
1925 put_str(_("腕力 知能 賢さ 器用 耐久 魅力 経験 ", "Str Int Wis Dex Con Chr EXP "), 4, 40);
1926 put_str(_("の種族修正", ": Race modification"), 3, 40 + strlen(rp_ptr->title));
1928 sprintf(buf, "%+3d %+3d %+3d %+3d %+3d %+3d %+4d%% ",
1929 rp_ptr->r_adj[0], rp_ptr->r_adj[1], rp_ptr->r_adj[2], rp_ptr->r_adj[3],
1930 rp_ptr->r_adj[4], rp_ptr->r_adj[5], (rp_ptr->r_exp - 100));
1931 c_put_str(TERM_L_BLUE, buf, 5, 40);
1933 c_put_str(TERM_YELLOW, cur, 12 + (cs / 5), 1 + 16 * (cs % 5));
1940 sprintf(buf, _("種族を選んで下さい (%c-%c) ('='初期オプション設定): ", "Choose a race (%c-%c) ('=' for options): "), sym[0], sym[MAX_RACES - 1]);
1942 put_str(buf, 10, 10);
1948 if (c == ' ' || c == '\r' || c == '\n') {
1949 if (cs == MAX_RACES) {
1950 k = randint0(MAX_RACES);
1959 k = randint0(MAX_RACES);
1976 if ((cs + 5) <= MAX_RACES)
1979 k = (islower(c) ? A2I(c) : -1);
1980 if ((k >= 0) && (k < MAX_RACES)) {
1984 k = (isupper(c) ? (26 + c - 'A') : -1);
1985 if ((k >= 26) && (k < MAX_RACES)) {
1992 show_help(creature_ptr, "jraceclas.txt#TheRaces");
1994 show_help(creature_ptr, "raceclas.txt#TheRaces");
1996 } else if (c == '=') {
1998 do_cmd_options_aux(OPT_PAGE_BIRTH, _("初期オプション((*)はスコアに影響)", "Birth Option((*)s effect score)"));
2000 } else if (c != '2' && c != '4' && c != '6' && c != '8')
2005 creature_ptr->prace = (byte)k;
2007 rp_ptr = &race_info[creature_ptr->prace];
2010 c_put_str(TERM_L_BLUE, rp_ptr->title, 4, 15);
2017 * @brief プレイヤーの職業選択を行う / Player class
2020 static bool get_player_class(player_type* creature_ptr)
2024 char sym[MAX_CLASS_CHOICE];
2026 char buf[80], cur[80];
2031 put_str(_("注意:《職業》によってキャラクターの先天的な能力やボーナスが変化します。",
2032 "Note: Your 'class' determines various intrinsic abilities and bonuses."),
2035 put_str(_("()で囲まれた選択肢はこの種族には似合わない職業です。",
2036 "Any entries in parentheses should only be used by advanced players."),
2040 for (n = 0; n < MAX_CLASS_CHOICE; n++) {
2042 cp_ptr = &class_info[n];
2043 mp_ptr = &m_info[n];
2044 str = cp_ptr->title;
2048 sym[n] = ('A' + n - 26);
2051 if (!(rp_ptr->choice & (1L << n)))
2052 sprintf(buf, "%c%c(%s)", sym[n], p2, str);
2054 sprintf(buf, "%c%c%s", sym[n], p2, str);
2056 put_str(buf, 13 + (n / 4), 2 + 19 * (n % 4));
2059 sprintf(cur, "%c%c%s", '*', p2, _("ランダム", "Random"));
2063 cs = creature_ptr->pclass;
2064 os = MAX_CLASS_CHOICE;
2068 c_put_str(TERM_WHITE, cur, 13 + (os / 4), 2 + 19 * (os % 4));
2069 put_str(" ", 3, 40);
2070 if (cs == MAX_CLASS_CHOICE) {
2071 sprintf(cur, "%c%c%s", '*', p2, _("ランダム", "Random"));
2072 put_str(" ", 4, 40);
2073 put_str(" ", 5, 40);
2075 cp_ptr = &class_info[cs];
2076 mp_ptr = &m_info[cs];
2077 str = cp_ptr->title;
2078 if (!(rp_ptr->choice & (1L << cs)))
2079 sprintf(cur, "%c%c(%s)", sym[cs], p2, str);
2081 sprintf(cur, "%c%c%s", sym[cs], p2, str);
2083 c_put_str(TERM_L_BLUE, cp_ptr->title, 3, 40);
2084 put_str(_("の職業修正", ": Class modification"), 3, 40 + strlen(cp_ptr->title));
2085 put_str(_("腕力 知能 賢さ 器用 耐久 魅力 経験 ", "Str Int Wis Dex Con Chr EXP "), 4, 40);
2086 sprintf(buf, "%+3d %+3d %+3d %+3d %+3d %+3d %+4d%% ",
2087 cp_ptr->c_adj[0], cp_ptr->c_adj[1], cp_ptr->c_adj[2], cp_ptr->c_adj[3],
2088 cp_ptr->c_adj[4], cp_ptr->c_adj[5], cp_ptr->c_exp);
2089 c_put_str(TERM_L_BLUE, buf, 5, 40);
2091 c_put_str(TERM_YELLOW, cur, 13 + (cs / 4), 2 + 19 * (cs % 4));
2098 sprintf(buf, _("職業を選んで下さい (%c-%c) ('='初期オプション設定): ", "Choose a class (%c-%c) ('=' for options): "), sym[0], sym[MAX_CLASS_CHOICE - 1]);
2100 put_str(buf, 10, 10);
2106 if (c == ' ' || c == '\r' || c == '\n') {
2107 if (cs == MAX_CLASS_CHOICE) {
2108 k = randint0(MAX_CLASS_CHOICE);
2117 k = randint0(MAX_CLASS_CHOICE);
2130 if (cs < MAX_CLASS_CHOICE)
2134 if ((cs + 4) <= MAX_CLASS_CHOICE)
2137 k = (islower(c) ? A2I(c) : -1);
2138 if ((k >= 0) && (k < MAX_CLASS_CHOICE)) {
2142 k = (isupper(c) ? (26 + c - 'A') : -1);
2143 if ((k >= 26) && (k < MAX_CLASS_CHOICE)) {
2150 show_help(creature_ptr, "jraceclas.txt#TheClasses");
2152 show_help(creature_ptr, "raceclas.txt#TheClasses");
2154 } else if (c == '=') {
2156 do_cmd_options_aux(OPT_PAGE_BIRTH, _("初期オプション((*)はスコアに影響)", "Birth Option((*)s effect score)"));
2158 } else if (c != '2' && c != '4' && c != '6' && c != '8')
2163 creature_ptr->pclass = (byte)k;
2164 cp_ptr = &class_info[creature_ptr->pclass];
2165 mp_ptr = &m_info[creature_ptr->pclass];
2168 c_put_str(TERM_L_BLUE, cp_ptr->title, 5, 15);
2174 * @brief プレイヤーの性格選択を行う / Player Player seikaku
2177 static bool get_player_seikaku(player_type* creature_ptr)
2182 char sym[MAX_SEIKAKU];
2184 char buf[80], cur[80];
2190 put_str(_("注意:《性格》によってキャラクターの能力やボーナスが変化します。", "Note: Your personality determines various intrinsic abilities and bonuses."), 23, 5);
2193 for (n = 0; n < MAX_SEIKAKU; n++) {
2194 if (seikaku_info[n].sex && (seikaku_info[n].sex != (creature_ptr->psex + 1)))
2198 ap_ptr = &seikaku_info[n];
2199 str = ap_ptr->title;
2203 sym[n] = ('A' + n - 26);
2206 sprintf(buf, "%c%c%s", I2A(n), p2, str);
2207 put_str(buf, 12 + (n / 4), 2 + 18 * (n % 4));
2210 sprintf(cur, "%c%c%s", '*', p2, _("ランダム", "Random"));
2214 cs = creature_ptr->pseikaku;
2219 c_put_str(TERM_WHITE, cur, 12 + (os / 4), 2 + 18 * (os % 4));
2220 put_str(" ", 3, 40);
2221 if (cs == MAX_SEIKAKU) {
2222 sprintf(cur, "%c%c%s", '*', p2, _("ランダム", "Random"));
2223 put_str(" ", 4, 40);
2224 put_str(" ", 5, 40);
2226 ap_ptr = &seikaku_info[cs];
2227 str = ap_ptr->title;
2228 sprintf(cur, "%c%c%s", sym[cs], p2, str);
2229 c_put_str(TERM_L_BLUE, ap_ptr->title, 3, 40);
2230 put_str(_("の性格修正", ": Personality modification"), 3, 40 + strlen(ap_ptr->title));
2231 put_str(_("腕力 知能 賢さ 器用 耐久 魅力 ", "Str Int Wis Dex Con Chr "), 4, 40);
2232 sprintf(buf, "%+3d %+3d %+3d %+3d %+3d %+3d ",
2233 ap_ptr->a_adj[0], ap_ptr->a_adj[1], ap_ptr->a_adj[2], ap_ptr->a_adj[3],
2234 ap_ptr->a_adj[4], ap_ptr->a_adj[5]);
2235 c_put_str(TERM_L_BLUE, buf, 5, 40);
2237 c_put_str(TERM_YELLOW, cur, 12 + (cs / 4), 2 + 18 * (cs % 4));
2244 sprintf(buf, _("性格を選んで下さい (%c-%c) ('='初期オプション設定): ", "Choose a personality (%c-%c) ('=' for options): "), sym[0], sym[MAX_SEIKAKU - 1]);
2246 put_str(buf, 10, 10);
2252 if (c == ' ' || c == '\r' || c == '\n') {
2253 if (cs == MAX_SEIKAKU) {
2255 k = randint0(MAX_SEIKAKU);
2256 } while (seikaku_info[k].sex && (seikaku_info[k].sex != (creature_ptr->psex + 1)));
2267 } while (seikaku_info[k].sex && (seikaku_info[k].sex != (creature_ptr->psex + 1)));
2274 if (cs != MAX_SEIKAKU && seikaku_info[cs].sex && (seikaku_info[cs].sex != (creature_ptr->psex + 1))) {
2284 if (cs != MAX_SEIKAKU && seikaku_info[cs].sex && (seikaku_info[cs].sex != (creature_ptr->psex + 1))) {
2292 if (cs < MAX_SEIKAKU)
2294 if (cs != MAX_SEIKAKU && seikaku_info[cs].sex && (seikaku_info[cs].sex != (creature_ptr->psex + 1))) {
2295 if ((cs + 1) <= MAX_SEIKAKU)
2302 if ((cs + 4) <= MAX_SEIKAKU)
2304 if (cs != MAX_SEIKAKU && seikaku_info[cs].sex && (seikaku_info[cs].sex != (creature_ptr->psex + 1))) {
2305 if ((cs + 4) <= MAX_SEIKAKU)
2311 k = (islower(c) ? A2I(c) : -1);
2312 if ((k >= 0) && (k < MAX_SEIKAKU)) {
2313 if ((seikaku_info[k].sex == 0) || (seikaku_info[k].sex == (creature_ptr->psex + 1))) {
2318 k = (isupper(c) ? (26 + c - 'A') : -1);
2319 if ((k >= 26) && (k < MAX_SEIKAKU)) {
2320 if ((seikaku_info[k].sex == 0) || (seikaku_info[k].sex == (creature_ptr->psex + 1))) {
2328 show_help(creature_ptr, "jraceclas.txt#ThePersonalities");
2330 show_help(creature_ptr, "raceclas.txt#ThePersonalities");
2332 } else if (c == '=') {
2334 do_cmd_options_aux(OPT_PAGE_BIRTH, _("初期オプション((*)はスコアに影響)", "Birth Option((*)s effect score)"));
2336 } else if (c != '2' && c != '4' && c != '6' && c != '8')
2341 creature_ptr->pseikaku = (CHARACTER_IDX)k;
2342 ap_ptr = &seikaku_info[creature_ptr->pseikaku];
2344 strcpy(tmp, ap_ptr->title);
2345 if (ap_ptr->no == 1)
2348 strcpy(tmp, ap_ptr->title);
2351 strcat(tmp, creature_ptr->name);
2353 c_put_str(TERM_L_BLUE, tmp, 1, 34);
2359 * @brief オートローラで得たい能力値の基準を決める。
2360 * @param creature_ptr プレーヤーへの参照ポインタ
2363 static bool get_stat_limits(player_type* creature_ptr)
2365 int i, j, m, cs, os;
2368 char buf[80], cur[80];
2374 /* Extra infomation */
2375 put_str(_("最低限得たい能力値を設定して下さい。", "Set minimum stats."), 10, 10);
2376 put_str(_("2/8で項目選択、4/6で値の増減、Enterで次へ", "2/8 for Select, 4/6 for Change value, Enter for Goto next"), 11, 10);
2378 put_str(_(" 基本値 種族 職業 性格 合計値 最大値", " Base Rac Cla Per Total Maximum"), 13, 10);
2380 /* Output the maximum stats */
2381 for (i = 0; i < A_MAX; i++) {
2382 /* Reset the "success" counter */
2386 /* Race/Class bonus */
2387 j = rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i];
2389 /* Obtain the "maximal" stat */
2390 m = adjust_stat(17, j);
2394 sprintf(cur, "18/%02d", (m - 18));
2399 sprintf(cur, "%2d", m);
2402 /* Obtain the current stat */
2403 m = adjust_stat(cval[i], j);
2407 sprintf(inp, "18/%02d", (m - 18));
2412 sprintf(inp, "%2d", m);
2415 /* Prepare a prompt */
2416 sprintf(buf, "%6s %2d %+3d %+3d %+3d = %6s %6s",
2417 stat_names[i], cval[i], rp_ptr->r_adj[i], cp_ptr->c_adj[i],
2418 ap_ptr->a_adj[i], inp, cur);
2420 /* Dump the prompt */
2421 put_str(buf, 14 + i, 10);
2424 /* Get a minimum stat */
2431 c_put_str(TERM_WHITE, _("決定する", "Accept"), 21, 35);
2432 } else if (os < A_MAX) {
2433 c_put_str(TERM_WHITE, cur, 14 + os, 10);
2436 c_put_str(TERM_YELLOW, _("決定する", "Accept"), 21, 35);
2438 /* Race/Class bonus */
2439 j = rp_ptr->r_adj[cs] + cp_ptr->c_adj[cs] + ap_ptr->a_adj[cs];
2441 /* Obtain the current stat */
2442 m = adjust_stat(cval[cs], j);
2446 sprintf(inp, "18/%02d", (m - 18));
2451 sprintf(inp, "%2d", m);
2454 /* Prepare a prompt */
2455 sprintf(cur, "%6s %2d %+3d %+3d %+3d = %6s",
2456 stat_names[cs], cval[cs], rp_ptr->r_adj[cs],
2457 cp_ptr->c_adj[cs], ap_ptr->a_adj[cs], inp);
2458 c_put_str(TERM_YELLOW, cur, 14 + cs, 10);
2463 /* Prompt for the minimum stats */
2494 if (cval[cs] == 3) {
2497 } else if (cval[cs] > 3) {
2507 if (cval[cs] == 17) {
2510 } else if (cval[cs] < 17) {
2531 show_help(creature_ptr, "jbirth.txt#AutoRoller");
2533 show_help(creature_ptr, "birth.txt#AutoRoller");
2539 do_cmd_options_aux(OPT_PAGE_BIRTH, "初期オプション((*)はスコアに影響)");
2541 do_cmd_options_aux(OPT_PAGE_BIRTH, "Birth Option((*)s effect score)");
2550 if (c == ESCAPE || ((c == ' ' || c == '\r' || c == '\n') && cs == 6))
2554 for (i = 0; i < A_MAX; i++) {
2555 /* Save the minimum stat */
2556 stat_limit[i] = (s16b)cval[i];
2563 * @brief オートローラで得たい年齢、身長、体重、社会的地位の基準を決める。
2566 static bool get_chara_limits(player_type* creature_ptr)
2570 int i, j, m, cs, os;
2571 int mval[MAXITEMS], cval[MAXITEMS];
2572 int max_percent, min_percent;
2574 char buf[80], cur[80];
2575 concptr itemname[] = {
2577 _("身長(インチ)", "height"),
2578 _("体重(ポンド)", "weight"),
2579 _("社会的地位", "social class")
2584 /* Prompt for the minimum stats */
2585 put_str(_("2/4/6/8で項目選択、+/-で値の増減、Enterで次へ",
2586 "2/4/6/8 for Select, +/- for Change value, Enter for Goto next"), 11, 10);
2587 put_str(_("注意:身長と体重の最大値/最小値ぎりぎりの値は非常に出現確率が低くなります。",
2588 "Caution: Values near minimum or maximum are extremely rare."), 23, 2);
2590 if (creature_ptr->psex == SEX_MALE) {
2591 max_percent = (int)(rp_ptr->m_b_ht + rp_ptr->m_m_ht * 4 - 1) * 100 / (int)(rp_ptr->m_b_ht);
2592 min_percent = (int)(rp_ptr->m_b_ht - rp_ptr->m_m_ht * 4 + 1) * 100 / (int)(rp_ptr->m_b_ht);
2594 max_percent = (int)(rp_ptr->f_b_ht + rp_ptr->f_m_ht * 4 - 1) * 100 / (int)(rp_ptr->f_b_ht);
2595 min_percent = (int)(rp_ptr->f_b_ht - rp_ptr->f_m_ht * 4 + 1) * 100 / (int)(rp_ptr->f_b_ht);
2598 put_str(_("体格/地位の最小値/最大値を設定して下さい。", "Set minimum/maximum attribute."), 10, 10);
2599 put_str(_(" 項 目 最小値 最大値", " Parameter Min Max"), 13, 20);
2601 /* Output the maximum stats */
2602 for (i = 0; i < MAXITEMS; i++) {
2603 /* Obtain the "maximal" stat */
2605 case 0: /* Minimum age */
2606 m = rp_ptr->b_age + 1;
2608 case 1: /* Maximum age */
2609 m = rp_ptr->b_age + rp_ptr->m_age;
2612 case 2: /* Minimum height */
2613 if (creature_ptr->psex == SEX_MALE)
2614 m = rp_ptr->m_b_ht - rp_ptr->m_m_ht * 4 + 1;
2616 m = rp_ptr->f_b_ht - rp_ptr->f_m_ht * 4 + 1;
2618 case 3: /* Maximum height */
2619 if (creature_ptr->psex == SEX_MALE)
2620 m = rp_ptr->m_b_ht + rp_ptr->m_m_ht * 4 - 1;
2622 m = rp_ptr->f_b_ht + rp_ptr->f_m_ht * 4 - 1;
2624 case 4: /* Minimum weight */
2625 if (creature_ptr->psex == SEX_MALE)
2626 m = (rp_ptr->m_b_wt * min_percent / 100) - (rp_ptr->m_m_wt * min_percent / 75) + 1;
2628 m = (rp_ptr->f_b_wt * min_percent / 100) - (rp_ptr->f_m_wt * min_percent / 75) + 1;
2630 case 5: /* Maximum weight */
2631 if (creature_ptr->psex == SEX_MALE)
2632 m = (rp_ptr->m_b_wt * max_percent / 100) + (rp_ptr->m_m_wt * max_percent / 75) - 1;
2634 m = (rp_ptr->f_b_wt * max_percent / 100) + (rp_ptr->f_m_wt * max_percent / 75) - 1;
2636 case 6: /* Minimum social class */
2639 case 7: /* Maximum social class */
2647 /* Save the maximum or minimum */
2652 for (i = 0; i < 4; i++) {
2653 /* Prepare a prompt */
2654 sprintf(buf, "%-12s (%3d - %3d)", itemname[i], mval[i * 2], mval[i * 2 + 1]);
2656 /* Dump the prompt */
2657 put_str(buf, 14 + i, 20);
2659 for (j = 0; j < 2; j++) {
2660 sprintf(buf, " %3d", cval[i * 2 + j]);
2661 put_str(buf, 14 + i, 45 + 8 * j);
2665 /* Get a minimum stat */
2671 const char accept[] = _("決定する", "Accept");
2673 if (os == MAXITEMS) {
2674 c_put_str(TERM_WHITE, accept, 19, 35);
2676 c_put_str(TERM_WHITE, cur, 14 + os / 2, 45 + 8 * (os % 2));
2679 if (cs == MAXITEMS) {
2680 c_put_str(TERM_YELLOW, accept, 19, 35);
2682 /* Prepare a prompt */
2683 sprintf(cur, " %3d", cval[cs]);
2684 c_put_str(TERM_YELLOW, cur, 14 + cs / 2, 45 + 8 * (cs % 2));
2689 /* Prompt for the minimum stats */
2698 break; /*後でもう一回breakせんと*/
2731 if (cs != MAXITEMS) {
2733 if (cval[cs] > cval[cs - 1]) {
2738 if (cval[cs] > mval[cs]) {
2747 if (cs != MAXITEMS) {
2749 if (cval[cs] < mval[cs]) {
2754 if (cval[cs] < cval[cs + 1]) {
2762 if (cs != MAXITEMS) {
2764 if (cval[cs] < mval[cs]) {
2765 cval[cs] = mval[cs];
2769 if (cval[cs] < cval[cs + 1]) {
2770 cval[cs] = cval[cs + 1];
2777 if (cs != MAXITEMS) {
2779 if (cval[cs] > cval[cs - 1]) {
2780 cval[cs] = cval[cs - 1];
2784 if (cval[cs] > mval[cs]) {
2785 cval[cs] = mval[cs];
2793 show_help(creature_ptr, "jbirth.txt#AutoRoller");
2795 show_help(creature_ptr, "birth.txt#AutoRoller");
2800 do_cmd_options_aux(OPT_PAGE_BIRTH, _("初期オプション((*)はスコアに影響)", "Birth Option((*)s effect score)"));
2807 if (c == ESCAPE || ((c == ' ' || c == '\r' || c == '\n') && cs == MAXITEMS))
2811 /* Input the minimum stats */
2812 chara_limit.agemin = (s16b)cval[0];
2813 chara_limit.agemax = (s16b)cval[1];
2814 chara_limit.htmin = (s16b)cval[2];
2815 chara_limit.htmax = (s16b)cval[3];
2816 chara_limit.wtmin = (s16b)cval[4];
2817 chara_limit.wtmax = (s16b)cval[5];
2818 chara_limit.scmin = (s16b)cval[6];
2819 chara_limit.scmax = (s16b)cval[7];
2824 #define HISTPREF_LIMIT 1024
2825 static char* histpref_buf = NULL;
2828 * @brief 生い立ちメッセージの内容をバッファに加える。 / Hook function for reading the histpref.prf file.
2831 void add_history_from_pref_line(concptr t)
2833 /* Do nothing if the buffer is not ready */
2837 my_strcat(histpref_buf, t, HISTPREF_LIMIT);
2841 * @brief 生い立ちメッセージをファイルからロードする。
2844 static bool do_cmd_histpref(player_type* creature_ptr, void (*process_autopick_file_command)(char*))
2851 char histbuf[HISTPREF_LIMIT];
2853 if (!get_check(_("生い立ち設定ファイルをロードしますか? ", "Load background history preference file? ")))
2856 /* Prepare the buffer */
2858 histpref_buf = histbuf;
2861 sprintf(buf, "histedit-%s.prf", creature_ptr->base_name);
2863 sprintf(buf, "histpref-%s.prf", creature_ptr->base_name);
2865 err = process_histpref_file(creature_ptr, buf, process_autopick_file_command);
2867 /* Process 'hist????.prf' if 'hist????-<name>.prf' doesn't exist */
2870 strcpy(buf, "histedit.prf");
2872 strcpy(buf, "histpref.prf");
2874 err = process_histpref_file(creature_ptr, buf, process_autopick_file_command);
2878 msg_print(_("生い立ち設定ファイルの読み込みに失敗しました。", "Failed to load background history preference."));
2881 /* Kill the buffer */
2882 histpref_buf = NULL;
2885 } else if (!histpref_buf[0]) {
2886 msg_print(_("有効な生い立ち設定はこのファイルにありません。", "There does not exist valid background history preference."));
2889 /* Kill the buffer */
2890 histpref_buf = NULL;
2895 /* Clear the previous history strings */
2896 for (i = 0; i < 4; i++)
2897 creature_ptr->history[i][0] = '\0';
2899 /* Skip leading spaces */
2900 for (s = histpref_buf; *s == ' '; s++) /* loop */
2903 /* Get apparent length */
2906 /* Kill trailing spaces */
2907 while ((n > 0) && (s[n - 1] == ' '))
2910 roff_to_buf(s, 60, temp, sizeof(temp));
2912 for (i = 0; i < 4; i++) {
2916 strcpy(creature_ptr->history[i], t);
2921 /* Fill the remaining spaces */
2922 for (i = 0; i < 4; i++) {
2923 for (j = 0; creature_ptr->history[i][j]; j++) /* loop */
2927 creature_ptr->history[i][j] = ' ';
2928 creature_ptr->history[i][59] = '\0';
2931 /* Kill the buffer */
2932 histpref_buf = NULL;
2938 * @brief 生い立ちメッセージを編集する。/Character background edit-mode
2941 static void edit_history(player_type* creature_ptr, void (*process_autopick_file_command)(char*))
2943 char old_history[4][60];
2944 TERM_LEN y = 0, x = 0;
2947 /* Edit character background */
2948 for (i = 0; i < 4; i++) {
2949 sprintf(old_history[i], "%s", creature_ptr->history[i]);
2951 /* Turn 0 to space */
2952 for (i = 0; i < 4; i++) {
2953 for (j = 0; creature_ptr->history[i][j]; j++) /* loop */
2957 creature_ptr->history[i][j] = ' ';
2958 creature_ptr->history[i][59] = '\0';
2961 display_player(creature_ptr, 1, map_name);
2963 c_put_str(TERM_L_GREEN, "(キャラクターの生い立ち - 編集モード)", 11, 20);
2964 put_str("[ カーソルキーで移動、Enterで終了、Ctrl-Aでファイル読み込み ]", 17, 10);
2966 c_put_str(TERM_L_GREEN, "(Character Background - Edit Mode)", 11, 20);
2967 put_str("[ Cursor key for Move, Enter for End, Ctrl-A for Read pref ]", 17, 10);
2974 for (i = 0; i < 4; i++) {
2975 put_str(creature_ptr->history[i], i + 12, 10);
2978 if (iskanji2(creature_ptr->history[y], x))
2979 c_put_str(TERM_L_BLUE, format("%c%c", creature_ptr->history[y][x], creature_ptr->history[y][x + 1]), y + 12, x + 10);
2982 c_put_str(TERM_L_BLUE, format("%c", creature_ptr->history[y][x]), y + 12, x + 10);
2984 /* Place cursor just after cost of current stat */
2985 Term_gotoxy(x + 10, y + 12);
2987 /* Get special key code */
2988 skey = inkey_special(TRUE);
2990 /* Get a character code */
2991 if (!(skey & SKEY_MASK))
2996 if (skey == SKEY_UP || c == KTRL('p')) {
3001 if ((x > 0) && (iskanji2(creature_ptr->history[y], x - 1)))
3004 } else if (skey == SKEY_DOWN || c == KTRL('n')) {
3009 if ((x > 0) && (iskanji2(creature_ptr->history[y], x - 1)))
3012 } else if (skey == SKEY_RIGHT || c == KTRL('f')) {
3014 if (iskanji2(creature_ptr->history[y], x))
3023 } else if (skey == SKEY_LEFT || c == KTRL('b')) {
3034 if ((x > 0) && (iskanji2(creature_ptr->history[y], x - 1)))
3037 } else if (c == '\r' || c == '\n') {
3038 Term_erase(0, 11, 255);
3039 Term_erase(0, 17, 255);
3041 put_str("(キャラクターの生い立ち - 編集済み)", 11, 20);
3043 put_str("(Character Background - Edited)", 11, 20);
3046 } else if (c == ESCAPE) {
3049 put_str("(キャラクターの生い立ち)", 11, 25);
3051 put_str("(Character Background)", 11, 25);
3054 for (i = 0; i < 4; i++) {
3055 sprintf(creature_ptr->history[i], "%s", old_history[i]);
3056 put_str(creature_ptr->history[i], i + 12, 10);
3059 } else if (c == KTRL('A')) {
3060 if (do_cmd_histpref(creature_ptr, process_autopick_file_command)) {
3062 if ((x > 0) && (iskanji2(creature_ptr->history[y], x - 1)))
3066 } else if (c == '\010') {
3076 creature_ptr->history[y][x] = ' ';
3078 if ((x > 0) && (iskanji2(creature_ptr->history[y], x - 1))) {
3080 creature_ptr->history[y][x] = ' ';
3085 else if (iskanji(c) || isprint(c))
3087 else if (isprint(c)) /* BUGFIX */
3091 if (iskanji2(creature_ptr->history[y], x)) {
3092 creature_ptr->history[y][x + 1] = ' ';
3103 if (iskanji2(creature_ptr->history[y], x + 1)) {
3104 creature_ptr->history[y][x + 2] = ' ';
3107 creature_ptr->history[y][x++] = c;
3112 creature_ptr->history[y][x++] = c;
3120 } /* while (TRUE) */
3124 * @brief player_birth()関数のサブセット/Helper function for 'player_birth()'
3126 * The delay may be reduced, but is recommended to keep players
3127 * from continuously rolling up characters, which can be VERY
3128 * expensive CPU wise. And it cuts down on player stupidity.
3131 static bool player_birth_aux(player_type* creature_ptr, void (*process_autopick_file_command)(char*))
3133 int i, k, n, cs, os;
3148 char buf[80], cur[80];
3153 /* Title everything */
3154 put_str(_("名前 :", "Name :"), 1, 26);
3155 put_str(_("性別 :", "Sex :"), 3, 1);
3156 put_str(_("種族 :", "Race :"), 4, 1);
3157 put_str(_("職業 :", "Class :"), 5, 1);
3159 /* Dump the default name */
3160 c_put_str(TERM_L_BLUE, creature_ptr->name, 1, 34);
3162 /*** Instructions ***/
3164 /* Display some helpful information */
3165 put_str(_("キャラクターを作成します。('S'やり直す, 'Q'終了, '?'ヘルプ)",
3166 "Make your charactor. ('S' Restart, 'Q' Quit, '?' Help)"), 8, 10);
3168 /*** Player sex ***/
3171 put_str(_("注意:《性別》の違いはゲーム上ほとんど影響を及ぼしません。",
3172 "Note: Your 'sex' does not have any significant gameplay effects."), 23, 5);
3174 /* Prompt for "Sex" */
3175 for (n = 0; n < MAX_SEXES; n++) {
3177 sp_ptr = &sex_info[n];
3181 sprintf(buf, "%c%c%s", I2A(n), p2, sp_ptr->title);
3183 sprintf(buf, "%c%c %s", I2A(n), p2, sp_ptr->title);
3185 put_str(buf, 12 + (n / 5), 2 + 15 * (n % 5));
3189 sprintf(cur, "%c%c%s", '*', p2, "ランダム");
3191 sprintf(cur, "%c%c %s", '*', p2, "Random");
3200 put_str(cur, 12 + (os / 5), 2 + 15 * (os % 5));
3201 if (cs == MAX_SEXES)
3203 sprintf(cur, "%c%c%s", '*', p2, "ランダム");
3205 sprintf(cur, "%c%c %s", '*', p2, "Random");
3208 sp_ptr = &sex_info[cs];
3209 str = sp_ptr->title;
3211 sprintf(cur, "%c%c%s", I2A(cs), p2, str);
3213 sprintf(cur, "%c%c %s", I2A(cs), p2, str);
3216 c_put_str(TERM_YELLOW, cur, 12 + (cs / 5), 2 + 15 * (cs % 5));
3224 sprintf(buf, "性別を選んで下さい (%c-%c) ('='初期オプション設定): ", I2A(0), I2A(n - 1));
3226 sprintf(buf, "Choose a sex (%c-%c) ('=' for options): ", I2A(0), I2A(n - 1));
3229 put_str(buf, 10, 10);
3235 if (c == ' ' || c == '\r' || c == '\n') {
3236 if (cs == MAX_SEXES)
3237 k = randint0(MAX_SEXES);
3243 k = randint0(MAX_SEXES);
3254 k = (islower(c) ? A2I(c) : -1);
3255 if ((k >= 0) && (k < MAX_SEXES)) {
3261 do_cmd_help(creature_ptr);
3262 else if (c == '=') {
3265 do_cmd_options_aux(OPT_PAGE_BIRTH, "初期オプション((*)はスコアに影響)");
3267 do_cmd_options_aux(OPT_PAGE_BIRTH, "Birth Option((*)s effect score)");
3271 } else if (c != '4' && c != '6')
3276 creature_ptr->psex = (byte)k;
3277 sp_ptr = &sex_info[creature_ptr->psex];
3280 c_put_str(TERM_L_BLUE, sp_ptr->title, 3, 15);
3285 /* Choose the players race */
3286 creature_ptr->prace = 0;
3291 if (!get_player_race(creature_ptr))
3296 roff_to_buf(race_explanations[creature_ptr->prace], 74, temp, sizeof(temp));
3299 for (i = 0; i < 10; i++) {
3308 if (get_check_strict("よろしいですか?", CHECK_DEFAULT_Y))
3311 if (get_check_strict("Are you sure? ", CHECK_DEFAULT_Y))
3315 c_put_str(TERM_WHITE, " ", 4, 15);
3321 /* Choose the players class */
3322 creature_ptr->pclass = 0;
3327 if (!get_player_class(creature_ptr))
3331 roff_to_buf(class_explanations[creature_ptr->pclass], 74, temp, sizeof(temp));
3334 for (i = 0; i < 9; i++) {
3344 if (get_check_strict("よろしいですか?", CHECK_DEFAULT_Y))
3347 if (get_check_strict("Are you sure? ", CHECK_DEFAULT_Y))
3350 c_put_str(TERM_WHITE, " ", 5, 15);
3353 /* Choose the magic realms */
3354 if (!get_player_realms(creature_ptr))
3357 /* Choose the players seikaku */
3358 creature_ptr->pseikaku = 0;
3363 if (!get_player_seikaku(creature_ptr))
3367 roff_to_buf(personality_explanations[creature_ptr->pseikaku], 74, temp, sizeof(temp));
3370 for (i = 0; i < A_MAX; i++) {
3379 if (get_check_strict("よろしいですか?", CHECK_DEFAULT_Y))
3382 if (get_check_strict("Are you sure? ", CHECK_DEFAULT_Y))
3385 c_put_str(TERM_L_BLUE, creature_ptr->name, 1, 34);
3386 prt("", 1, 34 + strlen(creature_ptr->name));
3391 put_str(" ", 3, 40);
3392 put_str(" ", 4, 40);
3393 put_str(" ", 5, 40);
3397 do_cmd_options_aux(OPT_PAGE_BIRTH, "初期オプション((*)はスコアに影響)");
3399 do_cmd_options_aux(OPT_PAGE_BIRTH, "Birth Option((*)s effect score)");
3404 if (autoroller || autochara) {
3410 if (!get_stat_limits(creature_ptr))
3415 if (!get_chara_limits(creature_ptr))
3421 /* Reset turn; before auto-roll and after choosing race */
3422 init_turn(creature_ptr);
3432 if (autoroller || autochara) {
3437 put_str("回数 :", 10, col + 13);
3439 put_str("Round:", 10, col + 13);
3442 /* Indicate the state */
3444 put_str("(ESCで停止)", 12, col + 13);
3446 put_str("(Hit ESC to stop)", 12, col + 13);
3450 /* Otherwise just get a character */
3452 get_stats(creature_ptr);
3453 get_ahw(creature_ptr);
3454 get_history(creature_ptr);
3461 put_str("最小値", 2, col + 5);
3463 put_str(" Limit", 2, col + 5);
3468 put_str("成功率", 2, col + 13);
3470 put_str(" Freq", 2, col + 13);
3475 put_str("現在値", 2, col + 24);
3477 put_str(" Roll", 2, col + 24);
3480 /* Put the minimal stats */
3481 for (i = 0; i < A_MAX; i++) {
3485 put_str(stat_names[i], 3 + i, col);
3487 /* Race/Class bonus */
3488 j = rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i];
3490 /* Obtain the current stat */
3491 m = adjust_stat(stat_limit[i], j);
3495 c_put_str(TERM_L_BLUE, buf, 3 + i, col + 5);
3500 while (autoroller || autochara) {
3503 /* Get a new character */
3504 get_stats(creature_ptr);
3506 /* Advance the round */
3509 /* Hack -- Prevent overflow */
3510 if (auto_round >= 1000000000L) {
3514 for (i = 0; i < A_MAX; i++) {
3521 /* Check and count acceptable stats */
3522 for (i = 0; i < A_MAX; i++) {
3523 /* This stat is okay */
3524 if (creature_ptr->stat_max[i] >= stat_limit[i]) {
3528 /* This stat is not okay */
3535 /* Break if "happy" */
3537 get_ahw(creature_ptr);
3538 get_history(creature_ptr);
3541 if ((creature_ptr->age < chara_limit.agemin) || (creature_ptr->age > chara_limit.agemax))
3543 if ((creature_ptr->ht < chara_limit.htmin) || (creature_ptr->ht > chara_limit.htmax))
3545 if ((creature_ptr->wt < chara_limit.wtmin) || (creature_ptr->wt > chara_limit.wtmax))
3547 if ((creature_ptr->sc < chara_limit.scmin) || (creature_ptr->sc > chara_limit.scmax))
3554 /* Take note every x rolls */
3555 flag = (!(auto_round % AUTOROLLER_STEP));
3557 /* Update display occasionally */
3560 birth_put_stats(creature_ptr);
3563 put_str(format("%10ld", auto_round), 10, col + 20);
3565 /* Make sure they see everything */
3568 /* Do not wait for a key */
3571 /* Check for a keypress */
3573 get_ahw(creature_ptr);
3574 get_history(creature_ptr);
3580 if (autoroller || autochara)
3589 /* Roll for base hitpoints */
3590 get_extra(creature_ptr, TRUE);
3593 get_money(creature_ptr);
3595 /* Hack -- get a chaos patron even if you are not a chaos warrior */
3596 creature_ptr->chaos_patron = (s16b)randint0(MAX_PATRON);
3600 /* Calculate the bonuses and hitpoints */
3601 creature_ptr->update |= (PU_BONUS | PU_HP);
3602 update_creature(creature_ptr);
3604 creature_ptr->chp = creature_ptr->mhp;
3605 creature_ptr->csp = creature_ptr->msp;
3607 display_player(creature_ptr, mode, map_name);
3609 /* Prepare a prompt (must squeeze everything in) */
3611 Term_addch(TERM_WHITE, b1);
3612 Term_addstr(-1, TERM_WHITE, _("'r' 次の数値", "'r'eroll"));
3615 Term_addstr(-1, TERM_WHITE, _(", 'p' 前の数値", "'p'previous"));
3617 Term_addstr(-1, TERM_WHITE, _(", 'h' その他の情報", ", 'h' Misc."));
3619 Term_addstr(-1, TERM_WHITE, _(", 'h' 生い立ちを表示", ", 'h'istory"));
3620 Term_addstr(-1, TERM_WHITE, _(", Enter この数値に決定", ", or Enter to accept"));
3621 Term_addch(TERM_WHITE, b2);
3633 /* Escape accepts the roll */
3634 if (c == '\r' || c == '\n' || c == ESCAPE)
3637 /* Reroll this character */
3638 if ((c == ' ') || (c == 'r'))
3641 /* Previous character */
3642 if (prev && (c == 'p')) {
3643 load_prev_data(creature_ptr, TRUE);
3647 if ((c == 'H') || (c == 'h')) {
3648 mode = ((mode != 0) ? 0 : 1);
3655 show_help(creature_ptr, "jbirth.txt#AutoRoller");
3657 show_help(creature_ptr, "birth.txt#AutoRoller");
3660 } else if (c == '=') {
3662 do_cmd_options_aux(OPT_PAGE_BIRTH, _("初期オプション((*)はスコアに影響)", "Birth Option((*)s effect score)"));
3672 if (c == '\r' || c == '\n' || c == ESCAPE)
3675 /* Save this for the "previous" character */
3676 save_prev_data(creature_ptr, &previous_char);
3677 previous_char.quick_ok = FALSE;
3679 /* Note that a previous roll exists */
3686 /* Get a name, recolor it, prepare savefile */
3687 get_name(creature_ptr);
3689 /* Process the player name */
3690 process_player_name(creature_ptr, current_world_ptr->creating_savefile);
3692 /*** Edit character background ***/
3693 edit_history(creature_ptr, process_autopick_file_command);
3697 get_max_stats(creature_ptr);
3699 get_virtues(creature_ptr);
3703 prt("[ 'Q' 中断, 'S' 初めから, Enter ゲーム開始 ]", 23, 14);
3705 prt("['Q'uit, 'S'tart over, or Enter to continue]", 23, 10);
3719 /* Initialize random quests */
3720 init_dungeon_quests(creature_ptr);
3722 /* Save character data for quick start */
3723 save_prev_data(creature_ptr, &previous_char);
3724 previous_char.quick_ok = TRUE;
3731 * @brief クイックスタート処理の問い合わせと実行を行う。/Ask whether the player use Quick Start or not.
3734 static bool ask_quick_start(player_type* creature_ptr)
3736 /* Doesn't have previous data */
3737 if (!previous_char.quick_ok)
3743 put_str(_("クイック・スタートを使うと以前と全く同じキャラクターで始められます。",
3744 "Do you want to use the quick start function(same character as your last one)."), 11, 2);
3750 put_str(_("クイック・スタートを使いますか?[y/N]", "Use quick start? [y/N]"), 14, 10);
3757 else if (c == '?') {
3759 show_help(creature_ptr, "jbirth.txt#QuickStart");
3761 show_help(creature_ptr, "birth.txt#QuickStart");
3763 } else if ((c == 'y') || (c == 'Y')) {
3772 load_prev_data(creature_ptr, FALSE);
3773 init_turn(creature_ptr);
3774 init_dungeon_quests(creature_ptr);
3776 sp_ptr = &sex_info[creature_ptr->psex];
3777 rp_ptr = &race_info[creature_ptr->prace];
3778 cp_ptr = &class_info[creature_ptr->pclass];
3779 mp_ptr = &m_info[creature_ptr->pclass];
3780 ap_ptr = &seikaku_info[creature_ptr->pseikaku];
3782 /* Calc hitdie, but don't roll */
3783 get_extra(creature_ptr, FALSE);
3785 creature_ptr->update |= (PU_BONUS | PU_HP);
3786 update_creature(creature_ptr);
3787 creature_ptr->chp = creature_ptr->mhp;
3788 creature_ptr->csp = creature_ptr->msp;
3790 /* Process the player name */
3791 process_player_name(creature_ptr, FALSE);
3797 * @brief プレイヤー作成処理のメインルーチン/ Create a new character.
3799 * Note that we may be called with "junk" leftover in the various
3800 * fields, so we must be sure to clear them first.
3803 void player_birth(player_type* creature_ptr, void (*process_autopick_file_command)(char*))
3808 current_world_ptr->play_time = 0;
3810 wipe_monsters_list(creature_ptr);
3812 /* Wipe the player */
3813 player_wipe_without_name(creature_ptr);
3815 /* Create a new character */
3818 if (!ask_quick_start(creature_ptr)) {
3819 play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_DEFAULT);
3821 /* No, normal start */
3823 /* Roll up a new character */
3824 if (player_birth_aux(creature_ptr, process_autopick_file_command))
3827 /* Wipe the player */
3828 player_wipe_without_name(creature_ptr);
3832 /* Note player birth in the message recall */
3835 message_add("====================");
3839 exe_write_diary(creature_ptr, DIARY_GAMESTART, 1, _("-------- 新規ゲーム開始 --------", "------- Started New Game -------"));
3840 exe_write_diary(creature_ptr, DIARY_DIALY, 0, NULL);
3842 sprintf(buf, _(" 性別に%sを選択した。", " chose %s gender."),
3843 sex_info[creature_ptr->psex].title);
3844 exe_write_diary(creature_ptr, DIARY_DESCRIPTION, 1, buf);
3846 sprintf(buf, _(" 種族に%sを選択した。", " chose %s race."),
3847 race_info[creature_ptr->prace].title);
3848 exe_write_diary(creature_ptr, DIARY_DESCRIPTION, 1, buf);
3850 sprintf(buf, _(" 職業に%sを選択した。", " chose %s class."),
3851 class_info[creature_ptr->pclass].title);
3852 exe_write_diary(creature_ptr, DIARY_DESCRIPTION, 1, buf);
3854 if (creature_ptr->realm1) {
3855 sprintf(buf, _(" 魔法の領域に%s%sを選択した。", " chose %s%s."),
3856 realm_names[creature_ptr->realm1], creature_ptr->realm2 ? format(_("と%s", " and %s realms"), realm_names[creature_ptr->realm2]) : _("", " realm"));
3857 exe_write_diary(creature_ptr, DIARY_DESCRIPTION, 1, buf);
3860 sprintf(buf, _(" 性格に%sを選択した。", " chose %s personality."),
3861 seikaku_info[creature_ptr->pseikaku].title);
3862 exe_write_diary(creature_ptr, DIARY_DESCRIPTION, 1, buf);
3864 /* Init the shops */
3865 for (i = 1; i < max_towns; i++) {
3866 for (j = 0; j < MAX_STORES; j++) {
3871 /* Generate the random seeds for the wilderness */
3874 /* Give beastman a mutation at character birth */
3875 if (creature_ptr->prace == RACE_BEASTMAN)
3876 creature_ptr->hack_mutation = TRUE;
3878 creature_ptr->hack_mutation = FALSE;
3880 /* Set the message window flag as default */
3881 if (!window_flag[1])
3882 window_flag[1] |= PW_MESSAGE;
3884 /* Set the inv/equip window flag as default */
3885 if (!window_flag[2])
3886 window_flag[2] |= PW_INVEN;
3890 * @brief プレイヤー作成処理中のステータス表示処理
3891 * @param fff ファイルポインタ
3894 void dump_yourself(player_type* creature_ptr, FILE* fff)
3903 roff_to_buf(race_explanations[creature_ptr->prace], 78, temp, sizeof(temp));
3904 fprintf(fff, "\n\n");
3905 fprintf(fff, _("種族: %s\n", "Race: %s\n"), race_info[creature_ptr->prace].title);
3908 for (i = 0; i < 10; i++) {
3911 fprintf(fff, "%s\n", t);
3914 roff_to_buf(class_explanations[creature_ptr->pclass], 78, temp, sizeof(temp));
3916 fprintf(fff, _("職業: %s\n", "Class: %s\n"), class_info[creature_ptr->pclass].title);
3919 for (i = 0; i < 10; i++) {
3922 fprintf(fff, "%s\n", t);
3925 roff_to_buf(personality_explanations[creature_ptr->pseikaku], 78, temp, sizeof(temp));
3927 fprintf(fff, _("性格: %s\n", "Pesonality: %s\n"), seikaku_info[creature_ptr->pseikaku].title);
3930 for (i = 0; i < A_MAX; i++) {
3933 fprintf(fff, "%s\n", t);
3937 if (creature_ptr->realm1) {
3938 roff_to_buf(realm_explanations[technic2magic(creature_ptr->realm1) - 1], 78, temp, sizeof(temp));
3939 fprintf(fff, _("魔法: %s\n", "Realm: %s\n"), realm_names[creature_ptr->realm1]);
3942 for (i = 0; i < A_MAX; i++) {
3945 fprintf(fff, "%s\n", t);
3950 if (creature_ptr->realm2) {
3951 roff_to_buf(realm_explanations[technic2magic(creature_ptr->realm2) - 1], 78, temp, sizeof(temp));
3952 fprintf(fff, _("魔法: %s\n", "Realm: %s\n"), realm_names[creature_ptr->realm2]);
3955 for (i = 0; i < A_MAX; i++) {
3958 fprintf(fff, "%s\n", t);