Commit Graph

1678 Commits

Author SHA1 Message Date
nhmall
74a5339a5e housekeeping updates for 3.6.4
typos

README update
2019-12-17 14:11:52 -05:00
nhmall
90e4ffc0a0 flying hero should be able to pass through a hole using '>' 2019-12-17 11:32:25 -05:00
nhmall
ac6e13fd7a allow run-from-removable-device configuration on Windows
Allow a way to configure NetHack to run entirely from a USB stick
or other removable device in a way that allows everything to
reside entirely on the USB stick, and nothing on the computer's
hard drive. That could be done in versions prior to 3.6.3.

Sample:

i: is a USB stick

i:\nhdist contains the NetHack Windows distribution and a sysconf
file dropped into that distribution with the following entry in it:
	portable_device_top = nethack

No device is included in the portable_device_top entry, the device
is always the device that the nethack exe resides on. If you try
to specify a device in the portable_device_top path, the device
portion will be ignored.

portable_device_top specifies the folder on the device that is writable
by NetHack and as such it cannot be the same folder that the executable
resides in.

i:\nhdist\nethack --showpaths
Variable playground locations:
    [hackdir   ]="i:\nethack\"
    [leveldir  ]="i:\nethack\"
    [savedir   ]="i:\nethack\"
    [bonesdir  ]="i:\nethack\"
    [datadir   ]="i:\nhdist\"
    [scoredir  ]="i:\nethack\"
    [lockdir   ]="i:\nethack\"
    [sysconfdir]="i:\nhdist\"
    [configdir ]="i:\nethack\"
    [troubledir]="i:\nethack\"
NetHack's system configuration file (in sysconfdir):
    "i:\nhdist\sysconf"
The loadable symbols file (in sysconfdir):
    "i:\nhdist\symbols"
Basic data files (in datadir) are collected inside:
    "i:\nhdist\nhdat363"
No end-of-game disclosure file (disabled).
Writable folder for portable device config (sysconf portable_device_top):
    "i:\nethack\"
Your personal configuration file (in configdir):
    "i:\nethack\.nethackrc"

Without that sysconf file in the NetHack distribution folder on the
USB stick with the 'portable_device_top = '  entry, the paths
return to the default locations for 3.6.3 on Windows:

i:\nhdist\nethack --showpaths
Variable playground locations:
    [hackdir   ]="C:\Users\JaneDoe\NetHack\3.6\"
    [leveldir  ]="C:\Users\JaneDoe\AppData\Local\NetHack\3.6\"
    [savedir   ]="C:\Users\JaneDoe\AppData\Local\NetHack\3.6\"
    [bonesdir  ]="C:\ProgramData\NetHack\3.6\"
    [datadir   ]="i:\nhdist\"
    [scoredir  ]="C:\ProgramData\NetHack\3.6\"
    [lockdir   ]="C:\ProgramData\NetHack\3.6\"
    [sysconfdir]="C:\ProgramData\NetHack\3.6\"
    [configdir ]="C:\Users\JaneDoe\NetHack\"
    [troubledir]="C:\Users\JaneDoe\NetHack\3.6\"
NetHack's system configuration file (in sysconfdir):
    "C:\ProgramData\NetHack\3.6\sysconf"
The loadable symbols file (in sysconfdir):
    "C:\ProgramData\NetHack\3.6\symbols"
Basic data files (in datadir) are collected inside:
    "i:\nhdist\nhdat363"
No end-of-game disclosure file (disabled).
Your personal configuration file (in configdir):
    "C:\Users\JaneDoe\NetHack\.nethackrc"
2019-12-17 00:41:55 -05:00
nhmall
7a3ce901ab make this branch recognizable for post-3.6.3 patch commits and patch tests 2019-12-06 16:35:47 -05:00
nhmall
d4885095ad Merge branch 'stuff-to-merge-at-3.6.3-release' into NetHack-3.6 2019-12-05 16:38:10 -05:00
nhmall
4868f83db1 more self-recover prompting cleanup (tty) 2019-12-04 13:10:12 -05:00
nhmall
cfb382c626 more prep bits 2019-12-04 11:51:24 -05:00
nhmall
491b885777 more prep work 2019-12-04 11:46:15 -05:00
nhmall
ea2b8a90ee remove conflicting prototype declared for getlock in ntconf.h with mingw build 2019-12-04 04:46:41 -05:00
nhmall
5c57804a97 fix self-recover prompting on windows
the prompting on Windows wasn't working correctly if a prior game had crashed
and the self-recover feature was trying to kick in. This impacts tty, curses,
and mswin (GUI).
2019-12-03 23:32:12 -05:00
nhmall
8a7ec78d17 add code support to make keypad behave better with swap_yz option
This is being committed commented out in include/ntconf.h.
2019-12-02 22:55:48 -05:00
nhmall
d2d40289e6 update and/or clarify some version references 2019-12-01 19:07:28 -05:00
nhmall
42a13a1198 has_color() performance fixes
Performance profiling showed that multiple strcmpi() calls were
occurring each and every time a character was going to the map.

