Commit Graph

12696 Commits

Author SHA1 Message Date
nhmall
f4331a2d03 adjust build procedures for added file
Builds for:
   sys/msdos/Makefile.GCC - for local build on msdos itself (untested)
   sys/unix/NetHack.xcodeproj/project.pbxproj   - for Xcode build
   sys/windows/Makefile.gcc - for Windows build via Ming-w64 (untested)
   sys/windows/Makefile.msc - for visual studio nmake build
   sys/windows/vs/files.props for visual studio solution/project build
2022-01-20 10:37:53 -05:00
nhw_cron
c47934d087 This is cron-daily v1-Jan-11-2022. 000files updated: Files 2022-01-19 18:52:52 -05:00
PatR
5f14f0ff57 options help one more time...
Move the help text for the 'O' command from the code into its own file
and allow that to be accessed from the '?' menu as well as by choosing
entry '?' in the 'O' menu.

sys/unix/Makefile.top has been updated to handle new 'optmenu', others
need to catch up.  The game will still build and run without the file
but asking for options menu help won't work until they do.
2022-01-19 14:22:21 -08:00
nhmall
30af8e0ddc more if (c) XtSetArg(...); num_args++; braces 2022-01-19 11:01:52 -05:00
PatR
aaa49e3e96 fix #K3520 - typo in dry_a_towel()
Message shown when hero sees a monster's wet towel become less wet:
"<Mon>'s {moist|wet} towel drie[ out]."  Corresponding message for
hero's towel spelled "dries" correctly.

Reported for to-be-3.7 but present since 3.6.0.
2022-01-19 00:58:08 -08:00
PatR
ec06e03dd4 redo the help for the 'O' command
This is a bit more complicated but far less intrusive.  Instead of
three dozen lines of introductory text before the menu entries start,
it now has one extra menu choice at the start:
|
|    For a brief explanation of how this works, type '?' to select
|    the next menu choice, then press <enter> or <return>.
|? - view help for options menu
|    [To suppress this menu help, toggle off the 'cmdaddist' option.]
|
Picking '?' shows essentially the same text as was in-line text in
the menu before.  Then doset() goes back to the start and re-runs the
options setting menu but without that extra entry the second time.
2022-01-18 16:27:32 -08:00
PatR
9f6f6c1250 fix #K3518 - "WHAMMM!!!" vs deafness
Kicking a door can produce "WHAMMM!!!".  "Wham" doesn't necessarily
imply any noise but there's a strong suggestion that it does, so a
deaf hero shouldn't be able to hear it.  Give alternate feedback,
"Thwack!!" when deaf, and sometimes give that even when not deaf.

Also tone down "WHAMMM!!!" to Whammm!!".
2022-01-18 14:13:56 -08:00
PatR
f420b9672f Qt: more '#' support
Add an entry for running an extended command to Qt's 'game' menu.
2022-01-17 14:38:16 -08:00
PatR
0a47a6fd3d Qt vs #repeat
For Qt's extended command selector, gray out the button for "repeat"
because picking it just causes the '#' command that led to that to
be repeated, bringing the extended command selector up again.

It can be chosen by typing "rep" but at each keystroke the grayed
out button is visible so having that behave differently from what
was probably expected should not come as a surprise.
2022-01-17 11:22:13 -08:00
nhw_cron
9cca0d88d8 This is cron-daily v1-Jan-11-2022. 005guidebook updated: doc/Guidebook.txt 2022-01-17 12:51:40 -05:00
nhw_cron
d781c4172e This is cron-daily v1-Jan-11-2022. 001datesub updated: ./doc/Guidebook.tex ./doc/Guidebook.mn 2022-01-17 12:51:25 -05:00
Pasi Kallinen
2e144e814d Change repeat into extended command 2022-01-17 17:13:59 +02:00
PatR
a0f222fe66 Qt extended commands
The substantial increase in extended commands has forced the grid of
commands to be expanded, otherwise the bottom of each column ends up
off the bottom of the screen.

The widget supporting the '#' command doesn't include scrollbars.
It really needs to be able to include those when needed but I don't
know how to do that.
2022-01-16 14:41:17 -08:00
Pasi Kallinen
89cfea0085 Fix up/down movement
I broke these in the recent commit changing the movement commands.
2022-01-16 21:46:46 +02:00
nhw_cron
8fa1e1ffa6 This is cron-daily v1-Jan-11-2022. 005guidebook updated: doc/Guidebook.txt 2022-01-16 12:59:47 -05:00
nhw_cron
0f12d6db39 This is cron-daily v1-Jan-11-2022. 001datesub updated: ./doc/Guidebook.tex ./doc/Guidebook.mn 2022-01-16 12:59:33 -05:00
Pasi Kallinen
e7fa065203 Change special keys into extended commands
Changes most of the special keys used in the main input loop
into extended commands:

