OSDN Git Service

table.c の整理。
[hengband/hengband.git] / src / birth.c
index 89f0631..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
@@ -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
 };
 
@@ -2124,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)
        {
@@ -2146,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);
 
@@ -2176,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)
                        {
@@ -2235,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;
@@ -2346,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);
@@ -2362,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; 
@@ -2723,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);
 }
 
 
@@ -2964,7 +2981,7 @@ static void get_history(void)
                        chart = 148;
                        break;
                }
-               case RACE_KUTA:
+               case RACE_KUTAR:
                {
                        chart = 154;
                        break;
@@ -3267,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;
        }
 
 
@@ -3459,7 +3479,6 @@ 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;
@@ -3469,13 +3488,6 @@ static void init_dungeon_quests(void)
 
        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--)
        {
@@ -3520,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.
@@ -3655,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 },
@@ -3690,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}
@@ -3704,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 }
@@ -3721,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 }
+       },
 };
 
 
@@ -3752,6 +3839,9 @@ static void add_outfit(object_type *o_ptr)
 
        /* Auto-inscription */
        autopick_alter_item(slot, FALSE);
+
+       /* Now try wielding everything */ 
+       wield_all(); 
 }
 
 
@@ -3953,6 +4043,14 @@ void player_outfit(void)
 
                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);
+
+               add_outfit(q_ptr);
+       }
 
        if(p_ptr->pseikaku == SEIKAKU_SEXY)
        {
@@ -4184,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;
@@ -4400,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;
 }
@@ -4556,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;
@@ -4567,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--;
@@ -4578,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++;
@@ -4589,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;
@@ -5265,9 +5357,9 @@ static bool do_cmd_histpref(void)
        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);
 
@@ -5296,6 +5388,20 @@ static bool do_cmd_histpref(void)
 
                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;
+       }
 
        /* Clear the previous history strings */
        for (i = 0; i < 4; i++) p_ptr->history[i][0] = '\0';
@@ -5631,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));
        }
@@ -5736,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);
@@ -6229,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();
 
@@ -6236,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 */
@@ -6267,9 +6371,6 @@ static bool player_birth_aux(void)
        save_prev_data(&previous_char);
        previous_char.quick_ok = TRUE;
 
-       /* Process the player name */
-       process_player_name(FALSE);
-
        /* Accept */
        return (TRUE);
 }