Commit Graph

38 Commits

Author SHA1 Message Date
Alex Smith
253aea33fc Elemental Planes balance adjustments
The previous commit caused air elementals to become almost totally
nonthreatening in the endgame (even the buffed ones on the Plane of
Air). This commit fixes that (whilst still leaving them somewhat
weaker than they were before against characters with good AC), by
doubling the damage of home-plane air elementals.

The damage of the other home-plane elementals was doubled too,
because they were mostly nonthreatening previously. On Fire, this
has no real effect as almost any character would be fire-resistant
by this point. On Earth, it makes the elementals more of a threat,
when they previously weren't.

However, it made Water too difficult (albeit more fun, because it
became important to avoid letting water elementals swam you). As
such, water elementals are made slightly slower to compensate.
(My own playtesting indicates that 6 is slightly too fast, but 4 is
too slow, so I'm hoping that 5 is the correct value.)
2026-01-15 00:10:59 +00:00
Alex Smith
0e50adcc1e Restore monsters.h to its previous order
This causes the difficulties to get out of sequence, but we agreed
that this is a less important rule than keeping monster IDs stable.

Breaks save and bones files, because it changes monster IDs.
2025-05-29 19:14:10 +01:00
Alex Smith
47724f0137 Increase generation depth of soldier ants and killer bees
These two types of monster were extreme outliers in terms of where
they appeared versus how lethal they were (3-4 times as deadly as
other monsters that appeared at similar depth, based on statistics
from actual play), so their generation depth has been manually
modified.

Breaks save and bones files (because monster type IDs have to be
sorted numerically by difficulty, and changing difficulties thus
changes the IDs, but the IDs are used to identify the monsters in
save files).
2025-05-29 17:53:38 +01:00
nhmall
526571b1f7 another follow-up for magic number replacement 2025-03-19 14:12:03 -04:00
nhmall
a943c4c10b replace some weight-related magic numbers
adds a header file include/nhconst.h  (I'm open to a better name)
2025-03-19 13:29:58 -04:00
PatR
837da48621 fix issue #1340 - winter wolf, hellhound alignment
Issue reported by k21971:  winter wolf cub and hellhound pup were
defined with alignment -5 (chaotic) while winter wolf and hellhound
were 0 (neutral).

K2 suggested that winter wolf plus cub both be neutral and hellhound
plus pup both be chaotic but I've gone another way:  both cub and
pup are now 0 and both adults are -5.

Fixes #1340
2024-12-19 19:59:13 -08:00
PatR
214e508890 address issue #1267 - hasted shopkeepers
Issue reported by ars3niy:  a hasted shopkeeper always gets 2 moves
per turn and had a tendency to move away from the door and then move
right back, keeping it blocked.

I didn't view the ttyrec and didn't reproduce the situation, but I
have noticed something of the sort in the past.  This reduces shk
speed so that there will usually be 2 moves per turn but not always,
increasing the likelihood of leaving the door unblocked when nearby
hero does not owe anything.

This change results in a slowed shopkeeper having speed dropped to 11
rather than 12.  I suspect that the original 18 speed might have been
picked to guarantee slowed speed of at least 12, but if so, that was
in the days when speed 11 would have provided 11 consecutive moves
and then a turn guaranteed to not allow a move rather than the current
11 out of 12 chance to move each turn.

Fixes #1267
2024-08-17 19:02:20 -07:00
Pasi Kallinen
f15035868c Change Nalzok and Minion of Huhetotl to bright red
Disambiguate them from all the other red major demons.
The tiles are already bright red.
2024-04-11 21:39:22 +03:00
PatR
fc56ca0767 barbded devil and ice devil difficulty ratings
I enabled 'extmenu' and went through all the extended commands under
curses and try to find out what github issue #1229 refers to and
didn't spot anything out of the ordinary, except for #wizmondiff
which reported that the calculated diffculty ratings for ice devil
and barbed devil didn't match the values in their definitions.  They
were each given an extra ability about 6 months ago and it was enough
to have a higher rating.

Issue #1239 remains open.
2024-04-08 15:59:05 -07:00
RainRat
a3658f85ac fix typos 2024-02-28 20:15:56 -08:00
PatR
627b40fb57 redo monsters.h
Change MON(name, ...) to MON(NAM(name), ...) and get rid of MON3(),
replacing it with MON(NAMS(malename,femalename,neutername), ...).
That eliminates the macro which uses 16 parameters.  Standard C
allows compilers to impose a limit of 15, rejecting 16 or more while
still being in compliance.

That necessitated some reformatting since it made the first line of
each entry longer.  Shorten that by having all entries start with
name(s) and symbol on the first line, then LVL() and generation flags
on the second line, then attacks start on the third.

Reformat attacks to change ATTK(one) + 4 * NO_ATTK on one line plus
an orphaned NO_ATTK on the next line to always use ATTK(one) on first
line and all 5 NO_ATTKs on the next line.  Similarly, change ATTK(1of2)
ATTK(2of2) NO_ATTK on one line followed by 3 * NO_ATTK on the next line
into ATTK(1of2) ATTK(2of2) followed by 4 NO_ATTKS.  For three attacks,
list two on the first line then the third and 3 * NO_ATTK on the next.
Four or more attacks use a third line; ATTK(1of4+) ATTK(2of4+) on the
first, ATTK(3of4+) ATTK(4of4+) on the second, and whatever's left on
the third.  SIZ() follows on its own line for each of the cases.

Split the final line of each entry so that the difficulty value is the
first thing on that line, followed by color and enum tag.  This may or
may not make moving the difficulty into LVL() easier someday (which
would have been an alternate way to reduce the 16 args that MON3 had).

The file gets stretched out by many lines but entries should be easier
to read (matter of taste, I suppose).

I didn't attempt to clean up M1_foo, M2_bar, M3_quux; too hard....
I also didn't touch SIZ() or resistances which are less cluttered than
the other stuff.
2024-01-12 17:06:47 -08:00
PatR
df6e67f178 mons[NUMMONS] tweak
Add a couple of non-zero permonst flags to the terminator at the end
of mons[] in case some code using a pointer to mons[NUMMONS] for "not
a monster" unexpectedly references them.

Also, eliminate some obsolete handling for conditional color support
from monst.c.
2024-01-12 12:42:44 -08:00
Michael Meyer
f930a12fba Make erinyes scale with alignment abuse
Consistent with their mythological role of punishing those who had
violated societal taboos -- oathbreakers, hosts who attacked their
guests, etc -- erinyes scale with the cumulative amount of alignment
abuse the hero has committed over the course of the game.  This is
tracked separately from the alignment record, and cannot be cleared by
the hero improving her favor with her god via "good deeds" as the normal
alignment record can.  Erinyes will gain abilities, levels, and attacks
as the hero's alignment abuse worsens.  They will also aggravate
monsters when near the hero.
2024-01-10 22:57:10 -08:00
PatR
cb5e93e9e5 polymorphing into placeholder monsters
"human", "dwarf", "elf", "gnome", and "orc" are all flagged M2_NOPOLY;
so is "giant".  But dwarf and gnome are ordinary monsters and should
be eligible to be polymorph targets, so take the no-poly flag off of
them.  The others are used for corpses and not intended to be distinct
monsters.  But they are reasonable polymorph targets, so if player
with control picks any of them, choose a substitute.  The exception is
human, which already has special poly-self handling.
2023-12-29 02:29:16 -08:00
Pasi Kallinen
ecb3a1a68d Change mind flayers, the Wizard, and the riders to bright magenta 2023-12-08 22:03:54 +02:00
Pasi Kallinen
3b2d3eabed Change wolf, werewolf, and warg colors
There were 6 brown 'd' monsters; move wolf and werewolf to grey,
and warg to black, as those colors had no canines.

The wolf tiles are already greyish; changed warg tile to be
slightly darker.
2023-12-07 17:47:21 +02:00
Pasi Kallinen
6e2fa24344 Change hezrou and vrock color to green
There are many red major demons, and hezrous and vrocks
now emit poison gas, so change the symbol color to green.

Also adjust vrock tiles to have green. The hezrou tiles
already are green.
2023-12-07 13:50:51 +02:00
PatR
4fc88f3cbc TEXTCOLOR removal followup
Macros to conditionally include color fields in defsyms[] and objects[]
are no longer needed.  The one for mons[] was already gone but traces
were present in a comment.
2023-11-22 23:58:13 -08:00
Pasi Kallinen
76de4f6ee9 Ice devils get a slowing touch 2023-10-04 20:06:12 +03:00
Pasi Kallinen
3946c5a01d Give barbed devils a sticking attack 2023-10-04 11:09:25 +03:00
PatR
fe919f91b3 couple of comment typos
The second one has two on the same line.
2023-08-12 15:04:10 -07:00
PatR
ca99dfaeeb avoid "<mon> slithers under the water" for fish
Don't use "slither" for movement action when observing an aquatic
monster go into hiding underwater.  Use "dive" instead.

Shark, pirahna, and jellyfish had been flagged M1_SLITHY but aren't
anymore.  Giant eel and electric eel are still M1_SLITHY and kraken
wasn't and still isn't.

There may be some odd cases that used to use slither and it went by
unnoticed where now use of the default verb might become noticeable.
2023-07-19 12:12:41 -07:00
nhmall
d703539847 define WT_ macros in a header file
A recently added #undef WT_ELF caused a onefile build to break.

trap.c: In function 'trapeffect_landmine':
trap.c:2346:41: error: 'WT_ELF' undeclared (first use in this function); did you mean 'PM_ELF'?
trap.c:2346:41: note: each undeclared identifier is reported only once for each function it appears in
2023-04-22 11:13:53 -04:00
PatR
4fd7d51cb2 fix #H2694 - egg hatching feedback
A bug report from ten and half years ago...
If a carried egg hatches, the message is
|<foo> drops from your pack.
and if tame, is followed by
|Its cries sound like {mommy,daddy}.
The latter was issued even when <foo> has no speech capability.

Replace "its cries sound like" with "its <vocalize>ing sounds like"
for suitable value of <vocalize>.

This adds two new monster sounds, MS_BELLOW and MS_CHIRP, also two
new sound effect codes, se_chirp and se_croc_bellow.

We had MS_SILENT for crocodile.  On wikipedia, crocodile is described
as the most vocal reptile.  Adult males make a load bellowing noise
and hatchlings make a chirping noise.

This changes crocodile, titanothere, and baluchitherium from MS_SILENT
to MS_BELLOW and baby crocodile from MS_SILENT to MS_CHIRP.  Chirp
might be appropriate for lizards and lizard-like amphibians but I've
left those as MS_SILENT.

[Noticed but not changed:  lizards and lizard-like amphibians aren't
flagged as oviparous.  Shouldn't they be?]
2023-02-25 07:02:19 -08:00
Pasi Kallinen
05f6a33092 Nazgul can see invisible 2023-01-29 18:07:03 +02:00
PatR
2e981966d0 fix several monster difficulty ratings
Fix most of the things pointed out by #wizmondiff.

Weakening of placeholder 'elf' is due to recent removal of M2_STRONG
for it as part of the "orc strongmonst" changes.

I assume that the discrepancies for multiple quest leaders came about
as part of the change that allows killing the leader as an alternate
way to gain access to the lower levels of the quest, but didn't check.

I don't know what's up with 'piranha' but just changed it to match
generated value.

'{freezing,flaming,shocking} sphere' still show up as discrepancies
with hardcoded (mons[].difficulty) value higher than generated value.
They got harder when their explosion was beefed up, so the formula to
calculate difficulty ought to be updated to account for that.
2022-10-14 14:42:54 -07:00
PatR
01dea35a22 fix github issue #894 - guardian nagas can't grab
Issue reported by eakaye:  for a 'hugs' attack to succeed, the
monster must have at least three attacks and the two preceding the
hug attack need to both hit.  Guardian nagas had three attacks but
the first was melee 'bite' and the second was ranged 'spit'.  Those
are mutually exclusive, so they would never both hit and nagas never
grabbed their prey.

Make the spit attack be first, the bite attack be second, insert a
touch attack for 0 damage third, and make the hug be fourth.  Also,
change their hug damage type from 'phys' to 'wrap'.  The first and
2nd+3rd+4th are still mutually exclusive.

The resulting message feedback left something to be desired and has
been tweaked.

The difficulty-level formula used by deprecated 'makedefs -m' now
generates 17 rather than 16 for guardian naga so I changed revised
monster to match.  They are definitely more difficult now that their
constriction attack has a chance to hit.

Fixes #894
2022-10-07 01:07:43 -07:00
PatR
b6a3d4b984 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
2022-10-01 18:14:59 -07:00
PatR
b07fe59b3c attack/damage by trapper and lurker above
Change trappers and lurkers above to remove digestion damage.  They
fold themselves around rather than swallow the victim.  There were
are lot of places that assumed that an engulfer which is an animal
would swallow and digest the victim.  In hindsight, it might have
been simpler to take the M1_ANIMAL flag off of trappers and lurkers
above.

This adds a new digests() predicate for creatures with AT_ENGL+AD_DGST
(purple worm) and also enfolds() for AT_ENGL+AD_WRAP (both 't'-class
critters).

There are several minor fixes mixed in with this.  I didn't record
them as I went along but the two I remember are
1) if poly'd into a holder and holding on to a monster, the '<' and
   '>' commands refursed to work; release the held creature first
   and then treat those commands as normal;
2) throwing a non-weapon while engulfed by an ochre jelly reported
   "the <item> vanishes into the ochre jelly's /currents/".

This needs a lot more testing.  I found and fixed multiple minor
details before my own testing burned out.
2022-08-15 04:14:36 -07:00
Pasi Kallinen
83f8ec1c43 Give pyrolisk a bite attack 2022-08-06 10:55:04 +03:00
Pasi Kallinen
7c96825525 Demote elf-queen to a lady 2022-07-17 21:47:32 +03:00
Pasi Kallinen
a1ca981907 Grid bugs don't have hands
Fixes #799
2022-07-13 11:21:21 +03:00
PatR
071d79dce2 stoning resistance revisited
It turns out that there were a bunch more monsters with the corpse-
conveys-stoning-resistance flag than just green mold.  Instead of
stripping it off, give them (including green mold) a chance to confer
timed resistance against stoning and also against acid.

All of these can convey either of those two resistances.  Like other
intrinsics obtained via eating, at most one can be obtained from any
given corpse.
  green mold, acid blob, spotted jelly, ochre jelly, black naga,
  yellow dragon, Chromatic Dragon
These can confer temporary stoning resistance but not acid resistance:
  lizard, chickatrice, cockatrice, gargoyle, winged gargoyle,
  xorn, Medusa
There aren't any that confer just acid resistance without a chance for
stoning resistance.

The effect lasts for 3d6 turns, or is extended by 3d6 more if randomly
chosen and applied when already in effect.

Having temporary acid resistance time out during another meal when
eating a corpse that ends up conferring acid resistance seems strange.
The protection against acid is granted at the start of the meal and
continues to the end (in regards to eating, not external attacks) even
when the intrinisic is lost in between.  I'm not sure whether that
needs some form of fixing, and if so, what that fixing should be.
2022-03-26 11:23:06 -07:00
PatR
167dec0d56 eating green mold corpses
A reddit posting points out that the green mold monster definition
has the flag for conveying stoning resistance but it doesn't work.
There seem to be 3 choices:
 1) implement being able to gain that resistance;
 2) take the flag away;
 3) mark green molds no-corpse so that the issue becomes moot.