This update:
- honors the WC_COLOR capability
- It allows a window-port to control individual color availability should the window-port wish to do so.
- Makes checking on the individual colors for the active window-port is a straightforward table lookup at the CLR_ offset.

iflags.use_color remains a master on/off switch for use of color, regardless of the capability
compiled into the game (default TRUE).

The has_color() routine, which is now a shared routine in src/windows.c, could likely be made
into a simple macro to eliminate the function call, but this update does not go that far.

This hits a lot of port files due to the window-port interface change, mostly cookie-cutter.
2019-11-30 11:44:07 -05:00
nhmall
fd7d0f5d52 more things considered when you're on the brink 2019-11-29 11:14:55 -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
PatR
cc3152dc9a ignore 3.7 file if present 2019-11-27 09:53:40 -08:00
PatR
3130676077 alignment of mimicked or polymorphed altars
A reddit thread about an unaligned altar in an aligned temple was
a tipoff that mimics posing as altars didn't have any particular
alignment.  The look-at code was misusing an operloaded field of the
underlying terrain.  Pick an alignment at random when taking on the
appearance of an altar, store it in the mimic's mon->mextra->mcorpsenm
field, and have look-at use that.

Also, dropping a ring of polymorph into a sink can transform it, and
one possible outcome is an altar.  In this case, the alignment is
part of the location's topology, but code setting that up was using
Align2amask(rn2(foo)).  That's a macro which evaluates its argument
more than once.  The first evaluation was effectively a no-op.  If
the second evaluation picked lawful then the result was lawful as
intended.  But if the second picked non-lawful and the third picked
lawful, the result would end up as none-of-the-above (a value of 3
when it needs to be a single-bit mask of 1, 2, or 4).
2019-11-25 15:01:40 -08:00
nhmall
e85646816c mark source tree as beta, previously marked work-in-progress 2019-11-17 20:06:21 -05:00
nhmall
57584a22d7 add some guard code to the Is_*_level macros in dungeon.h
All Is_*_level tests during early startup would test as true until
dungeon_topology was initialized in a new game or restored from
a save file. That could result in some unexpected code paths being
taken.
2019-11-17 19:13:23 -05:00
nhmall
a364348098 add an mgflags parameter to mapglyph() to alter how it behaves internally
avoid a recent save-value,call,restore-value kludge by adding
an mgflags parameter to mapglyph() to control its behavior

 Changes to be committed:
	modified:   doc/window.doc
	modified:   include/extern.h
	modified:   include/hack.h
	modified:   src/detect.c
	modified:   src/mapglyph.c
	modified:   src/pager.c
	modified:   sys/amiga/winfuncs.c
	modified:   sys/wince/mhmap.c
	modified:   win/Qt/qt_win.cpp
	modified:   win/Qt4/qt4map.cpp
	modified:   win/X11/winmap.c
	modified:   win/curses/cursdial.c
	modified:   win/curses/cursinvt.c
	modified:   win/curses/cursmain.c
	modified:   win/gem/wingem.c
	modified:   win/tty/wintty.c
	modified:   win/win32/mhmap.c
	modified:   win/win32/mswproc.c
2019-11-16 22:49:36 -05:00
PatR
2a07924063 rename S_player_override to S_hero_override 2019-11-16 14:31:57 -08:00
PatR
2a50fb1845 place_monster() debugging
Show more information if place_monster() detects something wrong.
I don't know whether it will actually be useful.
2019-11-16 13:42:25 -08:00
PatR
ae415589e9 have --showpaths show DUMPLOG file
While not a path exactly, the dumplog file isn't placed somewhere
fixed so being able to see where it is placed could be useful.

This cascaded a bit during testing.  Fix one of the warnings from
hardfought (fqn_prefix_names[]).  And a few more that came up with
SYSCF disabled (panictrace_gdb, two unused variables if files.c).
2019-11-15 17:51:20 -08:00
PatR
f3a923d647 fix #H1554, #H1736, github issue #240 - silver )
Fixes #240

Monster versus monster (melee and throwing) didn't handle shades
(need silver or blessed weapon to take damage) or silver feedback
(extra info when silver-haters are hit).

I did a lot of test, revise, re-test but didn't always re-test
everything that had previously been tested, so bugs that I thought
were quashed might have crept in.

Now if a missile weapon "passes harmlessly through the shade" it
will continue on and maybe hit something else.  (Regular misses
still stop at the missed target.)

