fix github issue #1085 - strength of orc captain

Issue reported by Umbire:  Uruk-Hai have strength 18/100 and can grow
into orc captains, but orc captains' strength was limited to 18/50.

Cap strength at 18/100 for hero poly'd into an orc captain, same as
when poly'd into an Uruk-hai.  Since poly'd heroes don't grow into
larger forms, the only way to notice is to polymorph into an Uruk-Hai
at some point and into an orc captain at some other point.

Fixes #1085
This commit is contained in:
PatR
2023-08-04 15:12:33 -07:00
parent 9d9042e94b
commit 651a5b210f
2 changed files with 8 additions and 6 deletions
+2
View File
@@ -1652,6 +1652,8 @@ pets capable of using items would pick up and wear cursed armor
if something breakable was set up as alternate weapon and the second of two if something breakable was set up as alternate weapon and the second of two
bare-handed hits succeeded, it would be broken and trigger impossible bare-handed hits succeeded, it would be broken and trigger impossible
"objfree: deleting worn obj" "objfree: deleting worn obj"
strength cap for hero poly'd into an orc captain was 18/50 even though it is
10/100 for Uruk-Hai and monster Uruk-Hai can grow into orc captains
Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository
+6 -6
View File
@@ -1028,7 +1028,7 @@ uasmon_maxStr(void)
struct permonst *ptr = &mons[mndx]; struct permonst *ptr = &mons[mndx];
if (is_orc(ptr)) { if (is_orc(ptr)) {
if (mndx != PM_URUK_HAI) if (mndx != PM_URUK_HAI && mndx != PM_ORC_CAPTAIN)
mndx = PM_ORC; mndx = PM_ORC;
} else if (is_elf(ptr)) { } else if (is_elf(ptr)) {
mndx = PM_ELF; mndx = PM_ELF;
@@ -1052,11 +1052,11 @@ uasmon_maxStr(void)
hero poly'd into an orc the same; goblins, orc shamans, and orc hero poly'd into an orc the same; goblins, orc shamans, and orc
zombies don't have strongmonst() attribute so won't get here; zombies don't have strongmonst() attribute so won't get here;
hobgoblins and orc mummies do get here and are limited to 18/50 hobgoblins and orc mummies do get here and are limited to 18/50
like normal orcs; however, Uruk-hai retain 18/100 strength; like normal orcs; however, orc captains and Uruk-hai retain 18/100
hero gnomes are also limited to 18/50; hero elves are limited strength; hero gnomes are also limited to 18/50; hero elves are
to 18/00 regardless of whether they're strongmonst, but the two limited to 18/00 regardless of whether they're strongmonst, but
strongmonst types (monarchs and nobles) have current strength the two strongmonst types (monarchs and nobles) have current
set to 18 [by polymon()], the others don't */ strength set to 18 [by polymon()], the others don't */
newMaxStr = R ? R->attrmax[A_STR] : live_H ? STR19(19) : STR18(100); newMaxStr = R ? R->attrmax[A_STR] : live_H ? STR19(19) : STR18(100);
} else { } else {
newMaxStr = R ? R->attrmax[A_STR] : 18; /* 18 is same as STR18(0) */ newMaxStr = R ? R->attrmax[A_STR] : 18; /* 18 is same as STR18(0) */