fix pull request #636 - the("Capitalized Monster")

Function the() wasn't supposed to be used for monsters because many
of the ones with capitalized names confuse it, but over time multiple
instances of the(mon_nam()) have crept into the code.  Instead of
ripping those out, modify the() to handle that situation better.

Pull request #636 by entrez dealt with this with one extra line of
code, but could end up scanning all the names in mons[] repeatedly
if the("Capitalized string") gets called a lot.  This uses a similar
one line fix but calls a whole new routine that scans through mons[]
once collecting all the relevant special case names.  As a bonus,
it does the same for hallucinatory monster names which name_to_mon()
couldn't handle.

Fixes #626
This commit is contained in:
PatR
2021-11-24 00:24:56 -08:00
parent dc4b98ebdc
commit b2d4b77d3a
5 changed files with 195 additions and 1 deletions

View File

@@ -686,6 +686,8 @@ if #untrap monst-from-web failure happened while hero was standing on a spot
the expected "<monst> remains entangled" feedback wasn't delivered
if hero is wearing an amulet of magical breathing and polymorphs into a fish
or sea monster, don't lose health for turns spent out of water
fix up some "the" handling for monsters whose type name is upper case to avoid
"Uruk-hai is healthy for a statue", "You can't polymorph into Oracle"
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository