]> granicus.if.org Git - nethack/log
nethack
4 years agocron daily Files update
nhmall [Sun, 11 Oct 2020 18:29:16 +0000 (14:29 -0400)]
cron daily Files update

4 years agoadopt some integration suggestions
nhmall [Sun, 11 Oct 2020 17:33:51 +0000 (13:33 -0400)]
adopt some integration suggestions

sys/lib -> sys/libnh
sys/lib/libnethackmain.c -> sys/libnh/libnhmain.c
libnethack.a -> libnh.a

4 years agoget this working: "make wasm"
nhmall [Sun, 11 Oct 2020 14:51:46 +0000 (10:51 -0400)]
get this working: "make wasm"

4 years agolibnethackmain.c includes date.h
nhmall [Sun, 11 Oct 2020 13:43:15 +0000 (09:43 -0400)]
libnethackmain.c includes date.h

4 years agofollow-up bit
nhmall [Sun, 11 Oct 2020 13:16:23 +0000 (09:16 -0400)]
follow-up bit
remove an unnecessary dependency for top Makefile wasm

4 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
nhmall [Sun, 11 Oct 2020 13:12:02 +0000 (09:12 -0400)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

4 years agocross-compiles need not build host native lua library
nhmall [Sun, 11 Oct 2020 13:08:27 +0000 (09:08 -0400)]
cross-compiles need not build host native lua library

Because some Makefile.top dependencies triggered the build
of the host native lua library, the cross-compiles were
building it needlessly.

Make it a make variable so that it can be overridden by
cross-compile recipes in sys/unix/hints/include/cross-*.2020

4 years agocron daily Files update
nhmall [Sat, 10 Oct 2020 23:36:36 +0000 (19:36 -0400)]
cron daily Files update

4 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
Bart House [Sat, 10 Oct 2020 23:28:54 +0000 (16:28 -0700)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

4 years agoUpdate files heading to reflect that we support VS 2017 and 2019.
Bart House [Sat, 10 Oct 2020 23:28:41 +0000 (16:28 -0700)]
Update files heading to reflect that we support VS 2017 and 2019.

4 years agoupdate win/win32/vs/.gitattributes text
nhmall [Sat, 10 Oct 2020 22:38:25 +0000 (18:38 -0400)]
update win/win32/vs/.gitattributes text

4 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Sat, 10 Oct 2020 22:24:07 +0000 (18:24 -0400)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

4 years agoSupport both VS 2017 and VS 2019 without making changes to project files.
Bart House [Sat, 10 Oct 2020 22:15:59 +0000 (15:15 -0700)]
Support both VS 2017 and VS 2019 without making changes to project files.
Renamed 'vs2017' folder to 'vs'.

4 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
Bart House [Sat, 10 Oct 2020 21:18:18 +0000 (14:18 -0700)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

4 years agoAdd text mentioning that LUA sources must be copied into tree.
Bart House [Sat, 10 Oct 2020 21:17:58 +0000 (14:17 -0700)]
Add text mentioning that LUA sources must be copied into tree.

4 years agomore warnings
nhmall [Sat, 10 Oct 2020 20:41:09 +0000 (16:41 -0400)]
more warnings

4 years agomore warning bits
nhmall [Sat, 10 Oct 2020 20:28:17 +0000 (16:28 -0400)]
more warning bits

4 years agofix github issue #399 - [not] fixing chest lock
PatR [Sat, 10 Oct 2020 18:46:02 +0000 (11:46 -0700)]
fix github issue #399 - [not] fixing chest lock

Use ansimpleoname() instead of doname() to describe the key or
lock pick or credit card when reporting "You can't fix a chest's
broken lock with a <foo>."  doname() includes BUC status when
known and feedback mentioning a particular bless/curse state on
the tool that can't be used to fix the lock suggests that some
other bless/curse state might be viable.

4 years agosilence some util/makdefs.c src/mdlib warnings
nhmall [Sat, 10 Oct 2020 12:55:43 +0000 (08:55 -0400)]
silence some util/makdefs.c src/mdlib warnings

In file included from makedefs.c:213:0:
../src/mdlib.c: In function ‘runtime_info_init’:
../src/mdlib.c:808:12: warning: variable ‘timeresult’ set but not used [-Wunused-but-set-variable]
     time_t timeresult;
            ^~~~~~~~~~
makedefs.c: In function ‘do_date’:
makedefs.c:1140:16: warning: unused variable ‘ind’ [-Wunused-variable]
     const char ind[] = "    ";
                ^~~
makedefs.c:1139:9: warning: unused variable ‘steps’ [-Wunused-variable]
     int steps = 0;
         ^~~~~
makedefs.c: In function ‘do_monstr’:
makedefs.c:1934:12: warning: variable ‘j’ set but not used [-Wunused-but-set-variable]
     int i, j;
            ^

4 years agoLua: Allow matching any wall
Pasi Kallinen [Sat, 10 Oct 2020 08:31:16 +0000 (11:31 +0300)]
Lua: Allow matching any wall

A 'w' in a map fragment will match any wall (IS_WALL macro):

   des.replace_terrain({ mapfragment = "w", toterrain = "F" });

4 years agofix #K2393 - brass lantern hit by water
PatR [Fri, 9 Oct 2020 19:02:26 +0000 (12:02 -0700)]
fix #K2393 - brass lantern hit by water

Don't extinguish a brass lantern when hit by water unless it is
being submerged.

4 years agounix/Makefile.utl
PatR [Fri, 9 Oct 2020 15:45:03 +0000 (08:45 -0700)]
unix/Makefile.utl

Replace use of $(LINK) with $(CLINK) or $(CXXLINK) as warranted.
When the Qt interface is enabled, the utility programs were all
(except dlb) being linked with C++ support.  That didn't cause
any problems, just looked wrong.  Link them as C instead of C++.
Two actually do need C++ support (and still have it) but both
are dead:  'tile2beos' because the source file doesn't exist (not
even in 'outdated'), 'tileedit' because it won't build with Qt5.
I didn't bother with QUIETCC support for them.

There were still a couple of references to dgn_comp (for the lint
target; just in the name of a macro, not its value); remove those.

4 years agore-enable the MSDOS cross-compile on travis-ci
nhmall [Fri, 9 Oct 2020 13:36:55 +0000 (09:36 -0400)]
re-enable the MSDOS cross-compile on travis-ci

4 years agomore wasm dependency order tinkering
nhmall [Fri, 9 Oct 2020 13:18:51 +0000 (09:18 -0400)]
more wasm dependency order tinkering

4 years agofollow-up bit
nhmall [Fri, 9 Oct 2020 13:05:56 +0000 (09:05 -0400)]
follow-up bit
make variable had changed in PRE but not in POST

4 years agomore wasm build
nhmall [Fri, 9 Oct 2020 12:54:36 +0000 (08:54 -0400)]
more wasm build

This issue
https://github.com/NetHack/NetHack/issues/398
reported some issues with the wasm build. Attempt to resolve
some of those.

4 years agocross-compile fix-up
nhmall [Fri, 9 Oct 2020 12:52:46 +0000 (08:52 -0400)]
cross-compile fix-up

4 years agoQt prompt highlighting
PatR [Thu, 8 Oct 2020 18:24:11 +0000 (11:24 -0700)]
Qt prompt highlighting

When qt_yn_function() or qt_more() is asking for a single character
response, typing anything will cause the prompt line in the message
window to stop being highlighted.  If they reject what's been typed,
they beep (--More-- doesn't start beeping until second rejection);
change both of them to also rehighlight the prompt line to give a
visual indication that the question/acknowledgement is still being
asked.

4 years agobe more consistent with CROSS_TO_target macro names for cross-compiles
nhmall [Thu, 8 Oct 2020 17:49:24 +0000 (13:49 -0400)]
be more consistent with CROSS_TO_target macro names for cross-compiles

-DCROSS_TO_MSDOS msdos cross-compile (djgpp cross-compiler)
-DCROSS_TO_AMIGA Amiga cross-compile
-DCROSS_TO_WASM wasm cross-compile (emscripten)

4 years agoQt menu hack
PatR [Thu, 8 Oct 2020 17:18:44 +0000 (10:18 -0700)]
Qt menu hack

Prevent a small inventory menu as the first one shown from forcing
all subsequent ones from being the same short height by forcing it
to have room for at least 15 lines.  Temporary hack until someone
figures out why resizing the reused WIN_INVEN isn't working.

Does not affect non-inventory menus which get created on demand and
destroyed when done so don't need to change size to fit different
contents.

4 years agofollow-up to previous
nhmall [Wed, 7 Oct 2020 13:23:41 +0000 (09:23 -0400)]
follow-up to previous

4 years agosmall monsters seeping through their shirt
nhmall [Wed, 7 Oct 2020 13:09:51 +0000 (09:09 -0400)]
small monsters seeping through their shirt

The code is slightly different than in the PR which left out the noncorporeal case.

Closes #397

4 years agoQt click-to-command
PatR [Wed, 7 Oct 2020 11:19:55 +0000 (04:19 -0700)]
Qt click-to-command

Consolidate some recently added duplicated code.

4 years agoQt status panel as command button
PatR [Tue, 6 Oct 2020 22:20:25 +0000 (15:20 -0700)]
Qt status panel as command button

Clicking on the status panel runs ^X to show character and status
information without abbreviations.  The code needed is identical
to what's now used for clicking on the paper doll inventory panel
except for the command to execute.

4 years agoQt "paperdoll" as command button
PatR [Tue, 6 Oct 2020 16:42:59 +0000 (09:42 -0700)]
Qt "paperdoll" as command button

Clicking on the paper doll inventory subset window will cause
the '*' command (#seeall) to execute.  They convey the same
information (unless multiple leashes or multiple light sources
are in use; seeall lists all of them instead of just the first
of each) but the doll shows the info with a small grid of map
tiles and seeall shows it with an inventory display of worn and
wielded items plus tools in active use.

Ideally it should show information about a specific item as a
"tool tip" when the mouse hovers over one of the doll slots.
I don't know whether I'll ever attempt to tackle that or even
if that's feasible with Qt.  Perhaps use right click instead.

4 years agoleft out of "Qt menus, mostly item counts"
PatR [Tue, 6 Oct 2020 16:15:32 +0000 (09:15 -0700)]
left out of "Qt menus, mostly item counts"

4 years agoQt menus, mostly item counts
PatR [Tue, 6 Oct 2020 16:09:09 +0000 (09:09 -0700)]
Qt menus, mostly item counts

Don't allow the user to construct a count value when operating on
a pick-none menu where counts aren't meaningful.  Unfortunately
that can still be done on pick-one or pick-any menus which don't
happen to have any entries where a count is applicable.

Allow a count to be optionally started with '#'.  Note that if
there is an entry using '#' for the selector letter (probably
inventory that has something in the overflow slot), typing '#'
will select the entry instead of initiating a count.

Flail about a bit trying to get menu size correct--failed on this
front.

4 years agoupdate Cross-compiling document for PR385 Web Assemply and libnethack
nhmall [Tue, 6 Oct 2020 15:00:33 +0000 (11:00 -0400)]
update Cross-compiling document for PR385 Web Assemply and libnethack

Credit: The initial Web Assembly cross compile was found in a pull request:
            https://github.com/NetHack/NetHack/pull/385
        by apowers313. The pull request was merged with some accompanying
        NetHack source tree integration changes in early October 2020.

Cross-compiler used: emscripten
Cross-compiler url: https://emscripten.org/docs/getting_started/downloads.html

    Here's a brief guide to obtaining the cross-compiler sources via git and
    building it on your system.

    For Ubuntu, the build prerequisite packages for building the compiler can
    be easily obtained:

        sudo apt-get install python3 cmake default-jre

    For macOS, you will need to install Xcode, git, cmake, Python 3.5 or new
    (at time of this writing).

    After installing the prerequite packages above, obtain the cross-compiler
    via git and build it from the directory of your choice using steps similar
    to these:

            git clone https://github.com/emscripten-core/emsdk.git
            cd emsdk
            git pull
            ./emsdk install latest
            ./emsdk activate latest
            source ./emsdk_env.sh

    The steps above reflect what was outlined at this url at the time
    of writing:

            https://emscripten.org/docs/getting_started/downloads.html

    That is the definitive source and trumps anything documented here.

    On your linux host, prepare to cross-compile NetHack as follows:

        cd sys/unix ; sh setup.sh hints/linux.2020 ; cd ../..
        make fetch-lua

    On your macOS host, prepare to cross-compile NetHack as follows:

        cd sys/unix ; sh setup.sh hints/macOS.2020 ; cd ../..
        make fetch-lua

    Then, cross-compile to targets/wasm as follows:

        make CROSS_TO_WASM=1

    You can build src/nethacklib.a from pull request 385 as follows:

        make WANT_LIBNH=1

    Do not add any additional windowport interfaces to your build
    (such as WANT_WIN_TTY=1 WANT_WIN_CURSES=1 WANT_WIN_X11=1 or
    WANT_WIN_QT=1) as those aren't applicable to the Web Assembly
    or nethacklib builds. A "shim" pseudo-windowport is included
    from pull request 385.

    Result: As mentioned, the wasm cross-compile will end up in
            targets/wasm and the nethacklib.a will end up
            src.

    The cross-compiler hints additions are enclosed inside ifdef sections
    and shouldn't interfere with the non-cross-compile builds using
    hints/linux.2020 or hints/macOS.2020.

4 years agoadding ; was inappropriate for BUILDMORE list of dependencies
nhmall [Tue, 6 Oct 2020 06:26:40 +0000 (02:26 -0400)]
adding ; was inappropriate for BUILDMORE list of dependencies

4 years agotemporarily turn off the msdos cross-compile on travis
nhmall [Tue, 6 Oct 2020 06:15:25 +0000 (02:15 -0400)]
temporarily turn off the msdos cross-compile on travis

4 years agotarget lua build was missing -c on cross-compile
nhmall [Tue, 6 Oct 2020 06:01:30 +0000 (02:01 -0400)]
target lua build was missing -c on cross-compile

4 years agomore wasm cross-compiling follow-up
nhmall [Tue, 6 Oct 2020 05:47:19 +0000 (01:47 -0400)]
more wasm cross-compiling follow-up

4 years agoQt menu search
PatR [Mon, 5 Oct 2020 23:26:27 +0000 (16:26 -0700)]
Qt menu search

Remove a 'TODO' for once.  Have the popup that's used to accept the
target string--after clicking on [search] or typing ':' to initiate
menu search+select operation--force keyboard focus to itself.  Menu
searching worked without this, but only if you manually clicked on
the search popup prior to typing the target string.  Failure to do
so resulted in typed characters being used to select menu entries.

4 years agoFix dropping const from params
Pasi Kallinen [Mon, 5 Oct 2020 14:17:07 +0000 (17:17 +0300)]
Fix dropping const from params

4 years agoclear a -Wshadow warning in options.c
nhmall [Mon, 5 Oct 2020 13:24:42 +0000 (09:24 -0400)]
clear a -Wshadow warning in options.c

options.c
options.c: In function ‘match_optname’:
options.c:5734:27: warning: declaration of ‘opt_name’ shadows a global declaration [-Wshadow]
 const char *user_string, *opt_name;
                           ^~~~~~~~
In file included from options.c:52:0:
../include/optlist.h:56:1: note: shadowed declaration is here
 opt_##a,
 ^
../include/optlist.h:307:5: note: in expansion of macro ‘NHOPTC’
     NHOPTC(name, PL_NSIZ, opt_in, set_gameview, No, Yes, No, No, NoAlias,
     ^~~~~~

4 years agocron daily Files update
nhmall [Mon, 5 Oct 2020 01:14:59 +0000 (21:14 -0400)]
cron daily Files update

4 years agoplacement of libnethack targets required adjusting
nhmall [Mon, 5 Oct 2020 01:12:03 +0000 (21:12 -0400)]
placement of libnethack targets required adjusting
From -PRE to -POST section

4 years agoupdates for LIBNH build
nhmall [Mon, 5 Oct 2020 00:48:09 +0000 (20:48 -0400)]
updates for LIBNH build

4 years agounixmain and libnethackmain diverged in the updated PR
nhmall [Mon, 5 Oct 2020 00:14:45 +0000 (20:14 -0400)]
unixmain and libnethackmain diverged in the updated PR
put unixmain back the way it was, now that libnethackmain is in the tree after all.

4 years agoMerge branch 'libnethack2' into NetHack-3.7
nhmall [Mon, 5 Oct 2020 00:13:35 +0000 (20:13 -0400)]
Merge branch 'libnethack2' into NetHack-3.7

4 years agothe .gitignore doesn't match the target locations on the merged code
nhmall [Mon, 5 Oct 2020 00:09:28 +0000 (20:09 -0400)]
the .gitignore doesn't match the target locations on the merged code

Leave it be for now.

4 years agomerging conflict fixup
nhmall [Mon, 5 Oct 2020 00:07:57 +0000 (20:07 -0400)]
merging conflict fixup

4 years agointegrate updates made to PR earlier on Oct 4
nhmall [Mon, 5 Oct 2020 00:05:29 +0000 (20:05 -0400)]
integrate updates made to PR earlier on Oct 4

4 years agoMerge branch 'libnethack' of https://github.com/apowers313/NetHack into libnethack2
nhmall [Sun, 4 Oct 2020 23:51:37 +0000 (19:51 -0400)]
Merge branch 'libnethack' of https://github.com/apowers313/NetHack into libnethack2

4 years agoMakefile.src: avoid extra feedback while linking
PatR [Sun, 4 Oct 2020 23:34:59 +0000 (16:34 -0700)]
Makefile.src: avoid extra feedback while linking

Recently added cross-compile stuff had resulted in an extra line
of feedback when linking:  'true;'.  Suppress that.

Also, I think 'AWK=nawk' was needed for Solaris or maybe even
SunOS.  Switch 'make depend' to use ordinary awk by default since
most systems have Posix-compliant awk these days and OSX doesn't
have nawk.

4 years agomore friendly javascript arguments
Adam Powers [Sun, 4 Oct 2020 21:04:56 +0000 (14:04 -0700)]
more friendly javascript arguments

4 years agoadd globals, constants, and helpers
Adam Powers [Sun, 4 Oct 2020 21:03:04 +0000 (14:03 -0700)]
add globals, constants, and helpers

4 years agocron daily Files update
nhmall [Sun, 4 Oct 2020 19:26:50 +0000 (15:26 -0400)]
cron daily Files update

4 years agoupdate original documentation for pr385
nhmall [Sun, 4 Oct 2020 19:19:58 +0000 (15:19 -0400)]
update original documentation for pr385
 Changes to be committed:
modified:   sys/lib/README.md

4 years agoMerge branch 'NetHack-3.7'
nhmall [Sun, 4 Oct 2020 18:54:41 +0000 (14:54 -0400)]
Merge branch 'NetHack-3.7'

4 years agoremove two unneeded files
nhmall [Sun, 4 Oct 2020 18:51:10 +0000 (14:51 -0400)]
remove two unneeded files

4 years agolibnethack pr385
Adam Powers [Thu, 27 Aug 2020 02:22:00 +0000 (19:22 -0700)]
libnethack pr385

roll parts of pr385 into source tree

This does not take the PR as is.

Unlike the PR, this streamlines and minimizes the integration somewhat:

- use hints/include mechanism instead of creating alternative
  Makefile.dat, Makefile.src, Makefile.top, Makefile.utl in sys/lib;
  those would have been a maintenance nightmare.

- don't have alternative mkmkfile.sh and setup.sh in sys/lib.

- sys/lib/libnethackmain.c differed from sys/unix/unixmain.c by
  very little, so just place a small bit of conditional code at the
  top of sys/unix/unixmain.c instead.

- changed the conditional code bits from __EMSCRIPTEN__ to
  CROSS_TO_WASM.

- You should be able to build the wasm result by:
    cd sys/unix ; sh setup.sh hints/linux.2020 ; cd ../..
    make fetch-lua    (<-one time)
    make WANT_LIBNH all

- You should be able to build LIBNBH by:
    cd sys/unix ; sh setup.sh hints/linux.2020 ; cd ../..
    make fetch-lua    (<-one time)
    make CROSS_TO_WASM=1 all

As it is currently coded, winshim.c requires C99.

4 years agoinitial shim graphics
Adam Powers [Thu, 27 Aug 2020 02:17:40 +0000 (19:17 -0700)]
initial shim graphics

4 years agoQt ynaq/yn#aq dialogs
PatR [Sun, 4 Oct 2020 14:36:12 +0000 (07:36 -0700)]
Qt ynaq/yn#aq dialogs

When 'popup_dialog' is set, the Qt interface uses a popup window
for yn_function() calls and the dialog has a list of buttons, one
per potential choice.  It has been handling "yn?" and "ynq?"
questions differently from general request-one-char prompts, using
buttons "Yes", "No, and "Cancel" instead of showing individual
letters.  This extends that to "ynaq" and "yn#aq" questions and
labels 'q' reply as "Stop" instead of "Cancel" for those.  Also,
when player uses keyboard instead of mouse to answer, allow 'c'
as well as 'q' for cancel ones, 's' as well as 'q' for stop ones.

Prompt  Buttons
yn      [Yes ][ No ]
ynq     [ Yes  ][  No  ][Cancel]
ynaq    [Yes ][ No ][All ][Stop]
yn#aq   [Yes ]Count:______[ No ][All ][Stop]
rl      [ Left ][Right ]    //unchanged; included for completeness

(For contrast, when something specifies "ny" as the acceptable
choices, the buttons will just be [n][y].  Prompts for choosing
from a list of inventory letters can't accidentally match these
special cases as long as they're specified in alphabetical order.)

4 years agoupdate sys/winnt/console.rc
nhmall [Fri, 2 Oct 2020 20:01:04 +0000 (16:01 -0400)]
update sys/winnt/console.rc

4 years agoGuidebook.txt update
nhmall [Fri, 2 Oct 2020 16:32:11 +0000 (12:32 -0400)]
Guidebook.txt update

4 years agobump Guidebook date to reflect most recent changes
nhmall [Fri, 2 Oct 2020 16:29:26 +0000 (12:29 -0400)]
bump Guidebook date to reflect most recent changes

4 years agoIncrement EDITLEVEL due to safe_wait
Pasi Kallinen [Fri, 2 Oct 2020 16:11:15 +0000 (19:11 +0300)]
Increment EDITLEVEL due to safe_wait

4 years agoFix some Guidebook.tex errors
Pasi Kallinen [Fri, 2 Oct 2020 16:00:16 +0000 (19:00 +0300)]
Fix some Guidebook.tex errors

4 years agoAdd safe_wait to toggle search and wait prevention
Pasi Kallinen [Fri, 2 Oct 2020 15:50:19 +0000 (18:50 +0300)]
Add safe_wait to toggle search and wait prevention

4 years agoQt build fix
PatR [Fri, 2 Oct 2020 11:51:15 +0000 (04:51 -0700)]
Qt build fix

The failing Travis build issued about 500 lines of diagnostics
when complaining about one line of the source.  It compiled ok
for me but I use older versions of Qt library and C++ compiler.

4 years agoQt popup_dialog's count entry
PatR [Fri, 2 Oct 2020 00:59:58 +0000 (17:59 -0700)]
Qt popup_dialog's count entry

For Qt with 'popup_dialog' On, fix number entry when user types
a digit (or '#') directly onto the dialog instead of clicking
inside the Count box and then typing.  Before, that first typed
digit was starting out as selected, so typing the next digit
replaced the selection instead of getting appended to the string
of digits being constructed.  Fixed by moving the relevant code
to the KeyPress handler instead of re-executing the dialog.

Also, if a keypress is just a modifier, ignore it.  The next
event should be the actual character.  Prevents treating <shift>
(and <caps lock>!) as useless dialog responses.  Before this,
attempting to type '#' to initiate a count wouldn't work because
the <shift> part of shift+3 ended the dialog.  Now '#' works
(and is still optional; starting with a digit suffices).

4 years agovenom fixes
PatR [Thu, 1 Oct 2020 23:41:56 +0000 (16:41 -0700)]
venom fixes

Noticed when fixing 'D$'.  Some commands, including D, which should
have been handling venom weren't doing so.

I'm not sure whether I got all the applicable cases.

4 years agoggetobj bug when dropping just gold
PatR [Thu, 1 Oct 2020 23:16:26 +0000 (16:16 -0700)]
ggetobj bug when dropping just gold

Noticed when testing something unrelated: for menustyle=traditional
and =combination, when using 'D' to drop multiple items, if the
player only supplied '$' for the list of object classes of interest
then that list remained empty and all classes were processed.
Caused by retaining an old special case for gold which isn't needed
any more.

I think that it only mattered for 'D'.  Other callers of ggetobj()
don't include gold as applicable so player can't pick gold hence
can't pick just gold to trigger this.

4 years agomore recover and cross-compiling
nhmall [Thu, 1 Oct 2020 14:04:05 +0000 (10:04 -0400)]
more recover and cross-compiling

4 years agoimplement "--More--" for Qt
PatR [Thu, 1 Oct 2020 10:16:14 +0000 (03:16 -0700)]
implement "--More--" for Qt

Support MSGTYPE=stop by having qt_display_nhwindow(WIN_MESSAGE,TRUE)
issue a tty-style --More-- prompt.  For popup_dialog Off, the prompt
gets appended to the most recent message; for popup_dialog On, it is
issued via a popup and not displayed in the message window.

It accepts <space>, ^J, ^M, and ^[ (ESC) to dismiss.  There's no way
to dismiss it with the mouse (for !popup_dialog) which might need
some fix....

Several adventures along the way.  The '^C-in-parent-terminal triggers
infinite loop repeatedly complaining about "event loop already running"'
is now a one-shot complaint.  It isn't fixed but the severity of
having it happen is greatly reduced.

4 years agomake sure recover utily is built for the CROSSCOMPILE target
nhmall [Thu, 1 Oct 2020 01:45:45 +0000 (21:45 -0400)]
make sure recover utily is built for the CROSSCOMPILE target

4 years agoFire sources can ignite candles, lamps, and potions of oil
Pasi Kallinen [Wed, 30 Sep 2020 16:43:12 +0000 (19:43 +0300)]
Fire sources can ignite candles, lamps, and potions of oil

... on the floor, in monster inventory, and in hero's inventory.

Items in your inventory being ignited produce a message even if you're
blind - you can see the lit-state by viewing inventory anyway, so just
give player the message.

(via xNetHack)

4 years agoMake piranhas faster and more bitey
Pasi Kallinen [Wed, 30 Sep 2020 15:59:09 +0000 (18:59 +0300)]
Make piranhas faster and more bitey

Piranhas are pretty bland, so make them faster and give them
an extra bite attack.

(via xNetHack)

4 years agocron daily Files update
nhmall [Tue, 29 Sep 2020 23:44:13 +0000 (19:44 -0400)]
cron daily Files update

4 years agoreinstate one $(CROSSCOMPILE_TARGET) in sys/winnt/Makefile.msc
nhmall [Tue, 29 Sep 2020 19:13:52 +0000 (15:13 -0400)]
reinstate one $(CROSSCOMPILE_TARGET) in sys/winnt/Makefile.msc

It was removed but shouldn't have been.

4 years agocross-compile update
nhmall [Tue, 29 Sep 2020 19:01:37 +0000 (15:01 -0400)]
cross-compile update

Update the cross-compiling doc at the top.

Remove sys/msdos/Makefile1.cross, sys/msdos/Makefile2.cross, and
sys/msdos/msdos-cross-compile.sh as they are no longer required.

Remove occurrences of CROSSCOMPILE_HOST as the host-side of a
cross-compile can be determined from:
    defined(CROSSCOMPILE) && !defined(CROSSCOMPILE_TARGET)
without the additional macro.

4 years agoFixes and lua doc
Pasi Kallinen [Tue, 29 Sep 2020 14:35:16 +0000 (17:35 +0300)]
Fixes and lua doc

4 years agoAvoid calling rn2(0) when the first room(s) have frequency 0
copperwater [Sat, 23 May 2020 21:11:36 +0000 (17:11 -0400)]
Avoid calling rn2(0) when the first room(s) have frequency 0

This probably won't happen in practice, but it is a good safeguard
if this ever does happen (it happened for me in debugging when I wished
to have no "regular" rooms and only generate themed rooms).

4 years agoAdd minimum difficulty cutoffs to two themed rooms
copperwater [Thu, 14 May 2020 00:52:33 +0000 (20:52 -0400)]
Add minimum difficulty cutoffs to two themed rooms

This sets the minimum level depth of "Spider nest" to 10, somewhat above
the difficulty of an individual giant spider, because a whole room full
of them is a tougher challenge. Note that this isn't the only possible
fix to this problem; another solution would be to alter the special case
in mktrap that hardcodes a giant spider to generate with each web to
produce cave spiders if giant spiders would be too tough. Even then, a
lower difficulty cutoff is probably still warranted for this room, since
a large number of cave spiders might be too tough for level 1 or 2.

This also sets the minimum level depth of "Boulder room" to 4, based on
the fact that individual rolling boulder traps normally can't appear
until level 2, and having a bunch of them in one place which may be
required to reach the downstairs could be problematic.

This doesn't do anything to address the "Mausoleum" room problem, in
which a master or arch-lich can generate and immediately warp out and
attack the player. Even with a high difficulty threshold, it won't fix
the problem of these liches generating out of their normal difficulty
and Gehennom constraints.

Other potential candidates for difficulty thresholds:
 - "Trap room": This room might be perilous on the first few levels,
   especially if the level generates with it blocking the way to the
   downstairs.
 - "Massacre": Doesn't have any particular hazards, but might be
   interesting if it only generated at deeper levels.

4 years agoEnable themed rooms to be constrained by level difficulty
copperwater [Wed, 13 May 2020 04:15:10 +0000 (00:15 -0400)]
Enable themed rooms to be constrained by level difficulty

The system of themed rooms currently makes it so that any themed room
can potentially generate anywhere a themed room can be placed. This is
problematic in the long run, since it makes it difficult to design new
rooms that are an appropriate amount of challenge at all levels of the
dungeon. (A few themed rooms already have this problem: a hero starting
out on level 1 probably won't live very long when the neighboring room
is full of giant spiders, or an arch-lich has generated in a mausoleum
nearby).

This commit adds optional "mindiff" and "maxdiff" properties for
themerooms defined as tables and exposes level_difficulty() to Lua. A
themeroom whose mindiff exceeds the current level difficulty, or whose
maxdiff is lower than the current level difficulty, is prevented from
being selected.

Because the set of rooms eligible to generate on a given level is no
longer fixed, the total frequency of all the rooms can't be computed
once per game when the file is first parsed, as it was before. In place
of this, the themerooms_generate() function now uses a reservoir
sampling algorithm to choose a room from among the eligible rooms,
weighted by frequency.

4 years agomsdos cross-compile follow-up bits
nhmall [Tue, 29 Sep 2020 13:41:31 +0000 (09:41 -0400)]
msdos cross-compile follow-up bits

add missing make rule for ../win/share files to cross-pre.2020

adjust .travis.yml to use the new approach for building msdos target

4 years agocron-daily Files update
nhmall [Tue, 29 Sep 2020 01:58:12 +0000 (21:58 -0400)]
cron-daily Files update

4 years agomove some left-over outdated files from old Mac
nhmall [Mon, 28 Sep 2020 22:42:27 +0000 (18:42 -0400)]
move some left-over outdated files from old Mac

4 years agocron-daily Files update
nhmall [Mon, 28 Sep 2020 22:33:46 +0000 (18:33 -0400)]
cron-daily Files update

4 years agofollow-up bit
nhmall [Mon, 28 Sep 2020 22:19:20 +0000 (18:19 -0400)]
follow-up bit

break into TARGETDIR and TARGETPFX

4 years agoMerge branch 'crosscompile-integration-amiga' into NetHack-3.7
nhmall [Mon, 28 Sep 2020 22:08:15 +0000 (18:08 -0400)]
Merge branch 'crosscompile-integration-amiga' into NetHack-3.7

4 years agoMerge branch 'crosscompile-integration-msdos' into NetHack-3.7
nhmall [Mon, 28 Sep 2020 22:07:55 +0000 (18:07 -0400)]
Merge branch 'crosscompile-integration-msdos' into NetHack-3.7

4 years agoMerge branch 'crosscompile-integration-core' into NetHack-3.7
nhmall [Mon, 28 Sep 2020 22:07:19 +0000 (18:07 -0400)]
Merge branch 'crosscompile-integration-core' into NetHack-3.7

4 years agoadd cross-compile recipe for amiga
nhmall [Mon, 28 Sep 2020 21:30:22 +0000 (17:30 -0400)]
add cross-compile recipe for amiga

Disclaimer: This is a minimal recipe, just to get someone else
started if they have a desire to get a full cross-compile of
NetHack-3.7 going for the Amiga. Some NetHack code bitrot was
corrected, and it does seem able to compile the game itself
to a point. See caveats below.

- If you want to obtain the cross-compiler and tools/libs for Amiga
         https://github.com/bebbo/amiga-gcc

  To our knowledge, a pre-built copy isn't available, so you have to
  obtain the source via git and build it on your system.

  The build prerequisite packages for Ubuntu are easily obtained:

    sudo apt install make wget git gcc g++ lhasa libgmp-dev \
        libmpfr-dev libmpc-dev flex bison gettext texinfo ncurses-dev \
        autoconf rsync

  The build prerequisite packages for macOS are apparently easily
  obtained via homebrew, but that was not tested:

    brew install bash wget make lhasa gmp mpfr libmpc flex gettext \
    texinfo gcc make autoconf

  After installing the prerequite packages and the cross-compiler
  it was a straightforward build:

        git clone https://github.com/bebbo/amiga-gcc.git
        cd amiga-gcc
        make update
    [Note that you may have to take ownership of the files in the
     bebbo repo via chown before succesfully carrying out the next
     steps]
        make clean
        make clean-prefix
        date; make all -j3 >&b.log; date
  The compiler pieces are installed in /opt/amiga by default which
  was satisfactory for our initial attempt, but if you want you can
  alter the prefix before you build if you want. That is all
  spelled out on the page at: https://github.com/bebbo/amiga-gcc

  The Amiga cross-compile can then be carried out by specifying
  CROSS_TO_AMIGA=1 on the make command line.

  For example:
       make CROSS_TO_AMIGA=1 all
       make CROSS_TO_AMIGA=1 package

You can explicitly include tty and curses support if desired, otherwise
you'll end up with a tty-only cross-compile build. The SDL1 pdcurses
support has not been tested.

       make WANT_WIN_TTY=1 WANT_WIN_CURSES=1 CROSS_TO_AMIGA=1 all

Also note that building the amiga targets using the make command
above, does not preclude you from building local linux or macOS
targets as well. Just drop the CROSS_TO_AMIGA=1 from the make
command line.

The cross-compiler hints additions are enclosed inside ifdef sections
and won't interfere with the non-cross-compile build in that case.

CAVEATS: The original NetHack Amiga build steps included the source for
some utilities that were built and executed on the amiga: txt2iff and
xpm2iff as part of the NetHack build procedure on amiga. Those did not
compile out-of-the-box on the linux host. They will either have to be:
    - ported to build and run on the linux or macOS cross-compile host

   or

    - their functionality will have to be rolled into amiga NetHack
      itself and executed on the target Amiga the first time the game
      is run, perhaps.

Good luck amiga aficionados, perhaps you'll be able to take this
initial effort forward and get NetHack-3.7 available on the amiga or
amiga-emulator. Let us know if you do, and we can roll changes in
if you provide them.

4 years agoadd cross-compile recipe for msdos
nhmall [Mon, 28 Sep 2020 20:28:15 +0000 (16:28 -0400)]
add cross-compile recipe for msdos

- If you want to obtain the djgpp cross-compiler and tools/libs for MSDOS,
which is available for linux and macOS, you can use the following script
to obtain it:

       sh sys/msdos/fetch-cross-compiler.sh

That script won't install anything, it is just file fetches. It will
store the cross-compiler in subfolders of lib and the hints files are
configured to find it appropriately there.

Note: Both the fetch and the msdos cross-compile package target require
unzip and zip to be available on your host build system.

Cross-compiler bits:
       https://github.com/andrewwutw/build-djgpp
   and the pre-built binary for your platform from:
       https://github.com/andrewwutw/build-djgpp/releases/download/v3.0/
   and a DOS-extender (for including in msdos packaging) from
       http://sandmann.dotster.com/cwsdpmi/csdpmi7b.zip
   and pdcurses from:
       https://github.com/wmcbrine/PDCurses.git

The MSDOS cross-compile can then be carried out by specifying
CROSS_TO_MSDOS=1 on the make command line.

For example:
       make CROSS_TO_MSDOS=1 all
       make CROSS_TO_MSDOS=1 package

You can explicitly include tty and curses support if desired, otherwise
you'll end up with a tty-only cross-compile build:
       make WANT_WIN_TTY=1 WANT_WIN_CURSES=1 CROSS_TO_MSDOS=1 all

Also note that building the msdos targets using the make command
above, does not preclude you from building local linux or macOS
targets as well. Just drop the CROSS_TO_MSDOS=1 from the make
command line.

The cross-compiler hints additions are enclosed inside ifdef sections
and won't interfere with the non-cross-compile build in that case.

4 years agoexpand sys/unix Makefiles scope
nhmall [Mon, 28 Sep 2020 20:25:31 +0000 (16:25 -0400)]
expand sys/unix Makefiles scope

Expand the use of the sys/unix Makefiles to be used for both normal
local builds and installs, as well as cross-compiles for other
platforms/targets.

Up until now, the primary unix Makefiles have treated util/host-side
component compiles, links and target object files just the same as
the game component compiles, links, and target object files.

Unfortunately, that meant that cross-compile effort typically had
to re-invent Makefiles specific to the cross-compile, creating a
maintenance burden and deviation from the typical local unix build
and providing a daunting obstacle to those that want to establish
build for a target environment/platform.

This change distinguishes between util/host-side component builds,
links, and component builds and targets object files destined for
the game (and other target platforms) in the Makefiles.

In theory, this will ease the effort for people that want to try to
resurrect NetHack perhaps on an old platform where it is no longer
viable to build NetHack-3.7 on the platform itself using old, outdated
compile tools, possibly with an old, outdated C dialect.

Some details:

-  Game-related targets in the Makefiles (as opposed to util/host-side
   targets that will be executed on the host), which could be destined
   for another platform in a cross-compile scenario are prefixed with
   $(TARGETPFX) so that they are distinguished.

   The default scenario where no cross-compiler is involved, is to
   define TARGETPFX to nothing, and therefore meant to have no effect.

-  Game-related compile and link commands in the Makefiles and their
   associated command line flags are distinguished from util/host-side
   compile and link commands in the Makefiles by using $(TARGET_CC),
   $(TARGET_CFLAGS), $(TARGET_LINK), $(TARGET_LFLAGS), $(TARGET_CXX),
   $(TARGET_CXXFLAGS), $(TARGET_LIBS).

   Those are used in the Makefile in place of $(CC), $(CFLAGS), $(LINK),
   $(LFLAGS), $(CXX), $(CXXFLAGS), $(LIBS).

   The default scenario where no cross-compiler is involved, defines
   the TARGET_ version of those Makefile variables to match their
   typical non-TARGET_ ounterparts.

-  The dependency lists in the Makefiles includes the $(TARGETPFX)
   prefix for stuff that would potentially be produced from a
   cross-compile build.

-  It adds pregame targets and $(PREGAME) variable, so that hints files
   can add some additional stuff if required for a cross-compile
   scenario.

   The default scenario where no cross-compiler is involved doesn't
   do anything for $(PREGAME).

-  It adds $(BUILDMORE) target and variable, so that hints files
   can add some additional things to be built for a cross-compile
   scenario.

-  It adds a "package" target and $(PACKAGE) variable, so that hints files
   can add steps for the target platform in a cross-compile
   scenario.

   The "install" target assumes local build and placement and
   isn't really applicable to a cross-compile scenario where the results
   really just need to be bundled up for transport to the target platform.

-  Also, this adds a pair of include files that can be updated with some
   cross-compile recipes as they evolve. They are named "cross-pre.2020"
   (for stuff to be included in the PRE section) and "cross-post.2020"
   for stuff to be included in the POST section via sys/unix/setup.sh.

   Those are included in sys/unix/hints/linux.2020 and
   sys/unix/hints/macOS.2020 hints files.

4 years agoPrevent any type of terrain overwrite from replacing stairs/ladders
copperwater [Mon, 28 Sep 2020 16:48:34 +0000 (12:48 -0400)]
Prevent any type of terrain overwrite from replacing stairs/ladders

Consider the following scenario: There's a level where there's a zone of
des.replace_terrain() between the stairs and some other objective, and
the terrain is something non-walkable like trees. There's a chance that
the path is entirely blocked off by random replace_terrain, so you
make the level set terrain to '.' along a randline (or normal line, or
whatever) between the randomly placed stairs and the other side of the
replace_terrain zone. The problem: this overwrote the stairs with a '.'
as well.

This can be worked around in the lua file by first picking the desired
location of the stairs, then setting the terrain that overlaps with the
stairs, then doing des.stair() after that, but this is awkward and hard
to read.

So this makes it impossible for anything calling SET_TYPLIT (only called
in sp_lev.c) to overwrite stairs. I can't really think of a situation
where a level designer would want to define stairs, then maybe overwrite
them.

4 years agoFix: randomly generated vaults weren't being filled
copperwater [Mon, 1 Jun 2020 14:08:21 +0000 (10:08 -0400)]
Fix: randomly generated vaults weren't being filled

This also caused the unexpected "You hear someone searching" message on
a level with an unlooted vault.

4 years agoFix: irregular rooms' walls were not part of the room
copperwater [Sun, 24 May 2020 18:59:50 +0000 (14:59 -0400)]
Fix: irregular rooms' walls were not part of the room

This was leading to problems with special themed rooms which were
irregular. Walls of ordinary rooms count as part of the room, and
irregular rooms should be no different.

This also makes doors on the room edge be considered as part of the
room, which affected special room entry messages and filling.

All irregular rooms' walls getting marked as SHARED instead of their own
room is probably a latent bug in upstream NetHack, but will prevent
future issues for when/if themed rooms that involve special
rooms/subrooms get added.