Commit Graph

5181 Commits

Author SHA1 Message Date
PatR
036d2a929f Fumbling while riding
Being stuck on a cursed saddle overrides Fumbling if hero would have
fallen off steed.
2023-12-24 00:54:48 -08:00
PatR
05cf948007 fix github issue #1186 - eating Medusa's corpse
and having temporary stoning resistance timeout before finishing.

Issue reported by Umbire:  hero was able to finish eating Medusa's
corpse safely after getting the message about no longer being
protected against stoning that is given when temporary resistance
times out.

The eating code was extending temporary resistance--when eating
something protected by such--to avoid just that.  I thought this
was probably a message sequencing situation but it turns out that
the code was using touch_petrifies() to test the meal.  It should
use flesh_petrifies() instead; Medusa doesn't pass touch_petrifies().

I didn't figure that out until after rewriting how the duration is
extended.  The old way probably would have worked as desired with
the revised petrify test but I'm checking in the new version anyway.

Fixes #1186
2023-12-23 17:38:05 -08:00
PatR
35eb289cc3 "partly used candle" fix
If you wished for "lit candle" you'd get an unused candle that
is pre-lit but the feedback as it's added to inventory would be
"partly used candle (lit)".  If snuffed out immediately, it reverts
to "candle" (ie, not partly used).

This fixes the first aspect:  you will get "candle (lit)" added to
inventory.  On the next turn it changes to partly used as expected.
The second aspect, reverting to not-used-yet after being lit during
the wish is left as-is.
2023-12-23 16:15:38 -08:00
Pasi Kallinen
5b5e547791 Restful sleep gives a warning message 2023-12-21 09:41:47 +02:00
Pasi Kallinen
3c94b276a2 Amulet of unchanging cannot be polymorphed 2023-12-19 17:13:52 +02:00
Pasi Kallinen
c0fdb2e8c4 Level temperature affects monster generation
Hot levels generate more fire-resistant monsters, cold
levels cold-resistant ones.
2023-12-18 13:43:41 +02:00
Pasi Kallinen
3c421da746 Previous hero rising as undead in bones retains intrinsics 2023-12-15 16:03:26 +02:00
PatR
9d3710163e fix #K4063 - "back on ground" given at odd time
Moving over at item that's resting on ice gives a message about there
being ice present and then about the item, whether mention_decor is On
or Off.  With it On, you'll get a message about being back on solid
ground as soon as you leave the ice.  With it Off you wouldn't get
that at all if not levitating; that's the basic no-mention_decor
behavior for ice.  However, if you were levitating, you would get a
delayed "back on solid ground" message when moving over some other
object, which might occur quite a bit later.  Autopickup handling is
calling describe_decor() when the hero is levitating and some of that
wasn't appropriate for no-mention_decor.

This issue has been present since I first implemented mention_decor,
not introduced by recent back_on_ground() changes.
2023-12-13 13:15:18 -08:00
PatR
a7db78f7d6 fix #K4060 - "you walk quietly" while riding
Donning elven boots while riding and not already stealthy, you'd get
the message "you walk quietly" when not walking at all.  Instead of
just changing the message, make riding a non-flying steed block
stealth.  Riding a flying steed (or one you take aloft with an amulet
of flying) does not.  It would have been quite a bit simpler to have
made riding anything block stealth, but the hard part is done.
2023-12-10 22:09:26 -08:00
Alex Smith
f3408b87ba A new HP regeneration formula
The new formula is: (xlevel + Con)% chance of regenerating 1 hp
each turn.

This formula has been extensively playtested throughout the whole
game (including two ascensions). The intention is to make late-
game combat more interesting: early game the HP regeneration rate
is potentially slightly faster but not significantly changed, but
in the midgame and lategame is substantially slower because there
is no longer a big regeneration boost once the character's xlevel
is in the double digits.

With the new formula, I'm finding that my characters have to heal
with potions (rather than by waiting) in places that they never
had to before (e.g. lower Dungeons, and upper Gehennom), which in
turn means that fighting efficiently is now more important than it
was before. (In fact, in one of the games I wished for potions of
full healing on Astral for safety, although I think I would still
have won without.) It's also generally the case that you can no
longer regenerate "mid-fight": you need to disengage in order to
heal up. This made the game more fun as it meant that escape items
became more relevant, and I was using a greater range of items
throughout the game than I normally would.

The ring of regeneration has also been slightly buffed: it now
heals an extra 1hp per turn unconditionally (rather than becoming
less effective as the character levels). In both my test
ascensions, I found a ring of regeneration, but intentionally
refrained from using it in order to ensure that the new HP
regeneration rate would be tolerable even without one.
2023-12-11 03:11:23 +00:00
Pasi Kallinen
c2802dba2d Demons cannot be frightened by showing them their reflection
From xnethack by copperwater <aosdict@gmail.com>.
2023-12-10 20:11:29 +02:00
nhmall
e0f591bc49 fixes3-7-0.txt entry for pull request 1155 2023-12-10 10:42:01 -05:00
PatR
31717fe227 fix github issue #1170 - trapped without a trap
Issue reported by mkuoppal:  drum of earthquake triggers a sanity
check warning which the fuzzer escalated to panic.

Analysis by entrez.  If a pit gets created next to a pool or moat or
lava, liquid might flow there and replace the pit.  But the drum of
earthquake code assumed that the pit was still there.  If there was a
monster there and it wasn't levitating or flying and it wasn't killed
by the liquid, it got marked as trapped even though the pit was gone.
'sanity_check' noticed.

With difficulty I was able to reproduce the impossible warning before
the fix, but the are a bunch of random factors at play.  After the
fix I can't reproduce it again, but that's not a guarantee that it's
actually fixed.  The analysis seems correct though and the fix is
based on dealing with that.

Closes #1170
2023-12-10 03:21:52 -08:00
Pasi Kallinen
252e661b72 Prioritize paying shopkeeper next to you even if multiple are detected 2023-12-09 13:24:50 +02:00
Pasi Kallinen
1ceb9d2d91 Show menu when paying items
... and have more than 1 billed item, and using non-traditional
menustyle.

I opted to add an extra field to the bill struct, because
that made the code cleaner.

Breaks saves and bones.
2023-12-09 12:43:41 +02:00
nhmall
a6985b1f1a Guidebook updates 2023-12-08 19:45:07 -05:00
PatR
c08304f875 fixes entry for PR #1140 - nopick_dropped
Pull request from entrez:  add 'nopick_dropped' option of not pick up
items dropped by hero via autopickup and 'pickup_stolen' to picup up
items stolen from hero via autopickup, bypassing pickup_types and
autopickup_exceptions like existing 'pickup_thrown'.

This fixes entry commit also fixes the description of pickup_stolen.

Closes #1140
2023-12-08 15:30:04 -08:00
Michael Meyer
e427063560 Enable 'dropped_nopick' by default 2023-12-08 15:20:20 -08:00
Michael Meyer
1736f3caaa Add 'pickup_stolen' option
Add pickup_stolen option to autopick items stolen from you by a nymph or
monkey, even if they don't match your normal autopickup settings.
Replace was_dropped, was_thrown with a 2-bit bitfield that can contain
values LOST_DROPPED, LOST_THROWN, and LOST_STOLEN (or 0), since they
should all be mutually exclusive anyway as they track the most recent
way the item left the hero's inventory.

[Rebase/merge conflict fixed up.  PR]
2023-12-08 15:19:54 -08:00
Michael Meyer
e2e89cb93e Rename/invert 'pickup_dropped' to 'dropped_nopick' 2023-12-08 15:19:05 -08:00
Michael Meyer
d7d1c1476d Add option to exclude dropped items from autopick
This is based on a feature in UnNetHack (and I think some other variants
as well).  If the hero intentionally drops an item with 'pickup_dropped'
disabled, don't autopick it back up when walking over that square again.

Typically when the player drops an item, it's because she doesn't want
it in her inventory any more, and this option stops autopickup from
defeating that goal (especially useful for tasks like stash management
without a container).  Players have come up with workarounds to this
problem like toggling autopickup when approaching their stash pile or
adding name-based autopickup exceptions to allow them to exclude
individual items from autopickup, but this behavior should reduce the
need for those things.