A couple of minor ball&chain changes accidentally got included.
2019-11-13 15:47:46 -08: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
91b4bd0da9 new prefix_locked bits conditionalized to WIN32 2019-11-11 11:46:49 -05:00
nhmall
bc69fc65d2 Merge branch 'NetHack-3.6' into bart-test 2019-11-11 11:27:50 -05:00
PatR
15dbf661d9 more slippery gloves
Move makeplural(body_part(FINGER)) into its own routine, with option
to substitute gloves when wearing such.

Wearing slippery gloves (ie, wearing gloves while having slippery
fingers) wouldn't let you put on a ring because you can't take the
gloves off, but removing a worn ring lacked the same restriction.

After changing that, teach prayer that slippery gloves is another
reason why a ring of levitation can't be removed.
2019-11-09 16:36:41 -08:00
nhmall
67bea58539 Merge branch 'NetHack-3.6' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6 2019-11-09 11:12:18 -05:00
nhmall
c566c01f8d add command line option --showpaths
Add
	--showpaths
early option to show where NetHack is expecting to find certain files
without starting up a game. It exits afterwards.

Windows sample (for illustration only, locations may differ for you):
    Variable playground locations:
        [hackdir   ]="C:\Users\JohnDoe\NetHack\3.6\"
        [leveldir  ]="C:\Users\JohnDoe\AppData\Local\NetHack\3.6\"
        [savedir   ]="C:\Users\JohnDoe\AppData\Local\NetHack\3.6\"
        [bonesdir  ]="C:\ProgramData\NetHack\3.6\"
        [datadir   ]="C:\personal\nhdev\363\test\binary\"
        [scoredir  ]="C:\ProgramData\NetHack\3.6\"
        [lockdir   ]="C:\ProgramData\NetHack\3.6\"
        [sysconfdir]="C:\ProgramData\NetHack\3.6\"
        [configdir ]="C:\Users\JohnDoe\NetHack\3.6\"
        [troubledir]="C:\Users\JohnDoe\NetHack\3.6\"
    Your system configuration file (in sysconfdir):
        "C:\Users\JohnDoe\NetHack\3.6\sysconf"
    Your system symbols file (in sysconfdir):
        "C:\Users\JohnDoe\NetHack\3.6\symbols"
    Your personal configuration file (in configdir):
        "C:\Users\JohnDoe\NetHack\3.6\.nethackrc"

Linux (for illustration only, locations may differ for you):
    Your system configuration file:
        "/home/johndoe/nh/install/games/lib/nethackdir/sysconf"
    Your system symbols file:
        "/home/johndoe/nh/install/games/lib/nethackdir/symbols"
    Your personal configuration file:
        "/home/johndoe/.nethackrc"
2019-11-09 10:57:25 -05:00
PatR
0615387f95 fix #H9391 - slippery gloves
Slippery fingers would transfer from bare hands to gloved hands if
you put gloves on.  The reverse, transfering from gloves to bare
hands when taking gloves off, was already being prevented for
directly taking them off, but still allowed the slipperiness to
transfer when gloves were lost.  This prevents putting on gloves
when fingers are slippery and attempts to handle cases where gloves
get unworn by ways other than 'T' (or 'R') or 'A'.

There's no slippery attribute for objects (way too much work for too
little value); slippery gloves is just the combination of wearing
gloves and having slippery fingers (which now has to have happened
while already wearing those gloves).  This changes inventory to use
"(being worn; slippery)" when applicable and much of the patch deals
with funnelling Glib changes through new make_glib() to try to make
sure that persistent inventory adds or removes "; slippery" right
away when changes happen.

If gloves are taken off involuntarily (shapechange to a form that
can't wear them, destruction via scroll of destroy armor or monster
spell of same or via overenchantment, theft), slippery fingers ends
right away instead of the usual few turns later.
2019-11-09 01:07:09 -08:00
nhmall
96e7e11a5e typo 2019-11-07 10:59:20 -05:00
nhmall
71d229a99d Update README and include/patchlevel.h 2019-11-07 10:50:14 -05:00
Bart House
f0707fee6e More tweaks to how windows deals with directory paths. 2019-11-03 13:31:17 -08:00
Bart House
11018da6b8 Renamed configuration file for windows to .nethackrc.
Also adjusted name of template files populated during windows builds.
2019-11-02 19:11:26 -07:00
Bart House
4ab976d6fd Renamed defaults.nh to .nethackrc for windows. 2019-11-02 18:18:02 -07:00
Bart House
2b9e6a057b Removed the redundant #if definded(MSDOS). 2019-11-02 18:17:10 -07:00
Bart House
33149eed0e Move is_desktop_bridge() api to win10 wrapper. 2019-11-02 11:39:11 -07:00
Pasi Kallinen
54024f2015 Fix pet polyed to long worm staying leashed
Long worms cannot be leashed, but polymorphing a leashed pet
into a long worm kept it leashed.
2019-11-01 19:05:48 +02:00
nhmall
b110ee9eaf msdos build fix following recent files.c change 2019-10-31 12:00:59 -04:00
Bart House
86473526b8 Save a copy of the symbols file to symbols.save when updating. 2019-10-30 19:17:03 -07:00
nhmall
33d00cf0e4 attempt to get mingw building correctly after recent changes
make typedef of boolean match mingw header files
link with shell32 and ole32 as Makefile.msc now had to do
kludge some stuff missing from mingw headers in sys/winnt/windmain.c
2019-10-30 18:48:28 -04:00
Bart House
43ef5ef7fa Windows Store support for NetHack 3.6. 2019-10-29 21:28:39 -07:00
nhmall
a399151d01 some symbol tweaks
A few symbol-related modifications:

