OSDN Git Service

This commit was manufactured by cvs2svn to create tag
[hengbandforosx/hengbandosx.git] / src / birth.c
index 3b18559..1796a24 100644 (file)
@@ -1,11 +1,11 @@
 /* Purpose: create a player character */
 
 /*
- * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
  *
- * This software may be copied and distributed for educational, research, and
- * not for profit purposes provided that this copyright and statement are
- * included in all such copies.
+ * This software may be copied and distributed for educational, research,
+ * and not for profit purposes provided that this copyright and statement
+ * are included in all such copies.  Other copyrights may also apply.
  */
 
 #include "angband.h"
@@ -728,7 +728,7 @@ static hist_type bg[] =
 
 
 #ifdef JP
-       {"¤¢¤Ê¤¿¤Ï½÷²¦¥¯¥é¥³¥ó¤Î²¿¿Í¤«¤Î»Ò¶¡¤Î¤¦¤Á¤Î°ì¿Í¤Ç¤¹¡£"
+       {"¤¢¤Ê¤¿¤Ï½÷²¦¥¯¥é¥å³¥ó¤Î²¿¿Í¤«¤Î»Ò¶¡¤Î¤¦¤Á¤Î°ì¿Í¤Ç¤¹¡£"
        , 100, 84, 85, 50 },
 
        {"¤¢¤Ê¤¿¤ÏÀÖ¤¤È©¤È", 40, 85, 86, 50 },
@@ -1353,7 +1353,7 @@ static hist_type bg[] =
        {"¤¢¤Ê¤¿¤Ï°­¤òÌǤܤ¹¤¿¤á¤Ë¤³¤ÎÃϤËÁ÷¤é¤ì¤Æ¤­¤Þ¤·¤¿¡£", 100, 143, 144, 80},
        {"¤³¤ÎÌÜŪ¤òÀ®¤·¿ë¤²¤ë¤Þ¤Ç¤ÏµÙ¤à¤³¤È¤Ïµö¤µ¤ì¤Þ¤»¤ó¡£", 100, 144, 0, 80},
 #else
-       {"You are of the blessed host of heaven.", 100, 142, 143, 80},
+       {"You are of the blessed host of heaven.  ", 100, 142, 143, 80},
        {"You have been sent to earth to eradicate the wicked, ", 100, 143, 144, 80},
        {"and shall not rest until you have succeeded.", 100, 144, 0, 80},
 #endif
@@ -1843,7 +1843,7 @@ static cptr class_jouhou[MAX_CLASS] =
 
 "The Monk character class is very different from all other classes.  Their training in martial arts makes them much more powerful with no armor or weapons.  To gain the resistances necessary for survival a monk may need to wear some kind of armor, but if the armor he wears is too heavy, it will severely disturb his martial arts maneuvers.  As the monk advances levels, new, powerful forms of attack become available.  Their defensive capabilities increase likewise, but if armour is being worn, this effect decreases.  Wisdom determines a Monk's spell casting ability.",
 
-"The Mindcrafter is a unique class that uses the powers of the mind instead of magic.  These powers are unique to Mindcrafters, and vary from simple extrasensory powers to mental domination of others.  Since these powers are developed by the practice of certain disciplines, a Mindcrafter requires no spellbooks to use them.  The available powers are simply determined by the character's level.  Wisdom determines a Mindcrafter's ability to use mind powers,",
+"The Mindcrafter is a unique class that uses the powers of the mind instead of magic.  These powers are unique to Mindcrafters, and vary from simple extrasensory powers to mental domination of others.  Since these powers are developed by the practice of certain disciplines, a Mindcrafter requires no spellbooks to use them.  The available powers are simply determined by the character's level.  Wisdom determines a Mindcrafter's ability to use mind powers.",
 
 "High-mages are mages who specialize in one particular field of magic and learn it very well - much better than the ordinary mage.  For the price of giving up a second realm of magic, they gain substantial benefits in the mana costs, minimum levels, and failure rates in the spells of the realm of their specialty.  A high mage's prime statistic is intelligence as this determines his spell casting ability. ",
 
@@ -1981,15 +1981,15 @@ static cptr realm_jouhou[VALID_REALM] =
 
 "Arcane magic is a general purpose realm of magic.  It attempts to encompass all 'useful' spells from all realms.  This is the downside of Arcane magic: while Arcane does have all the necessary 'tool' spells for a dungeon delver, it has no ultra-powerful high level spells.  As a consequence, all Arcane spellbooks can be bought in town.  It should also be noted that the 'specialized' realms usually offer the same spell at a lower level and cost. ",
 
-"Craft magic can strengthen the caster or equipments.  These spells greatly improve the caster's fighting ability, but spells that hurts opponents directly is not exist.",
+"Craft magic can strengthen the caster or the equipments.  These spells can greatly improve the caster's fighting ability.  Using them against opponents directly is not possible.",
 
 "Demon is a very evil realm, same as Death.  It provides various attack spells and devilish detection spells.  at higher levels, Demon magic provides ability to dominate demons, and to polymorph yourself into a demon.",
 
-"Crusade is a realm of 'Justice'; It does have many attack spells which are mostly used for harming and banishing foul minions of evil, and these spells are not so effective for good monsters.",
+"Crusade is a magic of 'Justice'.  It includes damage spells, which are greatly effective against foul and evil monsters, but have poor effects against good monsters.",
 
 "Music magic shows various effects as sing song.  There is two type of song; the one which shows effects instantly and the other one shows effect continuously until SP runs out.  But the latter type has a limit; only one song can be sing at the same time.",
 
-"The books of Kendo describes various combat technique.  it need to read the books when one studys the techniques, but it doesn't need to take around the books to use the techniques after one momorizes it.  It need a weapon wielded to use the techniques."
+"The books of Kendo describe about various combat techniques.  When learning new techniques, you are required to carry the books, but once you memorizes them, you don't have to carry them.  When using a technique, wielding a weapon is required."
 #endif
 };
 
