OSDN Git Service

Vanillaにならって、キャラクターの状態を表わすグローバル変数の多くを
[hengband/hengband.git] / src / birth.c
index 8914717..85c98f3 100644 (file)
  * system may have problems because the user can't stop the
  * autoroller for this number of rolls.
  */
-#define AUTOROLLER_STEP                25L
+#define AUTOROLLER_STEP 5431L
 
 /*
  * Define this to cut down processor use while autorolling
  */
-/*#define AUTOROLLER_DELAY*/
+#if 0
+#  define AUTOROLLER_DELAY
+#endif
 
 /*
  * Maximum number of tries for selection of a proper quest monster
 /*
  * Forward declare
  */
-typedef struct birther birther;
-
-/*
- * A structure to hold "rolled" information
- */
-struct birther
-{
-       s16b age;
-       s16b wt;
-       s16b ht;
-       s16b sc;
-
-       s32b au;
-
-       s16b stat[6];
-       s16b hp[50];
-
-       s16b chaos_patron;
-
-       char history[4][60];
-};
-
-
-
-/*
- * The last character displayed
- */
-static birther prev;
-
-
-
-/*
- * Forward declare
- */
 typedef struct hist_type hist_type;
 
 /*
@@ -1497,9 +1465,87 @@ static hist_type bg[] =
 #endif
 
 #ifdef JP
-       {"¤¢¤Ê¤¿¤Ï¥¹¥­¡¼¥ê¥Õ¥È¤Ë¾è¤Ã¤¿¤ê¤¹¤ë¤­¤ï¤á¤ÆÄ̾ï¤Î¥¯¥¿¡¼¤Ç¤¹¡£¤¢¤Ê¤¿¤ÎÌÓ¤ÏÜô¿§¤Ç¤¹¡£", 65, 154, 0, 55},
-       {"¤¢¤Ê¤¿¤ÏÄ̾ï¤Î¥¯¥¿¡¼Ã£¤¬Íê¤ê¤Ë¤·¤Æ¤¤¤ë¥Ñ¥Ñ¥¯¥¿¡¼¤Ç¤¹¡£¤¢¤Ê¤¿¤ÎÌÓ¤ÏÎп§¤Ç¤¹¡£", 95, 154, 0, 65},
-       {"¤¢¤Ê¤¿¤Ï¤È¤Æ¤âÄÁ¤·¤¤¥È¥é¥¯¥¿¡¼¤Ç¤¹¡£¤¢¤Ê¤¿¤ÎÌӤϥȥé¤Î¤è¤¦¤Ê²«¤È¹õ¤Î¼ÊÌÏÍͤǤ¹¡£", 100, 154, 0, 80},
+       {"¤¢¤Ê¤¿¤ÏÉáÃÊ¥¶¥¯¥¶¥¯¥Ç¥¶¡¼¥È¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 4, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃÊ¥°¥é¥°¥é¥¿¥ï¡¼¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 8, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃʥۥإۥض®Ã«¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 12, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃʥɥץɥ×ÃÓ¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 16, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃʥƥ¯¥Æ¥¯»¨µ»¾ì¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 20, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃÊ¥Õ¥à¥Õ¥àȪ¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 24, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃÊ¥¯¥Î¥¯¥ÎÂì¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 28, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃÊ¥¯¥ê¥¯¥êÀî¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 32, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃʥƥê¥Æ¥ê¥­¥ã¥ó¥×¾ì¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 36, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃÊ¥¯¥¿¡¼ÁüÁ°¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 40, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃʥƥ¯¥ÎÅò¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 44, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃʥƥ¯¥Î¥¢¥¤¥é¥ó¥É¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 48, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃʥƥ¯¥Î¥Þ¥ê¥ó¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 52, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃʥƥ¯¥Î¥É¡¼¥à¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 56, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃʥƥ¯¥Î¥Û¡¼¥ë¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 60, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃʥƥ¯¥Î¹â¸¶¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 64, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃʥƥ¯¥Î»Ô̱²ñ´Û¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 68, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃʥƥ¯¥Î¸ø±à¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 72, 154, 159, 50},
+       {"¤¢¤Ê¤¿¤ÏÉáÃÊ¥¹¥¤¥¹¥¤¥¢¥ë¥×¥¹¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 76, 154, 159, 65},
+       {"¤¢¤Ê¤¿¤ÏÉáÃÊ¥Ò¥½¥Ò¥½¿¹¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 80, 154, 159, 65},
+       {"¤¢¤Ê¤¿¤ÏÉáÃʥƥ¯¥ÎÀ¸ÂÖ¸¦µæ½ê¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 84, 154, 159, 65},
+       {"¤¢¤Ê¤¿¤ÏÉáÃʥƥ¯¥Î¥í¥±¥Ã¥Èȯ¼ÍÂæ¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 88, 154, 159, 65},
+       {"¤¢¤Ê¤¿¤ÏÉáÃÊ¥Á¥ã¥¤¥Ê¥¦¥©¡¼¥ë¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 92, 154, 159, 65},
+       {"¤¢¤Ê¤¿¤ÏÉáÃÊ¥¹¥Ú¡¼¥¹¥¦¥©¡¼¥ë¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 96, 154, 159, 70},
+       {"¤¢¤Ê¤¿¤ÏÉáÃʥƥ¯¥Î¥ê¥¾¡¼¥È¥Û¥Æ¥ë¤ÇÍ·¤ó¤Ç¤¤¤ë¡¢", 100, 154, 159, 75},
+
+       {"ÉáÄ̤Υ¯¥¿¡¼¤Ç¤¹¡£", 70, 159, 160, 50},
+       {"¤ß¤ó¤Ê¤¬Íê¤ê¤Ë¤·¤Æ¤¤¤ë¿Æ¥¯¥¿¡¼¤Ç¤¹¡£", 85, 159, 160, 65},
+       {"ºû¤¬Â繥ʪ¤Ê¥Ñ¥ó¥À¥¯¥¿¡¼¤Ç¤¹¡£", 92, 159, 161, 75},
+       {"¤È¤Æ¤âÄÁ¤·¤¤¥È¥é¥¯¥¿¡¼¤Ç¤¹¡£", 96, 159, 162, 80},
+       {"¤È¤Æ¤âÄÁ¤·¤¤¥Ô¥«¥¯¥¿¡¼¤Ç¤¹¡£", 100, 159, 163, 90},
+
+       {"¤¢¤Ê¤¿¤ÏÀÖ¿§¤ÎÌÓ¤ò¤â¤Á¡¢", 6, 160, 164, 50},
+       {"¤¢¤Ê¤¿¤Ï¥¯¥ê¡¼¥à¿§¤ÎÌÓ¤ò¤â¤Á¡¢", 12, 160, 164, 50},
+       {"¤¢¤Ê¤¿¤Ï²«ÅÚ¿§¤ÎÌÓ¤ò¤â¤Á¡¢", 18, 160, 164, 50},
+       {"¤¢¤Ê¤¿¤Ï²«¿§¤ÎÌÓ¤ò¤â¤Á¡¢", 24, 160, 164, 50},
+       {"¤¢¤Ê¤¿¤Ï²«Î理ÎÌÓ¤ò¤â¤Á¡¢", 30, 160, 164, 50},
+       {"¤¢¤Ê¤¿¤ÏËõÃ㿧¤ÎÌÓ¤ò¤â¤Á¡¢", 36, 160, 164, 50},
+       {"¤¢¤Ê¤¿¤ÏÇ»¤¤Î理ÎÌÓ¤ò¤â¤Á¡¢", 42, 160, 164, 50},
+       {"¤¢¤Ê¤¿¤ÏÀÄÎ理ÎÌÓ¤ò¤â¤Á¡¢", 48, 160, 164, 50},
+       {"¤¢¤Ê¤¿¤Ï¿å¿§¤ÎÌÓ¤ò¤â¤Á¡¢", 54, 160, 164, 50},
+       {"¤¢¤Ê¤¿¤ÏÇö¤¤»ç¿§¤ÎÌÓ¤ò¤â¤Á¡¢", 60, 160, 164, 50},
+       {"¤¢¤Ê¤¿¤Ï»ç¿§¤ÎÌÓ¤ò¤â¤Á¡¢", 65, 160, 164, 50},
+       {"¤¢¤Ê¤¿¤Ï°«¿§¤ÎÌÓ¤ò¤â¤Á¡¢", 70, 160, 164, 60},
+       {"¤¢¤Ê¤¿¤Ï¥Ô¥ó¥¯¿§¤ÎÌÓ¤ò¤â¤Á¡¢", 75, 160, 164, 60},
+       {"¤¢¤Ê¤¿¤ÏÇò¿§¤ÎÌÓ¤ò¤â¤Á¡¢", 80, 160, 164, 60},
+       {"¤¢¤Ê¤¿¤ÏÀÄ¿§¤ÎÌÓ¤ò¤â¤Á¡¢", 85, 160, 164, 65},
+       {"¤¢¤Ê¤¿¤Ï¹õ¿§¤ÎÌÓ¤ò¤â¤Á¡¢", 90, 160, 164, 65},
+       {"¤¢¤Ê¤¿¤ÏÎ理ÎÌÓ¤ò¤â¤Á¡¢", 95, 160, 164, 65},
+       {"¤¢¤Ê¤¿¤ÏÜô¿§¤ÎÌÓ¤ò¤â¤Á¡¢", 100, 160, 164, 70},
+       {"¤¢¤Ê¤¿¤Ï¥Ñ¥ó¥À¤Î¤è¤¦¤ÊÇò¤È¹õ¤ÎÈÃÌÏÍͤÎÌÓ¤ò¤â¤Á¡¢", 100, 161, 164, 70},
+       {"¤¢¤Ê¤¿¤Ï¥È¥é¤Î¤è¤¦¤Ê²«¤È¹õ¤Î¼ÊÌÏÍͤÎÌÓ¤ò¤â¤Á¡¢", 100, 162, 164, 70},
+       {"¤¢¤Ê¤¿¤ÏÌÀ¤ë¤¯µ±¤¤¤Æ¤¤¤Æ¡¢", 100, 163, 164, 70},
+
+       {"¥Þ¥Õ¥é¡¼¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 4, 164, 0, 50},
+       {"¥é¥¤¥¿¡¼¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 8, 164, 0, 50},
+       {"¥ê¥â¥³¥ó¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 12, 164, 0, 50},
+       {"¼ê¤Ì¤°¤¤¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 16, 164, 0, 50},
+       {"µíÆý¥Ó¥ó¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 20, 164, 0, 50},
+       {"¥Ó¥ó¤Î¤Õ¤¿¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 24, 164, 0, 50},
+       {"Ìîµå˹¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 28, 164, 0, 50},
+       {"É⤭ÎؤòÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 32, 164, 0, 50},
+       {"¥Ð¥Ã¥È¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 36, 164, 0, 50},
+       {"Â纬¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 40, 164, 0, 50},
+       {"¥ê¥å¥Ã¥¯¥µ¥Ã¥¯¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 44, 164, 0, 50},
+       {"¾­´ýÈפòÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 48, 164, 0, 50},
+       {"¾­´ý¤Î¶ð¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 52, 164, 0, 50},
+       {"»±¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 56, 164, 0, 50},
+       {"¤ä¤«¤ó¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 60, 164, 0, 50},
+       {"¤Û¤¦¤­¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 64, 164, 0, 50},
+       {"¥Æ¥£¥Ã¥·¥åÈ¢¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 68, 164, 0, 50},
+       {"¥À¥ë¥Þ¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 71, 164, 0, 50},
+       {"¥Ë¥ó¥¸¥ó¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 75, 164, 0, 60},
+       {"¥Û¥ë¥ó¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 79, 164, 0, 60},
+       {"¤ß¤«¤óÈ¢¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 83, 164, 0, 60},
+       {"ÊõÈ¢¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 86, 164, 0, 60},
+       {"¥Æ¥ó¥¬¥í¥ó¥Ï¥Ã¥È¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 90, 164, 0, 60},
+       {"¥¢¥Õ¥í¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 94, 164, 0, 65},
+       {"¤·¤ã¤±¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 97, 164, 0, 65},
+       {"39¥Ü¥¦¥ä¤òÊõʪ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£", 100, 164, 0, 70},
+
 #else
        {"You are a normal Kutar.  You have orange colored fur.", 65, 154, 0, 55},
        {"You are a father Kutar, the patriarch of many normal Kutars.  You have green colored fur.", 95, 154, 0, 65},
@@ -1703,7 +1749,7 @@ static cptr race_jouhou[MAX_RACES] =
 
  "This race is a blasphemous abomination produced by Chaos. It is not an independent race but rather a humanoid creature, most often a human, twisted by the Chaos, or a nightmarish crossbreed of a human and a beast. All Beastmen are accustomed to Chaos so much that they are untroubled by confusion and sound, although raw logrus can still have effects on them. Beastmen revel in chaos, as it twists them more and more. Beastmen are subject to mutations: when they have been created, they receive a random mutation. After that, every time they advance a level they have a small chance of gaining yet another mutation.",
 
-"The Ents are a powerful race dating from the beginning of the world, oldest of all animals or plants who inhabit Arda. Spirits of the land, they were summoned to guard the forests of Middle-earth. Being much like trees they are very slow but strong, and very susceptible to fire. As the Shepherds of the Trees, they have the innate ability to cause trees to rise about them for protection.",
+"The Ents are a powerful race dating from the beginning of the world, oldest of all animals or plants who inhabit Arda. Spirits of the land, they were summoned to guard the forests of Middle-earth. Being much like trees they are very clumsy but strong, and very susceptible to fire.",
 
 "Archons are a higher class of angels. They are good at all skills, and are strong, wise, and are a favorite with any people. They are able to see the unseen, and their wings allow them to safely fly over traps and other dangerous places. However, belonging to a higher plane as they do, the experiences of this world do not leave a strong impression on them and they gain levels slowly.",
 
@@ -1775,7 +1821,7 @@ static cptr class_jouhou[MAX_CLASS] =
 
 "¶À»È¤¤¤Ï¡¢ËâÎϤιþ¤á¤é¤ì¤¿¶À¤òºî¤ê½Ð¤·¤Æ¡¢¤½¤ì¤ò¿¨ÇޤȤ·¤Æ¹¶·â¤ò¹Ô¤Ê¤¦¤³¤È¤¬¤Ç¤­¤ë¶ÀËâË¡¤ò»È¤¤¤Þ¤¹¡£¶À»È¤¤¤Ï¶À¤Î¾å¤Ç¼ÂÎϤòȯ´ø¤·¡¢¶À¤Î¾å¤Ç¤ÏÁÇÁᤤ¥Æ¥ì¥Ý¡¼¥È¤¬²Äǽ¤È¤Ê¤ê¤Þ¤¹¡£ËâË¡¤Î¶À¤Ï¡¢¥ì¥Ù¥ë¤Ë¤è¤Ã¤Æ°ìÅÙ¤ËÀ©¸æ¤Ç¤­¤ë¿ô¤¬À©¸Â¤µ¤ì¤Þ¤¹¡£¶ÀËâË¡¤ËɬÍפÊǽÎϤÏÃÎǽ¤Ç¤¹¡£",
 
-"Ǧ¼Ô¤Ï°Å°Ç¤ËÀø¤à¶²¤ë¤Ù¤­°Å»¦¼Ô¤Ç¤¢¤ê¡¢¸÷¸»¤ò»ý¤¿¤º¤Ë¹ÔÆ°¤·¡¢Áê¼ê¤ÎÉÔ°Õ¤ò¤Ä¤­°ì·â¤Ç©¤Îº¬¤ò»ß¤á¤Þ¤¹¡£¤Þ¤¿¡¢Áê¼ê¤òÏǤ魯¤¿¤á¤ÎǦ½Ñ¤â¿È¤Ë¤Ä¤±¤Þ¤¹¡£æ«¤ä¥É¥¢¤ò¸«¤Ä¤±¤ëǽÎϤËÍ¥¤ì¡¢æ«¤Î²ò½ü¤ä¸°³«¤±¤Ë½Ï㤷¤Æ¤¤¤Þ¤¹¡£·ÚÁõ¤ò¹¥¤ß¡¢½Å¤¤³»¤äÉð´ï¤òÁõÈ÷¤¹¤ë¤ÈÃø¤·¤¯Æ°¤­¤¬À©¸Â¤µ¤ì¡¢¤Þ¤¿¡¢½â¤òÁõÈ÷¤·¤è¤¦¤È¤Ï¤·¤Þ¤»¤ó¡£·ÚÁõ¤Ê¤é¤Ð¡¢¥ì¥Ù¥ë¤¬¾å¤¬¤ë¤Ë¤Ä¤ì¤è¤ê®¤¯¤è¤êÀŤ«¤Ë¹ÔÆ°¤Ç¤­¤Þ¤¹¡£¤µ¤é¤ËǦ¼Ô¤Ï¶²Éݤ»¤º¡¢À®Ä¹¤¹¤ì¤ÐÆǤ¬¤Û¤È¤ó¤É¸ú¤«¤Ê¤¯¤Ê¤ê¡¢Æ©ÌÀ¤Ê¤â¤Î¤ò¸«¤ë¤³¤È¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£Ç¦½Ñ¤ËɬÍפÊǽÎϤϴïÍѤµ¤Ç¤¹¡£"
+"Ǧ¼Ô¤Ï°Å°Ç¤ËÀø¤à¶²¤ë¤Ù¤­°Å»¦¼Ô¤Ç¤¢¤ê¡¢¸÷¸»¤ò»ý¤¿¤º¤Ë¹ÔÆ°¤·¡¢Áê¼ê¤ÎÉÔ°Õ¤ò¤Ä¤­°ì·â¤Ç©¤Îº¬¤ò»ß¤á¤Þ¤¹¡£¤Þ¤¿¡¢Áê¼ê¤òÏǤ魯¤¿¤á¤ÎǦ½Ñ¤â¿È¤Ë¤Ä¤±¤Þ¤¹¡£æ«¤ä¥É¥¢¤ò¸«¤Ä¤±¤ëǽÎϤËÍ¥¤ì¡¢æ«¤Î²ò½ü¤ä¸°³«¤±¤Ë½Ï㤷¤Æ¤¤¤Þ¤¹¡£·ÚÁõ¤ò¹¥¤ß¡¢½Å¤¤³»¤äÉð´ï¤òÁõÈ÷¤¹¤ë¤ÈÃø¤·¤¯Æ°¤­¤¬À©¸Â¤µ¤ì¡¢¤Þ¤¿¡¢½â¤òÁõÈ÷¤·¤è¤¦¤È¤Ï¤·¤Þ¤»¤ó¡£·ÚÁõ¤Ê¤é¤Ð¡¢¥ì¥Ù¥ë¤¬¾å¤¬¤ë¤Ë¤Ä¤ì¤è¤ê®¤¯¤è¤êÀŤ«¤Ë¹ÔÆ°¤Ç¤­¤Þ¤¹¡£¤µ¤é¤ËǦ¼Ô¤Ï¶²Éݤ»¤º¡¢À®Ä¹¤¹¤ì¤ÐÆǤ¬¤Û¤È¤ó¤É¸ú¤«¤Ê¤¯¤Ê¤ê¡¢Æ©ÌÀ¤Ê¤â¤Î¤ò¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£Ç¦½Ñ¤ËɬÍפÊǽÎϤϴïÍѤµ¤Ç¤¹¡£"
 
 #else
 
@@ -1895,7 +1941,7 @@ static cptr seikaku_jouhou[MAX_SEIKAKU] =
 static cptr realm_jouhou[VALID_REALM] =
 {
 #ifdef JP
-"À¸Ì¿¤Ï¡Ö¤è¤¤¡×ËâË¡¤Ç¤¹¡£¤³¤ì¤Ï¼£ÎŤäËɸæ¤ËÈó¾ï¤ËÍê¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢¹¶·â¼öʸ¤â¤¤¤¯¤Ä¤«»ý¤Ã¤Æ¤¤¤Þ¤¹¡£¤½¤ì¤é¤Ï°­Ëâ¤Î±ø¤ì¤¿¼êÀè¤ËÂй³¤¹¤ë¤¿¤á¤Ë¤è¤¯»È¤ï¤ì¤Þ¤¹¡£",
+"À¸Ì¿¤Ï²óÉüǽÎϤËÍ¥¤ì¤¿ËâË¡¤Ç¤¹¡£¼£ÎŤäËɸ桢´¶ÃÎËâË¡¤¬Â¿¤¯´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢¹¶·â¼öʸ¤â¤ï¤º¤«¤Ë»ý¤Ã¤Æ¤¤¤Þ¤¹¡£Æä˹â¥ì¥Ù¥ë¤Î¼öʸ¤Ë¤Ï¥¢¥ó¥Ç¥Ã¥É¤ò¿Ð¤Ëµ¢¤¹ÎϤò¤¢¤ë¤È¸À¤ï¤ì¤Æ¤¤¤Þ¤¹¡£",
 
 "Àç½Ñ¤Ï¡Ömeta¡×Îΰè¤Ç¤¢¤ê¡¢´¶ÃΤä´ÕÄê¡¢¤µ¤é¤ËÂàµÑÍѤμöʸ¤ä¼«¿È¤ÎǽÎϤò¹â¤á¤ë¼öʸ¤Ê¤É¤ÎÊØÍø¤Ê¼öʸ¤¬´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£¤·¤«¤·¡¢Ä¾Àܹ¶·âÍѤμöʸ¤Ï»ý¤Ã¤Æ¤¤¤Þ¤»¤ó¡£",
 
@@ -1913,13 +1959,15 @@ static cptr realm_jouhou[VALID_REALM] =
 
 "°­Ëâ¤ÎËâË¡¤Ï°Å¹õ¤ÈƱÍÍÈó¾ï¤Ë¼Ù°­¤Ê¥«¥Æ¥´¥ê¡¼¤Ç¤¹¡£ÍÍ¡¹¤Ê¹¶·âËâË¡¤ËÍ¥¤ì¡¢¤Þ¤¿°­Ëâ¤Î¤´¤È¤­ÃγÐǽÎϤòÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¹â¥ì¥Ù¥ë¤Î¼öʸ¤Ï°­Ëâ¤ò¼«ºß¤ËÁà¤ê¡¢¼«Ê¬¼«¿È¤ÎÆùÂΤò¤â°­Ëâ²½¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£",
 
+"Ç˼٤ϡÖÀµµÁ¡×¤ÎËâË¡¤Ç¤¹¡£Ä¾ÀÜŨ¤ò½ý¤Ä¤±¤ëËâË¡¤¬Â¿¤¯´Þ¤Þ¤ì¡¢Æä˼ٰ­¤ÊŨ¤ËÂФ¹¤ëÎϤ϶²¤ë¤Ù¤­¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£¤·¤«¤·¡¢Á±ÎɤÊŨ¤Ë¤Ï¤¢¤Þ¤ê¸ú²Ì¤¬¤¢¤ê¤Þ¤»¤ó¡£",
+
 "²Î½¸¤Ï¡¢²Î¤Ë¤è¤Ã¤Æ¸ú²Ì¤òȯ´ø¤¹¤ëËâË¡¤Ç¤¹¡£ËâË¡¤ÈƱÍÍ¡¢»È¤Ã¤¿»þ¤Ë¸ú²Ì¤Î¤¢¤ë¤â¤Î¤È¡¢²Î¤¤Â³¤±¤ë¤³¤È¤Ë¤è¤Ã¤Æ»ý³¤·¤Æ¸ú²Ì¤òȯ´ø¤¹¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£¸å¼Ô¤Î¾ì¹ç¤Ï¡¢MP¤Î³¤¯¸Â¤ê¸ú²Ì¤òȯ´ø¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¤¬¡¢Æ±»þ¤Ë²Î¤¨¤ë²Î¤Ï1¤Ä¤À¤±¤È¤¤¤¦À©¸Â¤â¤¢¤ê¤Þ¤¹¡£",
 
 "Éð·Ý¤Î½ñ¤Ï¡¢ÍÍ¡¹¤ÊÀïÆ®¤Îµ»¤Ë¤Ä¤¤¤Æ½ñ¤«¤ì¤Æ¤¤¤Þ¤¹¡£¤³¤ÎËܤϵ»¤ò³Ð¤¨¤ë¤È¤­¤ËÆɤàɬÍפ¬¤¢¤ê¤Þ¤¹¤¬¡¢°ìÅٳФ¨¤¿µ»¤Ï»È¤¦¤Î¤ËËܤò»ý¤ÄɬÍפϤ¢¤ê¤Þ¤»¤ó¡£µ»¤ò»È¤¦¤È¤­¤Ë¤Ïɬ¤ºÉð´ï¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤¤¤±¤Þ¤»¤ó¡£"
 
 #else
 
-"Life is 'good' magic; it relies mostly on healing and protective spells. It does have a few attack spells as well, but these are mostly used for harming and banishing foul minions of evil. ",
+"Life magic is very good for healing; it relies mostly on healing, protection and detection spells. Also life magic have a few attack spells as well. It said that some high level spell of life magic can disintegrate Undead monsters into ash.",
 
 "Sorcery is a `meta` realm, including enchantment and general spells. It provides superb protection spells, spells to enhance your odds in combat and, most importantly, a vast selection of spells for gathering information. However, Sorcery has one weakness: it has no spells to deal direct damage to your enemies.",
 
@@ -1937,6 +1985,8 @@ static cptr realm_jouhou[VALID_REALM] =
 
 "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.",
+
 "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."
@@ -1946,7 +1996,7 @@ static cptr realm_jouhou[VALID_REALM] =
 static char realm_subinfo[VALID_REALM][41] =
 {
 #ifdef JP
-"´¶ÃΤȲóÉü¤ËÍ¥¤ì¡¢¹¶·â¤â¤Ç¤­¤Þ¤¹",
+"´¶ÃΤȲóÉü¤ËÍ¥¤ì¤Æ¤¤¤Þ¤¹",
 "¹¶·â¤Ï¤Ç¤­¤Þ¤»¤ó¤¬Èó¾ï¤ËÊØÍø¤Ç¤¹",
 "´¶ÃΤÈËɸæ¤ËÍ¥¤ì¤Æ¤¤¤Þ¤¹",
 "Ç˲õŪ¤Ê¹¶·â¤ËÍ¥¤ì¤Æ¤¤¤Þ¤¹",
@@ -1955,6 +2005,7 @@ static char realm_subinfo[VALID_REALM][41] =
 "¤ä¤ä¼å¤¤¤Ê¤¬¤é¤âÈó¾ï¤ËÊØÍø¤Ç¤¹",
 "ľÀÜÀïÆ®¤ÎÊä½õ¤ËÍ¥¤ì¤Æ¤¤¤Þ¤¹",
 "¹¶·â¤ÈËɸæ¤ÎξÌ̤ËÍ¥¤ì¤Æ¤¤¤Þ¤¹",
+"¼Ù°­¤Ê²øʪ¤ËÂФ¹¤ë¹¶·â¤ËÍ¥¤ì¤Æ¤¤¤Þ¤¹",
 "²Î¤Ç¤â²Î¤Ã¤Æ¤¤¤Þ¤·¤ç¤¦",
 "ÁÇľ¤ËÅá¤Ç¤â¿¶¤Ã¤Æ¤¤¤Þ¤·¤ç¤¦"
 #else
@@ -1974,11 +2025,6 @@ static char realm_subinfo[VALID_REALM][41] =
 
 
 /*
- * Current stats
- */
-static s16b stat_use[6];
-
-/*
  * Autoroll limit
  */
 static s16b stat_limit[6];
