Commit Graph

15978 Commits

Author SHA1 Message Date
Alex Smith
e8ca614e5c Reduce yields for multi-step alchemy recipes
With potions of healing becoming much more common, the multi-step
alchemy recipe from potion of healing to potion of extra healing to
potion of full healing is likely to become even more overpowered
(and it was somewhat unbalancing even beforehand).

This change restricts alchemy involving diluted dipped potions to
alchemize only two potions at a time. This means that potions of
healing can stil be alchemized into potions of extra healing as
efficiently as before this commit, and so can potions of extra
healing into potions of full healing; but the multi-step recipe
is now limited by requiring a lot of potions of gain level or gain
energy. As such, this is intended to make potions of healing into
an item primarily useful in the early game, and discourage hoarding
them for the late game.
2023-12-02 08:18:01 +00:00
Alex Smith
62fb875931 Make the potion of healing much more common and easier to identify
At present, potions of healing generate primarily in Gehennom,
which causes significant balance issues (e.g. you don't have them
to heal in the early game, or even if you do, you can't identify
them in time to use them). In this series of commits, I'm aiming to
make potions of healing a more viable early-game healing source,
which means making them both (much) more likely to generate, and
easier to identify so that they are actually usable in the early
game.

This commit radically increases the generation chance of potions
of healing (reducing the chance of most other potions slightly to
compensate), and gives them a unique base price. This should make
them fairly easy to identify either by price-ID or quantity-ID
(and the unique base price is chosen to be fairly easy to figure
out even for unspoiled players).
2023-12-02 08:18:01 +00:00
Alex Smith
ae3e5d281f Add bonus items to some early-game Dungeons levels
These are primarily in chests (apart from one guaranteed good food
item on the Mines branch level), and are quite likely to be potions
of healing, although other items that are useful for early-game
survivability are also possibilities.

This is part of a series of commits that aim to make the early game
less about waiting to heal up and more about pressing forwards. In
particular, this means that characters need likely access to
healing sources other than waiting/backtracking/hiding in closets.
In a future commit, I plan to make permafood generate primarily
through exploration (rather than drops from monsters) in order to
deter waiting around or grinding; the early guaranteed food drop is
present to give the more nutrition-intensive characters (e.g. orc
wizard or vegetarian Monk) a fair chance to reach the more abundant
food sources in Minetown or Sokoban.
2023-12-02 08:18:01 +00:00
PatR
ea57b9d8ca bones fix - clear monst->seen_resistance
When saving bones, forget observations of current hero's resistances
because they'll be stale when the bones are used in a future game.
2023-12-01 23:05:11 -08:00
PatR
a0008f7376 --windowtype:foo on command line
There's no need to process windowtype a second time after options
parsing.  The sequence set windowtype, process options, set
windowtype again was intended to deal with the options setting it
to some other value, but there's a flag available to disable that
from happening.
2023-12-01 22:58:53 -08:00
Alex Smith
9d910773d0 Make starting inventory magic markers more likely, but fewer charges
In particular, Wizards now get a magic marker guaranteed (but with
fewer charges than magic markers naturally generate with). This is
intended to improve the game in two ways: it reduces the incentive
for startscumming, and it gives Wizards a method to gain an
additional low-level spell early if they wish (but the marker does
not have enough charges to get higher-level spells quickly using
this method).
2023-12-02 03:59:29 +00:00
Alex Smith
319dfbdaa3 Wizards learn about spellbooks as they enhance their spell skills
Previously, Wizards got a boost to the chance of writing unknown
spellbooks based purely on being a Wizard (with the chance still
luck-based), leading to a very large power spike when the Wizard
gained access to a luckstone and the ability to max out luck.
This had two main issues: this power spike came *after* the major
early-game difficulty spike, often leaving Wizards forced to deal
with it without having appropriate spells; and it promotes
grinding (for Luck and for Magicbane) at an early point in the
game, meaning that the Wizard early game effectively followed a
sequence of extreme difficulty -> grinding -> minimal difficulty,
which isn't very good balance-wise.

