Commit Graph

255 Commits

Author SHA1 Message Date
PatR
f9a35132d6 crystal helmet
Discussed a long time ago, change helm of brilliance from iron to
crystal so that it doesn't need to be a special case for metallic
armor's affect on spell casting.  It now has a fixed description of
"crystal helmet" but is not pre-discovered.

Add new helm of caution to retain the "etched helmet" description
among the shuffled helms.  Wearing it confers the Warning attribute.
That's fairly lame but not necessarily useless.  It's iron and gets
half the former probability for a random piece of armor being helm
of brilliance so is not likely to be popular.

Helm of caution keeps the old helm of brilliance tile and new helm
of brilliance is basically the same image with different color and
pointed on the top.

Not changed:  the etched helmet was marked as green and is drawn
that way for text but the tile doesn't actually use green for it.
Crystal helmet started as hi_glass (rendered as 'bright cyan') but
has been changed to clr_white to match crystal plate mail.

Old save and bones files are invalidated.
2023-04-29 02:18:29 -07:00
PatR
92daa57395 increment EDITLEVEL for monst->meverseen
It seems unlikely that using a previously unused bit in the monst
structure would introduce any issues with old data, but better safe
than sorry.

Save and bones files are invalidated.
2023-04-22 05:51:19 -07:00
Pasi Kallinen
8b32ae98e9 Add petless conduct
Breaks saves.
2023-04-11 14:21:06 +03:00
Pasi Kallinen
ffb61612e3 Option to create the character deaf
Allows creating your character permanently deaf,
for that added challenge.

Breaks saves.
2023-04-11 13:23:30 +03:00
Pasi Kallinen
aa83dadc1e Add stormy level flag
Which makes clouds create lightning bolts at random.
This flag is used on the plane of air.

Breaks saves and bones.
2023-03-17 20:13:32 +02:00
Pasi Kallinen
4799fc937a Add level flag for plane of fire fumaroles
Also reduce the size of the gas clouds.

Breaks saves and bones.
2023-03-17 19:36:00 +02:00
nhmall
f6562f39b7 bump editlevel 2023-03-05 17:57:03 -05:00
Pasi Kallinen
10df388245 Untrap tip 2023-03-04 11:02:06 +02:00
Pasi Kallinen
08a2a2a1a4 Saving grace
Once per game, if receiving a killing blow from above 90% HP,
allow the hero to survive with 1 HP.
2023-03-03 17:38:48 +02:00
Pasi Kallinen
fc7a32b86e Tutorial level
Add a tutorial level to teach commands to new players.
Very much a WIP.

Breaks save and bones compat.
2023-03-01 14:00:29 +02:00
Pasi Kallinen
5d659cf1f6 Tips and option to disable them
Adds a more general way to handle gameplay tips, and adds
a boolean option "tips", which can be used to disable all
tips.  Adds a helpful longer message when the game goes
into the "farlook" mode.

Also adds a lua binding to easily show multi-line text
in a menu window.

Breaks save compat.
2023-02-19 15:56:18 +02:00
nhmall
709125a915 update patchlevel.h with NetHack 3.6.7 release info 2023-02-16 21:06:06 -05:00
Pasi Kallinen
7401b44fa1 Walls of lava
Add "walls of lava", basically lava which blocks vision and
require a bit more than just levitation or flight to move through.

No levels use this yet, as testing isn't thorough enough.
2023-02-06 19:23:42 +02:00
nhmall
43af05a6b8 Unchanging and improvisations
Adds a reveal.

Increments EDITLEVEL.
2023-02-05 11:32:58 -05:00
Pasi Kallinen
8aff869ef7 Increment editlevel
Commit 0f257ec538 (nhlua.c static analyzer fix) changed
a variable from long to unsigned, but the var is also saved
to the save file, so broke save compat.
2023-01-23 08:05:26 +02:00
Pasi Kallinen
bb8c144809 Level temperature
Allow setting a per-level "temperature": hot, cold, or temperate
via special level flags. Currently it only affects some messages
in Gehennom, but it could be expanded to ice melting, water freezing,
or monster generation, for example.

