OSDN Git Service

Thrown torch's dice is changed
[hengband/hengband.git] / src / birth.c
index 4c840ac..c5f2cd7 100644 (file)
@@ -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
@@ -1619,7 +1619,7 @@ static cptr race_jouhou[MAX_RACES] =
   
 "¥¨¥ë¥Õ¤Ï¿Í´Ö¤è¤êÎɤ¤ËâË¡»È¤¤¤Ë¤Ê¤ì¤Þ¤¹¤¬¡¢ÀïÆ®¤Ï¶ì¼ê¤Ç¤¹¡£Èà¤é¤Ï¿Í´Ö¤ä¥Ï¡¼¥Õ¥¨¥ë¥Õ¤è¤ê¤âƬ¤¬Îɤ¯¡¢¹â¤¤¸­¤µ¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£¥¨¥ë¥Õ¤Ïõº÷, ²ò½ü, ÃγÐ, ±£Ì©¹ÔÆ°, ¼Í·â, ¤½¤·¤ÆËâË¡Æ»¶ñ»ÈÍѤÇÍ¥¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢Éð´ï¤Î°·¤¤¤ÏÆÀ°Õ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£Èà¤é¤ÏÀ¸¤Þ¤ì¤Ä¤­¸÷¤ËÂФ¹¤ëÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£",
   
-"¥Û¥Ó¥Ã¥È¡¢¤Þ¤¿¤Ï¥Ï¡¼¥Õ¥ê¥ó¥°¤ÏµÝ¤äÅêÚ³¤ËŤ±¡¢ËâË¡Ëɸæ¤âÍ¥¤ì¤Æ¤¤¤Þ¤¹¡£¤Þ¤¿¡¢Ãµº÷, ²ò½ü, ÃγÐ, ¤½¤·¤Æ±£Ì©¹ÔÆ°¤Ç¤â¤È¤Æ¤âÎɤ¤Ç½ÎϤò¼¨¤·¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢Èà¤é¤ÏÍ¥¤ì¤¿Åð±¤È¤Ê¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡Ê¤·¤«¤·¡¢¡ÖǦ¤Ó¤Î¼Ô¡×¤È¸Æ¤Ð¤ì¤ë¤³¤È¤ò¹¥¤ß¤Þ¤¹¡Ë¡£¥Û¥Ó¥Ã¥È¤Ï¿Í´Ö¤è¤êÍÚ¤«¤ËÉϼå¤Ç¡¢Àï»Î¤È¤·¤Æ¤Ï¤Æ¤ó¤Ç¥À¥á¤Ç¤¹¡£Èà¤é¤Ï¤«¤Ê¤êÎɤ¤ÀÖ³°Àþ»ëÎϤò»ý¤Ã¤Æ¤ª¤ê¡¢²¹·ìưʪ¤òÎ¥¤ì¤¿¾ì½ê¤«¤é¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¥Û¥Ó¥Ã¥È¤Ï´ïÍѤµ¤ò²¼¤²¤é¤ì¤ë¤³¤È¤¬¤¢¤ê¤Þ¤»¤ó¡£",
+"¥Û¥Ó¥Ã¥È¡¢¤Þ¤¿¤Ï¥Ï¡¼¥Õ¥ê¥ó¥°¤ÏµÝ¤äÅêÚ³¤ËŤ±¡¢ËâË¡Ëɸæ¤âÍ¥¤ì¤Æ¤¤¤Þ¤¹¡£¤Þ¤¿¡¢Ãµº÷, ²ò½ü, ÃγÐ, ¤½¤·¤Æ±£Ì©¹ÔÆ°¤Ç¤â¤È¤Æ¤âÎɤ¤Ç½ÎϤò¼¨¤·¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢Èà¤é¤ÏÍ¥¤ì¤¿Åð±¤È¤Ê¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡Ê¤·¤«¤·¡¢¡ÖǦ¤Ó¤Î¼Ô¡×¤È¸Æ¤Ð¤ì¤ë¤³¤È¤ò¹¥¤ß¤Þ¤¹¡Ë¡£¥Û¥Ó¥Ã¥È¤Ï¿Í´Ö¤è¤êÍÚ¤«¤ËÉϼå¤Ç¡¢Àï»Î¤È¤·¤Æ¤Ï¤Æ¤ó¤Ç¥À¥á¤Ç¤¹¡£Èà¤é¤Ï¤«¤Ê¤êÎɤ¤ÀÖ³°Àþ»ëÎϤò»ý¤Ã¤Æ¤ª¤ê¡¢²¹·ìưʪ¤òÎ¥¤ì¤¿¾ì½ê¤«¤é¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£Èà¤é¤ÏÀ¸Ì¿ÎϤòÊÝ»ý¤¹¤ëÎϤ¬¶¯¤¯¡¢À¸Ì¿Îϵۼý¹¶·â¤ËÂФ·¤ÆÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£",
   
 "¥Î¡¼¥à¤Ï¥É¥ï¡¼¥Õ¤è¤ê¾®¤µ¤¤¤Ç¤¹¤¬¡¢¥Û¥Ó¥Ã¥È¤è¤ê¤ÏÂ礭¤¤¼ï²¤Ç¤¹¡£Èà¤é¤Ï¥Û¥Ó¥Ã¥ÈƱÍÍÃÏɽ¤Îƶ·ê¤Î¤è¤¦¤Ê²È¤Ë½»¤ó¤Ç¤¤¤Þ¤¹¡£¥Î¡¼¥à¤Ï¤È¤Æ¤âÎɤ¤ËâË¡Ëɸæ¤ò»ý¤Á¡¢Ãµº÷, ²ò½ü, ÃγÐ, ±£Ì©¹ÔÆ°¤Ç¤âÍ¥¤ì¤Æ¤¤¤Þ¤¹¡£Èà¤é¤Ï¿Í´Ö¤è¤êÄ㤤ÏÓÎϤò»ý¤Á¡¢Éð´ï¤ò»ý¤Ã¤Æ¤ÎÀïÆ®¤Ï¶ì¼ê¤Ç¤¹¡£¥Î¡¼¥à¤Ï¤«¤Ê¤êÎɤ¤ÀÖ³°Àþ»ëÎϤò»ý¤Ã¤Æ¤ª¤ê¡¢²¹·ìưʪ¤òÎ¥¤ì¤¿¾ì½ê¤«¤é¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¥Î¡¼¥à¤ÏÀ¸¤Þ¤ì¤Ä¤­Ëãáã¤ËÂФ¹¤ëÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£",
   
@@ -1695,7 +1695,7 @@ static cptr race_jouhou[MAX_RACES] =
 
 "Elves are better magicians then humans, but not as good at fighting.  They tend to be smarter and faster than either humans or half-elves and also have better wisdom.  Elves are better at searching, disarming, perception, stealth, bows, and magic, but they are not as good at hand weapons.  They resist light effects intrinsically.",
 
-"Hobbits, or Halflings, are very good at bows, throwing, and have good saving throws.  They also are very good at searching, disarming, perception, and stealth; so they make excellent rogues, but prefer to be called burglars.  They are much weaker than humans, and no good at melee fighting.  Halflings have fair infravision, so they can detect warm creatures at a distance.  They have their dexterity sustained.",
+"Hobbits, or Halflings, are very good at bows, throwing, and have good saving throws.  They also are very good at searching, disarming, perception, and stealth; so they make excellent rogues, but prefer to be called burglars.  They are much weaker than humans, and no good at melee fighting.  Halflings have fair infravision, so they can detect warm creatures at a distance.  They have a strong hold on their life force, and are thus intrinsically resistant to life draining.",
 
 "Gnomes are smaller than dwarves but larger than Halflings.  They, like the hobbits, live in the earth in burrow-like homes.  Gnomes make excellent mages, and have very good saving throws.  They are good at searching, disarming, perception, and stealth.  They have lower strength than humans so they are not very good at fighting with hand weapons.  Gnomes have fair infra-vision, so they can detect warm-blooded creatures at a distance.  Gnomes are intrinsically protected against paralysis.",
 