I think 'pickup_dropped' is a little unfortunate because it suggests
equivalence to 'pickup_thrown' (i.e. any dropped items will be
automatically picked up regardless of autopickup exceptions).  Calling
it something like 'nopick_dropped' might be better, but as far as I can
tell options cannot start with the word 'no' because it's interpreted as
a negation of the rest of the option name.
2023-12-08 15:19:04 -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
348f88c726 Walking into a shopkeeper tries to pay the bill 2023-12-08 18:31:16 +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
Alex Smith
b98a70e3ec Dwarvish cloaks somewhat protect inventory from cold and fire
The change to Sokoban difficulty calculation introduced a balance
issue: previously the Sokoban prize was obtainable before item-
destruction attacks became common and would protect from them,
whereas now they commonly appear in Sokoban itself, before the
prize is accessible. This makes scrolls and potions much less
usable as escape items, and potions of healing less usable for
HP recovery, because they either get stashed or destroyed (and
in either case aren't usable by the character in time-critical
situations).

This commit attempts to alleviate the problem by adding a way to
protect items from cold and fire in the early game. It's a
little unreliable, and requires equipping an item that has bad
stats and generally isn't otherwise used, but which is generally
easy to find early on.

Not included in this commit, but probably necessary for a
"finished" version of the feature: some way of letting players
know the new mechanic. It shows up in enlightenment, but there
should probably be at least rumors (and maybe even a major Oracle
consultation) hinting at the mechanic. We might also want to
change the unIDed description of the dwarvish cloak as a hint,
although that would require, e.g., new database entries.
2023-12-05 04:52:02 +00:00
nhmall
b0f5ad13e1 fixes3-7-0.txt catch up 2023-12-04 11:49:39 -05:00
Pasi Kallinen
d8421aa219 Save and restore hero tracks
The tracks left by hero were cleared when player saved and
restored the game, or changed levels.  Now the tracks are
saved in the dungeon level, so changing levels keeps the tracks
left by hero in that level.

Also increased the length of tracks from 50 to 100, and
simplify the tracking function.

Thing not done: fade out old tracks when returning to a level.

Breaks saves and bones.
2023-12-04 17:50:48 +02:00
PatR
2713853f28 another uhandedness bit
For the accessories section of '*' and perminv_mode=InUse, show the
ring on main hand first (after amulet) and the one on off hand after
(before blindfold).  Main hand ring is more significant due to the
potential of a one-handed weapon becoming cursed, preventing it from
being removed.
2023-12-04 00:54:42 -08:00
PatR
ed6b78e227 fix #K4054 - spellbook weight bug
Report was that converting a novel into a blank spellbook via water
damage resulted in a spellbook of blank paper that increased weight
when put into a bag of holding.

Spellbooks weigh 50 units but novels were defined with a weight of 0;
when one was created, a non-zero weight of 1 got assigned.  Blanking
it didn't update the weight; that stayed at 1.  Putting it into a
container reset the weight to match the new type: spellbook of blank
paper, so its weight increased.

Do that when blanking rather than wait until a container might fix it
up.  If it is already in a [possibly nested] container, update that
container's weight too along with any outer ones.

This also changes the base weight of novel from 0 to 10, so it still
gets magically heavier when turned into a spellbook of blank paper.
(The alternative seems to be to destroy it instead.)

The Book of the Dead weighed only 20 units which seemed odd to be so
much less than a spellbook.  This changes that to 50 to match those.
2023-12-03 18:03:16 -08:00
PatR
6c38bfeba2 fix #K4042 - visible but unreachable teleport trap
If a monster fled from the hero by intentionally jumping into a vault
teleporter located in a niche which was still hidden and the hero
saw it happen, the trap would be mapped but the niche would remain as
a secret corridor spot.  The hero couldn't move onto the trap until
searching or wall kicking or other map disclosing activity converted
the spot into regular corridor.

Trap doors in hidden niches did already change the secret corridor
into normal corridor to unhide the trap's spot, but only if the hero
saw it happen.  Now the terrain change occurs even if hero doesn't
see it; only mapping the trap depends on that.