Invalidates saves and bones.
2023-01-17 20:11:45 +02:00
Pasi Kallinen
6abb12aee0 Lua: Persistent variables
Add a way for the lua scripts to set and retrieve variables
that are persistent - saved and restored with the game.

Invalidates saves.
2023-01-15 10:34:45 +02:00
PatR
85c908cb03 displaying generic objects
Add 17 fake objects to objects[], one for each object class.  All
specific color as gray.  They're grouped at the start--actually near
the start since "strange object" is still objects[0]--rather than
being among the objects for each class.  init_object() knows to start
at [MAXOCLASSES] instead of [0]; other code that loops through every
object might need adjusting.

For potions, non-stone gems, and non-novel/non-Book_of_the_Dead
spellbooks that don't have obj->dknown set, display the corresponding
generic object rather the object itself.  Fixes the longstanding bug
of seeing color for not-yet-seen objects whose primary distinguishing
characteristic is their color.  Walking next to a generic object
while able to see its spot will set dknown and redraw as specific.
It's slightly disconcerting to have objects change as you reach them;
I hope it's just a matter of becoming used to that.  (If there is any
code still changing the hero's location manually instead of using
u_on_newpos(), it should be changed to use that routine.)

Most of the new tiles are just a big rendering of punctuation
characters.  The potion, gem, and spellbook ones could be cloned from
a specific object in their class and then have the color removed.  I
started out that way but wasn't happy with the result.  I'm not
artisticly inclined; hopefully someone else will do better.  Each of
them is preceded by a comment beginning with "#_"; the underscore
isn't required, just being used to make the comments stand out a bit.

Invalidates existing save and bones files.
2023-01-10 14:33:21 -08:00
nhmall
1972c8447f update year in copyright 2023-01-01 17:31:34 -05:00
PatR
249e431e46 new 'sortvanquished' option
Allow the preferred sort order for the vanquished monsters list to
be specified in the run-time config file
|OPTIONS=sortvanquished:X
where X is t, d, a, c, n, or z.  It can also be set to 'A' or 'C'
but those aren't documented and aren't offered as choices when
setting the value interactively, which can be done via 'm O' or by
using 'm #vanquished'.

Guidebook.mn has been updated but Guidebook.tex is lagging again.
2022-12-26 14:56:12 -08:00
nhmall
ad23b4e8e1 grammar: "foo based" to "foo-based"
There seems to be a need to locate these in the distribution every decade or so.
2022-10-30 16:08:14 -04:00
PatR
46f2903d43 missing EDITLEVEL update
The Elbereth fix changed 'struct engr' and should have included an
increment to EDITLEVEL to invalidate old save and bones files.
2022-10-15 06:22:18 -07:00
Michael Meyer
f8ec9dc32e Fix: antigravity trap doors
Trap doors saved their destinations as an absolute level, rather than a
relative one, so if you loaded bones from a special level their
destinations would reflect the dungeon layout from the bones player's
game.  For example, die on the Oracle level, on dlvl5, with a trap door
that goes to dlvl6.  Another player gets those bones on their Oracle
level, which is dlvl8... the trap door would still go to dlvl6.  Pretty
amazing trap door -- something you might see in a funhouse!

Include relative rather than absolute destinations in save and bones
files, much like stairs do, to avoid this problem.

I bumped EDITLEVEL because although this won't break save files in an
obvious way, it will interpret the (absolute) destinations in existing
save and bones files as relative, leading to some crazy long falls. :)
2022-09-22 11:36:47 +03:00
PatR
1df88e4c65 fix #H3820 - vault guard's "I repeat" message
Reported seven and a half years ago:  if you are in a vault but not
carrying any gold and the guard arrives, you're told "Follow me."
Then if you pick up gold while the guard is still in the wall breach
rather than out in the corridor, you would be told "I repeat, drop
that gold and follow me!"  "Repeat" refers to the follow part but
sounds as if it refers to the drop-gold part which isn't actually
being repeated.  Keep track of whether the guard has issued a drop
gold demand and use that to vary the wording of subsequent "I repeat"
message.