With this commit, Wizards lose their advantage to writing unknown
spellbooks by guessing, and instead learn spellbook IDs based on
their spell skills (advancing a skill gives knowledge of higher-
level spellbooks). This means that writing unknown spellbooks
becomes guaranteed with sufficient skill, but has no advantage
over non-Wizards in schools where the Wixard does not have
sufficient skill.

Due to Wizards' skill caps, there are two spells which they can't
ever write guaranteed: create familiar and charm monster. Create
familiar is a fairly niche spell (that doesn't match the Wizard
playstyle that well) and being unable to write it is not a major
problem. The inability to easily write charm monster is
intentional.
2023-12-02 03:46:55 +00:00
Pasi Kallinen
a30a205c45 Fix sanity error with migrating monster 2023-12-01 22:15:10 +02:00
Pasi Kallinen
e6ea551150 Fix segfault when trying to create tame lights 2023-12-01 22:13:46 +02:00
PatR
eb212c1676 refine PR #1139 - m_move() and postmov()
Remove a stale comment and update one or two others.
Remove several trailing spaces.
Change the data type of a couple of variables from schar to int and a
couple others from int to coordxy.
Redo a nested 'if' sequence to un-nest; results in a bloated diff due
to reducing indentation for a big chunk of code.
Change monster movement to use u_on_newpos() when swallowed hero's
location moves along with engulfer so that a clipped map will be kept
up to date.
2023-12-01 04:53:20 -08:00
PatR
f3bcec6c53 generic objects bit
u_on_newpos() bit:  player can't see the map while swallowed so hero
can't see objects on the map, hence shouldn't gain more info about
any generic objects if engulfer moves closer to some.

At the moment engulfer movement is manipulating <u.ux,u.uy> directly
rather than going through u_on_newpos(), but that's about to change.
Otherwise a clipped map doesn't get updated properly until the hero
is eventually expelled.
2023-12-01 04:52:21 -08:00
PatR
aff6df1095 PR #1139 - split postmov code out of m_move()
Pull request from argrath:  reduce the size of m_move() and eliminate
several goto's by splitting off 'goto postmov' into a separate routine.

Some of the comments have ended up out of date, referring to 'above'
or 'below' for stuff that moved away.  That can be fixed up later.

Closes #1139
2023-12-01 03:38:21 -08:00
SHIRAKATA Kentaro
fffb1d53ff split 'postmov' of m_move() into separate function 2023-12-01 03:37:47 -08:00
PatR
c899d3645f pull request #1141 - refine washing hands
Pull request from entrez:  when dipping gloved hands into pools or
fountains to wash them, subject those gloves to water damage.  Also,
showing '-' as a likely candidate when picking an inventory item to
dip while at a pool or fountain location didn't work if player had
the 'force_invmenu' option set.

Closes #1141
2023-11-30 19:00:13 -08:00
Michael Meyer
03801773a8 Allow #dipping bare hands from pickinv menu
This wasn't being provided as an option because apparently all actions
which allow hands needed to be explicitly added to the list in getobj().
Add a fallback default 'hands' entry for any action which permits hands,
which both allows #dipping your hands and means that future additions of
hands as a target to other actions will work with OPTIONS=force_invmenu
without needing to remember this.

I made it so that hands will only be presented in the pickinv menu if
they are actually one of the suggested/likely items, which was a little
tricky because pickinv was only looking at actual inventory to determine
whether some items were excluded and the "show everything" option should
be presented.  I had to add a parameter to inform it that hands are
allowed so it would know to display that option if they were allowed but
no 'hands' entry was passed in xtra_choice.  Not sure if there was a
better way to let it figure that out...
2023-11-30 18:36:09 -08:00
Michael Meyer
abafc849e9 Rust gauntlets when washing hands even if Glib
Make it so that washing your gloved hands in a fountain, pool, or sink
can still rust your gauntlets even if it successfully removes the grease
from your fingers.  There wasn't much logic behind the two effects being
mutually exclusive, since the oily fingers of the Glib effect don't
normally protect against water damage like the item being 'greased'
does, and this introduces a possible tradeoff that could make whether or
not to clear Glib by washing your hands a more interesting tactical
decision.
2023-11-30 18:36:08 -08:00
PatR
697a85aa4a pull request #1149 - mimic misbehavior
Pull request from entrez:  a 3.6 problem with mimics coming out of
hiding when they shouldn't was indirectly fixed by an earlier change.
Fix it directly.

