Commit Graph

196 Commits

Author SHA1 Message Date
Pasi Kallinen
396b819988 Add safe_wait to toggle search and wait prevention 2020-10-02 19:00:40 +03:00
PatR
5df5079700 peacefuls witnessing attack against peaceful mon
The short exclamations ("Gasp!", "Why?", &c) led to ambiguity
about which monster was vocalizing them.  Use full sentences
which refer to the speaker.  It can become quite a bit more
verbose but is less likely to lead to confusion.  Perhaps it
should cut those off after a modest number of them have been
issued?
2020-09-24 00:44:07 -07:00
PatR
afbcf3f9a9 monk's to-hit penalty for wearing a suit
If hero is a monk who is wearing a suit, have ^X mention the to-hit
penalty for that in the status section even though it isn't a normal
status line item.  Combat feedback makes it annoyingly obvious, but
player might forget if MSGTYPE=hide is used to suppress the "Your
armor is rather cumbersome..." message.
2020-07-20 03:00:28 -07:00
nhmall
5a437b336a remove SYSFLAGS and MFLOPPY code
A check into github issue 364 confirmed that
ba6edbe5dc
had incorrectly updated the bwrite sizeof entry for sysflags.

The SYSFLAGS and MFLOPPY code is all in the outdated part of the tree, so just
remove it rather than re-correct it.

Closes #364
Closes #207
2020-07-05 08:50:13 -04:00
nhmall
e4b18f0545 fix github issue 361 to make user_sounds useful even if MSGTYPE is hidden
fixes #361

Also, experminental introduction of vt_sounddata to enable tty to pass
a sound file index to the terminal side of things where perhaps someone
can add code to something like hterm to take the information relayed by
NetHack to trigger user_sounds locally even if playing on a server.

Compile time option TTY_SOUND_ESCCODES required to build that support in.

It should be independent of TTY_TILE_ESCCODES.
2020-07-02 15:49:45 -04:00
PatR
c17301a75c Sting vs level teleport revisted
This reverses all of c67f1dd710
except for the fixes37.0 entry and does a better job in a cleaner
fashion.  If Sting is going to start glowing and "you materialize
on a different level" is pending, give the materialize message
before the glowing message.  Otherwise handle both stop-glowing
and/or you-materialize in the normal fashion.
2020-04-27 10:49:34 -07:00
PatR
c67f1dd710 Sting vs level teleport's "materialize" message
When level teleporting, Sting/Orcrish/Grimtooth would start or stop
glowing based on occupants of the new level before "you materialize
on another level".  That wasn't necessarily incorrect for the glow
stopping but was clearly wrong for it starting.  This fix uses a flag
as a hack to avoid finding and changing all the calls to docrt() and
see_monsters().  It ought to be fixed properly....
2020-04-27 05:09:19 -07:00
PatR
2e177a7fc4 fix gibhub issue #320 and more - 'mention_decor'
Fixes #320

Avoid giving "you are back on the bottom" nearly every step when
moving around underwater.

Avoid "you are back on floor" followed by "you trip over <object>"
when fumbling in case that fumbling was due to being on ice when
taking the step to floor.  Done for all fumbling rather than just
one-turn fumbling instigated by ice.

When moving from ice or water to ground, show "you are back on floor"
before listing objects at that spot instead of after.

I think there was at least one more thing but have lost track.  At
any rate, 'mention_rate' potentially has a new set of bugs.
2020-04-08 18:33:55 -07:00
PatR
b37b9f25ce mention_decor vs Underwater or drowning escape
Avoid redundant
|You are on solid land again.
|You are back on floor.
when walking or teleporting out of water with the mention_decor option on.
2020-04-03 10:41:30 -07:00
nhmall
5d310d815d options follow-up: fix up duplicate_option_detection and !pet 2020-02-29 17:54:41 -05:00
PatR
cbe27c7702 unseen pet drowning
The "you have a sad feeling for a moment" message was only given when
one monster kills another (and the latter is an unseen pet).  Give it
for drowning too.  There are probably a bunch of other circumstances
which warrant it as well but I've settled for handling minliquid().
2020-02-13 15:38:59 -08:00
PatR
6c479f2317 more simplification of achievement tracking
Instead of hardcoding the "prize" type and then watching for that
to be created, specify it in the level description.