@@ -2062,6 +2108,11 @@ static byte choose_realm(s32b choices, int *count)
                (*count)++;
                auto_select = REALM_DAEMON;
        }
+       if (choices & CH_CRUSADE)
+       {
+               (*count)++;
+               auto_select = REALM_CRUSADE;
+       }
        if (choices & CH_MUSIC)
        {
                (*count)++;
@@ -2083,13 +2134,13 @@ static byte choose_realm(s32b choices, int *count)
        {
                if (p_ptr->pclass == CLASS_PRIEST)
                {
-                       if (p_ptr->realm1 == REALM_LIFE)
+                       if (is_good_realm(p_ptr->realm1))
                        {
                                choices &= ~(CH_DEATH | CH_DAEMON);
                        }
-                       else if ((p_ptr->realm1 == REALM_DEATH) || (p_ptr->realm1 == REALM_DAEMON))
+                       else
                        {
-                               choices &= ~(CH_LIFE);
+                               choices &= ~(CH_LIFE | CH_CRUSADE);
                        }
                }
        }
@@ -2183,7 +2234,7 @@ static byte choose_realm(s32b choices, int *count)
                {
                        if(cs == n)
                        {
-                               k = rand_int(n);
+                               k = randint0(n);
                                break;
                        }
                        else
@@ -2194,7 +2245,7 @@ static byte choose_realm(s32b choices, int *count)
                }
                if (c == '*')
                {
-                       k = rand_int(n);
+                       k = randint0(n);
                        break;
                }
                if (c == '8')
@@ -2386,37 +2437,48 @@ else
 /*
  * Save the current data for later
  */
-static void save_prev_data(void)
+static void save_prev_data(birther *birther_ptr)
 {
        int i;
 
-
-       /*** Save the current data ***/
-
        /* Save the data */
-       prev.age = p_ptr->age;
-       prev.wt = p_ptr->wt;
-       prev.ht = p_ptr->ht;
-       prev.sc = p_ptr->sc;
-       prev.au = p_ptr->au;
+       birther_ptr->psex = p_ptr->psex;
+       birther_ptr->prace = p_ptr->prace;
+       birther_ptr->pclass = p_ptr->pclass;
+       birther_ptr->pseikaku = p_ptr->pseikaku;
+       birther_ptr->realm1 = p_ptr->realm1;
+       birther_ptr->realm2 = p_ptr->realm2;
+       birther_ptr->age = p_ptr->age;
+       birther_ptr->ht = p_ptr->ht;
+       birther_ptr->wt = p_ptr->wt;
+       birther_ptr->sc = p_ptr->sc;
+       birther_ptr->au = p_ptr->au;
 
        /* Save the stats */
        for (i = 0; i < 6; i++)
        {
-               prev.stat[i] = p_ptr->stat_max[i];
+               birther_ptr->stat_max[i] = p_ptr->stat_max[i];
+               birther_ptr->stat_max_max[i] = p_ptr->stat_max_max[i];
        }
 
-       for(i = 0; i < 50; i++)
+       /* Save the hp */
+       for (i = 0; i < PY_MAX_LEVEL; i++)
        {
-               prev.hp[i] = player_hp[i];
+               birther_ptr->player_hp[i] = p_ptr->player_hp[i];
        }
 
-       prev.chaos_patron = p_ptr->chaos_patron;
+       birther_ptr->chaos_patron = p_ptr->chaos_patron;
+
+       /* Save the virtues */
+       for (i = 0; i < 8; i++)
+       {
+               birther_ptr->vir_types[i] = p_ptr->vir_types[i];
+       }
 
        /* Save the history */
        for (i = 0; i < 4; i++)
        {
-               strcpy(prev.history[i], history[i]);
+               strcpy(birther_ptr->history[i], p_ptr->history[i]);
        }
 }
 
@@ -2424,103 +2486,63 @@ static void save_prev_data(void)
 /*
  * Load the previous data
  */
-static void load_prev_data(void)
+static void load_prev_data(bool swap)
 {
        int i;
 
        birther temp;
 
-
        /*** Save the current data ***/
-
-       /* Save the data */
-       temp.age = p_ptr->age;
-       temp.wt = p_ptr->wt;
-       temp.ht = p_ptr->ht;
-       temp.sc = p_ptr->sc;
-       temp.au = p_ptr->au;
-
-       /* Save the stats */
-       for (i = 0; i < 6; i++)
-       {
-               temp.stat[i] = p_ptr->stat_max[i];
-       }
-
-       /* Save the hp */
-       for (i = 0; i < 50; i++)
-       {
-               temp.hp[i] = player_hp[i];
-       }
-
-       temp.chaos_patron = p_ptr->chaos_patron;
-
-       /* Save the history */
-       for (i = 0; i < 4; i++)
-       {
-               strcpy(temp.history[i], history[i]);
-       }
+       if (swap) save_prev_data(&temp);
 
 
        /*** Load the previous data ***/
 
        /* Load the data */
-       p_ptr->age = prev.age;
-       p_ptr->wt = prev.wt;
-       p_ptr->ht = prev.ht;
-       p_ptr->sc = prev.sc;
-       p_ptr->au = prev.au;
+       p_ptr->psex = previous_char.psex;
+       p_ptr->prace = previous_char.prace;
+       p_ptr->pclass = previous_char.pclass;
+       p_ptr->pseikaku = previous_char.pseikaku;
+       p_ptr->realm1 = previous_char.realm1;
+       p_ptr->realm2 = previous_char.realm2;
+       p_ptr->age = previous_char.age;
+       p_ptr->ht = previous_char.ht;
+       p_ptr->wt = previous_char.wt;
+       p_ptr->sc = previous_char.sc;
+       p_ptr->au = previous_char.au;
 
        /* Load the stats */
        for (i = 0; i < 6; i++)
        {
-               p_ptr->stat_max[i] = prev.stat[i];
-               p_ptr->stat_cur[i] = prev.stat[i];
+               p_ptr->stat_cur[i] = p_ptr->stat_max[i] = previous_char.stat_max[i];
+               p_ptr->stat_max_max[i] = previous_char.stat_max_max[i];
        }
 
        /* Load the hp */
-       for (i = 0; i < 50; i++)
-       {
-               player_hp[i] = prev.hp[i];
-       }
-       p_ptr->mhp = player_hp[0];
-       p_ptr->chp = player_hp[0];
-
-       p_ptr->chaos_patron = prev.chaos_patron;
-
-       /* Load the history */
-       for (i = 0; i < 4; i++)
+       for (i = 0; i < PY_MAX_LEVEL; i++)
        {
-               strcpy(history[i], prev.history[i]);
+               p_ptr->player_hp[i] = previous_char.player_hp[i];
        }
+       p_ptr->mhp = p_ptr->player_hp[0];
+       p_ptr->chp = p_ptr->player_hp[0];
 
+       p_ptr->chaos_patron = previous_char.chaos_patron;
 
-       /*** Save the current data ***/
-
-       /* Save the data */
-       prev.age = temp.age;
-       prev.wt = temp.wt;
-       prev.ht = temp.ht;
-       prev.sc = temp.sc;
-       prev.au = temp.au;
-
-       /* Save the stats */
-       for (i = 0; i < 6; i++)
+       for (i = 0; i < 8; i++)
        {
-               prev.stat[i] = temp.stat[i];
+               p_ptr->vir_types[i] = previous_char.vir_types[i];
        }
 
-       /* Save the hp */
-       for (i = 0; i < 50; i++)
+       /* Load the history */
+       for (i = 0; i < 4; i++)
        {
-               prev.hp[i] = temp.hp[i];
+               strcpy(p_ptr->history[i], previous_char.history[i]);
        }
 
-       prev.chaos_patron = temp.chaos_patron;
-
-       /* Save the history */
-       for (i = 0; i < 4; i++)
+       /*** Save the previous data ***/
+       if (swap)
        {
-               strcpy(prev.history[i], temp.history[i]);
+               COPY(&previous_char, &temp, birther);
        }
 }
 
@@ -2589,50 +2611,53 @@ static int adjust_stat(int value, int amount, int auto_roll)
  */
 static void get_stats(void)
 {
-       int             i, j;
-
-       int             bonus;
-
-       int             dice[18];
-
-
        /* Roll and verify some stats */
        while (TRUE)
        {
+               int i;
+               int sum = 0;
+
                /* Roll some dice */
-               for (j = i = 0; i < 18; i++)
+               for (i = 0; i < 2; i++)
                {
-                       /* Roll the dice */
-                       dice[i] = randint(3 + i % 3);
-
-                       /* Collect the maximum */
-                       j += dice[i];
+                       s32b tmp = randint0(60*60*60);
+                       int val;
+
+                       /* Extract 5 + 1d3 + 1d4 + 1d5 */
+                       val = 5 + 3;
+                       val += tmp % 3; tmp /= 3;
+                       val += tmp % 4; tmp /= 4;
+                       val += tmp % 5; tmp /= 5;
+
+                       /* Save that value */
+                       sum += val;
+                       p_ptr->stat_cur[3*i] = p_ptr->stat_max[3*i] = val;
+
+                       /* Extract 5 + 1d3 + 1d4 + 1d5 */
+                       val = 5 + 3;
+                       val += tmp % 3; tmp /= 3;
+                       val += tmp % 4; tmp /= 4;
+                       val += tmp % 5; tmp /= 5;
+
+                       /* Save that value */
+                       sum += val;
+                       p_ptr->stat_cur[3*i+1] = p_ptr->stat_max[3*i+1] = val;
+
+                       /* Extract 5 + 1d3 + 1d4 + 1d5 */
+                       val = 5 + 3;
+                       val += tmp % 3; tmp /= 3;
+                       val += tmp % 4; tmp /= 4;
+                       val += tmp;
+
+                       /* Save that value */
+                       sum += val;
+                       p_ptr->stat_cur[3*i+2] = p_ptr->stat_max[3*i+2] = val;
                }
 
                /* Verify totals */
-               if ((j > 42) && (j < 57)) break;
+               if ((sum > 42+5*6) && (sum < 57+5*6)) break;
                /* 57 was 54... I hate 'magic numbers' :< TY */
        }
-
-       /* Acquire the stats */
-       for (i = 0; i < 6; i++)
-       {
-               /* Extract 5 + 1d3 + 1d4 + 1d5 */
-               j = 5 + dice[3*i] + dice[3*i+1] + dice[3*i+2];
-
-               /* Save that value */
-               p_ptr->stat_max[i] = j;
-
-               /* Obtain a "bonus" for "race" and "class" and "seikaku"*/
-               bonus = rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i];
-
-               /* Start fully healed */
-               p_ptr->stat_cur[i] = p_ptr->stat_max[i];
-
-               /* Efficiency -- Apply the racial/class bonuses */
-               /* stat_use[i] = modify_stat_value(p_ptr->stat_max[i], bonus); */
-               stat_use[i] = p_ptr->stat_max[i];
-       }
 }
 
 void get_max_stats(void)