- movement keys are now bound to extended commands, eg.
  #movewest and so on.

- m-prefix is now #reqmenu extended command, still bound to
  the 'm' key.

- run, rush, and fight are now extended commands, still bound
  to the same keys as previously.

- nopickup and runnopickup keys are removed.
  Nopickup was using 'm' key, the same as the m-prefix, so
  allow #reqmenu to modify movement commands to disable pickup.

- multiple prefix commands are allowed. This lets user to
  use #reqmenu, followed by #run, followed by movement to simulate
  runnopickup behaviour. (If necessary, adding runnopickup back
  as an extended command would be easy)
2022-01-16 14:48:24 +02:00
nhmall
dd28139a9e QT build warning
The reason that the QT6.2 build on Linux was getting a warning
on qt_main.cpp, but the QT6.2 build on macOS was not, was
because of a difference in compiler flags between clang++ and g++.

clang++ was using the
    -Wno-deprecated-declarations
and g++ wasn't, so add it.
2022-01-15 17:12:06 -05:00
PatR
9550ea1274 Qt splash window again
Redo the fix that was used to eliminate a Qt6 compile-time warning.
The splash image is a square and doesn't need any clipping mask.
2022-01-15 10:14:11 -08:00
PatR
f05a9f956c warning fixes
unpaid_cost():  'shkp' might be used without being initialized.  That
sort of warning is sometimes wrong but was correct in this instance.

qt_Splash():  the Qt 6.2 warning suggests switching the argument for
setMask() from QBitmap() to fromPixmap() but that doesn't work with
5.11.  However, switching from setMask() to setPixmap() does work,
and results in a crisp splash image instead of the fuzzy one I
recently complained about.  I've no idea what the right QT_VERSION
check ought to be but another QLabel propery is documented as "added
in 4.2" and the pixmap one has no such mention so I picked Qt < 4
for the code that's been in use and Qt >= 4 for the new code.
2022-01-14 22:42:41 -08:00
PatR
689aed55ca remove unused roles[].femalenum, races[].femalenum
and rename {roles,races}[].malenum to {roles,races}[].mnum.

Pull request #653 from entrez.  Male and female player character
monsters are no long separate even when their title's differ and all
the entries for femalenum in the roles[] and races[] arrays were set
to NON_PM (meaning not used in this case).

The update in the pull request overlooked win/Qt/qt_plsel.cpp which
had four references to .malenum so this is more than just the fixes
entry.

Closes #653
2022-01-14 14:09:00 -08:00
Michael Meyer
f5e3bc3d96 Remove gendered mons indices from roles, races
There are no longer distinct gendered versions of monsters, so femalenum
is unused (i.e. set to NON_PM) for all roles and races. Take a pass at
removing all uses of/references to femalenum, and rename 'malenum' to
'mnum' since it no longer has any particular association with
gender or sex.
2022-01-14 13:51:26 -08:00
PatR
c954c267c0 fixes entry for unpaid_cost regression fix
Pull request #654 from entrez:  the change to avoid impossible
"unpaid_cost: object wasn't on any bill" when examining inventory
while in a wall shared by multiple shops didn't work correctly for
shop-owned objects inside hero-owned containers (which worked prior
to that change).

Not fixed, and possibly not going to be:  if a hero-owned container
holds items from more than one shop, the cost appended to those items'
inventory entries might show the wrong amount if the relevant code
picks the wrong shk.  Presumably the wrong amount can also happen if
player puts items from one shop into a container owned by another
shop.

Closes #654
2022-01-14 13:33:17 -08:00
Michael Meyer
70f263f0ce Fix: unpaid_cost regression
Recent commit 5c14f3e fixed an issue with unpaid_cost when the hero is
in two shops at once (e.g. phasing through a shared wall), but
introduced new problems with finding the cost of a container with unpaid
contents -- an unpaid item in a player-owned container would generate
the same "unpaid_cost: object wasn't on any bill" impossible as the
issue the commit fixed.

The main issue was that finding the bill entry used to depend on finding
the shopkeeper, but after the change, finding the shopkeeper depended on
finding the bill entry; for a container with unpaid items which has a
shopkeeper, but no bill entry, this caused issues.

Revert part of 5c14f3e and tackle the problem another way, which should
correctly handle unpaid items in inventory or a container, even if they
belong to a mixture of different shops and/or the hero is on a space
shared between multiple shops.
2022-01-14 13:29:55 -08:00
PatR
6d6a266eed fixes entry for flyers 'swooping' down levels
Pull request from entrez:  flying hero who uses a hole or trap door to
move down to a lower level shouldn't fall to the floor when arriving.