The poster was hoping for (1) but I've gone with (2).  Green molds
are too common and not at all dangerous; being able to gain stoning
resistance--even with a tiny chance--could potentially be a major
change in play balance.
2022-03-24 15:49:27 -07:00
Michael Meyer
dc21b3d657 Make ravens oviparous
Ravens are birds, so they should be able to lay eggs.
2022-02-19 17:31:34 -08:00
Pasi Kallinen
b25138e6d9 Zombies groan 2022-02-16 23:04:02 +02:00
PatR
8b30f3e1d1 red dragon's sight
Since wearing red dragon scales/mail confers infravision, give that
ability to red dragons.  Matters when the hero is polymorphed into one.
Also give it to the Chromatic Dragon, where I don't think it matters.
2021-12-26 14:57:29 -08:00
nhmall
9bb96322a8 compile NetHack-3.7 without makedefs-generated .h files
This evolves and hopefully eases the game-build requirements by
removing game-compile dependencies on any header files generated
by the makedefs utility, including:

date.h dependency and its inclusion is removed and comparable functionality
is produced at runtime via new file src/date.c.

pm.h dependency and its inclusion is removed and comparable functionality is
produced by moving the monster definitions from monst.c into new header
file called monsters.h and altering them slightly. The former pm.h header
file #define PM_ values are now replaced with appropriate emitted enum
entries during the compiler preprocessing.