@@ -2648,7 +2673,7 @@ void get_max_stats(void)
                for (j = i = 0; i < 6; i++)
                {
                        /* Roll the dice */
-                       dice[i] = randint(7);
+                       dice[i] = randint1(7);
 
                        /* Collect the maximum */
                        j += dice[i];
@@ -2677,13 +2702,10 @@ void get_max_stats(void)
 /*
  * Roll for some info that the auto-roller ignores
  */
-static void get_extra(void)
+static void get_extra(bool roll_hitdie)
 {
        int             i, j, min_value, max_value;
 
-       /* Level one */
-       p_ptr->max_plv = p_ptr->lev = 1;
-
        /* Experience factor */
        if (p_ptr->prace == RACE_ANDROID) p_ptr->expfact = rp_ptr->r_exp;
        else p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
@@ -2691,19 +2713,7 @@ static void get_extra(void)
        if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_NINJA)) && ((p_ptr->prace == RACE_KLACKON) || (p_ptr->prace == RACE_SPRITE)))
                p_ptr->expfact -= 15;
 
-       /* Initialize arena and rewards information -KMW- */
-       p_ptr->arena_number = 0;
-       p_ptr->inside_arena = FALSE;
-       p_ptr->inside_quest = 0;
-       p_ptr->leftbldg = FALSE;
-       for (i = 0; i < MAX_MANE; i++)
-       {
-               mane_spell[i] = -1;
-               mane_dam[i] = 0;
-       }
-       mane_num = 0;
-       p_ptr->exit_bldg = TRUE; /* only used for arena now -KMW- */
-
+       /* Reset record of race/realm changes */
        p_ptr->start_race = p_ptr->prace;
        p_ptr->old_race1 = 0L;
        p_ptr->old_race2 = 0L;
@@ -2711,29 +2721,21 @@ static void get_extra(void)
 
        for (i = 0; i < 64; i++)
        {
-               if (p_ptr->pclass == CLASS_SORCERER) spell_exp[i] = 1600;
-               else if (p_ptr->pclass == CLASS_RED_MAGE) spell_exp[i] = 1200;
-               else spell_exp[i] = 0;
+               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;
        }
 
        for (i = 0; i < 5; i++)
                for (j = 0; j < 64; j++)
-                       weapon_exp[i][j] = s_info[p_ptr->pclass].w_start[i][j];
+                       p_ptr->weapon_exp[i][j] = s_info[p_ptr->pclass].w_start[i][j];
        if(p_ptr->pseikaku == SEIKAKU_SEXY)
        {
-               weapon_exp[TV_HAFTED-TV_BOW][SV_WHIP] = 4000;
+               p_ptr->weapon_exp[TV_HAFTED-TV_BOW][SV_WHIP] = 4000;
        }
 
        for (i = 0; i < 10; i++)
-               skill_exp[i] = s_info[p_ptr->pclass].s_start[i];
-
-       /* Reset rewards */
-       for (i = 0; i < MAX_BACT; i++)
-       {
-               p_ptr->rewards[i] = 0;
-       }
-
-       p_ptr->today_mon = 0;
+               p_ptr->skill_exp[i] = s_info[p_ptr->pclass].s_start[i];
 
        /* Hitdice */
        if (p_ptr->pclass == CLASS_SORCERER)