@@ -1821,7 +1821,9 @@ static cptr class_jouhou[MAX_CLASS] =
 
 "¶À»È¤¤¤Ï¡¢ËâÎϤιþ¤á¤é¤ì¤¿¶À¤òºî¤ê½Ð¤·¤Æ¡¢¤½¤ì¤ò¿¨ÇޤȤ·¤Æ¹¶·â¤ò¹Ô¤Ê¤¦¤³¤È¤¬¤Ç¤­¤ë¶ÀËâË¡¤ò»È¤¤¤Þ¤¹¡£¶À»È¤¤¤Ï¶À¤Î¾å¤Ç¼ÂÎϤòȯ´ø¤·¡¢¶À¤Î¾å¤Ç¤ÏÁÇÁᤤ¥Æ¥ì¥Ý¡¼¥È¤¬²Äǽ¤È¤Ê¤ê¤Þ¤¹¡£ËâË¡¤Î¶À¤Ï¡¢¥ì¥Ù¥ë¤Ë¤è¤Ã¤Æ°ìÅÙ¤ËÀ©¸æ¤Ç¤­¤ë¿ô¤¬À©¸Â¤µ¤ì¤Þ¤¹¡£¶ÀËâË¡¤ËɬÍפÊǽÎϤÏÃÎǽ¤Ç¤¹¡£",
 
-"Ǧ¼Ô¤Ï°Å°Ç¤ËÀø¤à¶²¤ë¤Ù¤­°Å»¦¼Ô¤Ç¤¢¤ê¡¢¸÷¸»¤ò»ý¤¿¤º¤Ë¹ÔÆ°¤·¡¢Áê¼ê¤ÎÉÔ°Õ¤ò¤Ä¤­°ì·â¤Ç©¤Îº¬¤ò»ß¤á¤Þ¤¹¡£¤Þ¤¿¡¢Áê¼ê¤òÏǤ魯¤¿¤á¤ÎǦ½Ñ¤â¿È¤Ë¤Ä¤±¤Þ¤¹¡£æ«¤ä¥É¥¢¤ò¸«¤Ä¤±¤ëǽÎϤËÍ¥¤ì¡¢æ«¤Î²ò½ü¤ä¸°³«¤±¤Ë½Ï㤷¤Æ¤¤¤Þ¤¹¡£·ÚÁõ¤ò¹¥¤ß¡¢½Å¤¤³»¤äÉð´ï¤òÁõÈ÷¤¹¤ë¤ÈÃø¤·¤¯Æ°¤­¤¬À©¸Â¤µ¤ì¡¢¤Þ¤¿¡¢½â¤òÁõÈ÷¤·¤è¤¦¤È¤Ï¤·¤Þ¤»¤ó¡£·ÚÁõ¤Ê¤é¤Ð¡¢¥ì¥Ù¥ë¤¬¾å¤¬¤ë¤Ë¤Ä¤ì¤è¤ê®¤¯¤è¤êÀŤ«¤Ë¹ÔÆ°¤Ç¤­¤Þ¤¹¡£¤µ¤é¤ËǦ¼Ô¤Ï¶²Éݤ»¤º¡¢À®Ä¹¤¹¤ì¤ÐÆǤ¬¤Û¤È¤ó¤É¸ú¤«¤Ê¤¯¤Ê¤ê¡¢Æ©ÌÀ¤Ê¤â¤Î¤ò¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£Ç¦½Ñ¤ËɬÍפÊǽÎϤϴïÍѤµ¤Ç¤¹¡£"
+"Ǧ¼Ô¤Ï°Å°Ç¤ËÀø¤à¶²¤ë¤Ù¤­°Å»¦¼Ô¤Ç¤¢¤ê¡¢¸÷¸»¤ò»ý¤¿¤º¤Ë¹ÔÆ°¤·¡¢Áê¼ê¤ÎÉÔ°Õ¤ò¤Ä¤­°ì·â¤Ç©¤Îº¬¤ò»ß¤á¤Þ¤¹¡£¤Þ¤¿¡¢Áê¼ê¤òÏǤ魯¤¿¤á¤ÎǦ½Ñ¤â¿È¤Ë¤Ä¤±¤Þ¤¹¡£æ«¤ä¥É¥¢¤ò¸«¤Ä¤±¤ëǽÎϤËÍ¥¤ì¡¢æ«¤Î²ò½ü¤ä¸°³«¤±¤Ë½Ï㤷¤Æ¤¤¤Þ¤¹¡£·ÚÁõ¤ò¹¥¤ß¡¢½Å¤¤³»¤äÉð´ï¤òÁõÈ÷¤¹¤ë¤ÈÃø¤·¤¯Æ°¤­¤¬À©¸Â¤µ¤ì¡¢¤Þ¤¿¡¢½â¤òÁõÈ÷¤·¤è¤¦¤È¤Ï¤·¤Þ¤»¤ó¡£·ÚÁõ¤Ê¤é¤Ð¡¢¥ì¥Ù¥ë¤¬¾å¤¬¤ë¤Ë¤Ä¤ì¤è¤ê®¤¯¤è¤êÀŤ«¤Ë¹ÔÆ°¤Ç¤­¤Þ¤¹¡£¤µ¤é¤ËǦ¼Ô¤Ï¶²Éݤ»¤º¡¢À®Ä¹¤¹¤ì¤ÐÆǤ¬¤Û¤È¤ó¤É¸ú¤«¤Ê¤¯¤Ê¤ê¡¢Æ©ÌÀ¤Ê¤â¤Î¤ò¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£Ç¦½Ñ¤ËɬÍפÊǽÎϤϴïÍѤµ¤Ç¤¹¡£",
+
+"¥¹¥Ê¥¤¥Ñ¡¼¤Ï°ì·âɬ»¦¤òÁÀ¤¦¶²¤ë¤Ù¤­¼Í¼ê¤Ç¤¹¡£Àº¿À¤ò¹â¤á¤ë¤³¤È¤Ë¤è¤ê¡¢¼Í·â¤Î°ÒÎϤÈÀºÅÙ¤ò¹â¤á¤Þ¤¹¡£¤Þ¤¿¡¢ËâË¡¤ò»È¤¦¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¤¬¡¢¸¦¤®À¡¤Þ¤µ¤ì¤¿Àº¿À¤«¤é·«¤ê½Ð¤µ¤ì¤ë¼Í·â½Ñ¤Ï¤µ¤é¤Ê¤ë°ÒÎϤò¤â¤¿¤é¤¹¤³¤È¤Ç¤·¤ç¤¦¡£¥Æ¥¯¥Ë¥Ã¥¯¤¬É¬ÍפȤµ¤ì¤ë¿¦¶È¤Ç¤¹¡£"
 
 #else
 
@@ -1877,7 +1879,9 @@ static cptr class_jouhou[MAX_CLASS] =
 
 "Mirror-Masters are spell casters; like other mages, they must live by their wits.  They can create magical mirrors, and employ them in the casting of Mirror-Magic spells.  A Mirror-Master standing on a mirror has greater ability and, for example, can perform quick teleports.  The maximum number of Magical Mirrors which can be controlled simultaneously depends on the level.  Intelligence determines a Mirror-Master's spell casting ability.",
 