Closes #655
2022-01-14 12:59:46 -08:00
Michael Meyer
7efba965d9 Don't 'fall' and self-stone when flying down
When a flying hero deliberately "swoops" through a trap door or hole,
consider the movement down to the next level to be controlled flight
rather than falling, preventing the sort of inadvertent touching of a
carried cockatrice corpse that happens when falling between levels.
2022-01-14 11:53:37 -05:00
nhmall
33cbcab6b3 tested Jan 11 visual studio updates 2022-01-13 21:45:05 -05:00
PatR
bbe83a8f05 yet more help
Add an extra couple of sentences explantion for control and meta.
Noticed an omitted command in the process.
2022-01-13 16:56:32 -08:00
PatR
9d3425917f more user help
A couple of additional things witnessed in between the frequent adds
shown by youtube (top prize goes to the recurring popup ad advertising
popup blocking).

He knew that ^D meant a control character but thought that he had to
type Ctrl+Shift+d instead of just being able to type Ctrl+d.  And he
had no idea what "meta key" meant.  (I don't think I've ever seen a
key labeled that myself.)
2022-01-13 16:32:37 -08:00
nhmall
c4b1a6c35d linking with Qt6 support on Linux 2022-01-13 18:27:21 -05:00
PatR
d5b7d8520c 'O' assistance
I don't care for this very much at all, but making it shorter will
reduce its usefullness.  It addresses one of the struggles exhibited
in the "a man and his cat" youtube video, where he was baffled when
selecting booleans didn't change their values and he later used Esc
instead of Enter after eventually finding number_pad.

This inserts some explanatory text (around three dozen lines,
unfortunately) at the start of 'O's menu.  Some of it is general menu
stuff, some is specific options stuff, and some attempts to fend off
various bug reports about options that do or don't persist across
save and restore or RC revisions that seem to have no effect.

The new introductory text can be disabled by turning off cmdassist.
Players who already do that don't need to see this.  Many who ignore
cmdassist and occasionally endure an outburst of compass directions
are likely to be goaded into turning it off.  I hope we won't need a
new 'optassist' for players who want to skip this but leave cmdassist
in general on.

It doesn't attempt to address his attempt to use arrow keys (possibly
arrows overloaded on number pad keys, or perhaps just digits on the
number pad while numpad mode was off) to navigate the menu then having
the Windows port 'helpfully' change those into hjkl which resulted in
selecting and subsequently unintentionally toggling some options on
the first page.  One was 'color' which he did notice and then re-run
'O' to successfully toggle it back on.  There was at least one other
which he either didn't notice to didn't both to reverse.
2022-01-13 14:25:01 -08:00
nhmall
2486b527ba remove a couple of debugging lines 2022-01-13 14:35:07 -05:00
nhmall
b6dae17b21 typo fix 2022-01-13 14:30:52 -05:00
nhmall
53f3016b43 build with Qt6 support on Linux 2022-01-13 14:09:41 -05:00
PatR
6fda779979 move_update()
Some changes I made while investigating the unpaid_code impossible.
Shouldn't produce any noticeable changes in behavior.
2022-01-11 23:42:13 -08:00
PatR
5c14f3e81d fix #K3514 - unpaid_cost() impossible
Fix the reported bug of using Passes_walls to carry an unpaid item
from inside a shop into the wall it shares with another shop
producing a situation where examining inventory issued an impossible
"unpaid_cost: object wasn't on any bill" when trying to append the
cost to the formatted inventory line.  u.ushops[], u.ushops0[], and
others are lists that can have up to four entries and the relevant
code was only checking the first one.

Not mentioned in the report:  continuing another step into the other
shop didn't get recognized as robbing the first shop, for a similar
reason.

For either of these bugs, digging a breach in the wall, paying off
the miffed shopkeeper, then stepping into the breach before it gets
repaired will probably trigger the same results without the need for
polymorphing into a xorn or earth elemental.  But not on the tourist
goal level test case since walls there are undiggable.

I didn't go looking for other instances of not checking all relevant
shopkeepers.  It wouldn't surprise me if there are some more.
2022-01-11 23:32:13 -08:00
PatR
8aa7f31b23 more Qt player selection
Mostly expands the comment about the layout of the selection dialog.
Also adds filtering available roles and races by the currently checked
alignment.
2022-01-11 14:56:33 -08:00
PatR
27a2c530e3 monnum_to_glyph() followup
This was a fix for missing parentheses, but that just became redundant.
Add it anyway, for the reformatting.
2022-01-11 14:42:28 -08:00
nhmall
0dd5d69da9 Guidebook.txt update from cron job 2022-01-11 17:38:46 -05:00
nhw_cron
ce3923e208 This is cron-daily v1-Jan-11-2022. 001datesub updated: ./doc/Guidebook.tex ./doc/Guidebook.mn 2022-01-11 17:37:18 -05:00
nhmall
ec55b04ace macro argument monnum_to_glyph
In file included from ../include/hack.h:217,
                 from ../win/Qt/qt_plsel.cpp:18:
../win/Qt/qt_plsel.cpp: In member function ‘void nethack_qt_::NetHackQtPlayerSelector::populate_roles()’:
../win/Qt/qt_plsel.cpp:378:53: warning: enumerated and non-enumerated type in conditional expression [-Wextra]
  378 |         gf = monnum_to_glyph(roles[i].malenum, is_f ? FEMALE : MALE);
../include/display.h:610:27: note: in definition of macro ‘monnum_to_glyph’
  610 |                         ((gnd == MALE) ? GLYPH_MON_MALE_OFF : GLYPH_MON_FEM_OFF))
      |                           ^~~
../win/Qt/qt_plsel.cpp: In member function ‘void nethack_qt_::NetHackQtPlayerSelector::populate_races()’:
../win/Qt/qt_plsel.cpp:407:53: warning: enumerated and non-enumerated type in conditional expression [-Wextra]
  407 |         gf = monnum_to_glyph(races[j].malenum, is_f ? FEMALE : MALE);
../include/display.h:610:27: note: in definition of macro ‘monnum_to_glyph’
  610 |                         ((gnd == MALE) ? GLYPH_MON_MALE_OFF : GLYPH_MON_FEM_OFF))
      |                           ^~~
2022-01-11 17:00:31 -05:00
Kenneth Lorber
6991800adc Merge branch 'keni-datesub2' into NetHack-3.7 2022-01-11 16:49:21 -05:00
Pasi Kallinen
1f2d16082e Fix shopkeeper Kop summons causing segfault
... if it happened on a level with no downstairs, such as the tourist quest.
2022-01-11 22:55:43 +02:00
Kenneth Lorber
3a4cee5955 Enable automated date generation on the Guidebook source files. 2022-01-11 15:39:20 -05:00
PatR
a8e9e1b488 suppress obsolete restore_attrib()
moveloop() has been calling restore_attrib() every turn, and
restore_attrib() loops through all six characteristics every time
to check for ones that have temporary adjustments timing out.  But
ATIME(characteristic) is never set anywhere and no time outs would
occur.  So delete the call to restore_attrib() from moveloop().

This leaves that no-longer-called routine in place and updates it
to handle Wounded_legs properly in case it ever does get used.

Also, add a comment about "restore ability" not fixing temporarily
lost characteristics due to hunger or wounded legs.  And update
unfixable_trouble_count() to check for those so that restore ability
won't say "you feel great" when it fails to fix them.
2022-01-11 11:25:04 -08:00
PatR
ffeb0e27a8 fix recent Wounded_legs fix
Wounded_legs was changed from (HWounded_legs || EWounded_legs) to
just (HWounded_legs), but when the timeout code decremented the timer
to 0, HWounded_legs became 0 and heal_legs() operated as if there was
nothing to repair and hero didn't recover from temporarily lost Dex.
Change Wounded_legs back to (HWounded_legs || EWounded_legs).
2022-01-11 10:25:50 -08:00
PatR
1069777bc6 Qt player selection dialog
During role/race/gender/alignment selection, when gender gets toggled
replace the gender-specific role titles and their icons to reflect
new gender value.  And enable or disable Valkyrie choice depending
upon the gender value, not just current race value.

This ended up revising a lot of the NetHackQtPlayerSelector code,
eliminating some redundancies and being more careful with the use of
validrace()/validgend()/validalign().  That still isn't bulletproof.

It also changes the two instances of buttonPressed that were drawing
Qt6 warnings from connect() at run-time with buttonClicked.  That
works as intended with Qt5 and might eliminate those.

The code to use female player character tiles looks correct to me
but when I toggle gender, role titles change but their icons don't.
I don't know what's going on here.  Some ealier code always specifies
MALE but that code isn't used according to various prints to stderr
that I temporarily inserted.
2022-01-10 13:23:09 -08:00
nhmall
560b74fabc remove some dev code
Closes #648
2022-01-10 14:18:12 -05:00
Pasi Kallinen
e36145082a More "user canceled" extended command return values 2022-01-10 17:37:48 +02:00
SHIRAKATA Kentaro
a2a40c6b0b fix typo in Guidebook.tex 2022-01-10 21:36:16 +09:00