@@ -2341,7 +2341,7 @@ static bool get_player_realms(void)
        p_ptr->realm2 = 255;
        while (1)
        {
-               char temp[80*8];
+               char temp[80*10];
                cptr t;
                count = 0;
                p_ptr->realm1 = choose_realm(realm_choices1[p_ptr->pclass], &count);
@@ -2357,7 +2357,7 @@ static bool get_player_realms(void)
 
                roff_to_buf(realm_jouhou[technic2magic(p_ptr->realm1)-1], 74, temp, sizeof(temp));
                t = temp;
-               for (i = 0; i< 6; i++)
+               for (i = 0; i < 10; i++)
                {
                        if(t[0] == 0)
                                break; 
@@ -2381,9 +2381,9 @@ static bool get_player_realms(void)
                }
 else
 #ifdef JP
-               if (get_check("¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) break;
+               if (get_check_strict("¤è¤í¤·¤¤¤Ç¤¹¤«¡©", CHECK_DEFAULT_Y)) break;
 #else
-               if (get_check("Are you sure? ")) break;
+               if (get_check_strict("Are you sure? ", CHECK_DEFAULT_Y)) break;
 #endif
        }
 
@@ -2443,9 +2443,9 @@ else
                                break;
                        }
 #ifdef JP
-                       else if (get_check("¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) break;
+                       else if (get_check_strict("¤è¤í¤·¤¤¤Ç¤¹¤«¡©", CHECK_DEFAULT_Y)) break;
 #else
-                       else if (get_check("Are you sure? ")) break;
+                       else if (get_check_strict("Are you sure? ", CHECK_DEFAULT_Y)) break;
 #endif
                }
                if (p_ptr->realm2)
@@ -2726,7 +2726,7 @@ void get_max_stats(void)
  */
 static void get_extra(bool roll_hitdie)
 {
-       int             i, j, min_value, max_value;
+       int i, j;
 
        /* Experience factor */
        if (p_ptr->prace == RACE_ANDROID) p_ptr->expfact = rp_ptr->r_exp;
@@ -2743,17 +2743,17 @@ static void get_extra(bool roll_hitdie)
 
        for (i = 0; i < 64; i++)
        {
-               if (p_ptr->pclass == CLASS_SORCERER) p_ptr->spell_exp[i] = 1600;
-               else if (p_ptr->pclass == CLASS_RED_MAGE) p_ptr->spell_exp[i] = 1200;
-               else p_ptr->spell_exp[i] = 0;
+               if (p_ptr->pclass == CLASS_SORCERER) p_ptr->spell_exp[i] = SPELL_EXP_MASTER;
+               else if (p_ptr->pclass == CLASS_RED_MAGE) p_ptr->spell_exp[i] = SPELL_EXP_SKILLED;
+               else p_ptr->spell_exp[i] = SPELL_EXP_UNSKILLED;
        }
 
        for (i = 0; i < 5; i++)
                for (j = 0; j < 64; j++)
                        p_ptr->weapon_exp[i][j] = s_info[p_ptr->pclass].w_start[i][j];
-       if(p_ptr->pseikaku == SEIKAKU_SEXY)
+       if ((p_ptr->pseikaku == SEIKAKU_SEXY) && (p_ptr->weapon_exp[TV_HAFTED-TV_BOW][SV_WHIP] < WEAPON_EXP_BEGINNER))
        {
-               p_ptr->weapon_exp[TV_HAFTED-TV_BOW][SV_WHIP] = 4000;
+               p_ptr->weapon_exp[TV_HAFTED-TV_BOW][SV_WHIP] = WEAPON_EXP_BEGINNER;
        }
 
        for (i = 0; i < 10; i++)
@@ -2766,45 +2766,7 @@ static void get_extra(bool roll_hitdie)
                p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
 
        /* Roll for hit point unless quick-start */
-       if (roll_hitdie)
-       {
-               /* Minimum hitpoints at highest level */
-               min_value = ((PY_MAX_LEVEL+2) * (p_ptr->hitdie + 1)) * 3 / 8;
-               min_value += p_ptr->hitdie;
-
-               /* Maximum hitpoints at highest level */
-               max_value = ((PY_MAX_LEVEL+2) * (p_ptr->hitdie + 1)) * 5 / 8;
-               max_value += p_ptr->hitdie;
-
-               /* Roll out the hitpoints */
-               while (TRUE)
-               {
-                       /* Pre-calculate level 1 hitdice */
-                       p_ptr->player_hp[0] = p_ptr->hitdie;
-
-                       for (i = 1; i < 4; i++)
-                       {
-                               j = randint1(p_ptr->hitdie);
-                               p_ptr->player_hp[0] += j;
-                       }
-
-                       /* Roll the hitpoint values */
-                       for (i = 1; i < PY_MAX_LEVEL; i++)
-                       {
-                               j = randint1(p_ptr->hitdie);
-                               p_ptr->player_hp[i] = p_ptr->player_hp[i - 1] + j;
-                       }
-
-                       /* XXX Could also require acceptable "mid-level" hitpoints */
-
-                       /* Require "valid" hitpoints at highest level */
-                       if (p_ptr->player_hp[PY_MAX_LEVEL - 1] < min_value) continue;
-                       if (p_ptr->player_hp[PY_MAX_LEVEL - 1] > max_value) continue;
-
-                       /* Acceptable */
-                       break;
-               }
-       }
+       if (roll_hitdie) do_cmd_rerate_aux();
 
        /* Initial hitpoints */
        p_ptr->mhp = p_ptr->player_hp[0];
@@ -3266,7 +3228,9 @@ static void player_wipe(void)
 
                /* Hack -- Reset the max counter */
                if (r_ptr->flags1 & RF1_UNIQUE) r_ptr->max_num = 1;
-               if (r_ptr->flags7 & RF7_UNIQUE_7) r_ptr->max_num = 5;
+
+               /* Hack -- Non-unique Nazguls are semi-unique */
+               else if (r_ptr->flags7 & RF7_NAZGUL) r_ptr->max_num = MAX_NAZGUL_NUM;
 
                /* Clear player kills */
                r_ptr->r_pkills = 0;
@@ -3358,12 +3322,6 @@ static void player_wipe(void)
        p_ptr->mane_num = 0;
        p_ptr->exit_bldg = TRUE; /* only used for arena now -KMW- */
 
-       /* Reset rewards */
-       for (i = 0; i < MAX_BACT; i++)
-       {
-               p_ptr->rewards[i] = 0;
-       }
-
        /* Bounty */
        p_ptr->today_mon = 0;
 
@@ -3391,13 +3349,81 @@ static void player_wipe(void)
        }
 }
 
+
+/*
+ *  Hook function for quest monsters
+ */
+static bool mon_hook_quest(int r_idx)
+{
+       monster_race *r_ptr = &r_info[r_idx];
+
+       /* Random quests are in the dungeon */
+       if (r_ptr->flags8 & RF8_WILD_ONLY) return FALSE;
+
+       /* No random quests for aquatic monsters */
+       if (r_ptr->flags7 & RF7_AQUATIC) return FALSE;
+
+       /* No random quests for multiplying monsters */
+       if (r_ptr->flags2 & RF2_MULTIPLY) return FALSE;
+
+       /* No quests to kill friendly monsters */
+       if (r_ptr->flags7 & RF7_FRIENDLY) return FALSE;
+
+       return TRUE;
+}
+
+
+/*
+ * Determine the random quest uniques
+ */
+void determine_random_questor(quest_type *q_ptr)
+{
+       int          r_idx;
+       monster_race *r_ptr;
+
+       /* Prepare allocation table */
+       get_mon_num_prep(mon_hook_quest, NULL);
+
+       while (1)
+       {
+               /*
+                * Random monster 5 - 10 levels out of depth
+                * (depending on level)
+                */
+               r_idx = get_mon_num(q_ptr->level + 5 + randint1(q_ptr->level / 10));
+               r_ptr = &r_info[r_idx];
+
+               if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
+
+               if (r_ptr->flags1 & RF1_QUESTOR) continue;
+
+               if (r_ptr->rarity > 100) continue;
+
+               if (r_ptr->flags7 & RF7_FRIENDLY) continue;
+
+               if (r_ptr->flags7 & RF7_AQUATIC) continue;
+
+               if (r_ptr->flags8 & RF8_WILD_ONLY) continue;
+
+               if (no_questor_or_bounty_uniques(r_idx)) continue;
+
+               /*
+                * Accept monsters that are 2 - 6 levels
+                * out of depth depending on the quest level
+                */
+               if (r_ptr->level > (q_ptr->level + (q_ptr->level / 20))) break;
+       }
+
+       q_ptr->r_idx = r_idx;
+}
+
+
 /*
  *  Initialize random quests and final quests
  */
 static void init_dungeon_quests(int number_of_quests)
 {
        int i;
-       monster_race    *r_ptr;
 
        /* Init the random quests */
        init_flags = INIT_ASSIGN;
@@ -3407,57 +3433,17 @@ static void init_dungeon_quests(int number_of_quests)
 
        p_ptr->inside_quest = 0;
 
-       /* Prepare allocation table */
-       get_mon_num_prep(monster_quest, NULL);
-
-       /* Remove QUESTOR flag */
-       for (i = 1; i < max_r_idx; i++)
-       {
-               r_ptr = &r_info[i];
-               if (r_ptr->flags1 & RF1_QUESTOR) r_ptr->flags1 &= ~RF1_QUESTOR;
-       }
-
        /* Generate quests */
        for (i = MIN_RANDOM_QUEST + number_of_quests - 1; i >= MIN_RANDOM_QUEST; i--)
        {
                quest_type      *q_ptr = &quest[i];
                monster_race    *quest_r_ptr;
-               int             r_idx;
 
                q_ptr->status = QUEST_STATUS_TAKEN;
-
-               while (1)
-               {
-                       /*
-                        * Random monster 5 - 10 levels out of depth
-                        * (depending on level)
-                        */
-                       r_idx = get_mon_num(q_ptr->level + 5 + randint1(q_ptr->level / 10));
-                       r_ptr = &r_info[r_idx];
-
-                       if(!(r_ptr->flags1 & RF1_UNIQUE)) continue;
-
-                       if(r_ptr->flags1 & RF1_QUESTOR) continue;
-
-                       if(r_ptr->flags6 & RF6_SPECIAL) continue;
-
-                       if(r_ptr->flags7 & RF7_FRIENDLY) continue;
-
-                       if(r_ptr->flags7 & RF7_AQUATIC) continue;
-
-                       if(r_ptr->flags8 & RF8_WILD_ONLY) continue;
-
-                       /*
-                        * Accept monsters that are 2 - 6 levels
-                        * out of depth depending on the quest level
-                        */
-                       if (r_ptr->level > (q_ptr->level + (q_ptr->level / 20))) break;
-               }
-
-               q_ptr->r_idx = r_idx;
-               quest_r_ptr = &r_info[q_ptr->r_idx];
+               determine_random_questor(q_ptr);
 
                /* Mark uniques */
+               quest_r_ptr = &r_info[q_ptr->r_idx];
                quest_r_ptr->flags1 |= RF1_QUESTOR;
 
                q_ptr->max_num = 1;
@@ -3491,13 +3477,16 @@ static void init_turn(void)
        {
                /* Undead start just after midnight */
                turn = (TURNS_PER_TICK*3 * TOWN_DAWN) / 4 + 1;
+               turn_limit = TURNS_PER_TICK * TOWN_DAWN * MAX_DAYS + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
        }
        else
        {
                turn = 1;
+               turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
        }
 
        dungeon_turn = 1;
+       dungeon_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
 }
 
 /*
@@ -3626,7 +3615,7 @@ static byte player_init[MAX_CLASS][3][2] =
        },
 
        {
-               /* Harper */
+               /* Bard */
                { TV_MUSIC_BOOK, 0 },
                { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR},
                { TV_SWORD, SV_SHORT_SWORD },
@@ -3661,7 +3650,7 @@ static byte player_init[MAX_CLASS][3][2] =
        },
 
        {
-               /* Kihei */
+               /* Cavalry */
                { TV_BOW, SV_SHORT_BOW },
                { TV_SOFT_ARMOR, SV_LEATHER_SCALE_MAIL},
                { TV_POLEARM, SV_BROAD_SPEAR}
@@ -3675,7 +3664,7 @@ static byte player_init[MAX_CLASS][3][2] =
        },
 
        {
-               /* Kaji */
+               /* Weaponsmith */
                { TV_RING, SV_RING_RES_FEAR }, /* Warriors need it! */
                { TV_HARD_ARMOR, SV_CHAIN_MAIL },
                { TV_POLEARM, SV_BROAD_AXE }
@@ -3787,7 +3776,7 @@ void player_outfit(void)
                object_prep(q_ptr, lookup_kind(TV_FLASK, SV_ANY));
 
                /* Fuel with oil (move pval to xtra4) */
-               apply_magic(q_ptr, 1, FALSE, FALSE, FALSE, FALSE);
+               apply_magic(q_ptr, 1, AM_NO_FIXED_ART);
 
                q_ptr->number = (byte)rand_range(7, 12);
                object_aware(q_ptr);
@@ -4831,10 +4820,8 @@ static bool get_stat_limits(void)
                switch ( c ){
                case 'Q':
                        birth_quit();
-                       break;
                case 'S':
-                       return (FALSE); 
-                       break;
+                       return FALSE;
                case ESCAPE:
                        break;
                case ' ':
@@ -5081,7 +5068,6 @@ static bool get_chara_limits(void)
                switch (c){
                case 'Q':
                        birth_quit();
-                       break;
                case 'S':
                        return (FALSE);
                case ESCAPE:
@@ -5230,6 +5216,125 @@ static bool get_chara_limits(void)
 }
 #endif
 
+static char histpref_buf[240];
+
+void add_history_from_pref_line(cptr t)
+{
+       int  limit = (sizeof histpref_buf) - 1;
+       int  i;
+
+       for (i = strlen(histpref_buf); *t && (i < limit); t++)
+       {
+#ifdef JP
+               if (iskanji(*t) || isprint(*t))
+#else
+               if (isprint(*t))
+#endif
+               {
+#ifdef JP
+                       if (iskanji(*t))
+                       {
+                               if (i + 1 >= limit) break;
+                               histpref_buf[i++] = *(t++);
+                       }
+#endif
+                       histpref_buf[i++] = *t;
+               }
+       }
+
+       /* Terminate */
+       histpref_buf[(i < limit) ? i : limit] = '\0';
+}
+
+
+static bool do_cmd_histpref(void)
+{
+       char buf[80];
+       errr err;
+       int i, j, n;
+       char *s, *t;
+       char temp[64 * 4];
+
+#ifdef JP
+       if (!get_check("À¸¤¤Î©¤ÁÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return FALSE;
+#else
+       if (!get_check("Load background history preference file? ")) return FALSE;
+#endif
+
+       /* Init buffer */
+       histpref_buf[0] = '\0';
+
+#ifdef JP
+       sprintf(buf, "histedit-%s.prf", player_name);
+#else
+       sprintf(buf, "histpref-%s.prf", player_name);
+#endif
+       err = process_histpref_file(buf);
+
+       /* Process 'hist????.prf' if 'hist????-<name>.prf' doesn't exist */
+       if (0 > err)
+       {
+#ifdef JP
+               strcpy(buf, "histedit.prf");
+#else
+               strcpy(buf, "histpref.prf");
+#endif
+               err = process_histpref_file(buf);
+       }
+
+       if (err)
+       {
+#ifdef JP
+               msg_print("À¸¤¤Î©¤ÁÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
+#else
+               msg_print("Failed to load background history preference.");
+#endif
+               msg_print(NULL);
+
+               /* Terminate buffer */
+               histpref_buf[0] = '\0';
+               return FALSE;
+       }
+
+       /* Clear the previous history strings */
+       for (i = 0; i < 4; i++) p_ptr->history[i][0] = '\0';
+
+       /* Skip leading spaces */
+       for (s = histpref_buf; *s == ' '; s++) /* loop */;
+
+       /* Get apparent length */
+       n = strlen(s);
+
+       /* Kill trailing spaces */
+       while ((n > 0) && (s[n - 1] == ' ')) s[--n] = '\0';
+
+       roff_to_buf(s, 60, temp, sizeof(temp));
+       t = temp;
+       for (i = 0; i < 4; i++)
+       {
+               if (t[0] == 0) break;
+               else
+               {
+                       strcpy(p_ptr->history[i], t);
+                       t += strlen(t) + 1;
+               }
+       }
+
+       /* Turn 0 to space */
+       for (i = 0; i < 4; i++)
+       {
+               for (j = 0; p_ptr->history[i][j]; j++) /* loop */;
+
+               for (; j < 59; j++) p_ptr->history[i][j] = ' ';
+               p_ptr->history[i][59] = '\0';
+       }
+
+       /* Terminate buffer */
+       histpref_buf[0] = '\0';
+
+       return TRUE;
+}
+
 /*
  *  Character background edit-mode
  */
@@ -5256,8 +5361,10 @@ static void edit_history(void)
        display_player(1);
 #ifdef JP
        c_put_str(TERM_L_GREEN, "(¥­¥ã¥é¥¯¥¿¡¼¤ÎÀ¸¤¤Î©¤Á - ÊÔ½¸¥â¡¼¥É)", 11, 20);
+       put_str("[ 2/4/6/8¤Ç°ÜÆ°¡¢Enter¤Ç½ªÎ»¡¢Ctrl-F¤Ç¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß ]", 17, 10);
 #else
        c_put_str(TERM_L_GREEN, "(Character Background - Edit Mode)", 11, 20);
+       put_str("[ 2/4/6/8 for Move, Enter for End, Ctrl-F for Read pref ]", 17, 10);
 #endif
 
        while (TRUE)
@@ -5323,12 +5430,26 @@ static void edit_history(void)
                        if ((x > 0) && (iskanji2(p_ptr->history[y], x-1))) x--;
 #endif
                }
-               else if (c == '\r')
+               else if (c == '\r' || c == '\n')
                {
+                       Term_erase(0, 11, 255);
+                       Term_erase(0, 17, 255);
+#ifdef JP
+                       put_str("(¥­¥ã¥é¥¯¥¿¡¼¤ÎÀ¸¤¤Î©¤Á - ÊÔ½¸ºÑ¤ß)", 11, 20);
+#else
+                       put_str("(Character Background - Edited)", 11, 20);
+#endif
                        break;
                }
                else if (c == ESCAPE)
                {
+                       clear_from(11);
+#ifdef JP
+                       put_str("(¥­¥ã¥é¥¯¥¿¡¼¤ÎÀ¸¤¤Î©¤Á)", 11, 25);
+#else
+                       put_str("(Character Background)", 11, 25);
+#endif
+
                        for (i = 0; i < 4; i++)
                        {
                                sprintf(p_ptr->history[i], "%s", old_history[i]);
@@ -5336,6 +5457,15 @@ static void edit_history(void)
                        }
                        break;
                }
+               else if (c == KTRL('F'))
+               {
+                       if (do_cmd_histpref())
+                       {
+#ifdef JP
+                               if ((x > 0) && (iskanji2(p_ptr->history[y], x - 1))) x--;
+#endif
+                       }
+               }
                else if (c == '\010')
                {
                        x--;
@@ -5634,9 +5764,9 @@ static bool player_birth_aux(void)
                        }
                }
 #ifdef JP
-               if (get_check("¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) break;
+               if (get_check_strict("¤è¤í¤·¤¤¤Ç¤¹¤«¡©", CHECK_DEFAULT_Y)) break;
 #else
-               if (get_check("Are you sure? ")) break;
+               if (get_check_strict("Are you sure? ", CHECK_DEFAULT_Y)) break;
 #endif
                clear_from(10);
                c_put_str(TERM_WHITE, "              ", 4, 15);
@@ -5670,9 +5800,9 @@ static bool player_birth_aux(void)
                }
 
 #ifdef JP
-               if (get_check("¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) break;
+               if (get_check_strict("¤è¤í¤·¤¤¤Ç¤¹¤«¡©", CHECK_DEFAULT_Y)) break;
 #else
-               if (get_check("Are you sure? ")) break;
+               if (get_check_strict("Are you sure? ", CHECK_DEFAULT_Y)) break;
 #endif
                c_put_str(TERM_WHITE, "              ", 5, 15);
        }
@@ -5704,9 +5834,9 @@ static bool player_birth_aux(void)
                        }
                }
 #ifdef JP
-               if (get_check("¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) break;
+               if (get_check_strict("¤è¤í¤·¤¤¤Ç¤¹¤«¡©", CHECK_DEFAULT_Y)) break;
 #else
-               if (get_check("Are you sure? ")) break;
+               if (get_check_strict("Are you sure? ", CHECK_DEFAULT_Y)) break;
 #endif
                c_put_str(TERM_L_BLUE, player_name, 1, 34);
                prt("", 1, 34+strlen(player_name));
@@ -5827,8 +5957,6 @@ static bool player_birth_aux(void)
        /* Clear */
        clear_from(10);
 
-       init_dungeon_quests(number_of_quests);
-
        /* Reset turn; before auto-roll and after choosing race */
        init_turn();
 
@@ -6198,6 +6326,8 @@ static bool player_birth_aux(void)
        /* Start over */
        if (c == 'S') return (FALSE);
 
+       init_dungeon_quests(number_of_quests);
+
        /* Save character data for quick start */
        save_prev_data(&previous_char);
        previous_char.quests = number_of_quests;
@@ -6236,9 +6366,9 @@ static bool ask_quick_start(void)
                char c;
 
 #ifdef JP
-               put_str("¥¯¥¤¥Ã¥¯¡¦¥¹¥¿¡¼¥È¤ò»È¤¤¤Þ¤¹¤«¡©[y/n]", 14, 10);
+               put_str("¥¯¥¤¥Ã¥¯¡¦¥¹¥¿¡¼¥È¤ò»È¤¤¤Þ¤¹¤«¡©[y/N]", 14, 10);
 #else
-               put_str("Use quick start? [y/n]", 14, 10);
+               put_str("Use quick start? [y/N]", 14, 10);
 #endif
                c = inkey();
 
@@ -6309,6 +6439,12 @@ void player_birth(void)
 
        playtime = 0;
 
+       /*
+        * Paranoia - wipe the pets
+        * For accuracy of precalc_cur_num_of_pet() called from wipe_m_list()
+        */
+       C_WIPE(party_mon, MAX_PARTY_MON, monster_type);
+
        /* 
         * Wipe monsters in old dungeon
         * This wipe destroys value of m_list[].cur_num .