OSDN Git Service

This commit was manufactured by cvs2svn to create tag
[hengbandforosx/hengbandosx.git] / src / birth.c
index 20e87c4..1796a24 100644 (file)
@@ -728,7 +728,7 @@ static hist_type bg[] =
 
 
 #ifdef JP
-       {"¤¢¤Ê¤¿¤Ï½÷²¦¥¯¥é¥³¥ó¤Î²¿¿Í¤«¤Î»Ò¶¡¤Î¤¦¤Á¤Î°ì¿Í¤Ç¤¹¡£"
+       {"¤¢¤Ê¤¿¤Ï½÷²¦¥¯¥é¥å³¥ó¤Î²¿¿Í¤«¤Î»Ò¶¡¤Î¤¦¤Á¤Î°ì¿Í¤Ç¤¹¡£"
        , 100, 84, 85, 50 },
 
        {"¤¢¤Ê¤¿¤ÏÀÖ¤¤È©¤È", 40, 85, 86, 50 },
@@ -1353,7 +1353,7 @@ static hist_type bg[] =
        {"¤¢¤Ê¤¿¤Ï°­¤òÌǤܤ¹¤¿¤á¤Ë¤³¤ÎÃϤËÁ÷¤é¤ì¤Æ¤­¤Þ¤·¤¿¡£", 100, 143, 144, 80},
        {"¤³¤ÎÌÜŪ¤òÀ®¤·¿ë¤²¤ë¤Þ¤Ç¤ÏµÙ¤à¤³¤È¤Ïµö¤µ¤ì¤Þ¤»¤ó¡£", 100, 144, 0, 80},
 #else
-       {"You are of the blessed host of heaven.", 100, 142, 143, 80},
+       {"You are of the blessed host of heaven.  ", 100, 142, 143, 80},
        {"You have been sent to earth to eradicate the wicked, ", 100, 143, 144, 80},
        {"and shall not rest until you have succeeded.", 100, 144, 0, 80},
 #endif
@@ -1981,15 +1981,15 @@ static cptr realm_jouhou[VALID_REALM] =
 
 "Arcane magic is a general purpose realm of magic.  It attempts to encompass all 'useful' spells from all realms.  This is the downside of Arcane magic: while Arcane does have all the necessary 'tool' spells for a dungeon delver, it has no ultra-powerful high level spells.  As a consequence, all Arcane spellbooks can be bought in town.  It should also be noted that the 'specialized' realms usually offer the same spell at a lower level and cost. ",
 
-"Craft magic can strengthen the caster or equipments.  These spells greatly improve the caster's fighting ability, but spells that hurts opponents directly is not exist.",
+"Craft magic can strengthen the caster or the equipments.  These spells can greatly improve the caster's fighting ability.  Using them against opponents directly is not possible.",
 
 "Demon is a very evil realm, same as Death.  It provides various attack spells and devilish detection spells.  at higher levels, Demon magic provides ability to dominate demons, and to polymorph yourself into a demon.",
 
-"Crusade is a realm of 'Justice'; It does have many attack spells which are mostly used for harming and banishing foul minions of evil, and these spells are not so effective for good monsters.",
+"Crusade is a magic of 'Justice'.  It includes damage spells, which are greatly effective against foul and evil monsters, but have poor effects against good monsters.",
 
 "Music magic shows various effects as sing song.  There is two type of song; the one which shows effects instantly and the other one shows effect continuously until SP runs out.  But the latter type has a limit; only one song can be sing at the same time.",
 
-"The books of Kendo describes various combat technique.  it need to read the books when one studys the techniques, but it doesn't need to take around the books to use the techniques after one momorizes it.  It need a weapon wielded to use the techniques."
+"The books of Kendo describe about various combat techniques.  When learning new techniques, you are required to carry the books, but once you memorizes them, you don't have to carry them.  When using a technique, wielding a weapon is required."
 #endif
 };
 
