Commit Graph

11119 Commits

Author SHA1 Message Date
nhmall
43112cec01 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,
     ^~~~~~
2020-10-05 09:24:42 -04:00
nhmall
ab5c8dff05 cron daily Files update 2020-10-04 21:14:59 -04:00
nhmall
ac493aa455 placement of libnethack targets required adjusting
From -PRE to -POST section
2020-10-04 21:12:03 -04:00
nhmall
d8961b0067 updates for LIBNH build 2020-10-04 20:48:09 -04:00
nhmall
7bf5172f2e unixmain and libnethackmain diverged in the updated PR
put unixmain back the way it was, now that libnethackmain is in the tree after all.
2020-10-04 20:14:45 -04:00
nhmall
c3683eaa9b Merge branch 'libnethack2' into NetHack-3.7 2020-10-04 20:13:35 -04:00
nhmall
60dbb4c12f the .gitignore doesn't match the target locations on the merged code
Leave it be for now.
2020-10-04 20:09:28 -04:00
nhmall
11b5f29e07 merging conflict fixup 2020-10-04 20:07:57 -04:00
nhmall
15c1cb648d integrate updates made to PR earlier on Oct 4 2020-10-04 20:05:29 -04:00
nhmall
751d5ef76c Merge branch 'libnethack' of https://github.com/apowers313/NetHack into libnethack2 2020-10-04 19:51:37 -04:00
PatR
49ef50fc54 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.
2020-10-04 16:34:59 -07:00
Adam Powers
dc1c85faa4 more friendly javascript arguments 2020-10-04 14:04:56 -07:00
Adam Powers
ac4649e63f add globals, constants, and helpers 2020-10-04 14:03:04 -07:00
nhmall
61185f3405 cron daily Files update 2020-10-04 15:26:50 -04:00
nhmall
de0195191b update original documentation for pr385
Changes to be committed:
	modified:   sys/lib/README.md
2020-10-04 15:19:58 -04:00
nhmall
f6b0d86ce6 Merge branch 'NetHack-3.7' 2020-10-04 14:54:41 -04:00
nhmall
b41b897565 remove two unneeded files 2020-10-04 14:51:10 -04:00
Adam Powers
dc2d757399 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.
2020-10-04 14:46:32 -04:00
Adam Powers
741e6fd5b7 initial shim graphics 2020-10-04 14:46:31 -04:00
PatR
9bad6840f4 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.)
2020-10-04 07:36:12 -07:00
nhmall
ef6978ec51 update sys/winnt/console.rc 2020-10-02 16:01:04 -04:00
nhmall
ee08122771 Guidebook.txt update 2020-10-02 12:32:11 -04:00
nhmall
af739196cf bump Guidebook date to reflect most recent changes 2020-10-02 12:29:26 -04:00
Pasi Kallinen
40648503b2 Increment EDITLEVEL due to safe_wait 2020-10-02 19:11:15 +03:00
Pasi Kallinen
fac154d364 Fix some Guidebook.tex errors 2020-10-02 19:00:40 +03:00
Pasi Kallinen
396b819988 Add safe_wait to toggle search and wait prevention 2020-10-02 19:00:40 +03:00
PatR
aaf88f9662 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.
2020-10-02 04:51:15 -07:00
PatR
d1e1b0cdc9 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).
2020-10-01 17:59:58 -07:00
PatR
9045ccb63d 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.
2020-10-01 16:41:56 -07:00
PatR
ada5ffd627 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.
2020-10-01 16:16:26 -07:00
nhmall
1261aedd45 more recover and cross-compiling 2020-10-01 10:04:05 -04:00
PatR
2e90c1ebd4 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.
2020-10-01 03:16:14 -07:00
nhmall
92902fd128 make sure recover utily is built for the CROSSCOMPILE target 2020-09-30 21:45:45 -04:00
Pasi Kallinen
6a35a84c56 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)
2020-09-30 19:49:10 +03:00
Pasi Kallinen
fb7b578af1 Make piranhas faster and more bitey
Piranhas are pretty bland, so make them faster and give them
an extra bite attack.

(via xNetHack)
2020-09-30 19:05:02 +03:00
nhmall
a47e742892 cron daily Files update 2020-09-29 19:44:13 -04:00
nhmall
1ff5b519c8 reinstate one $(CROSSCOMPILE_TARGET) in sys/winnt/Makefile.msc
It was removed but shouldn't have been.
2020-09-29 15:13:52 -04:00
nhmall
945d10cfbc 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.
2020-09-29 15:01:37 -04:00
Pasi Kallinen
476990b303 Fixes and lua doc 2020-09-29 17:35:16 +03:00
copperwater
3d4ba4d666 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).
2020-09-29 17:30:11 +03:00
copperwater
999222a8a4 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.
2020-09-29 17:30:11 +03:00
copperwater
c5b5a869d7 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.
2020-09-29 17:30:11 +03:00
nhmall
5e9303f9df 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
2020-09-29 09:41:31 -04:00
nhmall
560ace217b cron-daily Files update 2020-09-28 21:58:12 -04:00
nhmall
d33cc59c64 move some left-over outdated files from old Mac 2020-09-28 18:42:27 -04:00
nhmall
24a554ecaf cron-daily Files update 2020-09-28 18:33:46 -04:00
nhmall
4b58cfd201 follow-up bit
break into TARGETDIR and TARGETPFX
2020-09-28 18:19:20 -04:00
nhmall
5eada896e2 Merge branch 'crosscompile-integration-amiga' into NetHack-3.7 2020-09-28 18:08:15 -04:00
nhmall
19d3d24cc0 Merge branch 'crosscompile-integration-msdos' into NetHack-3.7 2020-09-28 18:07:55 -04:00
nhmall
ba34897fa6 Merge branch 'crosscompile-integration-core' into NetHack-3.7 2020-09-28 18:07:19 -04:00