OSDN Git Service

・生い立ちオートローラーで年齢の範囲も指定できるようにした。
authormogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 20 Oct 2003 11:39:17 +0000 (11:39 +0000)
committermogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 20 Oct 2003 11:39:17 +0000 (11:39 +0000)
・カオスパトロンの決定に年齢と社会的地位を使用する get_chaos_patron() は
  実は古いZAngbandからのコンバート時しか使わなかったので廃止。
・histpref.prfの読み込み用のバッファはスタックから用意するようにした。
・石仮面と自己変容の種族変更コードを関数化。
・身長体重を決めるコードを関数化。

src/birth.c
src/cmd3.c
src/effects.c
src/externs.h
src/load.c
src/xtra2.c

index e43833b..aeee479 100644 (file)
@@ -2030,7 +2030,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
@@ -3032,36 +3037,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
  */
@@ -4936,17 +4951,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 +5004,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 +5048,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 +5065,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 +5110,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 +5120,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 +5129,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 +5155,7 @@ static bool get_chara_limits(void)
                        break;
                case '+':
                case '>':
-                       if (cs != 6)
+                       if (cs != MAXITEMS)
                        {
                                if(cs%2)
                                {
@@ -5151,7 +5176,7 @@ static bool get_chara_limits(void)
                        }
                        break;
                case 'm':
-                       if(cs != 6)
+                       if(cs != MAXITEMS)
                        {
                                if(cs%2)
                                {
@@ -5172,7 +5197,7 @@ static bool get_chara_limits(void)
                        }
                        break;
                case 'n':
-                       if(cs != 6)
+                       if(cs != MAXITEMS)
                        {
                                if(cs%2)
                                {
@@ -5213,47 +5238,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;
-
-       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;
-               }
-       }
+       /* Do nothing if the buffer is not ready */
+       if (!histpref_buf) return;
 
-       /* Terminate */
-       histpref_buf[(i < limit) ? i : limit] = '\0';
+       my_strcat(histpref_buf, t, HISTPREF_LIMIT);
 }
 
 
@@ -5264,6 +5277,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,8 +5285,9 @@ 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);
@@ -5301,8 +5316,9 @@ static bool do_cmd_histpref(void)
 #endif
                msg_print(NULL);
 
-               /* Terminate buffer */
-               histpref_buf[0] = '\0';
+               /* Kill the buffer */
+               histpref_buf = NULL;
+
                return FALSE;
        }
 
@@ -5330,7 +5346,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 +5355,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;
 }
@@ -6121,9 +6137,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;
                        }
index 39d6569..c353498 100644 (file)
@@ -557,63 +557,11 @@ msg_print("
                o_ptr->ident |= (IDENT_SENSE);
        }
 
+       /* The Stone Mask make the player turn into a vampire! */
        if ((o_ptr->name1 == ART_STONEMASK) && (p_ptr->prace != RACE_VAMPIRE) && (p_ptr->prace != RACE_ANDROID))
        {
-               int h_percent;
-               if (p_ptr->prace < 32)
-               {
-                       p_ptr->old_race1 |= 1L << p_ptr->prace;
-               }
-               else
-               {
-                       p_ptr->old_race2 |= 1L << (p_ptr->prace-32);
-               }
-               p_ptr->prace = RACE_VAMPIRE;
-#ifdef JP
-               msg_format("¤¢¤Ê¤¿¤ÏµÛ·ìµ´¤ËÊѲ½¤·¤¿¡ª");
-#else
-               msg_format("You polymorphed into a vampire!");
-#endif
-
-               rp_ptr = &race_info[p_ptr->prace];
-
-               /* Experience factor */
-               p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
-
-               /* 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 );
-               }
-
-               /* 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 );
-               }
-
-               check_experience();
-
-               /* Hitdice */
-               if (p_ptr->pclass == CLASS_SORCERER)
-                       p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
-               else
-                       p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
-
-               do_cmd_rerate(FALSE);
-
-               p_ptr->redraw |= (PR_BASIC);
-
-               p_ptr->update |= (PU_BONUS);
-
-               handle_stuff();
-               lite_spot(py, px);
+               /* Turn into a vampire */
+               change_race(RACE_VAMPIRE, "");
        }
 
        /* Recalculate bonuses */
index d3ed172..6c43bb7 100644 (file)
@@ -4726,6 +4726,67 @@ take_hit(DAMAGE_LOSELIFE, change / 2, "
 }
 
 