While testing the fix, I noticed that a monster jumping onto a vault
teleporter was teleporting randomly rather than being sent to the
vault, unlike when triggering such a trap by accident.  The code has
changed for 3.7 but this bug was already present in earlier versions.
2023-12-02 15:05:45 -08:00
Alex Smith
6acf5a7784 Potions are often destroyed when dropped onto very hot ground
In Gehennom and on the Plane of Fire, the ground is hot enough to
boil potions (although not hot enough to, e.g., burn scrolls).
The potions sometimes survive this (almost always if it's your
potion, it's blessed, and you have maxed Luck), but often don't.

In addition to making a lot of flavour sense, this serves a
gameplay purpose in that it reduces the number of potions that
are deathdropped by monsters in the late game. In Gehennom,
monsters often generate with potions to use defensively, but then
get killed before they have a chance to use them: this produces a
surfeit of potions that players tend to convert into holy water or
potions of full healing (and in general it doesn't make much sense
that the basic potion of healing primarily generates in Gehennom).
This commit approximately halves the number of useful potion
deathdrops, whilst still allowing monsters access to their
potions; when the monster dies, it drops the potion and this has a
chance of destroying it.
2023-12-02 08:18:01 +00:00
Alex Smith
39a7dc1c52 Most monsters no longer deathdrop comestibles other than their corpse
Playtesting has shown that there is too much permafood in the game
at present: in the late-game the only food-related problem is how
much to carry in order to avoid burdening yourself. In the early
game, food could previously have been a problem prior to
Minetown/Sokoban (thus the recent commit to add a guaranteed ration
in the upper dungeons), but past that point, there is easily enough
food generated on the ground. Additionally, the recent commits to
make healing sources more available in the early game reduce the
amount of time that needs to be spent waiting to heal, thus
further reducing food requirements.

The main purposes of food as a mechanic are to given an incentive
to press onwards and to discourage grinding. However, if monsters
are deathdropping non-corpse permafood, then beyond the very
early game, grinding actually generates more food than it uses up,
so the nutrition mechanic doesn't do its job properly.

Playtesting (including a full ascension!) has shown that there is
still plenty of food available even without deathdrops available
(my test game had 8 spare non-deathdrop food rations upon reaching
the Castle, at which point nutrition is no longer an issue due to
the Castle food stores and the huge numbers of C- and K-rations
dropped by the soldiers). I will address the potential problems
this causes for vegetarian Monks in a future commit.
2023-12-02 08:18:01 +00:00
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
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
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
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
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
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
nhmall
b2a94c8555 misbehavior when tethered aklys gets stuck in web
Reported by elunna after it was noticed on Hack'EM
Closes #1152
2023-11-25 20:47:35 -05:00
PatR
99ccb7a26f revamp '*' (#seeall command)
For '*' and for persistent inventory with perminv_mode==inuse, show
the items in a specific order and within four labelled groups rather
than within their object classes:
|Accessories
| amulet
| right ring
| left ring
| blindfold
|Wielded/Readied Weapons
| primary weapon
| alternate or secondary weapon
| quiver/ammo pouch
|Armor
| suit
| cloak
| shield
| helmet
| gloves
| boots
| shirt
|Miscellaneous
| lit candles and/or lamps
| attached leashes

The accessories come first due to the default 'packorder' position
for amulets; weapons before armor likewise.  If you wield a potion or
quiver some gold, those non-')' items will appear in the weapons
section since the ordering is based on slot rather than object class.
2023-11-24 16:13:39 -08:00
PatR
5bf8b3de6b doc/{dlb,makedefs,nethack,recover}.txt update
Rebuild doc/*.txt (other than Guidebook) with 'nroff -man -c -Tascii'
rather than just 'nroff -man' to prevent it generating non-ASCII
characters for hyphen, aprostrophe, single and double quotes, long
dash, possibly others.  Also preprocess with '--grep-define ALLDOCS'
so that a few parts of the text don't end up being specific to the
local configuration.

The next time they're rebuilt they'll probably be subject to the
ping-pong effect of inserting padding spaces for justification
(alternating right-to-left vs left-to-right as intended but starting
with different parity so lots of gratuitous changes) since my quite
old version of groff triggers that for Guidebook.txt.
2023-11-23 17:24:33 -08:00
nhmall
5e514004e4 fixes update 2023-11-23 14:45:54 -05:00
nhmall
aa026e0f89 fixes update 2023-11-22 17:55:27 -05:00
nhmall
b09d663f71 placeholder copies of doc/*.txt until cron job gets repaired 2023-11-22 17:00:09 -05:00