Modifies monst->mextra->egd so save and bones files are invalidated.
2022-09-09 11:45:30 -07:00
Pasi Kallinen
a733004912 Remove the per dungeon level door limit
Number of doors in a room-and-corridor style level was fixed
at 120; now the doors-array is dynamically allocated when needed.

Breaks saves and bones.
2022-09-09 19:40:45 +03:00
PatR
75abc65bab pull request #817 - merge scimitar skill w/ saber
Pull request from Kufat:  combine a pair of single item skills into
one skill by changing scimitar to use saber skill and removing no
longer used scimitar skill.

I don't think skill values end up in save files but decided to
increment EDITLEVEL to be safe.

Closes #817
2022-07-23 23:14:12 -07:00
PatR
0059ced578 bump EDITLEVEL
The most recent "simulated mouse" commit included changes to 'struct u'
that should have been accompanied by an increment in EDITLEVEL.  Do the
missing increment now.
2022-07-10 15:43:49 -07:00
nhmall
30b557f7d5 change xchar to other typedefs
One of the drivers of this change was that screen coordinates require a
type that can hold values greater than 127. Parameters to the window
port routines require a large type in order to be able to have values
a fair bit larger than COLNO and ROWNO passed to them, particularly for
their use to the right of the map window.

This splits the uses of xchar into 3 different situations, and adjusts
their type and size:

                        xchar
                          |
               -----------------------
               |          |          |
            coordxy     xint16     xint8

coordxy: Actual x or y coordinates for various things (moved to 16-bits).

xint16:  Same data size as coordxy, but for non-coordinate use (16-bits).

xint8:   There are only a few use cases initially, where it was very
         plain to see that the variable could remain as 8-bits, rather
         than be bumped to 16-bits.  There are probably more such cases
         that could be changed after additional review.

Note: This first changed all xchar variables to coordxy. Some were
reviewed and got changed to xint16 or xint8 when it became apparent that
their usage was not for coordinates.