-"A Ninja is a fearful assassin lurking in darkness.  He or she can navigate effectively with no light source, catch enemies unawares, and kill with a single blow.  Ninjas can use Ninjutsu, and are good at locating hidden traps and doors, disarming traps and picking locks.  Since heavy armors, heavy weapons, or shields will restrict their motion greatly, they prefer light clothes, and become faster and more stealthy as they gain levels.  A Ninja knows no fear and, at high level, becomes almost immune to poison and able to see invisible things.  Dexterity determines a Ninja's ability to use Ninjutsu."
+"A Ninja is a fearful assassin lurking in darkness.  He or she can navigate effectively with no light source, catch enemies unawares, and kill with a single blow.  Ninjas can use Ninjutsu, and are good at locating hidden traps and doors, disarming traps and picking locks.  Since heavy armors, heavy weapons, or shields will restrict their motion greatly, they prefer light clothes, and become faster and more stealthy as they gain levels.  A Ninja knows no fear and, at high level, becomes almost immune to poison and able to see invisible things.  Dexterity determines a Ninja's ability to use Ninjutsu.",
+
+"Snipers are good at shooting, and they can kill targets by a few shots. After they concentrate deeply, they can demonstrate their shooting talents. You can see incredibly firepower of their shots."
 #endif
 };
 
@@ -1963,8 +1967,9 @@ static cptr realm_jouhou[VALID_REALM] =
 
 "²Î½¸¤Ï¡¢²Î¤Ë¤è¤Ã¤Æ¸ú²Ì¤òȯ´ø¤¹¤ëËâË¡¤Ç¤¹¡£ËâË¡¤ÈƱÍÍ¡¢»È¤Ã¤¿»þ¤Ë¸ú²Ì¤Î¤¢¤ë¤â¤Î¤È¡¢²Î¤¤Â³¤±¤ë¤³¤È¤Ë¤è¤Ã¤Æ»ý³¤·¤Æ¸ú²Ì¤òȯ´ø¤¹¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£¸å¼Ô¤Î¾ì¹ç¤Ï¡¢MP¤Î³¤¯¸Â¤ê¸ú²Ì¤òȯ´ø¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¤¬¡¢Æ±»þ¤Ë²Î¤¨¤ë²Î¤Ï1¤Ä¤À¤±¤È¤¤¤¦À©¸Â¤â¤¢¤ê¤Þ¤¹¡£",
 
-"Éð·Ý¤Î½ñ¤Ï¡¢ÍÍ¡¹¤ÊÀïÆ®¤Îµ»¤Ë¤Ä¤¤¤Æ½ñ¤«¤ì¤Æ¤¤¤Þ¤¹¡£¤³¤ÎËܤϵ»¤ò³Ð¤¨¤ë¤È¤­¤ËÆɤàɬÍפ¬¤¢¤ê¤Þ¤¹¤¬¡¢°ìÅٳФ¨¤¿µ»¤Ï»È¤¦¤Î¤ËËܤò»ý¤ÄɬÍפϤ¢¤ê¤Þ¤»¤ó¡£µ»¤ò»È¤¦¤È¤­¤Ë¤Ïɬ¤ºÉð´ï¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤¤¤±¤Þ¤»¤ó¡£"
+"Éð·Ý¤Î½ñ¤Ï¡¢ÍÍ¡¹¤ÊÀïÆ®¤Îµ»¤Ë¤Ä¤¤¤Æ½ñ¤«¤ì¤Æ¤¤¤Þ¤¹¡£¤³¤ÎËܤϵ»¤ò³Ð¤¨¤ë¤È¤­¤ËÆɤàɬÍפ¬¤¢¤ê¤Þ¤¹¤¬¡¢°ìÅٳФ¨¤¿µ»¤Ï»È¤¦¤Î¤ËËܤò»ý¤ÄɬÍפϤ¢¤ê¤Þ¤»¤ó¡£µ»¤ò»È¤¦¤È¤­¤Ë¤Ïɬ¤ºÉð´ï¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤¤¤±¤Þ¤»¤ó¡£",
 
+"¼ö½Ñ¤Ï´÷¤à¤Ù¤­Îΰè¤Ç¤¹¡£Ê£¿ô¤Î¼ö¤¤¤Î¸ÀÍÕ¤ò²Î¤Î¤è¤¦¤Ëˤ®¤Ê¤¬¤é±Ó¾§¤·¤Þ¤¹¡£Â¿¤¯¤Î¼öʸ¤Ï±Ó¾§¤·Â³¤±¤ë¤³¤È¤Ë¤è¤Ã¤Æ¸ú²Ì¤¬»ý³¤µ¤ì¤Þ¤¹¡£¼öʸ¤Ë¤ÏÁê¼ê¤Î¹ÔÆ°¤ò«Çû¤¹¤ë¤â¤Î¡¢¥À¥á¡¼¥¸¤òÍ¿¤¨¤ë¤â¤Î¡¢¹¶·â¤ËÂФ·¤ÆÈ¿·â¤¹¤ë¤â¤Î¤¬Â¿¤¯¤¢¤ê¤Þ¤¹¡£"
 #else
 
 "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.",
@@ -1989,7 +1994,9 @@ static cptr realm_jouhou[VALID_REALM] =
 
 "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 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."
+"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.",
+
+"Hex is a very terrible realm. Spells gives continual effects when they are spelled continually like songs. Spells may obstract monsters' actions, may deal damages in sight, may revenge against enemies."
 #endif
 };
 
@@ -2007,7 +2014,8 @@ static char realm_subinfo[VALID_REALM][41] =
 "¹¶·â¤ÈËɸæ¤ÎξÌ̤ËÍ¥¤ì¤Æ¤¤¤Þ¤¹",
 "¼Ù°­¤Ê²øʪ¤ËÂФ¹¤ë¹¶·â¤ËÍ¥¤ì¤Æ¤¤¤Þ¤¹",
 "ÍÍ¡¹¤ÊËâË¡¸ú²Ì¤ò»ý¤Ã¤¿²Î¤ò²Î¤¤¤Þ¤¹",
-"ÂǷ⹶·â¤ËÆüìǽÎϤòÉղä·¤Þ¤¹"
+"ÂǷ⹶·â¤ËÆüìǽÎϤòÉղä·¤Þ¤¹",
+"Ũ¤ò¼ÙË⤷¤Ä¤ÄÉü½²¤òÁÀ¤¤¤Þ¤¹"
 #else
 "Good at detection and healing.",
 "Utility and protective spells.",
@@ -2020,7 +2028,8 @@ static char realm_subinfo[VALID_REALM][41] =
 "Good at both offence and defence.",
 "Destroys evil creatures.",
 "Song with magical effects.",
-"Special attacks on melee."
+"Special attacks on melee.",
+"Good at obstacle and revenge."
 #endif
 };
 
@@ -2030,7 +2039,12 @@ static char realm_subinfo[VALID_REALM][41] =
  */
 static s16b stat_limit[6];
 
