Commit Graph

14381 Commits

Author SHA1 Message Date
nhmall
91ce86326b Merge branch 'qt6-buttons' of https://github.com/chasonr/NetHack into NetHack-3.7 2022-10-29 10:33:37 -04:00
nhmall
a51c983a13 Revert "PR913 - Another Qt 6 signal: mapped -> mappedString"
This reverts commit 57617da39b.
2022-10-29 10:33:17 -04:00
PatR
ad74d9e407 fix RC file CHOOSE '[section] #comment'
Two years ago I modified the parsing for [section] labels for the
config file's CHOOSE directive to allow end-of-line comments, but
the code used had a logic error (don't think I can blame it on
copy+paste).  It looked for '#' after ']' but allowed anything--
rather than just spaces--in between.

"[section-name]abc#comment" would become "section-name" as if the
trailing junk hadn't been present.  Parsing that should produce
"section-name]abc" and get rejected as invalid.
2022-10-28 23:26:39 -07:00
PatR
8034a0d60e w_blocks()
Add the fix that silences whatever extra warning was enabled for the
onefile testing.  The original already worked as intended.
2022-10-28 16:27:41 -07:00
PatR
cec7da0505 another comment typo fix 2022-10-28 00:30:38 -07:00
PatR
d2fe949ab9 yet more knockback induced dismount
The revision to directed dismount during knockback introduced a bug.
Need parentheses to prevent || that follows ?: from binding with :.
2022-10-28 00:27:32 -07:00
Ray Chason
57617da39b PR913 - Another Qt 6 signal: mapped -> mappedString 2022-10-27 22:59:30 -04:00
Ray Chason
defecc5110 Another Qt 6 signal: mapped -> mappedString 2022-10-27 22:50:17 -04:00
nhmall
2fef1f497c more Guidebook updates 2022-10-27 22:27:00 -04:00
nhmall
ee03f5c2ba Merge branch 'showgold-guidebook-update' of https://github.com/entrez/NetHack into NetHack-3.7 2022-10-27 22:23:34 -04:00
nhmall
95adc9d661 Merge branch 'pr913' into NetHack-3.7 2022-10-27 22:15:00 -04:00
nhmall
1c0261a397 Merge branch 'qt6-buttons' of https://github.com/chasonr/NetHack into pr913 2022-10-27 22:14:13 -04:00
Ray Chason
5c001d3a32 Use idPressed signal for Qt 6 2022-10-27 21:51:10 -04:00
PatR
e121eee867 end-of-game disclosure for gold in invent on tty
Reported by entrez:  disclosing inventory at end of game did not show
gold.  Not mentioned:  only for tty.

It was using the same window as gets used for perm_invent (although
not shown _as_ perm_invent because end of game turns that off) and the
default for whether to show gold is different for tty than for other
interfaces due use of experimental TTYINV from player's environment.

Force the end of game inventory disclosure to work the same as the
dumplog inventory listing and use a different window, by falsely
telling display_inventory() that a response is requested.  Works but
the whole inventory mechanism has become quite convoluted.
2022-10-27 17:25:14 -07:00
PatR
9682f84aed more knockback induced dismount
When looking at the previous commit, I realized that my comment about
radius 1 was wrong.  The original code prefers dismounting to spots
that are orthogonal to the steed's position over diagonal ones.  It
doesn't say why.
2022-10-27 15:55:57 -07:00
PatR
da32b572a6 knockback knocking riding hero out of saddle
I've implemented targetted dismount such that being knocked out of
the saddle will place the hero opposite the attacker in preference
to a random spot adjacent to the steed.  If that opposite spot
isn't appropriate, the two spots next to it get tried.

In these map fragments, H is knocking mounted hero off of u.  The
digits indicate priority of potential destinations.

|.....   |..21.
|...2.   |..u2.
|.Hu1.   |.H...
|...2.   |.....

If spot 1 isn't acceptable, both of spots 2 (in random order) will
be tried next.  If those aren't acceptable either, it will try the
other 5 spots adjacent to the steed (the one of those with the
attacker will always be unacceptable).  And as before, it none of
those work, it uses enexto() to pick a random spot as close to the
steed as feasible.