@@ -2741,45 +2743,49 @@ static void get_extra(void)
        else
                p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
 
-       /* 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)
+       /* Roll for hit point unless quick-start */
+       if (roll_hitdie)
        {
-               /* Pre-calculate level 1 hitdice */
-               player_hp[0] = p_ptr->hitdie;
+               /* Minimum hitpoints at highest level */
+               min_value = ((PY_MAX_LEVEL+2) * (p_ptr->hitdie + 1)) * 3 / 8;
+               min_value += p_ptr->hitdie;
 
-               for (i = 1; i < 4; i++)
-               {
-                       j = randint(p_ptr->hitdie);
-                       player_hp[0] += j;
-               }
+               /* Maximum hitpoints at highest level */
+               max_value = ((PY_MAX_LEVEL+2) * (p_ptr->hitdie + 1)) * 5 / 8;
+               max_value += p_ptr->hitdie;
 
-               /* Roll the hitpoint values */
-               for (i = 1; i < PY_MAX_LEVEL; i++)
+               /* Roll out the hitpoints */
+               while (TRUE)
                {
-                       j = randint(p_ptr->hitdie);
-                       player_hp[i] = player_hp[i - 1] + j;
-               }
+                       /* Pre-calculate level 1 hitdice */
+                       p_ptr->player_hp[0] = p_ptr->hitdie;
 
-               /* XXX Could also require acceptable "mid-level" hitpoints */
+                       for (i = 1; i < 4; i++)
+                       {
+                               j = randint1(p_ptr->hitdie);
+                               p_ptr->player_hp[0] += j;
+                       }
 
-               /* Require "valid" hitpoints at highest level */
-               if (player_hp[PY_MAX_LEVEL - 1] < min_value) continue;
-               if (player_hp[PY_MAX_LEVEL - 1] > max_value) continue;
+                       /* 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;
+                       }
 
-               /* Acceptable */
-               break;
+                       /* 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;
+               }
        }
 
        /* Initial hitpoints */
-       p_ptr->mhp = player_hp[0];
+       p_ptr->mhp = p_ptr->player_hp[0];
 }
 
 
