Commit Graph

16025 Commits

Author SHA1 Message Date
nhmall
c1910026f0 include some more enum dumps 2023-12-06 21:41:49 -05:00
nhmall
11a926c4cc TTY_PERM_INVENT: menucolors colors text, not inv letter
This diff is slightly inflated because I relocated a tty function
within win/tty/wintty.c.
2023-12-06 15:41:06 -05:00
Alex Smith
0d508cc936 Implement the spellbook of chain lightning
Prior to this commit, there was no good way to deal with swarms of
weak, good-AC enemies using magic; trying to play a wizard as a
pure spellcaster would make bees and ants very difficult to deal
with (because they would usually dodge force bolts).

This commit adds a new spell designed to be very good against
swarms of weak enemies: "chain lightning", which does 2d6 lightning
damage to every monster around you. It has an initially short range,
but can chain from monster to monster to cover potentially large
distances (as long as none of the monsters en route are shock
resistant or tame/peaceful; the spell can't chain past shock
resistant monsters and avoids peacefuls). Monsters within one
space of the visible lightning bolts are affected. Unlike other
lightning effects, this one does only 2d6 damage, not enough to
blind affected monsters.

This commit breaks existing save and bones files (thus the
EDITLEVEL increase).
2023-12-06 20:02:35 +00:00
nhmall
45856e3b5b follow-up: bordercolor lacked have expected offset 2023-12-06 13:49:33 -05:00
nhmall
8018fe64cf remove an outdated TODO: comment in wintty.c
A comment made reference to something that is fulfilled by
the core now, but that probably wasn't the case when that
comment was originally added.
2023-12-06 13:42:28 -05:00
nhmall
54332f5598 TTY_PERM_INVENT: honor color passed by add_menu()
Features like menucolors and so forth, are now done in the
core, and passed to the window interfaces via add_menu().

TTY_PERM_INVENT was disregarding the passed color value.

That can be turned off by the option !menucolors.

If a way to turn off menucolors in TTY_PERM_INVENT (or
perhaps in any perm_invent implementation), while keeping
it on for other menus, then a new option will be required.
2023-12-06 13:30:33 -05:00
PatR
1b1c45d3ce TTY_PERM_INVENT perminv_mode=inuse
Revise the tty permanent inventory window's in-use mode to be able to
switch back and forth between one full width panel and two side-by-side
half width panels on the fly as needs dictate.

A lot of trial and error involved but I think it has reached a state
where it is reliable, and the smaller number of lines required at
present can probably be viable for actual usage.  At the moment it
requires at least 10 extra lines below the standard tty mesg+map+stat
display, 34 lines total for statuslines:2 or 35 for statuslines:3.
The top and bottom of the 10 or more extra lines get drawn as boundary
lines using wall characters, leaving 8 lines for full width or 16 half
lines when 8 isn't enough.  If more that 16 items are in use (maybe
lots of lit candles forced into separate inventory slots or a
menagerie on leashes), the excess get skipped.  However, it will use
more lines if they are available.  Prior to a few days ago it was
requiring 17 extra lines and able to show 15 items as full lines only,
unable to take advantage of more lines when available.
2023-12-06 02:19:41 -08:00
Pasi Kallinen
5dc94f3d83 Macro for picking random entry from array 2023-12-05 10:06:27 +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
Alex Smith
7ca9951996 Reduce code duplication in extrinsics-protect-items code
The same checks were being repeated for every damage type; this
sends them through two centralised functions (one for checking
whether an extrinsic blocks a specific instance of item destruction
and one for the enlightenment message), so that new mechanisms of
item destruction prevention will need to change only one point in
the code.
2023-12-05 04:34:24 +00:00
PatR
2d8ba944e1 add some flexibility to TTY_PERM_INVENT
Allow perm_invent to be enabled with 1 less line when statuslines==2
by not reserving a line for statuslines==3.  If the player changes
that from 2 to 3, the perm_invent window is torn down and repositioned
one line lower if that will fit.  If it won't fit, it won't reenable.