Not knockback:  when dismounting due to polymorph, avoid diagonal
adjacent spots if hero's new form can't move diagonally.  (The hero
can't already be in no-diagonal form because riding requires that
the rider be humanoid.  I keep thinking the restriction is "can't
be polymorphed" but that isn't correct.)
2022-10-27 15:33:49 -07:00
PatR
69f62e5872 fix comment typo 2022-10-27 14:52:50 -07:00
Michael Meyer
f39a158bdd Update Guidebook #showgold info
The #showgold command now does mention known contained gold in your
inventory, so the various lines in the Guidebook which explicitly state
that it doesn't needed to be updated.  Wish I had noticed this in time
to put it into the previous Guidebook patch I submitted, but what can
you do.
2022-10-27 16:21:11 -04:00
nhmall
8b89917ede be consistent for all patforms in fixes3-7-0.txt 2022-10-27 15:49:16 -04:00
nhmall
3cd99786f2 doc/Guidebook.txt update 2022-10-27 11:33:10 -04:00
nhmall
c2df67b1f1 Guidebook date stamp 2022-10-27 10:47:03 -04:00
Michael Meyer
19a02b7e18 Guidebook updates 2022-10-27 10:40:54 -04:00
nhmall
b70a3d198e add a fixes entry for pull request #910 2022-10-27 10:07:32 -04:00
nhmall
bddaf28ea6 Merge branch 'unicode-Qt' of https://github.com/chasonr/NetHack into NetHack-3.7 2022-10-27 10:05:04 -04:00
nhmall
8c9d4de9ed Merge branch 'no-urace-in-is_foo' of https://github.com/entrez/NetHack into NetHack-3.7 2022-10-27 10:04:11 -04:00
Michael Meyer
580c5a6e99 Remove urace test from is_elf, etc, macros
Reverts 690e072, which changed the various is_foo macros from this:

| #define is_elf(ptr) ((((ptr)->mflags2 & M2_ELF) != 0L)

to this:

| #define is_elf(ptr) ((((ptr)->mflags2 & M2_ELF) != 0L)     \
|                      || ((ptr) == g.youmonst.data &&       \
|                          !Upolyd && Race_if(PM_ELF)))

This is a problem because g.youmonst.data is not unique to the hero:
the '(ptr) == g.youmonst.data' test will also be true of all player
monsters of the same role.  For this reason, any of those player
monsters will be treated as sharing the hero's race, producing strange
results.  For example, if the player is an elven ranger, any ranger
player monster generated will be considered 'elven' too (so will get a
to-hit bonus when attacking orcs, etc) -- but only while the hero is
unpolymorphed.

There are already other ways of checking the hero's race in addition to
her current polyform, most notably the maybe_polyd() macro.  maybe_polyd
or something similar is already used in nearly all the cases where the
hero's race is being evaluated, meaning Race_if gets used instead when
the hero is in her natural form.  So I think the check of the hero's
race in is_foo had very little effect except for the unintended
side-effects on player monsters.

