Random figurines are of harder monsters

This commit is contained in:
Pasi Kallinen
2022-08-21 13:23:16 +03:00
parent 2b163d89b0
commit a9ca23e8f9
4 changed files with 22 additions and 4 deletions

View File

@@ -323,13 +323,20 @@ mkbox_cnts(struct obj *box)
/* select a random, common monster type */
int
rndmonnum(void)
{
return rndmonnum_adj(0, 0);
}
/* select a random, common monster type, with adjusted difficulty */
int
rndmonnum_adj(int minadj, int maxadj)
{
register struct permonst *ptr;
register int i;
unsigned short excludeflags;
/* Plan A: get a level-appropriate common monster */
ptr = rndmonst();
ptr = rndmonst_adj(minadj, maxadj);
if (ptr)
return monsndx(ptr);
@@ -965,8 +972,9 @@ mksobj(int otyp, boolean init, boolean artif)
break;
case FIGURINE:
tryct = 0;
/* figurines are slightly harder monsters */
do
otmp->corpsenm = rndmonnum();
otmp->corpsenm = rndmonnum_adj(5, 10);
while (is_human(&mons[otmp->corpsenm]) && tryct++ < 30);
blessorcurse(otmp, 4);
break;