]> granicus.if.org Git - nethack/commitdiff
naga hatchlings growing up
authorarromdee <arromdee>
Wed, 17 Apr 2002 00:12:02 +0000 (00:12 +0000)
committerarromdee <arromdee>
Wed, 17 Apr 2002 00:12:02 +0000 (00:12 +0000)
This was reported on the newsgroup.

doc/fixes34.1
src/makemon.c

index 4ffd67951fe75ad5bef44b38d39361b318db8e69..cf8da3bf52bae726b93bf210195732ac6fc92eca 100644 (file)
@@ -81,6 +81,7 @@ update swallowed display immediately if an engulfing monster polymorphs
 undo xname FAKE_AMULET_OF_YENDOR AD_DRIN check, the_unique_obj checks this case
 axes should chop trees; picks shouldn't
 chance to aim grappling hook when skilled or better
+level limit of monsters like naga hatchlings should be high enough to grow up
 
 
 Platform- and/or Interface-Specific Fixes
index 8039a1096bad0c98aefbbcdd057732dcbff8bca2..b6276399e029002cdee8a6e885678c1f93fb8b42 100644 (file)
@@ -1346,6 +1346,12 @@ struct monst *mtmp, *victim;
        if (mtmp->mhp <= 0)
            return ((struct permonst *)0);
 
+       /* note:  none of the monsters with special hit point calculations
+          have both little and big forms */
+       oldtype = monsndx(ptr);
+       newtype = little_to_big(oldtype);
+       if (newtype == PM_PRIEST && mtmp->female) newtype = PM_PRIESTESS;
+
        /* growth limits differ depending on method of advancement */
        if (victim) {           /* killed a monster */
            /*
@@ -1362,6 +1368,9 @@ struct monst *mtmp, *victim;
            else if (is_home_elemental(ptr))
                hp_threshold *= 3;
            lev_limit = 3 * (int)ptr->mlevel / 2;       /* same as adj_lev() */
+           /* If they can grow up, be sure the level is high enough for that */
+           if (oldtype != newtype && mons[newtype].mlevel > lev_limit)
+               lev_limit = (int)mons[newtype].mlevel;
            /* number of hit points to gain; unlike for the player, we put
               the limit at the bottom of the next level rather than the top */
            max_increase = rnd((int)victim->m_lev + 1);
@@ -1386,11 +1395,6 @@ struct monst *mtmp, *victim;
        else if (lev_limit < 5) lev_limit = 5;  /* arbitrary */
        else if (lev_limit > 49) lev_limit = (ptr->mlevel > 49 ? 50 : 49);
 
-       /* note:  none of the monsters with special hit point calculations
-          have both little and big forms */
-       oldtype = monsndx(ptr);
-       newtype = little_to_big(oldtype);
-       if (newtype == PM_PRIEST && mtmp->female) newtype = PM_PRIESTESS;
        if ((int)++mtmp->m_lev >= mons[newtype].mlevel && newtype != oldtype) {
            ptr = &mons[newtype];
            if (mvitals[newtype].mvflags & G_GENOD) {   /* allow G_EXTINCT */