From b6a3d4b984eb118ddb02f1605d76b1010df76055 Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 1 Oct 2022 18:14:59 -0700 Subject: [PATCH] fix github issue #679 - orc strength Reported by eakaye: orcish hero has maximum strength of 18/50 but hero poly'd into an orc was given 18/100 strength. Also, a comment from vultur-cadens pointed out that orcish heroes start with poison resistance while monster orcs lack it. Even though the boost to 18/100 is only temporary until the poly times out, make orcs a special case where strongmonst from poly'ing into them only gives 18/50 strength instead of 18/100. Adopt the suggestion that Uruk-hai be an exception and continue to give hero poly'd into them 18/100. If any gnome becomes strongmonst (currently none are), treat them as 18/50 too. Elvenking and elf-lord are strongmonst; treat their forms as plain 18 though, matching the limit of elf heroes. Lesser monster elves aren't strongmost. While in there, add another special case so that hero poly'd into a giant gets 19 strength. Monster giants are still plain strongmonst so might warrant some sort of adjustment. Give orcs poison resistance, but eating their corpses doesn't provide an opportunity to confer it. Note goblins and hobgoblins still don't have the resistance (to distinguish them from orcs a bit). Take away strongmonst from orc shamans and give it to orc mummies. Human mummies should have it too (at least according to movies) but I didn't alter them becuase they're already pretty dangerous at the point they start occurring. Take away strongmonst from plain 'elf' placeholder. New: when hero polymorphs into a form that lacks the strongmonst attribute, take away any exceptional strength (drop 18/01 through 18/100 down to 18; as mentioned above, the drop is only temporary). There's no attempt to set the maximum even lower for wimpy forms. Fixes #679 --- doc/fixes3-7-0.txt | 5 ++++ include/monsters.h | 60 ++++++++++++++++++++++++++-------------------- src/polyself.c | 32 +++++++++++++++++++++++-- 3 files changed, 69 insertions(+), 28 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 2689ee4d8..f932bcaec 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1037,6 +1037,11 @@ if a bones file contains a doppelganger imitating a unique monster, a game when mounted hero got hit by an explosion, hero and steed shared resistances removing an engraving from frost (ie, written with fingers on ice) reported "you wipe out the message that was written in the _dust_" +orc hero starts with poison resistance but orc monsters lacked that +orc hero has maximum 18/50 strength but hero poly'd into an orc got 18/100 +hero with exceptional strength (18/01..18/100) retained that when polymorphed + into any monster lacking the strongmonst attribute +give hero poly'd into a giant 19 strength instead of 18/100 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/include/monsters.h b/include/monsters.h index 0d4f8dbb1..bf3d7f768 100644 --- a/include/monsters.h +++ b/include/monsters.h @@ -627,53 +627,61 @@ * orcs */ MON("goblin", S_ORC, LVL(0, 6, 10, 0, -3), (G_GENO | 2), - A(ATTK(AT_WEAP, AD_PHYS, 1, 4), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, - NO_ATTK), + A(ATTK(AT_WEAP, AD_PHYS, 1, 4), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), SIZ(400, 100, MS_ORC, MZ_SMALL), 0, 0, M1_HUMANOID | M1_OMNIVORE, M2_ORC | M2_COLLECT, M3_INFRAVISIBLE | M3_INFRAVISION, 1, CLR_GRAY, GOBLIN), MON("hobgoblin", S_ORC, LVL(1, 9, 10, 0, -4), (G_GENO | 2), - A(ATTK(AT_WEAP, AD_PHYS, 1, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, - NO_ATTK), + A(ATTK(AT_WEAP, AD_PHYS, 1, 6), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), SIZ(1000, 200, MS_ORC, MZ_HUMAN), 0, 0, M1_HUMANOID | M1_OMNIVORE, M2_ORC | M2_STRONG | M2_COLLECT, M3_INFRAVISIBLE | M3_INFRAVISION, 3, CLR_BROWN, HOBGOBLIN), - /* plain "orc" for zombie corpses only; not created at random + /* plain "orc" for zombie corpses only; not created at random; + * orcs (but not goblins and hobgoblins) are granted poison resistance; + * however, their corpses don't confer it */ MON("orc", S_ORC, LVL(1, 9, 10, 0, -3), (G_GENO | G_NOGEN | G_LGROUP), - A(ATTK(AT_WEAP, AD_PHYS, 1, 8), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, - NO_ATTK), - SIZ(850, 150, MS_ORC, MZ_HUMAN), 0, 0, M1_HUMANOID | M1_OMNIVORE, + A(ATTK(AT_WEAP, AD_PHYS, 1, 8), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(850, 150, MS_ORC, MZ_HUMAN), MR_POISON, 0, + M1_HUMANOID | M1_OMNIVORE, M2_NOPOLY | M2_ORC | M2_STRONG | M2_GREEDY | M2_JEWELS | M2_COLLECT, M3_INFRAVISIBLE | M3_INFRAVISION, 3, CLR_RED, ORC), MON("hill orc", S_ORC, LVL(2, 9, 10, 0, -4), (G_GENO | G_LGROUP | 2), - A(ATTK(AT_WEAP, AD_PHYS, 1, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, - NO_ATTK), - SIZ(1000, 200, MS_ORC, MZ_HUMAN), 0, 0, M1_HUMANOID | M1_OMNIVORE, + A(ATTK(AT_WEAP, AD_PHYS, 1, 6), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(1000, 200, MS_ORC, MZ_HUMAN), MR_POISON, 0, + M1_HUMANOID | M1_OMNIVORE, M2_ORC | M2_STRONG | M2_GREEDY | M2_JEWELS | M2_COLLECT, M3_INFRAVISIBLE | M3_INFRAVISION, 4, CLR_YELLOW, HILL_ORC), MON("Mordor orc", S_ORC, LVL(3, 5, 10, 0, -5), (G_GENO | G_LGROUP | 1), - A(ATTK(AT_WEAP, AD_PHYS, 1, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, - NO_ATTK), - SIZ(1200, 200, MS_ORC, MZ_HUMAN), 0, 0, M1_HUMANOID | M1_OMNIVORE, + A(ATTK(AT_WEAP, AD_PHYS, 1, 6), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(1200, 200, MS_ORC, MZ_HUMAN), MR_POISON, 0, + M1_HUMANOID | M1_OMNIVORE, M2_ORC | M2_STRONG | M2_GREEDY | M2_JEWELS | M2_COLLECT, M3_INFRAVISIBLE | M3_INFRAVISION, 5, CLR_BLUE, MORDOR_ORC), MON("Uruk-hai", S_ORC, LVL(3, 7, 10, 0, -4), (G_GENO | G_LGROUP | 1), - A(ATTK(AT_WEAP, AD_PHYS, 1, 8), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, - NO_ATTK), - SIZ(1300, 300, MS_ORC, MZ_HUMAN), 0, 0, M1_HUMANOID | M1_OMNIVORE, + A(ATTK(AT_WEAP, AD_PHYS, 1, 8), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(1300, 300, MS_ORC, MZ_HUMAN), MR_POISON, 0, + M1_HUMANOID | M1_OMNIVORE, M2_ORC | M2_STRONG | M2_GREEDY | M2_JEWELS | M2_COLLECT, M3_INFRAVISIBLE | M3_INFRAVISION, 5, CLR_BLACK, URUK_HAI), MON("orc shaman", S_ORC, LVL(3, 9, 5, 10, -5), (G_GENO | 1), - A(ATTK(AT_MAGC, AD_SPEL, 0, 0), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, - NO_ATTK), - SIZ(1000, 300, MS_ORC, MZ_HUMAN), 0, 0, M1_HUMANOID | M1_OMNIVORE, - M2_ORC | M2_STRONG | M2_GREEDY | M2_JEWELS | M2_MAGIC, + A(ATTK(AT_MAGC, AD_SPEL, 0, 0), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(1000, 300, MS_ORC, MZ_HUMAN), MR_POISON, 0, + M1_HUMANOID | M1_OMNIVORE, + M2_ORC | M2_GREEDY | M2_JEWELS | M2_MAGIC, M3_INFRAVISIBLE | M3_INFRAVISION, 5, HI_ZAP, ORC_SHAMAN), MON("orc-captain", S_ORC, LVL(5, 5, 10, 0, -5), (G_GENO | 1), - A(ATTK(AT_WEAP, AD_PHYS, 2, 4), ATTK(AT_WEAP, AD_PHYS, 2, 4), NO_ATTK, - NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(1350, 350, MS_ORC, MZ_HUMAN), 0, 0, M1_HUMANOID | M1_OMNIVORE, + A(ATTK(AT_WEAP, AD_PHYS, 2, 4), ATTK(AT_WEAP, AD_PHYS, 2, 4), + NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), + SIZ(1350, 350, MS_ORC, MZ_HUMAN), MR_POISON, 0, + M1_HUMANOID | M1_OMNIVORE, M2_ORC | M2_STRONG | M2_GREEDY | M2_JEWELS | M2_COLLECT, M3_INFRAVISIBLE | M3_INFRAVISION, 7, HI_LORD, ORC_CAPTAIN), /* @@ -1628,7 +1636,7 @@ NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), SIZ(850, 75, MS_SILENT, MZ_HUMAN), MR_COLD | MR_SLEEP | MR_POISON, 0, M1_BREATHLESS | M1_MINDLESS | M1_HUMANOID | M1_POIS, - M2_UNDEAD | M2_HOSTILE | M2_ORC | M2_GREEDY | M2_JEWELS, + M2_UNDEAD | M2_HOSTILE | M2_STRONG | M2_ORC | M2_GREEDY | M2_JEWELS, M3_INFRAVISION, 6, CLR_GRAY, ORC_MUMMY), MON("dwarf mummy", S_MUMMY, LVL(5, 10, 5, 20, -4), (G_GENO | G_NOCORPSE | 1), A(ATTK(AT_CLAW, AD_PHYS, 1, 6), NO_ATTK, @@ -2233,7 +2241,7 @@ NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), SIZ(WT_ELF, 350, MS_HUMANOID, MZ_HUMAN), MR_SLEEP, MR_SLEEP, M1_HUMANOID | M1_OMNIVORE | M1_SEE_INVIS, - M2_NOPOLY | M2_ELF | M2_STRONG | M2_COLLECT, + M2_NOPOLY | M2_ELF | M2_COLLECT, M3_INFRAVISION | M3_INFRAVISIBLE, 2, HI_DOMESTIC, ELF), MON("Woodland-elf", S_HUMAN, LVL(4, 12, 10, 10, -5), (G_GENO | G_SGROUP | 2), diff --git a/src/polyself.c b/src/polyself.c index f68477049..be2ddcbcd 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -760,8 +760,36 @@ polymon(int mntmp) /* New stats for monster, to last only as long as polymorphed. * Currently only strength gets changed. */ - if (strongmonst(&mons[mntmp])) - ABASE(A_STR) = AMAX(A_STR) = STR18(100); + if (strongmonst(&mons[mntmp]) && !is_elf(&mons[mntmp])) { + /* ettins, titans and minotaurs don't pass the is_giant() test; + giant mummies and giant zombies do but we throttle those; + Lord Surtur and Cyclops pass the test but can't be poly'd into */ + boolean live_H = is_giant(&mons[mntmp]) && !is_undead(&mons[mntmp]); + int newStr = live_H ? STR19(19) : STR18(100); + + /* hero orcs are limited to 18/50 for maximum strength, so treat + hero poly'd into an orc the same; goblins, orc shamans, and orc + zombies don't have strongmonst() attribute so won't get here; + hobgoblins and orc mummies do get here and are limited to 18/50 + like normal orcs; however, Uruk-hai retain 18/100 strength; + hero gnomes are also limited to 18/50; hero elves are limited to + 18/00 so we treat strongmonst elves (elf-noble, elven monarch) + as if they're not (in 'if' above, so they don't get here) */ + if ((is_orc(&mons[mntmp]) + && !strstri(pmname(&mons[mntmp], NEUTRAL), "Uruk")) + || is_gnome(&mons[mntmp])) + newStr = STR18(50); + + ABASE(A_STR) = AMAX(A_STR) = newStr; + } else { + /* not a strongmonst(); if hero has exceptional strength, remove it + (note: removal is temporary until returning to original form); + we don't attempt to enforce lower maximum for wimpy forms; + we do avoid boosting current strength to 18 if presently less */ + AMAX(A_STR) = 18; /* same as STR18(0) */ + if (ABASE(A_STR) > AMAX(A_STR)) + ABASE(A_STR) = AMAX(A_STR); + } if (Stone_resistance && Stoned) { /* parnes@eniac.seas.upenn.edu */ make_stoned(0L, "You no longer seem to be petrifying.", 0,