@@ -2341,7 +2341,7 @@ static bool get_player_realms(void)
        p_ptr->realm2 = 255;
        while (1)
        {
-               char temp[80*8];
+               char temp[80*10];
                cptr t;
                count = 0;
                p_ptr->realm1 = choose_realm(realm_choices1[p_ptr->pclass], &count);
@@ -2357,7 +2357,7 @@ static bool get_player_realms(void)
 
                roff_to_buf(realm_jouhou[technic2magic(p_ptr->realm1)-1], 74, temp, sizeof(temp));
                t = temp;
-               for (i = 0; i< 6; i++)
+               for (i = 0; i < 10; i++)
                {
                        if(t[0] == 0)
                                break; 
@@ -3228,7 +3228,9 @@ static void player_wipe(void)
 
                /* Hack -- Reset the max counter */
                if (r_ptr->flags1 & RF1_UNIQUE) r_ptr->max_num = 1;
-               if (r_ptr->flags7 & RF7_UNIQUE_7) r_ptr->max_num = 5;
+
+               /* Hack -- Non-unique Nazguls are semi-unique */
+               else if (r_ptr->flags7 & RF7_NAZGUL) r_ptr->max_num = MAX_NAZGUL_NUM;
 
                /* Clear player kills */
                r_ptr->r_pkills = 0;
@@ -3320,12 +3322,6 @@ static void player_wipe(void)
        p_ptr->mane_num = 0;
        p_ptr->exit_bldg = TRUE; /* only used for arena now -KMW- */
 
-       /* Reset rewards */
-       for (i = 0; i < MAX_BACT; i++)
-       {
-               p_ptr->rewards[i] = 0;
-       }
-
        /* Bounty */
        p_ptr->today_mon = 0;
 
@@ -3353,13 +3349,81 @@ static void player_wipe(void)
        }
 }
 