In reviewing all the uses of is_{elf,dwarf,gnome,orc,human}, I noticed
only one case that relied on the hero-race-checking behavior.  That has
been changed in this commit to use maybe_polyd (there's another 'raw'
is_human(g.youmonst.data) a few lines down, but it doesn't need
maybe_polyd since it already distinguishes between 'hero in nonhuman
polyform' vs 'nonpolyd or human polyform').  same_race(mondata.c) is
another case where &g.youmonst.data can be passed to is_foo, but
everywhere that calls it for the hero also calls your_race() or
same_race(&mons[Race_switch]) to handle the racial case.
2022-10-27 09:53:33 -04:00
Ray Chason
8e457002a3 Add WC2_U_UTF8STR and WC2_U_24BITCOLOR 2022-10-26 22:33:47 -04:00
nhmall
116f80e8f5 config.h band should have been left off prev 2022-10-26 14:28:29 -04:00
nhmall
88f6df2d8b some tabs to spaces
cd src
    grep -P -n '\t' *.c | grep -v "1:"
    cd ../include
    grep -P -n '\t' *.h | grep -v "1:"
    cd ..

side note: win/Qt/*.cpp are full of tabs
2022-10-26 14:21:23 -04:00
nhmall
1cf4f9f7f9 another README update 2022-10-26 10:34:22 -04:00
nhmall
8e2ccb3ccc another README update
macOS Ventura (macOS 13) was tested
- successful NetHack build
- game start/save/restore
2022-10-26 10:29:27 -04:00
nhmall
faaea0c057 README update 2022-10-26 09:07:44 -04:00
PatR
535cb2e5e9 another bit of reformatting 2022-10-26 01:22:00 -07:00
PatR
13fb141ddd more steadfast
Make changes similar to the suggested patch from entrez:  support
for 'youmonst' as the monster passed to m_carrying().  This doesn't
change carrying(otyp) to call m_carrying(&g.youmonst,otyp) though.

Also, treat being on the Plane of Air or in an air bubble on the
Plane of Water similar to flying or levitating:  wielded Giantslayer
(or carried loadstone) doesn't prevent knockback there.
2022-10-26 01:13:01 -07:00
PatR
313cf1ccd8 github pull request #909 - Qt yn prompt
Pull request from chasonr:  remove NUL characters from constructed
prompt for Qt_yn_function().  I couldn't see any with Qt 5.11 on
OSX 10.11.6, but with some font(s) or Qt newer versions they were
visible as reported in issue #566 about 15 months ago.

Closes #909
2022-10-25 15:33:08 -07:00
Ray Chason
ec205c5a7b Remove null characters from Qt y/n prompt
Fixes issue #566.
2022-10-25 15:20:19 -07:00
PatR
1ccad11fab \#wizborn fix
The #wizborn command shows 'E' for an extinct species and 'G' for a
genocided one, but if a species first becomes extinct and then later
gets genocided, instead of showing both flags it stopped showing
either.  I was going to add a second flag column and show 'E' and 'G'
separately but decided to stick with one column and display 'X' for
the unlikely 'both extinct and genocided' case.
2022-10-25 13:58:26 -07:00
nhmall
7f94d04013 fix warning when ENHANCED_SYMBOLS is not defined
display.c:1484:23: warning: excess elements in struct initializer [-Wexcess-initializers]
    { 0U, { 0, 0}, 0, 0 }
                      ^
1 warning generated.
2022-10-25 14:12:47 -04:00
nhmall
fc6c524a5e Revert "fix warning when ENHANCED_SYMBOLS is not defined"
This reverts commit 88cc5246b4.
2022-10-25 14:08:17 -04:00
nhmall
88cc5246b4 fix warning when ENHANCED_SYMBOLS is not defined
display.c:1484:23: warning: excess elements in struct initializer [-Wexcess-initializers]
    { 0U, { 0, 0}, 0, 0 }
                      ^
1 warning generated.
2022-10-25 13:59:19 -04:00
PatR
1c24f9f143 refine genocide prompting
More PR #882; give a different message for empty input than "such
creatures do not exist".

The new message mentions 'none' (with single quotes) as a potential
choice so recognize "'none'" as well as "none" to decline.
2022-10-25 03:44:07 -07:00
PatR
eeb208b3a9 X11 getlin()'s prompt
Reissuing getlin() with a different prompt wasn't reliably resizing the
X11 prompt widget.  After a lot of hacking away at win/X11/dialogs.c I
eventually tried setting the response portion of the widget first and
got much better results, enough to throw away the tentative changes to
dialogs.c.

There's still a lot of room from improvement but I think it would need
to replace the ghostview prompting instead of trying to massage that.
2022-10-25 02:55:49 -07:00
PatR
d7d3becf24 more PR #906 - steadfastness
If someone gets hit for a knockback effect but resists it due to
wielding Giantslayer or carrying a loadstone, give feedback saying
so, otherwise the lack of knockback is indistinguishable from an
ordinary hit.

The message is not likely to appear for non-hero target since that
target needs to have special equipment.  A hero wielding Giantslayer
might see it enough for the player to become annoyed; if so,
MSGTYPE=hide could be used to suppress it.
2022-10-24 10:32:17 -07:00
nhmall
e2bd3b6b55 warning fix
mhitm.c: In function 'hitmm':
mhitm.c:583:30: warning: '%s' directive writing between 8 and 9 bytes into a region of size between 0 and 255 [-Wformat-overflow=]
  583 |             Sprintf(buf, "%s %s", magr_name,
      |                              ^~
In file included from ../include/config.h:671,
                 from ../include/hack.h:10,
                 from mhitm.c:6:
../include/global.h:279:24: note: 'sprintf' output between 10 and 266 bytes into a destination of size 256
  279 | #define Sprintf (void) sprintf
mhitm.c:583:13: note: in expansion of macro 'Sprintf'
  583 |             Sprintf(buf, "%s %s", magr_name,
      |             ^~~~~~~
2022-10-24 09:14:35 -04:00
Ray Chason
08de47ece1 Add Unicode support to Qt 2022-10-23 20:53:07 -04:00
PatR
027cf3bf4d map documentation refinement
Add minor detail to recently added map description in doc/window.txt:
origin is in upper left and positive y goes downward, so not typical
Cartesian x,y coordinate plane.
2022-10-23 15:31:12 -07:00
nhmall
b40ef88e1e nmake warning
NMAKE : warning U4004: too many rules for target 'o\x86\cppregex.o'
2022-10-23 12:38:22 -04:00
nhmall
6f20939db9 support Unicode on Win32 pr #903 2022-10-23 12:34:16 -04:00
nhmall
6fd0bd3169 Merge branch 'unicode-win32' of https://github.com/chasonr/NetHack into NetHack-3.7 2022-10-23 12:32:04 -04:00
PatR
39560aac49 fix github issue #907 - bad shade logic
Issue reported by vultur-cadens:  one of the checks for whether a
shade would be harmed by an attack was erroneously inside a block
of code that only executed when you could see the attack.  Basic
physical damage wasn't affected but some monster (or poly'd hero)
damage types that shouldn't affect shades didn't when seen but did
when unseen.

Could also get "attack passes harmlessly through the shade" when
an unseen attack for physical damage hit and failed to deal damage.

fixes #907
2022-10-23 01:11:14 -07:00