Split init attr minor variation

This commit is contained in:
Pasi Kallinen
2024-01-21 12:45:13 +02:00
parent 1d4cdf09f6
commit 311e82a9cc
3 changed files with 18 additions and 11 deletions

View File

@@ -191,6 +191,7 @@ extern void exercise(int, boolean);
extern void exerchk(void);
extern void init_attr(int);
extern void redist_attr(void);
extern void vary_init_attr(void);
extern void adjabil(int, int);
extern int newhp(void);
extern int minuhpmax(int);

View File

@@ -743,6 +743,22 @@ redist_attr(void)
/* (void) encumber_msg(); -- caller needs to do this */
}
/* apply minor variation to attributes */
void
vary_init_attr(void)
{
int i;
for (i = 0; i < A_MAX; i++)
if (!rn2(20)) {
register int xd = rn2(7) - 2; /* biased variation */
(void) adjattrib(i, xd, TRUE);
if (ABASE(i) < AMAX(i))
AMAX(i) = ABASE(i);
}
}
static
void
postadjabil(long *ability)

View File

@@ -933,18 +933,8 @@ u_init(void)
find_ac(); /* get initial ac value */
init_attr(75); /* init attribute values */
vary_init_attr(); /* minor variation to attrs */
max_rank_sz(); /* set max str size for class ranks */
/*
* Do we really need this?
*/
for (i = 0; i < A_MAX; i++)
if (!rn2(20)) {
register int xd = rn2(7) - 2; /* biased variation */
(void) adjattrib(i, xd, TRUE);
if (ABASE(i) < AMAX(i))
AMAX(i) = ABASE(i);
}
/* make sure you can carry all you have - especially for Tourists */
while (inv_weight() > 0) {