+
+/*
+ *  Hook function for quest monsters
+ */
+static bool mon_hook_quest(int r_idx)
+{
+       monster_race *r_ptr = &r_info[r_idx];
+
+       /* Random quests are in the dungeon */
+       if (r_ptr->flags8 & RF8_WILD_ONLY) return FALSE;
+
+       /* No random quests for aquatic monsters */
+       if (r_ptr->flags7 & RF7_AQUATIC) return FALSE;
+
+       /* No random quests for multiplying monsters */
+       if (r_ptr->flags2 & RF2_MULTIPLY) return FALSE;
+
+       /* No quests to kill friendly monsters */
+       if (r_ptr->flags7 & RF7_FRIENDLY) return FALSE;
+
+       return TRUE;
+}
+
+
+/*
+ * Determine the random quest uniques
+ */
+void determine_random_questor(quest_type *q_ptr)
+{
+       int          r_idx;
+       monster_race *r_ptr;
+
+       /* Prepare allocation table */
+       get_mon_num_prep(mon_hook_quest, NULL);
+
+       while (1)
+       {
+               /*
+                * Random monster 5 - 10 levels out of depth
+                * (depending on level)
+                */
+               r_idx = get_mon_num(q_ptr->level + 5 + randint1(q_ptr->level / 10));
+               r_ptr = &r_info[r_idx];
+
+               if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
+
+               if (r_ptr->flags1 & RF1_QUESTOR) continue;
+
+               if (r_ptr->rarity > 100) continue;
+
+               if (r_ptr->flags7 & RF7_FRIENDLY) continue;
+
+               if (r_ptr->flags7 & RF7_AQUATIC) continue;
+
+               if (r_ptr->flags8 & RF8_WILD_ONLY) continue;
+
+               if (no_questor_or_bounty_uniques(r_idx)) continue;
+
+               /*
+                * Accept monsters that are 2 - 6 levels
+                * out of depth depending on the quest level
+                */
+               if (r_ptr->level > (q_ptr->level + (q_ptr->level / 20))) break;
+       }
+
+       q_ptr->r_idx = r_idx;
+}
+
+
 /*
  *  Initialize random quests and final quests
  */
 static void init_dungeon_quests(int number_of_quests)
 {
        int i;
-       monster_race    *r_ptr;
 
        /* Init the random quests */
        init_flags = INIT_ASSIGN;
@@ -3369,57 +3433,17 @@ static void init_dungeon_quests(int number_of_quests)
 
        p_ptr->inside_quest = 0;
 
-       /* Prepare allocation table */
-       get_mon_num_prep(monster_quest, NULL);
-
-       /* Remove QUESTOR flag */
-       for (i = 1; i < max_r_idx; i++)
-       {
-               r_ptr = &r_info[i];
-               if (r_ptr->flags1 & RF1_QUESTOR) r_ptr->flags1 &= ~RF1_QUESTOR;
-       }
-
        /* Generate quests */
        for (i = MIN_RANDOM_QUEST + number_of_quests - 1; i >= MIN_RANDOM_QUEST; i--)
        {
                quest_type      *q_ptr = &quest[i];
                monster_race    *quest_r_ptr;
-               int             r_idx;
 
                q_ptr->status = QUEST_STATUS_TAKEN;
-
-               while (1)
-               {
-                       /*
-                        * Random monster 5 - 10 levels out of depth
-                        * (depending on level)
-                        */
-                       r_idx = get_mon_num(q_ptr->level + 5 + randint1(q_ptr->level / 10));
-                       r_ptr = &r_info[r_idx];
-
-                       if(!(r_ptr->flags1 & RF1_UNIQUE)) continue;
-
-                       if(r_ptr->flags1 & RF1_QUESTOR) continue;
-
-                       if(r_ptr->flags6 & RF6_SPECIAL) continue;
-
-                       if(r_ptr->flags7 & RF7_FRIENDLY) continue;
-
-                       if(r_ptr->flags7 & RF7_AQUATIC) continue;
-
-                       if(r_ptr->flags8 & RF8_WILD_ONLY) continue;
-
-                       /*
-                        * Accept monsters that are 2 - 6 levels
-                        * out of depth depending on the quest level
-                        */
-                       if (r_ptr->level > (q_ptr->level + (q_ptr->level / 20))) break;
-               }
-
-               q_ptr->r_idx = r_idx;
-               quest_r_ptr = &r_info[q_ptr->r_idx];
+               determine_random_questor(q_ptr);
 
                /* Mark uniques */
+               quest_r_ptr = &r_info[q_ptr->r_idx];
                quest_r_ptr->flags1 |= RF1_QUESTOR;
 
                q_ptr->max_num = 1;
@@ -3453,13 +3477,16 @@ static void init_turn(void)
        {
                /* Undead start just after midnight */
                turn = (TURNS_PER_TICK*3 * TOWN_DAWN) / 4 + 1;
+               turn_limit = TURNS_PER_TICK * TOWN_DAWN * MAX_DAYS + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
        }
        else
        {
                turn = 1;
+               turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
        }
 
        dungeon_turn = 1;
+       dungeon_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
 }
 
 /*
@@ -3588,7 +3615,7 @@ static byte player_init[MAX_CLASS][3][2] =
        },
 
        {
-               /* Harper */
+               /* Bard */
                { TV_MUSIC_BOOK, 0 },
                { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR},
                { TV_SWORD, SV_SHORT_SWORD },
@@ -3623,7 +3650,7 @@ static byte player_init[MAX_CLASS][3][2] =
        },
 
        {
-               /* Kihei */
+               /* Cavalry */
                { TV_BOW, SV_SHORT_BOW },
                { TV_SOFT_ARMOR, SV_LEATHER_SCALE_MAIL},
                { TV_POLEARM, SV_BROAD_SPEAR}
@@ -3637,7 +3664,7 @@ static byte player_init[MAX_CLASS][3][2] =
        },
 
        {
-               /* Kaji */
+               /* Weaponsmith */
                { TV_RING, SV_RING_RES_FEAR }, /* Warriors need it! */
                { TV_HARD_ARMOR, SV_CHAIN_MAIL },
                { TV_POLEARM, SV_BROAD_AXE }
@@ -3749,7 +3776,7 @@ void player_outfit(void)
                object_prep(q_ptr, lookup_kind(TV_FLASK, SV_ANY));
 
                /* Fuel with oil (move pval to xtra4) */
-               apply_magic(q_ptr, 1, FALSE, FALSE, FALSE, FALSE);
+               apply_magic(q_ptr, 1, AM_NO_FIXED_ART);
 
                q_ptr->number = (byte)rand_range(7, 12);
                object_aware(q_ptr);
@@ -5259,10 +5286,8 @@ static bool do_cmd_histpref(void)
        {
 #ifdef JP
                msg_print("À¸¤¤Î©¤ÁÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
-               msg_print("histedit.prf¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£");
 #else
                msg_print("Failed to load background history preference.");
-               msg_print("Can't find histpref.prf");
 #endif
                msg_print(NULL);
 
@@ -5405,7 +5430,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);