+/*
+ * Change player race
+ */
+void change_race(int new_race, cptr effect_msg)
+{
+       cptr title = race_info[new_race].title;
+
+#ifdef JP
+       msg_format("¤¢¤Ê¤¿¤Ï%s%s¤ËÊѲ½¤·¤¿¡ª", effect_msg, title);
+#else
+       msg_format("You turn into %s %s%s!", (!effect_msg[0] && is_a_vowel(title[0]) ? "an" : "a"), effect_msg, title);
+#endif
+
+       chg_virtue(V_CHANCE, 2);
+
+       if (p_ptr->prace < 32)
+       {
+               p_ptr->old_race1 |= 1L << p_ptr->prace;
+       }
+       else
+       {
+               p_ptr->old_race2 |= 1L << (p_ptr->prace-32);
+       }
+       p_ptr->prace = new_race;
+       rp_ptr = &race_info[p_ptr->prace];
+
+       /* Experience factor */
+       p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
+
+       /*
+        * The speed bonus of Klackons and Sprites are disabled
+        * and the experience penalty is decreased.
+        */
+       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;
+
+       /* Get character's height and weight */
+       get_height_weight();
+
+       /* Hitdice */
+       if (p_ptr->pclass == CLASS_SORCERER)
+               p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
+       else
+               p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
+
+       do_cmd_rerate(FALSE);
+
+       /* The experience level may be modified */
+       check_experience();
+
+       p_ptr->redraw |= (PR_BASIC);
+
+       p_ptr->update |= (PU_BONUS);
+
+       handle_stuff();
+
+       /* Player's graphic tile may change */
+       lite_spot(py, px);
+}
+
+
 void do_poly_self(void)
 {
        int power = p_ptr->lev;
@@ -4741,7 +4802,7 @@ msg_print("
        if ((power > randint0(20)) && one_in_(3) && (p_ptr->prace != RACE_ANDROID))
        {
                char effect_msg[80] = "";
-               int new_race, expfact, goalexpfact, h_percent;
+               int new_race, expfact, goalexpfact;
 
                /* Some form of racial polymorph... */
                power -= 10;
@@ -4848,78 +4909,7 @@ msg_print("
                }
                while (((new_race == p_ptr->prace) && (expfact > goalexpfact)) || (new_race == RACE_ANDROID));
 
-#ifdef JP
-               msg_format("¤¢¤Ê¤¿¤Ï%s%s¤ËÊѲ½¤·¤¿¡ª", effect_msg,
-                               race_info[new_race].title);
-#else
-               if (effect_msg[0])
-               {
-                       msg_format("You turn into a%s %s!",
-                               ((new_race == RACE_AMBERITE || new_race == RACE_ELF
-                               || new_race == RACE_IMP) ? "n" : ""),
-                               race_info[new_race].title);
-               }
-               else
-               {
-                       msg_format("You turn into a %s%s!", effect_msg,
-                               race_info[new_race].title);
-               }
-#endif
-
-               chg_virtue(V_CHANCE, 2);
-
-               if (p_ptr->prace < 32)
-               {
-                       p_ptr->old_race1 |= 1L << p_ptr->prace;
-               }
-               else
-               {
-                       p_ptr->old_race2 |= 1L << (p_ptr->prace-32);
-               }
-               p_ptr->prace = new_race;
-               rp_ptr = &race_info[p_ptr->prace];
-
-               /* Experience factor */
-               p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
-
-               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;
-
-
-               /* 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 );
-               }
-
-               /* 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 );
-               }
-
-               check_experience();
-
-               /* Hitdice */
-               if (p_ptr->pclass == CLASS_SORCERER)
-                       p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
-               else
-                       p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
-
-               do_cmd_rerate(FALSE);
-
-               p_ptr->redraw |= (PR_BASIC);
-
-               p_ptr->update |= (PU_BONUS);
-
-               handle_stuff();
-               lite_spot(py, px);
+               change_race(new_race, effect_msg);
        }
 
        if ((power > randint0(30)) && one_in_(6))
index ff492f4..f3e5d83 100644 (file)
@@ -539,6 +539,7 @@ extern void do_cmd_edit_autopick(void);
 extern void add_history_from_pref_line(cptr t);
 extern void player_birth(void);
 extern void get_max_stats(void);
+extern void get_height_weight(void);
 extern void determine_random_questor(quest_type *q_ptr);
 extern void player_outfit(void);
 extern void dump_yourself(FILE *fff);
@@ -1338,10 +1339,10 @@ extern bool get_aim_dir(int *dp);
 extern bool get_hack_dir(int *dp);
 extern bool get_rep_dir(int *dp, bool under);
 extern bool get_rep_dir2(int *dp);
-extern int get_chaos_patron(void);
 extern void gain_level_reward(int chosen_reward);
 extern bool tgt_pt (int *x, int *y);
 extern void do_poly_wounds(void);
+extern void change_race(int new_race, cptr effect_msg);
 extern int mon_damage_mod(monster_type *m_ptr, int dam, bool is_psy_spear);
 extern s16b gain_energy(void);
 extern s16b bow_energy(int sval);
index 90f2938..6a4be91 100644 (file)
@@ -1832,7 +1832,7 @@ note(format("
                p_ptr->multishadow = 0;
                p_ptr->dustrobe = 0;
 
-               p_ptr->chaos_patron = get_chaos_patron();
+               p_ptr->chaos_patron = ((p_ptr->age + p_ptr->sc) % MAX_PATRON);
                p_ptr->muta1 = 0;
                p_ptr->muta2 = 0;
                p_ptr->muta3 = 0;
index f1723ea..56258e1 100644 (file)
@@ -4595,12 +4595,6 @@ msg_print("
 }
 
 
-int get_chaos_patron(void)
-{
-       return ((p_ptr->age + p_ptr->sc) % MAX_PATRON);
-}
-
-
 void gain_level_reward(int chosen_reward)
 {
        object_type *q_ptr;