@@ -2795,13 +2801,13 @@ static void get_history(void)
        char buf[240];
 
        /* Clear the previous history strings */
-       for (i = 0; i < 4; i++) history[i][0] = '\0';
+       for (i = 0; i < 4; i++) p_ptr->history[i][0] = '\0';
 
        /* Clear the history text */
        buf[0] = '\0';
 
        /* Initial social class */
-       social_class = randint(4);
+       social_class = randint1(4);
 
        /* Starting place */
        switch (p_ptr->prace)
@@ -2994,7 +3000,7 @@ static void get_history(void)
                i = 0;
 
                /* Roll for nobility */
-               roll = randint(100);
+               roll = randint1(100);
 
 
                /* Access the proper entry in the table */
@@ -3035,7 +3041,7 @@ static void get_history(void)
         t = temp;
         for(i=0 ; i<4 ; i++){
              if(t[0]==0)break; 
-             else {strcpy(history[i], t);t += strlen(t)+1;}
+             else {strcpy(p_ptr->history[i], t);t += strlen(t)+1;}
              }
        }
 }
@@ -3051,7 +3057,7 @@ static void get_ahw(void)
 
 
   /* Calculate the age */
-  p_ptr->age = rp_ptr->b_age + randint(rp_ptr->m_age);
+  p_ptr->age = rp_ptr->b_age + randint1(rp_ptr->m_age);
   
   /* Calculate the height/weight for males */
   if (p_ptr->psex == SEX_MALE)
@@ -3080,7 +3086,7 @@ static void get_money(void)
        int i, gold;
 
        /* Social Class determines starting gold */
-       gold = (p_ptr->sc * 6) + randint(100) + 300;
+       gold = (p_ptr->sc * 6) + randint1(100) + 300;
        if (p_ptr->pclass == CLASS_TOURIST)
          gold += 2000;
 
@@ -3088,10 +3094,10 @@ static void get_money(void)
        for (i = 0; i < 6; i++)
        {
                /* Mega-Hack -- reduce gold for high stats */
-               if (stat_use[i] >= 18 + 50) gold -= 300;
-               else if (stat_use[i] >= 18 + 20) gold -= 200;
-               else if (stat_use[i] > 18) gold -= 150;
-               else gold -= (stat_use[i] - 8) * 10;
+               if (p_ptr->stat_max[i] >= 18 + 50) gold -= 300;
+               else if (p_ptr->stat_max[i] >= 18 + 20) gold -= 200;
+               else if (p_ptr->stat_max[i] > 18) gold -= 150;
+               else gold -= (p_ptr->stat_max[i] - 8) * 10;
        }
 
        /* Minimum 100 gold */
@@ -3132,7 +3138,7 @@ static void birth_put_stats(void)
                        j = rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i];
 
                        /* Obtain the current stat */
-                       m = adjust_stat(stat_use[i], j, TRUE);
+                       m = adjust_stat(p_ptr->stat_max[i], j, TRUE);
 
                        /* Put the stat */
                        cnv_stat(m, buf);
@@ -3141,7 +3147,16 @@ static void birth_put_stats(void)
                        /* Put the percent */
                        if (stat_match[i])
                        {
-                               p = 1000L * stat_match[i] / auto_round;
+                               if (stat_match[i] > 1000000L)
+                               {
+                                       /* Prevent overflow */
+                                       p = stat_match[i] / (auto_round / 1000L);
+                               }
+                               else
+                               {
+                                       p = 1000L * stat_match[i] / auto_round;
+                               }
+                       
                                attr = (p < 100) ? TERM_YELLOW : TERM_L_GREEN;
                                sprintf(buf, "%3d.%d%%", p/10, p%10);
                                c_put_str(attr, buf, 3+i, col+13);
@@ -3176,7 +3191,7 @@ static void player_wipe(void)
        /* Wipe the history */
        for (i = 0; i < 4; i++)
        {
-               strcpy(history[i], "");
+               strcpy(p_ptr->history[i], "");
        }
 
        /* Wipe the quests */
@@ -3243,16 +3258,16 @@ static void player_wipe(void)
        /* Wipe the spells */
        if (p_ptr->pclass == CLASS_SORCERER)
        {
-               spell_learned1 = spell_learned2 = 0xffffffffL;
-               spell_worked1 = spell_worked2 = 0xffffffffL;
+               p_ptr->spell_learned1 = p_ptr->spell_learned2 = 0xffffffffL;
+               p_ptr->spell_worked1 = p_ptr->spell_worked2 = 0xffffffffL;
        }
        else
        {
-               spell_learned1 = spell_learned2 = 0L;
-               spell_worked1 = spell_worked2 = 0L;
+               p_ptr->spell_learned1 = p_ptr->spell_learned2 = 0L;
+               p_ptr->spell_worked1 = p_ptr->spell_worked2 = 0L;
        }
-       spell_forgotten1 = spell_forgotten2 = 0L;
-       for (i = 0; i < 64; i++) spell_order[i] = 99;
+       p_ptr->spell_forgotten1 = p_ptr->spell_forgotten2 = 0L;
+       for (i = 0; i < 64; i++) p_ptr->spell_order[i] = 99;
        p_ptr->learned_spells = 0;
        p_ptr->add_spells = 0;
        p_ptr->knowledge = 0;
@@ -3269,19 +3284,19 @@ static void player_wipe(void)
        cheat_live = FALSE;
 
        /* Assume no winning game */
-       total_winner = FALSE;
+       p_ptr->total_winner = FALSE;
 
        world_player = FALSE;
 
        /* Assume no panic save */
-       panic_save = 0;
+       p_ptr->panic_save = 0;
 
        /* Assume no cheating */
-       noscore = 0;
-        wizard = FALSE;
+       p_ptr->noscore = 0;
+        p_ptr->wizard = FALSE;
 
        /* Not waiting to report score */
-       wait_report_score = FALSE;
+       p_ptr->wait_report_score = FALSE;
 
        /* Default pet command settings */
        p_ptr->pet_follow_distance = PET_FOLLOW_DIST;
@@ -3303,8 +3318,164 @@ static void player_wipe(void)
                p_ptr->magic_num1[i] = 0;
                p_ptr->magic_num2[i] = 0;
        }
+
+       /* Level one */
+       p_ptr->max_plv = p_ptr->lev = 1;
+
+       /* Initialize arena and rewards information -KMW- */
+       p_ptr->arena_number = 0;
+       p_ptr->inside_arena = FALSE;
+       p_ptr->inside_quest = 0;
+       p_ptr->leftbldg = FALSE;
+       for (i = 0; i < MAX_MANE; i++)
+       {
+               p_ptr->mane_spell[i] = -1;
+               p_ptr->mane_dam[i] = 0;
+       }
+       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;
+
+       /* Reset monster arena */
+       battle_monsters();
+
+       /* Reset mutations */
+       p_ptr->muta1 = 0;
+       p_ptr->muta2 = 0;
+       p_ptr->muta3 = 0;
+
+       /* Reset virtues*/
+       for (i = 0; i < 8; i++) p_ptr->virtues[i]=0;
+
+       /* Set the recall dungeon accordingly */
+       if (vanilla_town)
+       {
+               dungeon_type = 0;
+               p_ptr->recall_dungeon = DUNGEON_ANGBAND;
+       }
+       else
+       {
+               dungeon_type = 0;
+               p_ptr->recall_dungeon = DUNGEON_GALGALS;
+       }
 }
 
+/*
+ *  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;
+       p_ptr->inside_quest = MIN_RANDOM_QUEST;
+
+       process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
+
+       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];
+
+               /* Mark uniques */
+               quest_r_ptr->flags1 |= RF1_QUESTOR;
+
+               q_ptr->max_num = 1;
+       }
+
+       /* Init the two main quests (Oberon + Serpent) */
+       init_flags = INIT_ASSIGN;
+       p_ptr->inside_quest = QUEST_OBERON;
+
+       process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
+
+       quest[QUEST_OBERON].status = QUEST_STATUS_TAKEN;
+
+       p_ptr->inside_quest = QUEST_SERPENT;
+
+       process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
+
+       quest[QUEST_SERPENT].status = QUEST_STATUS_TAKEN;
+       p_ptr->inside_quest = 0;
+}
+
+/*
+ * Reset turn
+ */
+static void init_turn(void)
+{
+       if ((p_ptr->prace == RACE_VAMPIRE) ||
+           (p_ptr->prace == RACE_SKELETON) ||
+           (p_ptr->prace == RACE_ZOMBIE) ||
+           (p_ptr->prace == RACE_SPECTRE))
+       {
+               /* Undead start just after midnight */
+               turn = (TURNS_PER_TICK*3 * TOWN_DAWN) / 4 + 1;
+       }
+       else
+       {
+               turn = 1;
+       }
+
+       dungeon_turn = 1;
+}
 
 /*
  * Each player starts out with a few items, given as tval/sval pairs.
@@ -3419,7 +3590,7 @@ static byte player_init[MAX_CLASS][3][2] =
 
        {
                /* Archer */