Also, add a fixes entry since there didn't seem to be one.

Closes #1149
2023-11-30 18:10:23 -08:00
Michael Meyer
fe8710532e Fix: latent bug with finish_meating on catchup
Some players of 3.6 recently noticed that sometimes, mimics in shops
seemed to have moved around even before the player had entered the shop
or done anything to uncloak them.  I found that this was because
finish_meating was being called for all non-eating monsters when
restoring a level (monsters that weren't eating anything would have
meating == 0 so always pass the 'imv > meating' check).  This would
uncloak mimics -- but not all the time, because the 'mappearance != 0'
test meant mimics disguised as strange objects weren't uncloaked.  I
think that was meant to be an additional check to confirm the monster
really did have a disguise, but in reality it meant that M_AP_OBJECT
"strange object", M_AP_MONSTER "giant ant", etc disguises wouldn't be
removed by finish_meating.

As it turns out, this was mostly fixed by coincidence in 221e4a7, which
fixed the "exclude actual mimics" check in finish_meating.  So at this
point in 3.7 it's largely a latent bug, but it still had the potential
to improperly uncloak non-mimics who can disguise themselves (like the
Wizard of Yendor, maybe?), and could cause other problems if
finish_meating were updated to have additional effects, or if some
monster types were made to disguise themselves as a strange object when
eating a mimic.
2023-11-30 18:05:34 -08:00
PatR
97238fc01a github issue #1157 - wand of striking
Issue reported by elunna:  hero witnessing a wand of striking being
zapped by a monster didn't have that type of wand become discovered.
Monsters observing hero resisting--or failing to resist--the effect
on hero didn't learn about target's current resistance capability.

Barely tested.

Fixes #1157
2023-11-30 16:37:07 -08:00
nhmall
14bdbc8a04 Merge branch 'do-play-instrument' of https://github.com/argrath/NetHack into NetHack-3.7 2023-11-30 13:50:28 -05:00
nhmall
a6772da65d pull request 1156 follow-up bit 2023-11-30 12:19:16 -05:00
nhmall
182d7d27b8 Merge branch 'fix-mkobj' of https://github.com/argrath/NetHack into NetHack-3.7 2023-11-30 12:16:46 -05:00
SHIRAKATA Kentaro
3ab0d92ac9 remove unnecessary condition on save_mtraits()
`mtmp->data` here is always non-null, otherwise it leads segv at earlier code.
2023-12-01 02:05:38 +09:00
nhmall
706232faf0 invlet_basic follow-up 2023-11-30 11:23:29 -05:00
nhmall
d7fef5f194 avoid another magic number
Some of the hardcoded +1 scattered about are likely
invlet_gold or invlet_overflow, but I didn't hunt those down.
2023-11-30 11:15:32 -05:00
PatR
9847fcb5b1 improve the menu for setting pickup_types option
For
|Autopickup what?
| a - amulets
 ...
| A - all classes
prevent invert all and set all from setting the 'A - all classes'
entry.  For invert, toggling it is wrong.  For set, suppressing it
from being set is academic since all other entries get set.

Simplify the notes about what happens when no classes are selected,
and when autopickup is On about how to not autopickup anything at all.
Add one when it's Off, about how to make the chosen classes matter.
2023-11-29 21:37:40 -08:00
PatR
6332b17177 pull request #1138 - hands glowing red
Pull request from entrez:  "Your hands begin glowing red even more"
when hands are already glowing red is inaccurate and poorly phrased.

Closes #1138
2023-11-29 12:13:45 -08:00
Michael Meyer
4e008bb52f Reword feedback for repeated confuse monster use
I didn't like "your hands begin to glow red even more" very much (the
hero's hands aren't really 'beginning' to glow if they already have an
active confuse monster effect, and "glow red even more" was an awkward
turn of phrase on top of that).  Rephrase it to "The red glow of your
hands intensifies."
2023-11-29 12:11:43 -08:00
PatR
8764ae123b pull request #1137 - digging fixes
Pull request from entrez: if breaking a wand of digging or playing
a drum of earthquake destroys an altar, provoke the god's wrath.
Likewise for shop damage, have the shopkeeper demand payment for
repairs.