Also, instead of giving both Sokoban end levels 50:50 chance for
either prize, bias the one that used to always have the bag of
holding to now have 75% chance for that and 25% chance for amulet
of reflection, with the other one having those chances reversed.
So still 50:50 overall.
2020-01-30 17:35:32 -08:00
PatR
ea8248e3c6 new 'mention_decor' option
Somewhat similar to 'mention_walls', 'mention_decor' is a way to
request additional feedback when moving around the map.  It reports
furniture or unusual terrain when you step on that.  Normally stepping
on furniture only mentions it when it is covered by object(s).  And
moving onto (rather than into) water or lava or ice doesn't bother
saying anything at all.  With the new option set there will be a
message.  It uses Norep so won't repeat when moving from one water
spot to another or one lava spot to another or one ice spot to another
unless there has been at least one intervening message.  There is also
a one-shot message when moving from water or lava or ice onto ordinary
terrain (not Norep, just once since there's no land to land message).

Having the verbose flag Off doesn't inhibit these new messages but it
does shorten them: "A fountain." instead of "There is a fountain here."

The Guidebook gets a new subsection "Movement feedback" of the "Rooms
and corridors" section and it covers more than just 'mention_decor'.
As usual, Guidebook.tex is untested.

'mention_decor' persists across save/restore, so 'struct flags' has
changed and EDITLEVEL is being bumped, hence save files are invalided.
2020-01-29 09:47:36 -08:00
Ray Chason
9460796a2b MSDOS/VESA: Add video_width and video_height
To be used to set the video mode
2020-01-27 09:54:58 +02:00
PatR
d19cab4d98 implicit_uncursed, mention_walls
Move 'implicit_uncursed' and 'mention_walls' from iflags to flags to
make their current setting persist across save/restore.  Invalidates
existing save files.
2020-01-17 04:03:14 -08:00
nhmall
90f2af5277 merge bit 2019-12-27 09:02:51 -05:00
nhmall
b241945672 Merge branch 'NetHack-3.7' 2019-12-27 08:52:42 -05:00
nhmall
a034e8200c centralize the invert decision logic to avoid updates to 7 ports
This will make it easier to tinker for best results.
2019-12-23 21:44:34 -05:00
PatR
c3fb94104b 'quick_farsight' option
Bite the bullet and add a special purpose boolean option to control
game behavior for random clairvoyance.  When objects or monsters are
discovered, it normally issues "you sense your surroundings" and
performs a getpos() operation which allows the player to browse the
map by moving the cursor around and getting 'autodescribe' feedback.
But there have been complaints that once the hero has the Amulet
(which triggers random clairvoyance even though hero isn't flagged
as having that attribute) the message and pause-to-browse become too
intrusive.

This was initially combined with the 'timed clairvoyance' fix because
they both bump EDITLEVEL to invalidate existing save files, but their
details don't interact so I separated them.
2019-12-22 13:40:59 -08:00
copperwater
277dcc05b5 Port the autounlock feature, hallucinatory trap names from UnNetHack
This adds a boolean option, autounlock, defaulting to true. When this is
set to TRUE, messages stating that some door or container is locked are
automatically followed by a prompt asking if you would like to unlock
it, if you are carrying an unlocking tool (key, lock pick, or credit
card).

Architecturally, this extends the pick_lock function to take three
additional arguments (door coordinates or a box on the ground you are
autounlocking).

The code that selects an unlocking tool will always look first for a
skeleton key, then a lock pick, then a credit card. Since curses, rust,
and other attributes don't really have an effect on the viability of the
unlocking device, it didn't seem to warrant making a more complex
function for that.

Add hallucinatory trap names

This adds many funny, realistic, and nonsensical traps to the game, to
be shown when the player is hallucinating.

Architecturally, the biggest change is merging the what_trap macro and
the "defsyms[trap_to_defsym(ttyp)].explanation" pattern into a single
function "trapname", which returns the name of the trap, handling the
hallucination case. There is also a second parameter used for overriding
hallucination in the occasional cases where the actual trap name should
always be returned.

In addition, the what_trap and random_trap macros are now obsolete and
not used anywhere, so they are removed.

reinstate anti-rng abuse bit on hallucination

updates to hallucinatory trap names and fixes37.0 entry
2019-12-19 18:52:23 -05:00
PatR
adc455129d 3.7: goldX and other stuff
Move option variable goldX (True: treat gold as BUC unknown, False:
treat gold as uncursed during BUCX filtering) from iflags to flags
so that it persists across save/restore.

Get rid of a few obsolete things from struct flags.

Try to make the 'cursesgraphics' option work although I don't think
that it was ever functional enough for anybody to use so probably
could have been removed instead.

Bump EDITLEVEL; any current save files are invalid.

Demote status from Beta to Work-in-Progress.

I modified src/sfdata.c manually (not included here) to get a full
build.  The Unix Makefile.src needs to be taught when and how to
regenerate it.
2019-11-28 15:00:54 -08:00
nhmall
5847806104 Merge branch 'NetHack-3.6' 2019-11-27 23:07:29 -05:00
PatR
7ca572eb60 paranoid_confirmation:eating
Add 'eating' (synonym 'continue') to the list of things that can be
set via paranoid_confirmation to require "yes" instead of "y" when
the user is prompted about something, in this case "Continue eating?".

dat/opthelp was missing a few of the paranoid_confirmation choices.
2019-11-27 16:27:13 -08:00
nhmall
900a826e8e Merge branch 'NetHack-3.6' 2019-11-11 14:32:09 -05:00
nhmall
6dfbff9d4b --showpaths wasn't returning the paths if there was an error in a config file
Also,
Windows only: Introduces some environment variable substitution for paths
specified in a config file
2019-11-11 12:49:54 -05:00
nhmall
642f698a7a Merge branch 'NetHack-3.6' 2019-10-01 20:44:57 -04:00
nhmall
29946b551b autopickup exception priority in pull request 226
The pull request #226 commentary follows:

One major limitation of the autopickup exception system is that you can't
define an exception from an exception, despite both menucolors and msgtypes
prioritizing rules based on the order they are defined in .nethackrc. This
is because the "always pickup" and "never pickup" exceptions are tracked in
different lists, and at runtime, when the player steps over an object, the
game checks these lists seperately, with "never pickup" taking precedence.
This means that if you want to pick up some but not all items matching a
given expression, you may need to write a long and kludgy list of regexes
to get the behavior you want.

I've edited the autopickup exception code to remove this necessity: now
the exceptions are stored in one list, and conflicts between them are
resolved based on their relative position in that list. Whether an
exception was inclusive or exclusive was already tracked individually;
I don't know why they were stored separately in the first place. This
edit makes the system both more convenient and more consistent with the
semantics of menucolors and msgtypes.

With these changes, the 33 autopickup exception rules in the wiki article
linked above may be replaced with the following 7 much simpler rules for
the exact same effect:

AUTOPICKUP_EXCEPTION=">.* corpse.*"
AUTOPICKUP_EXCEPTION="<.* newt corpse.*"
AUTOPICKUP_EXCEPTION="<.* lichen corpse.*"
AUTOPICKUP_EXCEPTION="<.* lizard corpse.*"
AUTOPICKUP_EXCEPTION="<.* floating eye corpse.*"
AUTOPICKUP_EXCEPTION="<.* wraith corpse.*
AUTOPICKUP_EXCEPTION=">.*\>.*"

closes #226
2019-09-30 10:54:03 -04:00
HMM
234e5f38f2 Clean up stray comments 2019-09-24 20:05:37 -04:00
HMM
098e3e5b3e Merging in autopickup exception rework 2019-09-24 19:12:54 -04:00
HMM
2fb9cf7a1c Rework autopickup exceptions to override one another like menucolors 2019-09-24 18:20:49 -04:00
nhmall
7ab824eb40 Merge branch 'NetHack-3.6' 2019-09-23 20:46:38 -04:00
PatR
348f968132 fix add_to_minv panic when aklys kills enfulger
Reported directly to devteam rather than via the web contact form:
throwing wielded aklys while swallowed would hit the engulfer and
return to the hero's hand but leave a stale 'thrownobj' pointer if
the monster survived.  Under usual circumstances, throwing anything
else or throwing the aklys again when not engulfed would clear that
pointer, putting things back to normal.  However, killing any engulfer
with the same weapon would try to add it to engulfer's inventory to
be dropped as it died.  If the killing blow was via melee rather than
another throw, the object in question would still be in hero's
inventory instead of free, hence panic.

The initial returning-aklys implementation shared Mjollnir's code
which doesn't have this issue.  This reverts from having attached
aklys always returning successfully when thrown while swallowed to
Mjollnir's 99% chance of return and 99% to be caught when it does
come back.  (That was already the case if the engulfer was killed by
the throw, where hero wasn't swallowed anymore after the damage was
inflicted.)
2019-09-23 15:16:39 -07:00
Bart House
cd1b650fb7 Merge branch 'NetHack-3.6'
# Conflicts:
#	DEVEL/Developer.txt
#	include/config.h
#	include/decl.h
#	include/display.h
#	include/extern.h
#	include/global.h
#	include/hack.h
#	include/patchlevel.h
#	src/display.c
#	src/dothrow.c
#	src/makemon.c
#	src/monst.c
#	src/objnam.c
#	src/sp_lev.c
#	src/wield.c
#	src/zap.c
#	sys/share/pmatchregex.c
#	sys/winnt/Makefile.msc
2019-07-14 23:36:56 -07:00
Bart House
4c1c247028 Revert "Fuzzer improvements."
This reverts commit 435f1c4626.
2019-07-14 21:10:39 -07:00
nhmall
041a9ad9c1 Merge branch 'master' into NetHack-3.7 2019-07-14 09:57:32 -04:00
nhmall
ec1b77ff80 Merge branch 'NetHack-3.6' 2019-07-14 09:39:24 -04:00
Bart House
435f1c4626 Fuzzer improvements.
phase_of_moon and friday_13th determined using rn2() instead of local
time if fuzzing.  Don't reseed using init_random() if fuzzing.  Allow
set_random to be called outside of hacklib.  rn2_on_display_rng uses
rn2 if fuzzing so that we have a single source of random that we can
ensure is reproducible.  Implement rul() that returns a random unsigned
long.  Fix bug in fuzzer handling of ntposkey which would cause us to use
unitialized values for x and y.  Added command line arguments to allow
auto starting and stopping of fuzzer.  Add a logging facility for the
fuzzer to use to record activity.  Added some scripts used to automate
fuzzer testing on windows.
2019-07-14 00:20:09 -07:00
nhmall
01667d3a2e Merge branch 'master' into NetHack-3.7 2019-07-07 22:01:44 -04:00
nhmall
ae33500409 Merge branch 'NetHack-3.6' 2019-07-07 21:58:25 -04:00
PatR
ceb2d51426 ^X/disclosure of night, moon, Friday 13th
For ^X and final disclosure, report external issues that affect game
play:  midnight, other night, new or full moon, and Friday the 13th.

The 'new feature' entry in the fixes file rambles a bit but if it
heads off even one spurious bug report, it'll have been worth it.
2019-07-07 13:52:24 -07:00
nhmall
dedff68f5a remove a 3.6 save file compat kludge and clear another warning 2019-06-25 10:20:06 -04:00
nhmall
bfc4445537 Merge branch 'NetHack-3.6' 2019-06-05 08:08:32 -04:00
PatR
ac79fedf60 fix github issue #196 - green slime feedback
Fixes #196

If you didn't die from turning into green slime but then died because
green slimes had been genocided, the message given assumed that you
had just seen "OK, you don't die" from answering No to "Really die?".
Its wording didn't make sense if the reason you didn't die was an
amulet of life-saving.  Give a different message for that case.

Also, if you survive turning into slime (via either method) and either
green slimes are still around or you answer No to "Really die?" when
they've been genocided, give a message after "You survived that attempt
on your life" pointing out that you have done so in green slime form.
Useful since prior to 3.6.2 you would have reverted to original form--
despite the Slimed countdown saying you had turned into green slime.
2019-06-04 09:16:00 -07:00
nhmall
abfd80d3d7 Merge branch 'NetHack-3.6.2' 2019-04-02 12:25:16 -04:00
PatR
72696a36a5 build fix for X11-only
I didn't noticed this because I've been building for tty+curses+X11
and either of the first two cause iflags.extmenu to exist.  Make it
unconditional; there's not much benefit from trying to suppress it
for configurations that don't need it.
2019-04-01 14:56:00 -07:00
PatR
0a847f46f9 streamlined status update for 'time'
When the 'time' option is on and context.botl isn't already set,
call a simpler status update routine that ignores all other fields.
When that flag is already set, full status update takes care of time
along with the other fields.

Expected to reduce bottom lines processing time but not screen I/O.
Only lightly tested.
2019-03-31 08:23:36 -07:00
nhmall
c3b89f775e Merge branch 'NetHack-3.6.2' 2019-03-21 18:18:34 -04:00
PatR
5efea7115a curses options and status groundwork
More groundwork for overhauling the status display for curses, plus
a few functional changes.  It was doing a full status update for
every changed field (except conditions), instead of waiting for a
flush directive after gathering multiple changes at a time.  Since
it already does gather every change, the fix to wait is trivial.

This decouples 'hitpointbar' from 'statushilites'.  When highlighting
is off, it uses inverse video only.  When on, it behaves as before:
using inverse video plus the most recent color used to highlight HP
(which can vary if that has rules to highlight changes or percentage
thresholds) but ignoring any HP attribute(s).  This also enables the
latent 'statuslines' option and changes 'windowborders' option from
being settable at startup only to changeable during play.

'statuslines' can have a value of 2 (the default) or 3 and applies to
'align_status:bottom' or 'top'; it's ignored for 'left' and 'right'.
At the moment, setting it to 3 only allows status condition overflow
to wrap from the end of line to 2 to the beginning of line 3, and if
window borders are drawn they'll clobber the last character on line 2
and first one on line 3.  There's no point in trying to fix that
because it will go away when the main status overhaul changes go in.
Condition wrapping for vertical orientation (left or right placement)
was already subject to the same phenomenon and will be superseded too.

This also changes the meaning of the 'windowborders' value so could
impact players using source from git (or possibly beta binaries for
Windows, but not for OSX where curses interface wasn't included).
Old:
 0 = unspecified, 1 = On, 2 = Off, 3 = Auto (On if display is big
     enough, Off otherwise; reevaluated after dynamic resizing);
 Unspecified got changed to 3 during curses windowing initialization.
New:
 0 = Off, 1 = On, 2 = Auto;
 0 gets changed to 2 for default value at start of options processing.
So old value of 2 is changing meaning and explicit old value of 3 is
becoming invalid.  Implicit 3 changes to default 2.  Explicit 3 could
be the subject of a fixup but there isn't much point since 2 can't
have a similar fix.  Users who are using old 2 or explicit 3 will need
to update their run-time config files.

This adds 'statuslines' to the Guidebook and moves some other recently
added documentation of curses options from among the general options
(section 9.4) to "Window Port Customization options" (section 9.5).
None of them have been added to dat/opthelp which seems to be missing
all the wincap options.

Originally I made a lot of changes (mostly moving C99 declarations to
start of their blocks) to the old '#if 0' code at end of cursstat.c,
but have tossed those, except for one subtle bug that assumed 'int'
and 'long' are the same size.
2019-03-21 14:33:39 -07:00
Bart House
74edf42f1c Moved decl.c globals into instance globals. 2018-12-22 18:44:22 -08:00
Bart House
f1e48cddfe artifact.c, cmd.c and makemon.c globals moved to instance_globals. 2018-12-19 20:01:55 -08:00