- fulfill a request from a blind player to allow them to
  specify a unique/recognizable character for all pets and/or
  the player in the config file for use when using a screen
  reader (S_player_override, S_pet_override). Requires sysconf
  setting ACCESSIBILITY to be set to have an effect, although
  they can still be specified in the config file.

- Config file SYMBOLS entries were not working properly on
  the rogue level. Allow ROGUESYMBOLS as well as SYMBOLS to be
  specified in the config file independently.

- When values are moved into showsyms[], the overriding SYMBOLS
  or ROGUESYMBOLS entry from the config file is used if there is
  one; if there is no overriding value for a particular symbol,
  the loaded symset value is used; if there is no symset entry
  loaded for the symbol then a default symbol is used.
2019-10-27 23:12:11 -04:00
PatR
bf7e955645 mimicking slime molds
Mimic-as-slime_mold needs to keep track of the fruit index the same
way that mimic-as-corpse keeps track of corpse's monster type.  The
mimic description was changing (for '/' and ';' feedback) whenever
the player assiged a new fruit name.

That wasn't noticeable when applying a stethoscope because
mimic-as-slime_mold always yielded "that fruit is really a mimic".
Change it to report the fruit's type instead of generic "fruit".
2019-10-19 17:38:27 -07:00
nhmall
c099e0a1ff grammar fix for "That walking shoes is really a small mimic" 2019-10-19 12:05:33 -04:00
PatR
f114675739 containers in shops
Fix a couple of bugs I stumbled across while testing something else.
The sell prompt for a container dropped in a shop had phrasing issues.
This fixes a couple but there are more.  The message composition
assumes that contents fall into two categories:  those already owned
by the shop and those the shopkeeper is offering to buy from the hero.
But there is a third:  stuff the shopkeeper doesn't care about so
won't buy.  The count_contents() routine can supply total contents or
shop-owned contents.  Subtracting one from the other yields combined
hero-owned without any way to separate out shk-cares and don't-care.
2019-10-18 15:00:16 -07:00
PatR
6182b014ca github pull request #235 - curses symbol set init
Fixes #235

For initial options under curses, specifying 'DECgraphics' as a
boolean rather than as 'symset:DECgraphics' wasn't overriding the
new default 'symset:curses'.  Since previously DECgraphics was
rejected for curses, it's possible that no one noticed.
2019-10-17 14:38:45 -07:00
PatR
3e368b9a51 symbol set reorganization
Change the way symbol sets are loaded to make them have the same order
as they appear in the symbols file rather than being reversed.

Revise dat/symbols so that the new ordering yields a result similar
to the old ordering, more or less.  I've added a few set descriptions.
The only substantive change is marking DECgraphics as primary-only
(not available on rogue level) and adding new set DECgraphics_2 which
is commented out near the end.

Define symbol handling H_MAC since one of the sets specifies
'handling: MAC'.  All H_MAC is used for now is to avoid showing
MACgraphics as a symset when compiled without MAC_GRAPHICS_ENV (which
was used for pre-OSX Mac by the old code in sys/mac/), so it will be
hidden for everyone.

I left handling H_CURS even though curses doesn't implement anything
for it.  It could do something when rendering the map or assign a
function to 'cursesgraphics_mode_callback' for special init or both
but hasn't needed to.  Since curses is now supporting DECgraphics,
define 'decgraphics_mode_callback' for it.  No value is being
assigned so that doesn't do anything; curses seems to be setting up
the primary character set as text and secondary one as line-drawing
without the need for that hook.

With the added set descriptions, 'O's symset menu looked horrible for
curses due to the way curses decides to set the width of menus and
the resulting line wrapping which took place because of a too-narrow
menu.  I've added a chunk of code to the options handling code which
shouldn't really be there but makes the menu much easier to read.

Lastly, do some formatting cleanup in files.c.
2019-10-17 05:00:58 -07:00
PatR
d0c4d27a50 githib pull request #232 - curses symset
This time I'm putting things in as-is before making a few tweaks.

The pull request was three or four separate changes.  I used the
patch instead so they've been collected into one commit.
2019-10-16 15:52:00 -07:00