-               { TV_BOW, SV_LONG_BOW },
+               { TV_BOW, SV_SHORT_BOW },
                { TV_SOFT_ARMOR, SV_LEATHER_SCALE_MAIL},
                { TV_SWORD, SV_SHORT_SWORD },
        },
@@ -3868,7 +4039,7 @@ static bool get_player_race(void)
                {
                        if(cs == MAX_RACES)
                        {
-                               k = rand_int(MAX_RACES);
+                               k = randint0(MAX_RACES);
                                cs = k;
                                continue;
                        }
@@ -3880,7 +4051,7 @@ static bool get_player_race(void)
                }
                if (c == '*')
                {
-                       k = rand_int(MAX_RACES);
+                       k = randint0(MAX_RACES);
                        cs = k;
                        continue;
                }
@@ -4080,7 +4251,7 @@ static bool get_player_class(void)
                {
                        if(cs == MAX_CLASS_CHOICE)
                        {
-                               k = rand_int(MAX_CLASS_CHOICE);
+                               k = randint0(MAX_CLASS_CHOICE);
                                cs = k;
                                continue;
                        }
@@ -4092,7 +4263,7 @@ static bool get_player_class(void)
                }
                if (c == '*')
                {
-                       k = rand_int(MAX_CLASS_CHOICE);
+                       k = randint0(MAX_CLASS_CHOICE);
                        cs = k;
                        continue;
                }
@@ -4275,7 +4446,7 @@ static bool get_player_seikaku(void)
                        {
                                do
                                {
-                                       k = rand_int(MAX_SEIKAKU);
+                                       k = randint0(MAX_SEIKAKU);
                                }
                                while(seikaku_info[k].sex && (seikaku_info[k].sex != (p_ptr->psex+1)));
                                cs = k;
@@ -4291,7 +4462,7 @@ static bool get_player_seikaku(void)
                {
                        do
                        {
-                               k = rand_int(n);
+                               k = randint0(n);
                        }
                        while(seikaku_info[k].sex && (seikaku_info[k].sex != (p_ptr->psex+1)));
                        cs = k;
@@ -4949,6 +5120,156 @@ static bool get_chara_limits(void)
 #endif
 
 /*
+ *  Character background edit-mode
+ */
+static void edit_history(void)
+{
+        char old_history[4][60];
+       char c;
+       int y = 0, x = 0;
+       int i, j;
+
+        /* Edit character background */
+        for (i = 0; i < 4; i++)
+        {
+                sprintf(old_history[i], "%s", p_ptr->history[i]);
+        }
+        /* 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';
+       }
+        display_player(1);
+#ifdef JP
+        c_put_str(TERM_L_GREEN, "(¥­¥ã¥é¥¯¥¿¡¼¤ÎÀ¸¤¤Î©¤Á - ÊÔ½¸¥â¡¼¥É)", 11, 20);
+#else
+        c_put_str(TERM_L_GREEN, "(Character Background - Edit Mode)", 11, 20);
+#endif
+
+        while (TRUE)
+        {
+                for (i = 0; i < 4; i++)
+                {
+                        put_str(p_ptr->history[i], i + 12, 10);
+                }
+#ifdef JP
+               if (iskanji2(p_ptr->history[y], x))
+                       c_put_str(TERM_L_BLUE, format("%c%c", p_ptr->history[y][x],p_ptr->history[y][x+1]), y + 12, x + 10);
+               else
+#endif
+                c_put_str(TERM_L_BLUE, format("%c", p_ptr->history[y][x]), y + 12, x + 10);
+
+               /* Place cursor just after cost of current stat */
+                Term_gotoxy(x + 10, y + 12);
+
+                c = inkey();
+
+                if (c == '8')
+                {
+                        y--;
+                        if (y < 0) y = 3;
+#ifdef JP
+                       if ((x > 0) && (iskanji2(p_ptr->history[y], x-1))) x--;
+#endif
+                }
+                else if (c == '2')
+                {
+                        y++;
+                        if (y > 3) y = 0;
+#ifdef JP
+                       if ((x > 0) && (iskanji2(p_ptr->history[y], x-1))) x--;
+#endif
+                }
+                else if (c == '6')
+                {
+#ifdef JP
+                       if (iskanji2(p_ptr->history[y], x)) x++;
+#endif
+                        x++;
+                        if (x > 58) x = 0;
+                }
+                else if (c == '4')
+                {
+                        x--;
+#ifdef JP
+                       if ((x > 0) && (iskanji2(p_ptr->history[y], x-1))) x--;
+#endif
+                        if (x < 0) x = 58;
+                }
+                else if (c == '\r')
+                {
+                        break;
+                }
+                else if (c == ESCAPE)
+                {
+                        for (i = 0; i < 4; i++)
+                        {
+                                sprintf(p_ptr->history[i], "%s", old_history[i]);
+                                put_str(p_ptr->history[i], i + 12, 10);
+                        }
+                        break;
+                }
+               else if (c == '\010')
+               {
+                       x--;
+                        p_ptr->history[y][x] = ' ';
+#ifdef JP
+                       if ((x > 0) && (iskanji2(p_ptr->history[y], x-1)))
+                       {
+                               x--;
+                               p_ptr->history[y][x] = ' ';
+                       }
+#endif
+                       if (x < 0) x = 58;
+               }
+#ifdef JP
+               else if (iskanji(c) || isprint(c))
+#else
+                else if (isprint(c)) /* BUGFIX */
+#endif
+                {
+#ifdef JP
+                       if (iskanji2(p_ptr->history[y], x))
+                       {
+                               p_ptr->history[y][x+1] = ' ';
+                       }
+
+                       if (iskanji(c))
+                       {
+                               if (x > 57)
+                               {
+                                       x = 0;
+                                       y++;
+                                       if (y > 3) y = 0;
+                               }
+
+                               if (iskanji2(p_ptr->history[y], x+1))
+                               {
+                                       p_ptr->history[y][x+2] = ' ';
+                               }
+
+                               p_ptr->history[y][x++] = c;
+
+                               c = inkey();
+                       }
+#endif
+                        p_ptr->history[y][x++] = c;
+                       if (x > 58)
+                       {
+                               x = 0;
+                               y++;
+                               if (y > 3) y = 0;
+                       }
+                }
+        } /* while (TRUE) */
+
+}
+
+
+/*
  * Helper function for 'player_birth()'
  *
  * The delay may be reduced, but is recommended to keep players
@@ -4957,7 +5278,8 @@ static bool get_chara_limits(void)
  */
 static bool player_birth_aux(void)
 {
-       int i, k, n, v, cs, os;
+       int i, k, n, cs, os;
+       int number_of_quests;
 
        int mode = 0;
 
@@ -5025,6 +5347,79 @@ static bool player_birth_aux(void)
 #endif
 
 
+       /*** Quick Start ***/
+
+       if (previous_char.quick_ok)
+       {
+               bool do_quick_start = FALSE;
+
+               /* Extra info */
+#ifdef JP
+       put_str("¥¯¥¤¥Ã¥¯¡¦¥¹¥¿¡¼¥È¤ò»È¤¦¤È°ÊÁ°¤ÈÁ´¤¯Æ±¤¸¥­¥ã¥é¥¯¥¿¡¼¤Ç»Ï¤á¤é¤ì¤Þ¤¹¡£", 11, 5);
+#else
+       put_str("Do you want to use the quick start function(same character as your last one).", 11, 2);
+#endif
+
+               /* Choose */
+               while (1)
+               {
+#ifdef JP
+                       put_str("¥¯¥¤¥Ã¥¯¡¦¥¹¥¿¡¼¥È¤ò»È¤¤¤Þ¤¹¤«¡©[y/n]", 14, 10);
+#else
+                       put_str("Use quick start? [y/n]", 14, 10);
+#endif
+                       c = inkey();
+                       if (c == 'Q') quit(NULL);
+                       else if (c == 'S') return (FALSE);
+                       else if ((c == 'y') || (c == 'Y'))
+                       {
+                               do_quick_start = TRUE;
+                               break;
+                       }
+                       else
+                       {
+                               do_quick_start = FALSE;
+                               break;
+                       }
+               }
+
+               if (do_quick_start)
+               {
+                       load_prev_data(FALSE);
+                       init_dungeon_quests(previous_char.quests);
+                       init_turn();
+
+                       sp_ptr = &sex_info[p_ptr->psex];
+                       rp_ptr = &race_info[p_ptr->prace];
+                       cp_ptr = &class_info[p_ptr->pclass];
+                       ap_ptr = &seikaku_info[p_ptr->pseikaku];
+
+                       /* Calc hitdie, but don't roll */
+                       get_extra(FALSE);
+
+                       /* Calculate the bonuses and hitpoints */
+                       p_ptr->update |= (PU_BONUS | PU_HP);
+
+                       /* Update stuff */
+                       update_stuff();
+
+                       /* Fully healed */
+                       p_ptr->chp = p_ptr->mhp;
+
+                       /* Fully rested */
+                       p_ptr->csp = p_ptr->msp;
+
+                       /* Process the player name */
+                       process_player_name(FALSE);
+
+                       return TRUE;
+               }
+
+               /* Clean up */
+               clear_from(10);
+       }
+
+
        /*** Player sex ***/
 
        /* Extra info */
@@ -5102,14 +5497,14 @@ static bool player_birth_aux(void)
                if (c == ' ' || c == '\r' || c == '\n')
                {
                        if(cs == MAX_SEXES)
-                               k = rand_int(MAX_SEXES);
+                               k = randint0(MAX_SEXES);
                        else
                                k = cs;
                        break;
                }
                if (c == '*')
                {
-                       k = rand_int(MAX_SEXES);
+                       k = randint0(MAX_SEXES);
                        break;
                }
                if (c == '4')
@@ -5335,7 +5730,7 @@ static bool player_birth_aux(void)
                        strcpy(inp, "10");
 
                        /* Get a response (or escape) */
-                       if (!askfor_aux(inp, 2)) inp[0] = '\0';
+                       if (!askfor_aux(inp, 2)) strcpy(inp, "10");
 
                        /* Quit */
                        if (inp[0] == 'Q') birth_quit();
@@ -5347,15 +5742,15 @@ static bool player_birth_aux(void)
                        if (inp[0] == '*')
                        {
                                /* 0 to 49 random quests */
-                               v = rand_int(11);
+                               number_of_quests = randint0(11);
                        }
                        else
                        {
-                               v = atoi(inp);
+                               number_of_quests = atoi(inp);
                        }
 
                        /* Break on valid input */
-                       if ((v <= MAX_RANDOM_QUEST - MIN_RANDOM_QUEST + 1) && (v >= 0)) break;
+                       if ((number_of_quests <= MAX_RANDOM_QUEST - MIN_RANDOM_QUEST + 1) && (number_of_quests >= 0)) break;
                }
                break;
        }