Also revise the handling for some digging messages.

Closes #1137
2023-11-29 11:43:31 -08:00
Michael Meyer
392f300fa6 Blame hero for broken digging wand shop damage 2023-11-29 11:36:57 -08:00
Michael Meyer
e49c488f18 Streamline digactualhole messaging
Merge some nearly-duplicate code for the two trap types.  Also include
alignment name when referring to an altar's destruction, since it
provides some context for the immediate follow-up by its god.
2023-11-29 11:36:57 -08:00
Michael Meyer
0473fff5b5 Make destruction of altar incite its god's wrath
This is for completely destroying an altar with extra-powerful magical
digging -- the normal altar_wrath() punishment didn't seem sufficient
for such an outrage to me, so skip straight to slinging the lightning
bolts.  Destroying an altar is unlikely to happen by accident (though
it's possible with poorly timed usage of a drum of earthquake).
2023-11-29 11:36:56 -08:00
Michael Meyer
5cbc16a3bd Improve digging vs furniture messaging
When a wand of digging explosion overwrites furniture, describe it
appropriately.  "A pit appears in the altar" doesn't sound right.
2023-11-29 11:36:56 -08:00
Michael Meyer
06ef415c4f Remove unneeded furniture vs earthquake hack
This is no longer needed after ab37888b36.
2023-11-29 11:36:55 -08:00
PatR
44954b61b2 pull request #1136 - remove unnecessary test
Pull request from argrath:  no need to test for Null pointer when it
has already been unconditionally dereferenced.

Closes #1136
2023-11-29 11:28:55 -08:00
SHIRAKATA Kentaro
5f6535728d remove unnecessary condition on use_offensive()
`otmp` here is always non-null, otherwise it leads segv at earlier code.
2023-11-29 11:27:20 -08:00
PatR
5120764560 ^P in getlin()
Replace magic number 020 with ^P.
2023-11-29 11:24:46 -08:00
PatR
585e6373b5 drop_uswapwep()
drop_uswapwep() avoided calling makeplural() in a pline which also
had a call to Yobjname2(), with a comment about the possibility of
clobbering its static return buffer.  uswapwep might be a stack that
results in Yobjname2 indirectly calling makeplural to produce a
plural description.  But makeplural() has used xname's pool of obufs
since before uswapwep became a thing, so the code was evidently
cloned from some other out of date usage.

I was going to just move the makeplural() call into pline() but it
dawned on me that uswapwep must be one handed, so don't pluralize
hands at all.  And since uswapwep might have the same description as
uwep, explicitly mention "left hand" to distinguish.
2023-11-29 11:23:25 -08:00
Pasi Kallinen
94d44e433b Fix sanity error when pet ate a mimic corpse
When a pet ate a mimic corpse and started mimicking a monster,
and the user then used #wizmakemap, the sanity checker complained
about "non-mimic posing as foo" - the code was clearing the
pet eating counter, but didn't clear the appearance.
2023-11-29 12:15:08 +02:00
nhmall
5dd12fdc83 mandoc follow-up 2023-11-29 00:40:48 -05:00
nhmall
05c720bf9d more macOS make manpages follow-up 2023-11-29 00:11:04 -05:00
nhmall
dc7685f33c update MANDIR for macOS 2023-11-28 23:58:51 -05:00
nhmall
cbeb8a51a3 some macOS doc updates
Allow 'make USE_MANDOC=1 distrib' to be used for generating
the doc/*.txt files for systems that have mandoc and may not have groff.
(macOS Ventura doesn't include groff in the OS).
USE_MANDOC=1 is not restricted only to macOS.

Have hints/macOS.370 specify the /usr/share/man/man6 directory for the macOS
man pages, so that 'make manpages' will target the correct directory on
that platform.
2023-11-28 23:44:23 -05:00
nhmall
571de1528d some doc updates
add a 'distrib' target to the top level Makefile so that the
distribution doc/*.txt files can be created via 'make distrib'
from the top directory.  It utilizes the existing 'distrib'
target in the doc/Makefile.

Have hints/linux.370 specify the correct directory for Linux
man pages of /usr/share/man/man6, so that 'sudo make manpages'
works on that platform,
2023-11-28 22:49:31 -05:00
nhmall
521af751f3 more issue #1153
Some changes to achieve the following MAN2TXT commands...

If groff version is 1.23 or greater:
nroff -man -Tascii -P -cbou

If groff version is less than 1.23:
nroff -man -Tascii -c | col -b

If non-groff nroff:
nroff -man | col -b

Closes #1153 again.
2023-11-28 17:00:28 -05:00
nhmall
2cf5f725e8 quiet new warningis following change to UNDEFINED_ROLE macro
Commit 75104c69 modified the UNDEFINED_ROLE macro and caused a
new pair of warnings to appear.

decl.c:831:5: warning: missing field 'f' initializer [-Wmissing-field-initializers]
    UNDEFINED_ROLE, /* urole */
    ^
../include/hack.h:1018:14: note: expanded from macro 'UNDEFINED_ROLE'
      { NULL }, { { NULL } },                   \
             ^
decl.c:831:5: warning: missing field 'f' initializer [-Wmissing-field-initializers]
../include/hack.h:1018:26: note: expanded from macro 'UNDEFINED_ROLE'
      { NULL }, { { NULL } },                   \
                         ^
2 warnings generated.
2023-11-28 09:00:40 -05:00
nhmall
c8f4ad907f more MAN2TXT follow-up
Following a commit for Issue #1153, g-branden-robinson commented:
> Mac OS X stayed on _groff_ 1.19.2 for over a decade (presumably due to
> _groff_ 1.20 adopting to GNU GPLv3), until finally dropping _groff_
> altogether for macOS Ventura (2022).
>
> There _has_ been an interface change in that time.  The [`-P` option I
> advised about is new to _groff_ 1.23.0 (July 2023)]
> (https://git.savannah.gnu.org/cgit/groff.git/tree/NEWS?h=1.23.0#n86).
> [...]
>
> There is a significant number of _groff_ users via Homebrew (enough that
> we hear from them occasionally via bug reports).  Some of these have
> upgraded to 1.23.0 via that mechanism.
> [...]
>
> `nroff -` is not necessary with any _nroff_ known to me; like many other
> Bell Labs Unix programs, it reads from the standard input stream by default
> if not given any operands.

Action taken:

1. Remove the unnecessary ' -' from the nroff command in Makefile.doc.
2. In the misc.370 file containing make snippets to include, test whether
   groff >= 1.23, and only insert the -P option for 1.23 or greater.
2023-11-28 08:00:14 -05:00
PatR
f6e70bbc58 two-weapon combat on/off via inventory item action
When testing 'm )' I noticed that weapon and alternate weapon weren't
offering the chance to toggle two-weapon mode.  When already on,
providing it as a choice to toggle it off is simple, but when at is
off that isn't the case.  There are lots of reasons why attempting
to toggle it on might fail and it is silly to offer as a choice if
failure is sure to occur.  This tries to filter out the majority of
reasons why the player can't toggle it on when deciding whether to
include 'X' as a choice.
2023-11-28 01:15:04 -08:00
PatR
e6a7eb25d4 item actions for '* ) [ = " (' commands
Make the various item-in-use commands put up a menu--which allows
choosing an item for context-sensitive item action--if/when preceded
by the 'm' prefix.  Some of them do that even without the prefix ('*',
'[', or '=' when more than one ring is worn).  By default '(' shows
primary weapon, then secondary one if dual-wielding.  'm (' shows a
menu of primary, alternate whether dual-wielding it or not, and quiver.
2023-11-28 00:31:21 -08:00
PatR
75104c69ab fix #K4043 and #K4044 - out of bounds of races[]
character_race() was going out of bounds when scanning the races[]
array, relying on a field value that the fencepost entry didn't set.

This incorporates the previous fix for UNDEFINED_RACE but also changes
character_race() to not care about that anymore.
2023-11-27 16:43:44 -08:00