Temporarily(?) allow perminv_mode==InUse to be enabled with room for
only 8 lines instead of requiring 15.  It will use more than 8 if are
more rows.

8 happens to be the amount (via 1+21+3+(1+8+1)) that will fit within
35 lines which is the biggest I can make fit on may laptop without
switching to a smaller font.  Switching is a nuisance, worse than that
for the font tiny enough to fit the full perm_invent.

ToDo:  if in-use won't fit in the number of lines allotted, switch to
two columns before resorting to ignoring the excess.

Maybe:  allow fewer lines for full perm_invent too and use the '|'
command to scroll them.  Might be too clumsy to be worthwhile.
2023-12-04 13:20:25 -08:00
nhmall
d52049a5d3 The src/options.c change was unneeded 2023-12-04 16:12:04 -05:00
nhmall
3ca4571011 more SYMBOLS follow-up
missing break
2023-12-04 15:46:24 -05:00
nhmall
4a9d68bf7f symbol parsing follow-up 2023-12-04 15:41:09 -05:00
PatR
df789bc200 fix showing discoveries
A few add_menu_heading() calls were added to the '\' and '`' commands
which use a text window rather than a menu.  For some reason they were
using create_nhwindow(NHW_MENU) but only populating it with text so
the heading lines sent as menu entries were lost.  (Might panic with
Qt; I didn't check.)
2023-12-04 12:18:03 -08:00
nhmall
40d090a2c3 Merge branch 'ice_fumbling' of https://github.com/entrez/NetHack into NetHack-3.7 2023-12-04 15:01:07 -05:00
Michael Meyer
986c8e7ff4 Check whether steed will slip on ice if mounted
If riding over ice, check whether the steed, rather than the hero, is
cold-resistant or floating to determine whether it should slip, since it
is the monster which would actually be in contact with the ice.
2023-12-04 14:52:58 -05:00
Michael Meyer
a15d517326 Refine ice fumbling effects vs mounted hero
Fumbling makes the hero fall from the saddle, but the justification was
weak if the only fumbling source is riding over ice (the messages were
things like "you drop the reins" which made more sense from magical
fumbling).  Make all fumbling from ice alone go into the ice-specific
"slip on the ice" block and add a chance to fall from your mount there.
If fumbling from another source while riding on ice, the hero will
always fall from his steed, since that's what happens on normal floor --
ice had actually been reducing this chance.
2023-12-04 14:40:16 -05:00
nhmall
418953e0e6 symbol parsing improvement
This gets rid of a FIXME and K4056 internal bug report.

Allow the comma to be quoted as follows:
     SYMBOLS=S_ice:\,
or
     SYMBOLS=S_ice:','

Disclaimer:
The use of the comma on the map could conflict with future
use of that currently unused symbol for other intended purposes.
2023-12-04 14:20:07 -05:00
Michael Meyer
05f9950c99 Fix: fumbling vs losing footing in earthquake
Fumbling was apparently meant to make it harder to keep your footing
when an earthquake created a pit under you, requiring a 1/5 roll to
stay upright, but because it was added as an additional OR it actually
just gave the hero an additional (albeit unlikely) chance to retain her
footing.  Make it actually have a negative impact on the hero's ability
to retain his footing rather than a minor boost.
2023-12-04 13:07:43 -05:00
nhmall
b0f5ad13e1 fixes3-7-0.txt catch up 2023-12-04 11:49:39 -05:00
nhmall
7f97d86b40 Merge branch 'fix-zap' of https://github.com/argrath/NetHack into NetHack-3.7 2023-12-04 11:27:58 -05:00
nhmall
d8909ec3d0 comment 1st dereference of otmp in bhitm() 2023-12-04 11:26:50 -05:00
Pasi Kallinen
1c933d689e Remove leftover debug extern define 2023-12-04 17:57:58 +02: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
SHIRAKATA Kentaro
b36d792334 remove unnecessary null-check on bhitm()
`otmp` here is always non-null, otherwise it leads segv at earlier code.
2023-12-04 22:14:37 +09: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
6e785f4d8c uhandedness: include handedness in ^X feedback 2023-12-04 00:17:57 -08:00
PatR
2be47f1d93 options bit: wizweight
Persistent inventory window wasn't being updated right away if the
'wizweight' option was toggled via 'm O'.
2023-12-03 18:22:29 -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
nhmall
3230babae0 uhandedness follow-up
avoid (wielded in right hands)
2023-12-03 20:27:01 -05:00
Alex Smith
495a1a9b07 Tweak to Wizard spellbook knowledge
Wizards now start out recognising all level 1 spellbooks, making
it possible to write a low-level spellbook in order to start
training a spell skill of choice.
2023-12-03 16:16:19 +00:00
nhmall
370b8b2afb update tested versions of Visual Studio 2023-12-03 2023-12-03 02:22:14 -05:00
nhmall
713eafc8c8 reduce flashing w/options simple menu iterations 2023-12-03 01:15:04 -05:00
nhmall
7d22a2c7b9 uhandedness follow-up
boomerang trajectory
bones
2023-12-02 20:25:37 -05:00
Alex Smith
fe2d8faed9 Fix for use-after-free in supply chest generation 2023-12-03 00:50:28 +00: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
nhmall
0c03b9bea6 follow-up: Soundeffect does its own Deaf check
Simplify previous fix, as Soundeffect does its own Deaf checks,
so doesn't need to follow an if-test.
2023-12-02 14:40:18 -05:00
nhmall
e8ebad8db9 fix warnings when no soundlib is included in build
monmove.c: In function ‘postmov’:
monmove.c:1391:65: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
 1391 |                         Soundeffect(se_door_unlock_and_open, 50);
      |                                                                 ^
monmove.c:1410:55: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
 1410 |                         Soundeffect(se_door_open, 100);
      |                                                       ^
monmove.c:1435:60: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
 1435 |                         Soundeffect(se_door_crash_open, 50);
2023-12-02 14:33:47 -05:00
nhmall
a8313d47e5 rearrange some code in makedefs.c
This was a part of an earlier change that was reverted.
Get all the obsolete parts of makedefs arranged so that
they can be disabled simply by not defining
OLD_MAKEDEFS_OPTIONS.

Right now OLD_MAKEDEFS_OPTIONS is defined.
2023-12-02 14:22:18 -05:00
nhmall
3c82780c1c bump patchlevel for u field addition 2023-12-02 11:31:58 -05:00
nhmall
e4e8eea4e8 track the handedness of the hero
Don't make either LEFT_HANDED or RIGHT_HANDED be an advantage
or a disadvantage.

use suggested macros
2023-12-02 11:23:43 -05:00
nhmall
8ee8d89814 optlist.h
Currently, options.c is the only file that #includes "optlist.h".

In theory, if a source file did want to include optlist.h (perhaps
for the struct allopt_t declaration so they could deal with a
pointer to such a struct), they wouldn't be able to include it
because of a static function prototype that it contains.

Add some protection to only include that static function
prototype when optlist.h is included from options.c.
2023-12-02 11:09:41 -05:00
Alex Smith
4a00b66b30 TDTTOE: oil has a higher boiling point and flashpoint than water
As such, it shouldn't be affected by the heat of the ground in
Gehennom (which is hot enough to boil but not to burn). The oil
still heats but won't break its bottle.
2023-12-02 14:25:09 +00: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
87f3b4809f Add extra food rations to the Monk quest home level
The previous commit makes things somewhat harder for vegetarian
characters. Normally, making a conduct harder isn't a huge issue,
but vegetarian Monk is an intended/encouraged combination. As such,
compensate by adding some additional food rations to Monk games
specifically; the Quest home level is early enough to provide the
extra food, and as the level is Monk-specific, it will provide the
food only to Monks specifically.  (Although the Quest generally
requires level 14 to enter, the Quest home level specifically
doesn't.)
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