@@ -5363,95 +5758,10 @@ static bool player_birth_aux(void)
        /* Clear */
        clear_from(10);
 
-       /* Init the random quests */
-       init_flags = INIT_ASSIGN;
-       p_ptr->inside_quest = MIN_RANDOM_QUEST;
-
-       process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
-
-       p_ptr->inside_quest = 0;
-
-       /* Prepare allocation table */
-       get_mon_num_prep(monster_quest, NULL);
-
-       /* Generate quests */
-       for (i = MIN_RANDOM_QUEST + v - 1; i >= MIN_RANDOM_QUEST; i--)
-       {
-               quest_type      *q_ptr = &quest[i];
-               monster_race    *r_ptr;
-               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 + randint(q_ptr->level / 10));
-                       r_ptr = &r_info[r_idx];
-
-                       if(!(r_ptr->flags1 & RF1_UNIQUE)) 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];
-
-               /* Mark uniques */
-               quest_r_ptr->flags1 |= RF1_QUESTOR;
-
-               q_ptr->max_num = 1;
-       }
-
-       /* Init the two main quests (Oberon + Serpent) */
-       init_flags = INIT_ASSIGN;
-       p_ptr->inside_quest = QUEST_OBERON;
-
-       process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
-
-       quest[QUEST_OBERON].status = QUEST_STATUS_TAKEN;
-
-       p_ptr->inside_quest = QUEST_SERPENT;
-
-       process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
-
-       quest[QUEST_SERPENT].status = QUEST_STATUS_TAKEN;
-       p_ptr->inside_quest = 0;
-
-       /* Clear */
-       clear_from(10);
+       init_dungeon_quests(number_of_quests);
 
        /* Reset turn; before auto-roll and after choosing race */
-       if ((p_ptr->prace == RACE_VAMPIRE) ||
-           (p_ptr->prace == RACE_SKELETON) ||
-           (p_ptr->prace == RACE_ZOMBIE) ||
-           (p_ptr->prace == RACE_SPECTRE))
-       {
-               /* Undead start just after midnight */
-               turn = (60L * TOWN_DAWN) / 4 + 1;
-       }
-       else
-       {
-               turn = 1;
-       }
-       dungeon_turn = 1;
-
+       init_turn();
 
        /*** Generate ***/
 
@@ -5554,7 +5864,7 @@ static bool player_birth_aux(void)
                        auto_round++;
 
                        /* Hack -- Prevent overflow */
-                       if (auto_round >= 1000000L)
+                       if (auto_round >= 1000000000L)
                        {
                                auto_round = 1;
 
@@ -5573,7 +5883,7 @@ static bool player_birth_aux(void)
                                for (i = 0; i < 6; i++)
                                {
                                        /* This stat is okay */
-                                       if (stat_use[i] >= stat_limit[i])
+                                       if (p_ptr->stat_max[i] >= stat_limit[i])
                                        {
                                                stat_match[i]++;
                                        }
@@ -5618,7 +5928,7 @@ static bool player_birth_aux(void)
 
 #ifdef AUTOROLLER_DELAY
                                /* Delay 1/10 second */
-                               if (flag) Term_xtra(TERM_XTRA_DELAY, 100);
+                               if (flag) Term_xtra(TERM_XTRA_DELAY, 10);
 #endif
 
                                /* Make sure they see everything */
@@ -5653,17 +5963,13 @@ static bool player_birth_aux(void)
                mode = 0;
 
                /* Roll for base hitpoints */
-               get_extra();
+               get_extra(TRUE);
 
                /* Roll for gold */
                get_money();
 
                /* Hack -- get a chaos patron even if you are not a chaos warrior */
-               p_ptr->chaos_patron = (s16b)rand_int(MAX_PATRON);
-
-               p_ptr->muta1 = 0;
-               p_ptr->muta2 = 0;
-               p_ptr->muta3 = 0;
+               p_ptr->chaos_patron = (s16b)randint0(MAX_PATRON);
 
                /* Input loop */
                while (TRUE)
@@ -5736,7 +6042,7 @@ static bool player_birth_aux(void)
                        /* Previous character */
                        if (prev && (c == 'p'))
                        {
-                               load_prev_data();
+                               load_prev_data(TRUE);
                                continue;
                        }
 
@@ -5779,7 +6085,8 @@ static bool player_birth_aux(void)
                if (c == '\r' || c == '\n' || c == ESCAPE) break;
 
                /* Save this for the "previous" character */
-               save_prev_data();
+               save_prev_data(&previous_char);
+               previous_char.quick_ok = FALSE;
 
                /* Note that a previous roll exists */
                prev = TRUE;
@@ -5788,28 +6095,19 @@ static bool player_birth_aux(void)
        /* Clear prompt */
        clear_from(23);
 
-       get_max_stats();
+       /*** Edit character background ***/
+       edit_history();
 
        /*** Finish up ***/
 
+       get_max_stats();
+
        /* Get a name, recolor it, prepare savefile */
 
        get_name();
 
        get_virtues();
 
-       /* Set the recall dungeon accordingly */
-       if (vanilla_town)
-       {
-               dungeon_type = 0;
-               p_ptr->recall_dungeon = DUNGEON_ANGBAND;
-       }
-       else
-       {
-               dungeon_type = 0;
-               p_ptr->recall_dungeon = DUNGEON_GALGALS;
-       }
-
        /* Prompt for it */
 #ifdef JP
        prt("[ 'Q' ÃæÃÇ, 'S' ½é¤á¤«¤é, Enter ¥²¡¼¥à³«»Ï ]", 23, 14);
@@ -5827,6 +6125,11 @@ static bool player_birth_aux(void)
        /* Start over */
        if (c == 'S') return (FALSE);
 
+       /* Save character data for quick start */
+       save_prev_data(&previous_char);
+       previous_char.quests = number_of_quests;
+       previous_char.quick_ok = TRUE;
+
        /* Accept */
        return (TRUE);
 }
@@ -5845,6 +6148,12 @@ void player_birth(void)
 
         playtime = 0;
 
+       /* 
+        * Wipe monsters in old dungeon
+        * This wipe destroys value of m_list[].cur_num .
+        */
+       wipe_m_list();
+
        /* Create a new character */
        while (1)
        {