This increments EDITLEVEL in patchlevel.h
2022-06-30 23:48:18 -04:00
nhmall
b53e76813d bump patchlevel 2022-05-09 09:15:17 -04:00
PatR
44d5be6eb4 autounlock overhaul
This gives the player more control over what autounlock does.  It is
now a compound option rather than a boolean, and takes values of
  autounlock:none
  !autounlock or noautounlock (shortcuts for none)
  autounlock:untrap + apply-key + kick + force (spaces are optional
    or can be used instead of plus-signs, but can't mix "foo bar+quux")
  autounlock (without a value, shortcut for autounlock:apply-key).
Default is autounlock:apply-key.

Untrap isn't implemented (feel free to jump in) so is suppressed from
the 'O' command's new sub-menu for autounlock.  It's parsed and
accepted from .nethackrc but won't accomplish anything.

[Just musing: it should be feasible to kick in direction '.' to break
open a container or #force to an adjacent spot to break open a door.
If that was done, autounlock:kick+force (or more likely autounlock:
apply-key+kick+force when lacking a key) would resort to force if hero
couldn't kick due to wounded legs or riding.

This changes struct flags so increments EDITLEVEL again.

This includes pull requests #750 from entrez and #751 from FIQ but was
entered from scratch rather than using use their commits.

Closes #750
Closes #751
2022-05-04 19:13:28 -07:00
PatR
0efa1d60b7 fix compatability checking for development
It is astounding that after all this time no one noticed that
incrementing EDITLEVEL wasn't doing the job it's intended to do.
Diagnosed by entrez:  since VERSION_COMPATIBILITY was defined as
3.7.0-0 and up, increasing the fourth component wasn't resulting in
old 3.7.0-x files being rejected.

This increments EDITLEVEL yet again, because my testing after
commenting out VERSION_COMPATIBILITY still wasn't rejecting older
files.  Proably because the oldest I had available already had the
verison info with the preceding EDITLEVEL so weren't actually out
of date yet.

Once I had old files be rejected, I discovered that the rejection
message was invisible (for tty on OSX).  The message line showed
spaces, matching the length of the intended message, followed by
--More--.  This fixes that too.
2022-04-29 22:37:13 -07:00
PatR
5d56da3d32 bubble/cloud save/restore overhaul
The air bubbles on the Plane of Water and the clouds on the Plane of
Air were being saved and restored as part of the current level's state
(which is the 'u' struct and invent and such) rather than with the
current level itself.  That was ok for normal play, but for wizard
mode's ^V allowing you to return to a previously visited endgame level
after moving to a different one it meant a new set of bubbles for
Water and new set of clouds for Air.  Even that was ok since it only
applied to wizard mode, but using #wizmakemap to recreate Water or Air
while you were on it added a new set of bubbles or clouds to the
existing ones.  If repeated, eventually there wouldn't be much water
or air left.

Instead of just adding a hack to #wizmakemap, change save/restore to
keep the bubbles/clouds with the level rather than with the state.
That wasn't trivial and now I know why the old odd arrangement was
chosen.  Saving hides u.uz by zeroing it out for levels that the hero
isn't on and it is zero during restore so simple checks for whether a
given level is water or air won't work.

This also adds another non-file/non-debugpline() use of DEBUGFILES:
 DEBUGFILES=seethru nethack -D
will make water and clouds be transparent instead of opaque.  It also
makes fumaroles and other light-blocking gas clouds be transparent
which wasn't really intended, but avoiding it would be extra work that
doesn't accomplish much.

Increments EDITLEVEL for the third time this week....
2022-04-29 12:44:26 -07:00
PatR
d1217b9f25 add glyphs+tiles for door+chest traps
When trap detection finds trapped doors and trapped chests, it shows
those as bear traps.  When the hero comes within view, they revert to
normal and the detected trap is forgotten.  This doesn't change that,
it is just groundwork to be able to show them distinctly.  Like the
TT_BEARTRAP patch, it increments EDITLEVEL so this seemed like a good
time to put the groudwork in place.

There shouldn't be any visible changes even though internal glyph and
tile values have been renumbered after inserting two new entries.
Adding traps after S_vibrating_square was quite a hassle and suffered
though a couple of off-by-one errors that weren't trivial to find and
fix.
2022-04-27 11:22:12 -07:00
PatR
d194459c7d u.utraptype, TT_BEARTRAP
Add 'FIXME' fix by entrez to change TT_BEARTRAP to non-zero.

Increments EDITLEVEL, invalidating existing save and bones files.
2022-04-27 11:04:12 -07:00
PatR
77dc522a62 artifact tracking again
Redo the recent artifact creation stuff by replacing several nearly
identical routines with one more general one.  Also adds a tracking
bit for one or two more creation methods.  That changed artiexist[]
from an array of structs holding 8 or less bits to one holding 9, so
bump EDITLEVEL in case the total size changed.
2022-03-12 17:25:54 -08:00
PatR
2d977a5d48 keep track of how artifacts got created
Since the struct used for elements of artiexist[] has a lot of unused
bits, add some new ones to extend it to indicate how artifacts have
been created.  It had
| .exists (has been created) and
| .found (hero is aware that it has been created)
introduce
| .gift (divine gift),
| .wish (player wish),
| .named (naming elven weapon Sting or Orcrist)
| .viadip (made Excalibur by dipping long sword into fountain)
| .rndm (randomly created), and
| .bones (from bones file--how it got created in earlier game isn't
tracked).  The first four are implemented, fifth and sixth aren't.

Some of the feedback when receiving an artifact or spellbook has been
revised.

When artiexist[] was changed from an array of booleans to an array of
structs a couple of days ago, EDITLEVEL should have been incremented
but I overlooked that at the time.  This commit does so now.
2022-03-09 16:11:14 -08:00
PatR
74c4ee89cc EDITLEVEL increment
The change to report which item was acquired in the logged event for
Sokoban completion changed the context struct so changed the contents
of save files but neglected to update EDITLEVEL to reject old save
files.  Do so now.
2022-03-04 19:39:45 -08:00
Pasi Kallinen
03c715f179 Add paranoid:swim to prevent typoing into water or lava
In the name of accessibility: Prevent moving into dangerous liquids.

Now with themed rooms, water and lava are more common, and it's
unreasonable to expect blind players to check every step for those.
With paranoid:swim, just prevent normal walking into those liquids,
unless you prefix the movement with 'm', or if the liquid would not
harm you.

Doesn't completely prevent an accidental dunking - for example
if the hero is impaired or couldn't see the liquid.

This comes from xNetHack by copperwater <aosdict@gmail.com>
with some changes to the code.
2022-02-12 17:29:32 +02:00
PatR
96ba3c04d1 logging experience level changes again
The livelog message for losing a level had an off-by-1 error, showing
the level the hero ended up at rather than the level that was lost.

There was a message for regaining a previously lost level when rank
title stayed the same but no such message if the title changed (the
achievement of gaining a particular title only occurs once).

Say "regained" rather than "gained" when gaining a previously lost
level.  (Blessed potions of full healing regain levels but can also
reduce u.ulevelmax so a different way to remember peak experience
level has been added.)

Report level change due to polymorphing into new man/woman/elf/&c.
I hadn't realized that that hasn't been recording achievement for new
rank when applicable and decided to leave things that way.

Report gender change when putting on an amulet of change or becoming
a new man/&c unless hero is polymorphed at the time or experience
level is also changing.
2022-02-10 05:45:07 -08:00
Pasi Kallinen
1e90f89203 Chronicle of major events, and livelog
Log game events, such as entering a new dungeon level, breaking
a conduct, or killing a unique monster, in a new "Major events"
chronicle. The entries record the turn when the event happened.
The log can be viewed with #chronicle -command, and the entries
also show up in the end-of-game dump, if that is available.

This feature is on by default, but can be disabled by
defining NO_CHRONICLE compile-time option.

This also contains "live logging", writing the events as they
happen into a single livelog-file. This is mostly useful for
public servers. The livelog is off by default, and must be
compiled in with LIVELOG, and then turned on in sysconf.

Mostly this a version of livelogging from the Hardfought server,
with some changes.
2022-02-09 22:49:25 +02:00
nhmall
7b8309f178 update patchlevel.h copyright 2022-01-04 00:08:12 -05:00
PatR
5fbe1de2a7 hero_seq
'moves' is actually turns and there hasn't been any straightforward
way to track actual hero moves.  Add hero_seq for that.  It isn't a
counter but is distinct each time the hero makes a move.  I wanted
it for curses ^P support but so far use it for checking stethoscope
usage and for shopkeeper behavior when items in a shop are broken by
the hero.

Increment EDITLEVEL due to change in save file contents.
2021-12-26 00:16:55 -08:00
PatR
936be565d9 tracking peak maximum HP and energy
Keep track of the highest value that u.uhpmax and u.uenmax have
attained, in new u.uhppeak and u.uenpeak.  They aren't used for
anything yet.  u.mhmax (max HP while polymorphed) isn't interesting
enough to track.

Not save and bones compatible so increments EDITLEVEL.
2021-12-04 05:19:45 -08:00
PatR
e2ca016484 decaying globs of {ooze,pudding,slime}
Globs never rotted away but did become tainted after a relatively
short while, which seemed like a contradiction.  Change them to never
be tainted but shrink by 1 unit of weight approximately every 25
turns.  An ordinary glob (one that hasn't combined with any others)
starts out weighing 20 units, so it takes about 500 turns to vanish.
That's roughly twice as long as a corpse takes to rot away.

Shrinking globs give feedback when in hero's invent or in a container
in hero's inventory, but rarely (when going from an exact multiple
of 20 weight units; that is, from integral number of N globs to
N-1 + 19/20, or if weight reduction triggers an encumbrance change).
When a glob goes away completely, there is feedback for those two
circumstances and also for seeing the glob vanish from the floor.

I haven't touched how much nutrition eating a glob confers.  I have
changed formatting of glob names to use "small", "medium", "large",
"very large" instead of "small", [no adjective], "large", &c.  You
still need to have at least five globs coalesced together for the
adjective to become "medium", same amount as before.

I don't think EDITLEVEL needs to be modified but have incremented it
anyway to play things safe.
2021-11-06 18:24:36 -07:00
PatR
da859c5eb8 fix github issue #623 - soldiers and mattocks
Reported by eakaye.  Selection of equipment when creating a soldier
or watchperson can pick a polearm, but random selection among those
had a chance to choose dwarvish mattock which doesn't use polearms
skill and isn't appropriate for a human soldier or watchperson.
Not mentioned, but lance was in the same boat.

Change the selection to only pick something which uses polearms
skill, then make that moot by moving lance and dwarvish mattock out
of the midst of the polearms so that they're no longer candidates
for special case rejection.

A couple of other things which might have had a similar issue were
already ok.  Giving a polearm when creating a troll selects between
a few choices rather than among all the polearms.  And wishing for
"polearm" only considers items which use polearms skill.

While changing objects.h to reorder the two non-polearms, I removed
a bunch of tabs that were present in the scroll definitions.

EDITLEVEL is incremented due to objects[] reordering, so existing
save and bones files will be invalidated.

Fixes #623
2021-10-27 15:36:32 -07:00
nhmall
39713783d1 some trailing whitespace in src, include 2021-10-16 12:12:21 -04:00
PatR
d9bbad8e6e fix github issue #606 - shop wall repair
triggering an impossible warning about "wall_angle: unknown" due
to the known conflict between door state and wall info which both
overlay the flags field for map locations.

Reported and diagnosed by vultur-cadens:  if a shop's wall was dug
open, followed by use of locking magic to plug the gap with a door,
and then unlocking that door, the D_CLOSED door flag was left as
invalid wall_info when shop damage was repaired.  Map re-display
complained.  Leaving the door locked or opening it after unlocking
did not result in any complaint because the values for those door
states do not conflict with wall angle values.

The problem was reproducible and is now fixed by adding an extra
field to the shop damage structure.  A similar change has been
made to the vault guard's 'fake corridor' structure but I have no
test case for that so don't know whether it makes any difference.
At least it doesn't seem to have broken anything.

Existing save and bones files are invalidated by the fixes.

Fixes #606
2021-10-15 15:43:23 -07:00
nhmall
57644e1f33 bump editlevel 2021-09-20 21:19:39 -04:00
Pasi Kallinen
b30061b5ad Allow dropping just picked up items
When using a menu to drop or put in items into a container,
allow putting in the item (or items) you picked up previously,
by selecting the 'P' entry from the item class menu

Inspired by the itemcat patch by Stanislav Traykov.

Invalidates saves and bones.
2021-09-17 21:00:06 +03:00
PatR
583fb60835 fix github issue #587 - incompatible save files
Save files from before the 'disambiguate WHACK' patch were not
necessarily compatible with ones after it, leading to potential
restore problems.

Comments in objclass.h (from before the patch) suggested that
inappropriate assumptions were being made about field layout.
This deliberately introduces new incompatibility and increments
EDITLEVEL to caused earlier save and bones files to be thrown
away.

Fixes #587
2021-09-12 05:31:01 -07:00