-static s16b chara_limit[6];
+static struct {
+       s16b agemin, agemax;
+       s16b htmin, htmax;
+       s16b wtmin, wtmax;
+       s16b scmin, scmax;
+} chara_limit;
 
 /*
  * Autoroll matches
@@ -2119,7 +2133,7 @@ static byte choose_realm(s32b choices, int *count)
        if (choices & CH_ENCHANT)
        {
                (*count)++;
-               auto_select = REALM_ENCHANT;
+               auto_select = REALM_CRAFT;
        }
        if (choices & CH_DAEMON)
        {
@@ -2141,6 +2155,11 @@ static byte choose_realm(s32b choices, int *count)
                (*count)++;
                auto_select = REALM_HISSATSU;
        }
+       if (choices & CH_HEX)
+       {
+               (*count)++;
+               auto_select = REALM_HEX;
+       }
 
        clear_from(10);
 
@@ -2171,10 +2190,10 @@ static byte choose_realm(s32b choices, int *count)
 #endif
 
        cs = 0;
-       for (i = 0; i<16; i++)
+       for (i = 0; i<32; i++)
        {
                /* Analize realms */
-               if (choices & (1 << i))
+               if (choices & (1L << i))
                {
                        if (p_ptr->realm1 == i+1)
                        {
@@ -2230,7 +2249,7 @@ static byte choose_realm(s32b choices, int *count)
                                c_put_str(TERM_L_BLUE, realm_names[picks[cs]], 3, 40);
                                put_str(": Characteristic", 3, 40+strlen(realm_names[picks[cs]]));
 #endif
-                               put_str(realm_subinfo[picks[cs]-1], 4, 40);
+                               put_str(realm_subinfo[technic2magic(picks[cs])-1], 4, 40);
                        }
                        c_put_str(TERM_YELLOW, cur, 12 + (cs/5), 2 + 15 * (cs%5));
                        os = cs;
@@ -2341,7 +2360,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 +2376,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; 
@@ -2718,6 +2737,9 @@ void get_max_stats(void)
                        p_ptr->stat_cur[i] = j;
        }
        p_ptr->knowledge &= ~(KNOW_STAT);
+
+       /* Redisplay the stats later */
+       p_ptr->redraw |= (PR_STATS);
 }
 
 
@@ -2959,7 +2981,7 @@ static void get_history(void)
                        chart = 148;
                        break;
                }
-               case RACE_KUTA:
+               case RACE_KUTAR:
                {
                        chart = 154;
                        break;
@@ -3032,36 +3054,46 @@ static void get_history(void)
 
 
 /*
- * Computes character's age, height, and weight
- * by henkma
+ * Get character's height and weight
  */
-static void get_ahw(void)
+void get_height_weight(void)
 {
-  int h_percent; /* ¿ÈŤ¬Ê¿¶Ñ¤Ë¤¯¤é¤Ù¤Æ¤É¤Î¤¯¤é¤¤°ã¤¦¤«. */
+       int h_percent; /* ¿ÈŤ¬Ê¿¶Ñ¤Ë¤¯¤é¤Ù¤Æ¤É¤Î¤¯¤é¤¤°ã¤¦¤«. */
 
-
-  /* Calculate the 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)
+       /* Calculate the height/weight for males */
+       if (p_ptr->psex == SEX_MALE)
        {
-         p_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
-         h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
-         p_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent /100
-                                                 , (int)(rp_ptr->m_m_wt) * h_percent / 300 );
+               p_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
+               h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
+               p_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent /100
+                                   , (int)(rp_ptr->m_m_wt) * h_percent / 300 );
        }
   
-  /* Calculate the height/weight for females */
-  else if (p_ptr->psex == SEX_FEMALE)
+       /* Calculate the height/weight for females */
+       else if (p_ptr->psex == SEX_FEMALE)
        {
-         p_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
-         h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
-         p_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent /100
-                                                 , (int)(rp_ptr->f_m_wt) * h_percent / 300 );
+               p_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
+               h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
+               p_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent /100
+                                   , (int)(rp_ptr->f_m_wt) * h_percent / 300 );
        }
 }
 
+
+/*
+ * Computes character's age, height, and weight
+ * by henkma
+ */
+static void get_ahw(void)
+{
+       /* Get character's age */
+       p_ptr->age = rp_ptr->b_age + randint1(rp_ptr->m_age);
+
+       /* Get character's height and weight */
+       get_height_weight();
+}
+
+
 /*
  * Get the player's starting money
  */
@@ -3161,6 +3193,24 @@ static void birth_put_stats(void)
 }
 
 
+static void k_info_reset(void)
+{
+       int i;
+
+       /* Reset the "objects" */
+       for (i = 1; i < max_k_idx; i++)
+       {
+               object_kind *k_ptr = &k_info[i];
+
+               /* Reset "tried" */
+               k_ptr->tried = FALSE;
+
+               /* Reset "aware" */
+               k_ptr->aware = FALSE;
+       }
+}
+
+
 /*
  * Clear all the global "character" data
  */
@@ -3234,8 +3284,11 @@ static void player_wipe(void)
                /* Hack -- Non-unique Nazguls are semi-unique */
                else if (r_ptr->flags7 & RF7_NAZGUL) r_ptr->max_num = MAX_NAZGUL_NUM;
 
-               /* Clear player kills */
+               /* Clear visible kills in this life */
                r_ptr->r_pkills = 0;
+
+               /* Clear all kills in this life */
+               r_ptr->r_akills = 0;
        }
 
 
@@ -3323,12 +3376,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;
 
@@ -3428,10 +3475,10 @@ void determine_random_questor(quest_type *q_ptr)
 /*
  *  Initialize random quests and final quests
  */
-static void init_dungeon_quests(int number_of_quests)
+static void init_dungeon_quests(void)
 {
+       int number_of_quests = MAX_RANDOM_QUEST - MIN_RANDOM_QUEST + 1;
        int i;
-       monster_race    *r_ptr;
 
        /* Init the random quests */
        init_flags = INIT_ASSIGN;
@@ -3441,13 +3488,6 @@ static void init_dungeon_quests(int number_of_quests)
 
        p_ptr->inside_quest = 0;
 
-       /* 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--)
        {
@@ -3492,15 +3532,84 @@ 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;
 }
 
+
+/* 
+ * Try to wield everything wieldable in the inventory. 
+ * Code taken from Angband 3.1.0 under Angband license
+ */ 
+static void wield_all(void) 
+{ 
+       object_type *o_ptr; 
+       object_type *i_ptr; 
+       object_type object_type_body; 
+       int slot; 
+       int item; 
+       /* Scan through the slots backwards */ 
+       for (item = INVEN_PACK - 1; item >= 0; item--) 
+       { 
+               o_ptr = &inventory[item]; 
+               /* Skip non-objects */ 
+               if (!o_ptr->k_idx) continue; 
+               /* Make sure we can wield it and that there's nothing else in that slot */ 
+               slot = wield_slot(o_ptr); 
+               if (slot < INVEN_RARM) continue; 
+               if (slot == INVEN_LITE) continue; /* Does not wield toaches because buys a lantern soon */
+               if (inventory[slot].k_idx) continue; 
+               /* Get local object */ 
+               i_ptr = &object_type_body; 
+               object_copy(i_ptr, o_ptr); 
+               /* Modify quantity */ 
+               i_ptr->number = 1; 
+               /* Decrease the item (from the pack) */ 
+               if (item >= 0) 
+               { 
+                       inven_item_increase(item, -1); 
+                       inven_item_optimize(item); 
+               } 
+               /* Decrease the item (from the floor) */ 
+               else 
+               { 
+                       floor_item_increase(0 - item, -1); 
+                       floor_item_optimize(0 - item); 
+               } 
+               /* Get the wield slot */ 
+               o_ptr = &inventory[slot]; 
+               /* Wear the new stuff */ 
+               object_copy(o_ptr, i_ptr); 
+               /* Increase the weight */ 
+               p_ptr->total_weight += i_ptr->weight; 
+               /* Increment the equip counter by hand */ 
+               equip_cnt++;
+
+       } 
+       return; 
+} 
+
+
 /*
  * Each player starts out with a few items, given as tval/sval pairs.
  * In addition, he always has some food and a few torches.
@@ -3627,7 +3736,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 },
@@ -3662,7 +3771,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}
@@ -3676,7 +3785,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 }
@@ -3693,6 +3802,12 @@ static byte player_init[MAX_CLASS][3][2] =
                { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
                { TV_SWORD, SV_DAGGER }
        },
+       {
+               /* Sniper */
+               { TV_BOW, SV_LIGHT_XBOW },
+               { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
+               { TV_SWORD, SV_DAGGER }
+       },
 };
 
 
