Split out initial STR and CON boost if inventory too heavy
This commit is contained in:
+17
-10
@@ -18,6 +18,7 @@ static void knows_object(int);
|
|||||||
static void knows_class(char);
|
static void knows_class(char);
|
||||||
static void u_init_role(void);
|
static void u_init_role(void);
|
||||||
static void u_init_race(void);
|
static void u_init_race(void);
|
||||||
|
static void u_init_carry_attr_boost(void);
|
||||||
static boolean restricted_spell_discipline(int);
|
static boolean restricted_spell_discipline(int);
|
||||||
|
|
||||||
#define UNDEF_TYP 0
|
#define UNDEF_TYP 0
|
||||||
@@ -831,6 +832,21 @@ u_init_race(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* boost STR and CON until hero can carry inventory */
|
||||||
|
static void
|
||||||
|
u_init_carry_attr_boost(void)
|
||||||
|
{
|
||||||
|
/* make sure you can carry all you have - especially for Tourists */
|
||||||
|
while (inv_weight() > 0) {
|
||||||
|
if (adjattrib(A_STR, 1, TRUE))
|
||||||
|
continue;
|
||||||
|
if (adjattrib(A_CON, 1, TRUE))
|
||||||
|
continue;
|
||||||
|
/* only get here when didn't boost strength or constitution */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
u_init(void)
|
u_init(void)
|
||||||
{
|
{
|
||||||
@@ -934,18 +950,9 @@ u_init(void)
|
|||||||
find_ac(); /* get initial ac value */
|
find_ac(); /* get initial ac value */
|
||||||
init_attr(75); /* init attribute values */
|
init_attr(75); /* init attribute values */
|
||||||
vary_init_attr(); /* minor variation to attrs */
|
vary_init_attr(); /* minor variation to attrs */
|
||||||
|
u_init_carry_attr_boost();
|
||||||
max_rank_sz(); /* set max str size for class ranks */
|
max_rank_sz(); /* set max str size for class ranks */
|
||||||
|
|
||||||
/* make sure you can carry all you have - especially for Tourists */
|
|
||||||
while (inv_weight() > 0) {
|
|
||||||
if (adjattrib(A_STR, 1, TRUE))
|
|
||||||
continue;
|
|
||||||
if (adjattrib(A_CON, 1, TRUE))
|
|
||||||
continue;
|
|
||||||
/* only get here when didn't boost strength or constitution */
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If we have at least one spell, force starting Pw to be enough,
|
/* If we have at least one spell, force starting Pw to be enough,
|
||||||
so hero can cast the level 1 spell they should have */
|
so hero can cast the level 1 spell they should have */
|
||||||
if (num_spells() && (u.uenmax < SPELL_LEV_PW(1)))
|
if (num_spells() && (u.uenmax < SPELL_LEV_PW(1)))
|
||||||
|
|||||||
Reference in New Issue
Block a user