onames.h dependency and	its inclusion is removed and comparable functionality
is produced by moving the object definitions from objects.c into new header
file called objects.h and altering them slightly. The former onames.h header
file #define values are now replaced with appropriate emitted enum entries
during the compiler preprocessing.

artilist.h has been slightly altered, and the former onames.h artifact-related
header file #define ART_ values are now replaced with appropriate emitted enum
entries during the compiler preprocessing.

makedefs can still produce date.h (makedefs -v), pm.h (makedefs -p), and
onames.h (makedefs -o) for reference purposes. They won't be used during
the compiler.

The other uses for makedefs remain. They are used to prepare external
file content that the game utilizes, not prerequisite code for the
compile:
    makedefs -d    (database)
    makedefs -r    (rumors)
    makedefs -h    (oracles)
    makedefs -s    (epitaphs, engravings, bogusmons)

date.c

Pull the code for date/time stamping from mdlib.c into date.c.
Set date.o to be dependent on source files, header files, and .o files
so that date.o is rebuilt from date.c when any of those changes, thus
ensuring an accurate date/time stamp. It also includes git sha
functionality formerly done by makedefs writing #define directives
into include/date.h. For unix it passes the git info on
the compile line for date.c (via sys/unix/hints/linux.2020, macOS.2020)

nethack --dumpenums (optional, but on by default)

Allow developer to obtain some internal enum values from NetHack
without having to resort to an external utility such as
makedefs.

Uncomment #define NODUMPENUMS in config.h to disable this.

The updates to sys/windows/Makefile.gcc have not been tested yet.
2021-08-21 07:59:18 -04:00