@@ -3705,13 +3820,32 @@ static bool monster_hook_human(int r_idx)
 
        if (r_ptr->flags1 & (RF1_UNIQUE)) return FALSE;
 
-       if (strchr("pht", r_ptr->d_char)) return TRUE;
+       if (my_strchr("pht", r_ptr->d_char)) return TRUE;
 
        return FALSE;
 }
 
 
 /*
+ * Add an outfit object
+ */
+static void add_outfit(object_type *o_ptr)
+{
+       s16b slot;
+
+       object_aware(o_ptr);
+       object_known(o_ptr);
+       slot = inven_carry(o_ptr);
+
+       /* Auto-inscription */
+       autopick_alter_item(slot, FALSE);
+
+       /* Now try wielding everything */ 
+       wield_all(); 
+}
+
+
+/*
  * Init players with some belongings
  *
  * Having an item makes the player "aware" of its purpose.
@@ -3746,7 +3880,7 @@ void player_outfit(void)
                        object_prep(q_ptr, lookup_kind(TV_CORPSE, SV_CORPSE));
                        q_ptr->pval = get_mon_num(2);
                        q_ptr->number = 1;
-                       (void)inven_carry(q_ptr);
+                       add_outfit(q_ptr);
                }
                break;
 
@@ -3755,9 +3889,7 @@ void player_outfit(void)
                /* Some Skeletons */
                object_prep(q_ptr, lookup_kind(TV_SKELETON, SV_ANY));
                q_ptr->number = (byte)rand_range(7, 12);
-               object_aware(q_ptr);
-               object_known(q_ptr);
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
                break;
 #endif
        case RACE_SKELETON:
@@ -3767,19 +3899,15 @@ void player_outfit(void)
                /* Staff (of Nothing) */
                object_prep(q_ptr, lookup_kind(TV_STAFF, SV_STAFF_NOTHING));
                q_ptr->number = 1;
-               object_aware(q_ptr);
-               object_known(q_ptr);
 
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
                break;
 
        case RACE_ENT:
                /* Potions of Water */
                object_prep(q_ptr, lookup_kind(TV_POTION, SV_POTION_WATER));
                q_ptr->number = (byte)rand_range(15, 23);
-               object_aware(q_ptr);
-               object_known(q_ptr);
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
 
                break;
 
@@ -3791,9 +3919,7 @@ void player_outfit(void)
                apply_magic(q_ptr, 1, AM_NO_FIXED_ART);
 
                q_ptr->number = (byte)rand_range(7, 12);
-               object_aware(q_ptr);
-               object_known(q_ptr);
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
 
                break;
 
@@ -3801,10 +3927,8 @@ void player_outfit(void)
                /* Food rations */
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
                q_ptr->number = (byte)rand_range(3, 7);
-               object_aware(q_ptr);
-               object_known(q_ptr);
 
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
 
        /* Get local object */
@@ -3817,10 +3941,7 @@ void player_outfit(void)
 
                q_ptr->number = (byte)rand_range(2, 5);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
        else if (p_ptr->pclass != CLASS_NINJA)
        {
@@ -3828,10 +3949,8 @@ void player_outfit(void)
                object_prep(q_ptr, lookup_kind(TV_LITE, SV_LITE_TORCH));
                q_ptr->number = (byte)rand_range(3, 7);
                q_ptr->xtra4 = rand_range(3, 7) * 500;
-               object_aware(q_ptr);
-               object_known(q_ptr);
 
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
 
        /* Get local object */
@@ -3843,20 +3962,14 @@ void player_outfit(void)
                object_prep(q_ptr, lookup_kind(TV_ARROW, SV_AMMO_NORMAL));
                q_ptr->number = (byte)rand_range(15, 20);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
        if (p_ptr->pclass == CLASS_RANGER)
        {
                /* Hack -- Give the player some arrows */
                object_prep(q_ptr, lookup_kind(TV_BOW, SV_SHORT_BOW));
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
        else if (p_ptr->pclass == CLASS_ARCHER)
        {
@@ -3864,10 +3977,7 @@ void player_outfit(void)
                object_prep(q_ptr, lookup_kind(TV_ARROW, SV_AMMO_NORMAL));
                q_ptr->number = (byte)rand_range(15, 20);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
        else if (p_ptr->pclass == CLASS_HIGH_MAGE)
        {
@@ -3876,10 +3986,7 @@ void player_outfit(void)
                q_ptr->number = 1;
                q_ptr->pval = (byte)rand_range(25, 30);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
        else if (p_ptr->pclass == CLASS_SORCERER)
        {
@@ -3889,10 +3996,7 @@ void player_outfit(void)
                        object_prep(q_ptr, lookup_kind(i, 0));
                        q_ptr->number = 1;
 
-                       object_aware(q_ptr);
-                       object_known(q_ptr);
-
-                       (void)inven_carry(q_ptr);
+                       add_outfit(q_ptr);
                }
        }
        else if (p_ptr->pclass == CLASS_TOURIST)
@@ -3903,51 +4007,33 @@ void player_outfit(void)
                        object_prep(q_ptr, lookup_kind(TV_SHOT, SV_AMMO_LIGHT));
                        q_ptr->number = (byte)rand_range(15, 20);
 
-                       object_aware(q_ptr);
-                       object_known(q_ptr);
-
-                       (void)inven_carry(q_ptr);
+                       add_outfit(q_ptr);
                }
 
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_BISCUIT));
                q_ptr->number = (byte)rand_range(2, 4);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
 
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_WAYBREAD));
                q_ptr->number = (byte)rand_range(2, 4);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
 
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_JERKY));
                q_ptr->number = (byte)rand_range(1, 3);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
 
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_PINT_OF_ALE));
                q_ptr->number = (byte)rand_range(2, 4);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
 
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_PINT_OF_WINE));
                q_ptr->number = (byte)rand_range(2, 4);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
        else if (p_ptr->pclass == CLASS_NINJA)
        {
@@ -3955,10 +4041,15 @@ void player_outfit(void)
                object_prep(q_ptr, lookup_kind(TV_SPIKE, 0));
                q_ptr->number = (byte)rand_range(15, 20);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
+               add_outfit(q_ptr);
+       }
+       else if (p_ptr->pclass == CLASS_SNIPER)
+       {
+               /* Hack -- Give the player some bolts */
+               object_prep(q_ptr, lookup_kind(TV_BOLT, SV_AMMO_NORMAL));
+               q_ptr->number = (byte)rand_range(15, 20);
 
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
 
        if(p_ptr->pseikaku == SEIKAKU_SEXY)
@@ -4004,10 +4095,7 @@ void player_outfit(void)
                        q_ptr->name2 = EGO_BRAND_POIS;
                }
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
 
        /* Hack -- make aware of the water */
@@ -4194,10 +4282,9 @@ static bool get_player_race(void)
        p_ptr->prace = k;
 
        rp_ptr = &race_info[p_ptr->prace];
-       str = rp_ptr->title;
 
        /* Display */
-       c_put_str(TERM_L_BLUE, str, 4, 15);
+       c_put_str(TERM_L_BLUE, rp_ptr->title, 4, 15);
 
        /* Success */
        return TRUE;
@@ -4410,15 +4497,10 @@ static bool get_player_class(void)
        p_ptr->pclass = k;
        cp_ptr = &class_info[p_ptr->pclass];
        mp_ptr = &m_info[p_ptr->pclass];
-       str = cp_ptr->title;
 
 
        /* Display */
-#ifdef JP
-       c_put_str(TERM_L_BLUE, str, 5, 15);
-#else
        c_put_str(TERM_L_BLUE, cp_ptr->title, 5, 15);
-#endif
 
        return TRUE;
 }
@@ -4566,7 +4648,7 @@ static bool get_player_seikaku(void)
                if (c == '8')
                {
                        if (cs >= 4) cs -= 4;
-                       if (seikaku_info[cs].sex && (seikaku_info[cs].sex != (p_ptr->psex+1)))
+                       if (cs != MAX_SEIKAKU && seikaku_info[cs].sex && (seikaku_info[cs].sex != (p_ptr->psex+1)))
                        {
                                if((cs - 4) > 0)
                                        cs -= 4;
@@ -4577,7 +4659,7 @@ static bool get_player_seikaku(void)
                if (c == '4')
                {
                        if (cs > 0) cs--;
-                       if (seikaku_info[cs].sex && (seikaku_info[cs].sex != (p_ptr->psex+1)))
+                       if (cs != MAX_SEIKAKU && seikaku_info[cs].sex && (seikaku_info[cs].sex != (p_ptr->psex+1)))
                        {
                                if((cs - 1) > 0)
                                        cs--;
@@ -4588,7 +4670,7 @@ static bool get_player_seikaku(void)
                if (c == '6')
                {
                        if (cs < MAX_SEIKAKU) cs++;
-                       if (seikaku_info[cs].sex && (seikaku_info[cs].sex != (p_ptr->psex+1)))
+                       if (cs != MAX_SEIKAKU && seikaku_info[cs].sex && (seikaku_info[cs].sex != (p_ptr->psex+1)))
                        {
                                if((cs + 1) <= MAX_SEIKAKU)
                                        cs++;
@@ -4599,7 +4681,7 @@ static bool get_player_seikaku(void)
                if (c == '2')
                {
                        if ((cs + 4) <= MAX_SEIKAKU) cs += 4;
-                       if (seikaku_info[cs].sex && (seikaku_info[cs].sex != (p_ptr->psex+1)))
+                       if (cs != MAX_SEIKAKU && seikaku_info[cs].sex && (seikaku_info[cs].sex != (p_ptr->psex+1)))
                        {
                                if((cs + 4) <= MAX_SEIKAKU)
                                        cs += 4;
@@ -4936,17 +5018,21 @@ static bool get_stat_limits(void)
 #ifdef ALLOW_AUTOROLLER
 static bool get_chara_limits(void)
 {
+#define MAXITEMS 8
+
        int i, j, m, cs, os;
-       int mval[6], cval[6];
+       int mval[MAXITEMS], cval[MAXITEMS];
        int max_percent, min_percent;
        char c;
        char buf[80], cur[80];
-       char param[3][80] = {
+       cptr itemname[] = {
 #ifdef JP
+               "ǯÎð",
                "¿ÈĹ(¥¤¥ó¥Á)",
                "ÂνÅ(¥Ý¥ó¥É)",
                "¼Ò²ñŪÃÏ°Ì"
 #else
+               "age",
                "height",
                "weight",
                "social class"
@@ -4985,31 +5071,38 @@ static bool get_chara_limits(void)
 #endif
 
        /* Output the maximum stats */
-       for (i = 0; i < 6; i++)
+       for (i = 0; i < MAXITEMS; i++)
        {
                /* Obtain the "maximal" stat */
                switch (i)
                {
-               case 0: /* Minimum height */
+               case 0: /* Minimum age */
+                       m = rp_ptr->b_age + 1;
+                       break;
+               case 1: /* Maximum age */
+                       m = rp_ptr->b_age + rp_ptr->m_age;
+                       break;
+
+               case 2: /* Minimum height */
                        if (p_ptr->psex == SEX_MALE) m = rp_ptr->m_b_ht-rp_ptr->m_m_ht*4+1;
                        else m = rp_ptr->f_b_ht-rp_ptr->f_m_ht*4+1;
                        break;
-               case 1: /* Maximum height */
+               case 3: /* Maximum height */
                        if (p_ptr->psex == SEX_MALE) m = rp_ptr->m_b_ht+rp_ptr->m_m_ht*4-1;
                        else m = rp_ptr->f_b_ht+rp_ptr->f_m_ht*4-1;
                        break;
-               case 2: /* Minimum weight */
+               case 4: /* Minimum weight */
                        if (p_ptr->psex == SEX_MALE) m = (rp_ptr->m_b_wt * min_percent / 100) - (rp_ptr->m_m_wt * min_percent / 75) +1;
                        else m = (rp_ptr->f_b_wt * min_percent / 100) - (rp_ptr->f_m_wt * min_percent / 75) +1;
                        break;
-               case 3: /* Maximum weight */
+               case 5: /* Maximum weight */
                        if (p_ptr->psex == SEX_MALE) m = (rp_ptr->m_b_wt * max_percent / 100) + (rp_ptr->m_m_wt * max_percent / 75) -1;
                        else m = (rp_ptr->f_b_wt * max_percent / 100) + (rp_ptr->f_m_wt * max_percent / 75) -1;
                        break;
-               case 4: /* Minimum social class */
+               case 6: /* Minimum social class */
                        m = 1;
                        break;
-               case 5: /* Maximum social class */
+               case 7: /* Maximum social class */
                        m = 100;
                        break;
                default:
@@ -5022,10 +5115,10 @@ static bool get_chara_limits(void)
                cval[i] = m;
        }
 
-       for (i = 0; i < 3; i++)
+       for (i = 0; i < 4; i++)
        {
                /* Prepare a prompt */
-               sprintf(buf, "%-12s (%3d - %3d)", param[i], mval[i*2], mval[i*2+1]);
+               sprintf(buf, "%-12s (%3d - %3d)", itemname[i], mval[i*2], mval[i*2+1]);
 
                /* Dump the prompt */
                put_str(buf, 14 + i, 20);
@@ -5039,30 +5132,29 @@ static bool get_chara_limits(void)
        
        /* Get a minimum stat */
        cs = 0;
-       os = 6;
+       os = MAXITEMS;
        while (TRUE)
        {
                /* Move Cursol */
                if (cs != os)
                {
-                       if(os == 6)
-                       {
 #ifdef JP
-                               c_put_str(TERM_WHITE, "·èÄꤹ¤ë", 18, 35);
+                       const char accept[] = "·èÄꤹ¤ë";
 #else
-                               c_put_str(TERM_WHITE, "Accept", 18, 35);
+                       const char accept[] = "Accept";
 #endif
+                       if(os == MAXITEMS)
+                       {
+                               c_put_str(TERM_WHITE, accept, 19, 35);
                        }
-                       else if(os < 6)
+                       else
+                       {
                                c_put_str(TERM_WHITE, cur, 14 + os/2, 45 + 8 * (os%2));
+                       }
                        
-                       if(cs == 6)
+                       if(cs == MAXITEMS)
                        {
-#ifdef JP
-                               c_put_str(TERM_YELLOW, "·èÄꤹ¤ë", 18, 35);
-#else
-                               c_put_str(TERM_YELLOW, "Accept", 18, 35);
-#endif
+                               c_put_str(TERM_YELLOW, accept, 19, 35);
                        }
                        else
                        {
@@ -5085,7 +5177,7 @@ static bool get_chara_limits(void)
                case ' ':
                case '\r':
                case '\n':
-                       if(cs == 6) break;
+                       if(cs == MAXITEMS) break;
                        cs++;
                        c = '6';
                        break;
@@ -5095,8 +5187,8 @@ static bool get_chara_limits(void)
                        break;
                case '2':
                case 'j':
-                       if (cs < 6) cs += 2;
-                       if (cs > 6) cs = 6;
+                       if (cs < MAXITEMS) cs += 2;
+                       if (cs > MAXITEMS) cs = MAXITEMS;
                        break;
                case '4':
                case 'h':
@@ -5104,11 +5196,11 @@ static bool get_chara_limits(void)
                        break;
                case '6':
                case 'l':
-                       if (cs < 6) cs++;
+                       if (cs < MAXITEMS) cs++;
                        break;
                case '-':
                case '<':
-                       if (cs != 6)
+                       if (cs != MAXITEMS)
                        {
                                if(cs%2)
                                {
@@ -5130,7 +5222,7 @@ static bool get_chara_limits(void)
                        break;
                case '+':
                case '>':
-                       if (cs != 6)
+                       if (cs != MAXITEMS)
                        {
                                if(cs%2)
                                {
@@ -5151,7 +5243,7 @@ static bool get_chara_limits(void)
                        }
                        break;
                case 'm':
-                       if(cs != 6)
+                       if(cs != MAXITEMS)
                        {
                                if(cs%2)
                                {
@@ -5172,7 +5264,7 @@ static bool get_chara_limits(void)
                        }
                        break;
                case 'n':
-                       if(cs != 6)
+                       if(cs != MAXITEMS)
                        {
                                if(cs%2)
                                {
@@ -5213,47 +5305,35 @@ static bool get_chara_limits(void)
                        bell();
                        break;
                }
-               if(c == ESCAPE || ((c == ' ' || c == '\r' || c == '\n') && cs == 6))break;
+               if(c == ESCAPE || ((c == ' ' || c == '\r' || c == '\n') && cs == MAXITEMS))break;
        }
 
        /* Input the minimum stats */
-       for (i = 0; i < 6; i++)
-       {
-               /* Save the minimum stat */
-               chara_limit[i] = (cval[i] > 0) ? cval[i] : 0;
-       }
+       chara_limit.agemin = cval[0];
+       chara_limit.agemax = cval[1];
+       chara_limit.htmin = cval[2];
+       chara_limit.htmax = cval[3];
+       chara_limit.wtmin = cval[4];
+       chara_limit.wtmax = cval[5];
+       chara_limit.scmin = cval[6];
+       chara_limit.scmax = cval[7];
+
        return TRUE;
 }
 #endif
 
-static char histpref_buf[240];
+#define HISTPREF_LIMIT 1024
+static char *histpref_buf = NULL;
 
+/*
+ * Hook function for reading the histpref.prf file.
+ */
 void add_history_from_pref_line(cptr t)
 {
-       int  limit = (sizeof histpref_buf) - 1;
-       int  i;
+       /* Do nothing if the buffer is not ready */
+       if (!histpref_buf) return;
 
-       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';
+       my_strcat(histpref_buf, t, HISTPREF_LIMIT);
 }
 
 
@@ -5264,6 +5344,7 @@ static bool do_cmd_histpref(void)
        int i, j, n;
        char *s, *t;
        char temp[64 * 4];
+       char histbuf[HISTPREF_LIMIT];
 
 #ifdef JP
        if (!get_check("À¸¤¤Î©¤ÁÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return FALSE;
@@ -5271,13 +5352,14 @@ static bool do_cmd_histpref(void)
        if (!get_check("Load background history preference file? ")) return FALSE;
 #endif
 
-       /* Init buffer */
-       histpref_buf[0] = '\0';
+       /* Prepare the buffer */
+       histbuf[0] = '\0';
+       histpref_buf = histbuf;
 
 #ifdef JP
-       sprintf(buf, "histedit-%s.prf", player_name);
+       sprintf(buf, "histedit-%s.prf", player_base);
 #else
-       sprintf(buf, "histpref-%s.prf", player_name);
+       sprintf(buf, "histpref-%s.prf", player_base);
 #endif
        err = process_histpref_file(buf);
 
@@ -5301,8 +5383,23 @@ static bool do_cmd_histpref(void)
 #endif
                msg_print(NULL);
 
-               /* Terminate buffer */
-               histpref_buf[0] = '\0';
+               /* Kill the buffer */
+               histpref_buf = NULL;
+
+               return FALSE;
+       }
+       else if (!histpref_buf[0])
+       {
+#ifdef JP
+               msg_print("Í­¸ú¤ÊÀ¸¤¤Î©¤ÁÀßÄê¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤¢¤ê¤Þ¤»¤ó¡£");
+#else
+               msg_print("There does not exist valid background history preference.");
+#endif
+               msg_print(NULL);
+
+               /* Kill the buffer */
+               histpref_buf = NULL;
+
                return FALSE;
        }
 
@@ -5330,7 +5427,7 @@ static bool do_cmd_histpref(void)
                }
        }
 
-       /* Turn 0 to space */
+       /* Fill the remaining spaces */
        for (i = 0; i < 4; i++)
        {
                for (j = 0; p_ptr->history[i][j]; j++) /* loop */;
@@ -5339,8 +5436,8 @@ static bool do_cmd_histpref(void)
                p_ptr->history[i][59] = '\0';
        }
 
-       /* Terminate buffer */
-       histpref_buf[0] = '\0';
+       /* Kill the buffer */
+       histpref_buf = NULL;
 
        return TRUE;
 }
@@ -5396,13 +5493,13 @@ static void edit_history(void)
                Term_gotoxy(x + 10, y + 12);
 
                /* Get special key code */
-               skey = inkey_special();
+               skey = inkey_special(TRUE);
 
                /* Get a character code */
                if (!(skey & SKEY_MASK)) c = (char)skey;
                else c = 0;
 
-               if (skey == SKEY_UP)
+               if (skey == SKEY_UP || c == KTRL('p'))
                {
                        y--;
                        if (y < 0) y = 3;
@@ -5410,7 +5507,7 @@ static void edit_history(void)
                        if ((x > 0) && (iskanji2(p_ptr->history[y], x-1))) x--;
 #endif
                }
-               else if (skey == SKEY_DOWN)
+               else if (skey == SKEY_DOWN || c == KTRL('n'))
                {
                        y++;
                        if (y > 3) y = 0;
@@ -5418,7 +5515,7 @@ static void edit_history(void)
                        if ((x > 0) && (iskanji2(p_ptr->history[y], x-1))) x--;
 #endif
                }
-               else if (skey == SKEY_RIGHT)
+               else if (skey == SKEY_RIGHT || c == KTRL('f'))
                {
 #ifdef JP
                        if (iskanji2(p_ptr->history[y], x)) x++;
@@ -5430,7 +5527,7 @@ static void edit_history(void)
                                if (y < 3) y++;
                        }
                }
-               else if (skey == SKEY_LEFT)
+               else if (skey == SKEY_LEFT || c == KTRL('b'))
                {
                        x--;
                        if (x < 0)
@@ -5447,7 +5544,7 @@ 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);
@@ -5559,7 +5656,6 @@ static void edit_history(void)
 static bool player_birth_aux(void)
 {
        int i, k, n, cs, os;
-       int number_of_quests;
 
        int mode = 0;
 
@@ -5579,7 +5675,6 @@ static bool player_birth_aux(void)
        char b2 = ']';
 
        char buf[80], cur[80];
-       char inp[80];
 
 
        /*** Intro ***/
@@ -5642,14 +5737,12 @@ static bool player_birth_aux(void)
        {
                /* Analyze */
                sp_ptr = &sex_info[n];
-               str = sp_ptr->title;
-
 
                /* Display */
 #ifdef JP
-               sprintf(buf, "%c%c%s", I2A(n), p2, str);
+               sprintf(buf, "%c%c%s", I2A(n), p2, sp_ptr->title);
 #else
-               sprintf(buf, "%c%c %s", I2A(n), p2, str);
+               sprintf(buf, "%c%c %s", I2A(n), p2, sp_ptr->title);
 #endif
                put_str(buf, 12 + (n/5), 2 + 15 * (n%5));
        }
@@ -5747,11 +5840,9 @@ static bool player_birth_aux(void)
        /* Set sex */
        p_ptr->psex = k;
        sp_ptr = &sex_info[p_ptr->psex];
-       str = sp_ptr->title;
-
 
        /* Display */
-       c_put_str(TERM_L_BLUE, str, 3, 15);
+       c_put_str(TERM_L_BLUE, sp_ptr->title, 3, 15);
 
        /* Clean up */
        clear_from(10);
@@ -5897,80 +5988,6 @@ static bool player_birth_aux(void)
 
 #endif /* ALLOW_AUTOROLLER */
 
-       /* Clean up */
-       clear_from(10);
-
-       /*** User enters number of quests ***/
-       /* Heino Vander Sanden and Jimmy De Laet */
-
-       /* Extra info */
-#ifdef JP
-       put_str("ɬ¿Ü¤Î¥¯¥¨¥¹¥È(¥ª¥Ù¥í¥óµÚ¤Óº®Æ٤Υµ¡¼¥Ú¥ó¥È)¤Ë²Ã¤¨¤Æ¡¢ÄɲäΥ¯¥¨¥¹¥È¤Î", 10, 5);
-       put_str("¿ô¤òÀßÄꤹ¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£", 11, 5);
-       put_str("Äɲ寥¨¥¹¥È¤ò¹Ô¤Ê¤¤¤¿¤¯¤Ê¤¤¾ì¹ç¤Ï '0'¤òÆþÎϤ·¤Æ²¼¤µ¤¤¡£", 12, 5);
-       put_str("¥é¥ó¥À¥à¤Ë·èÄꤹ¤ë¤Ë¤Ï'*'¤òÆþÎϤ·¤Æ²¼¤µ¤¤¡£", 13, 5);
-#else
-       put_str("You can enter the number of quests you'd like to perform in addition", 10, 5);
-       put_str("to the two obligatory ones ( Oberon and the Serpent of Chaos )", 11, 5);
-       put_str("In case you do not want any additional quests, just enter 0", 12, 5);
-       put_str("If you want a random number of random quests, just enter *", 13, 5);
-#endif
-
-       /* Ask the number of additional quests */
-       while (TRUE)
-       {
-
-#ifdef JP
-               put_str(format("Äɲ寥¨¥¹¥È¤Î¿ô (%u°Ê²¼) ", MAX_RANDOM_QUEST - MIN_RANDOM_QUEST + 1), 15, 5);
-#else
-               put_str(format("Number of additional quests? (<%u) ", MAX_RANDOM_QUEST - MIN_RANDOM_QUEST + 2), 15, 5);
-#endif
-
-
-               /* Get a the number of additional quest */
-               while (TRUE)
-               {
-                       /* Move the cursor */
-                       put_str("", 15, 40);
-
-                       /* Default */
-                       strcpy(inp, "10");
-
-                       /* Get a response (or escape) */
-                       if (!askfor_aux(inp, 2)) strcpy(inp, "10");
-
-                       /* Quit */
-                       if (inp[0] == 'Q') birth_quit();
-
-                       /* Start over */
-                       if (inp[0] == 'S') return (FALSE);
-
-                       /* Check for random number of quests */
-                       if (inp[0] == '*')
-                       {
-                               /* 0 to 10 random quests */
-                               number_of_quests = randint0(11);
-                       }
-                       else if (inp[0] == '?')
-                       {
-#ifdef JP
-                               show_help("jbirth.txt#RandomQuests");
-#else
-                               show_help("birth.txt#RandomQuests");
-#endif
-                               continue;
-                       }
-                       else
-                       {
-                               number_of_quests = atoi(inp);
-                       }
-
-                       /* Break on valid input */
-                       if ((number_of_quests <= MAX_RANDOM_QUEST - MIN_RANDOM_QUEST + 1) && (number_of_quests >= 0)) break;
-               }
-               break;
-       }
-
        /* Clear */
        clear_from(10);
 
@@ -6121,9 +6138,10 @@ static bool player_birth_aux(void)
 
                                if (autochara)
                                {
-                                       if ((p_ptr->ht < chara_limit[0]) || (p_ptr->ht > chara_limit[1])) accept = FALSE;
-                                       if ((p_ptr->wt < chara_limit[2]) || (p_ptr->wt > chara_limit[3])) accept = FALSE;
-                                       if ((p_ptr->sc < chara_limit[4]) || (p_ptr->sc > chara_limit[5])) accept = FALSE;
+                                       if ((p_ptr->age < chara_limit.agemin) || (p_ptr->age > chara_limit.agemax)) accept = FALSE;
+                                       if ((p_ptr->ht < chara_limit.htmin) || (p_ptr->ht > chara_limit.htmax)) accept = FALSE;
+                                       if ((p_ptr->wt < chara_limit.wtmin) || (p_ptr->wt > chara_limit.wtmax)) accept = FALSE;
+                                       if ((p_ptr->sc < chara_limit.scmin) || (p_ptr->sc > chara_limit.scmax)) accept = FALSE;
                                }
                                if (accept) break;
                        }
@@ -6313,6 +6331,12 @@ static bool player_birth_aux(void)
        /* Clear prompt */
        clear_from(23);
 
+       /* Get a name, recolor it, prepare savefile */
+       get_name();
+
+       /* Process the player name */
+       process_player_name(creating_savefile);
+
        /*** Edit character background ***/
        edit_history();
 
@@ -6320,10 +6344,6 @@ static bool player_birth_aux(void)
 
        get_max_stats();
 
-       /* Get a name, recolor it, prepare savefile */
-
-       get_name();
-
        get_virtues();
 
        /* Prompt for it */
@@ -6343,16 +6363,14 @@ static bool player_birth_aux(void)
        /* Start over */
        if (c == 'S') return (FALSE);
 
-       init_dungeon_quests(number_of_quests);
+
+       /* Initialize random quests */
+       init_dungeon_quests();
 
        /* Save character data for quick start */
        save_prev_data(&previous_char);
-       previous_char.quests = number_of_quests;
        previous_char.quick_ok = TRUE;
 
-       /* Process the player name */
-       process_player_name(FALSE);
-
        /* Accept */
        return (TRUE);
 }
@@ -6412,7 +6430,7 @@ static bool ask_quick_start(void)
        }
 
        load_prev_data(FALSE);
-       init_dungeon_quests(previous_char.quests);
+       init_dungeon_quests();
        init_turn();
 
        sp_ptr = &sex_info[p_ptr->psex];