Commit Graph

9672 Commits

Author SHA1 Message Date
Pasi Kallinen
8762ab38ef Silent monsters in stinking clouds don't cough
... and you can hear the coughing some distance away,
even if you can't see the monster.
2024-04-04 12:32:31 +03:00
Pasi Kallinen
f0fdd3c371 Make hero polyed into fog cloud emit clouds
Also prevent cloud creation giving a message, if it was a single
cloud on hero and deals no damage.
2024-04-04 12:17:44 +03:00
Pasi Kallinen
7f1bbdfb0e Hero polyed into fog cloud will also maintain clouds 2024-04-04 11:33:09 +03:00
Pasi Kallinen
e2d3368b0e Make hero polyed into hezrou also stink 2024-04-04 11:22:20 +03:00
nhmall
1487d05c92 resolve 3 warnings during DOS cross-compile
wizcmds.c: In function 'wiz_custom':
wizcmds.c:1845:40: warning: format '%d' expects argument of type 'int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
 1845 |         Sprintf(bufa, "%s: colorcount=%d %s", wizcustom, iflags.colorcount,
      |                                       ~^                 ~~~~~~~~~~~~~~~~~
      |                                        |                       |
      |                                        int                     uint32_t {aka long unsigned int}
      |                                       %ld
wizcmds.c: In function 'wizcustom_callback':
wizcmds.c:1895:32: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint32' {aka 'long unsigned int'} [-Wformat=]
 1895 |             Sprintf(bufc, "%011x", cgm->customcolor);
      |                            ~~~~^   ~~~~~~~~~~~~~~~~
      |                                |      |
      |                                |      uint32 {aka long unsigned int}
      |                                unsigned int
      |                            %011lx
wizcmds.c:1899:37: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint32' {aka 'long unsigned int'} [-Wformat=]
 1899 |                 Sprintf(bufu, "U+%04x", cgm->u->utf32ch);
      |                                  ~~~^   ~~~~~~~~~~~~~~~
      |                                     |         |
      |                                     |         uint32 {aka long unsigned int}
      |                                     unsigned int
      |                                  %04lx
2024-04-03 12:15:51 -04:00
Pasi Kallinen
defb5d5f80 Pets considered any noise made by hero as whistling
In 3.6.2 parts of the wakeup code were merged together, and this
caused pets consider any noise made by the hero - such as hitting
iron bars or digging - as whistling for them to come to the hero.

Change it to only consider actual whistling and ringing a bell.
2024-04-03 12:46:15 +03:00
PatR
6aaab97044 Sunsword's #invoke for blinding ray
Support aiming at self (to become blinded) and aiming up/down (to
light the hero's current map spot only, persistently rather than
temporarily).  Also, recognize cancel at the "direction?" prompt to
not leave the #invoke cooldown count set when aborted.

Aiming at self was a little trickier than expected to test because
you're blindness-resistant when wielding Sunsword.  But it doesn't
have to be wielded to be invoked.
2024-04-02 19:56:39 -07:00
Pasi Kallinen
e821274382 Excalibur is much harder to get if hero is not a knight 2024-04-02 20:41:54 +03:00
PatR
de69dd750b some zap.c formatting 2024-04-01 14:18:25 -07:00
PatR
7f12c7e0e6 comment thinko 2024-03-31 15:46:10 -07:00
Pasi Kallinen
44575ab347 Prevent blinding ray at yourself
The code doesn't handle zapping blinding ray at yourself;
maybe it should be changed to handle it, but for now just
prevent Sunsword blinding the hero.
2024-03-31 20:24:02 +03:00
Pasi Kallinen
c71e8ec8d4 Sunsword can be invoked to create a blinding ray 2024-03-31 19:43:33 +03:00
Pasi Kallinen
1b0ba3433c Show damage only when any damage is dealt 2024-03-31 18:51:34 +03:00
nhmall
a3e9c7db2d follow-up: shorten some lines; add an assert 2024-03-31 08:28:50 -04:00
nhmall
8ccd8b8937 fix reported segfault in add_custom_nhcolor_entry()
Program terminated with signal SIGSEGV, Segmentation fault.
77      ../sysdeps/x86_64/multiarch/strlen-evex.S: No such file or directory.
(gdb) bt
    at glyphs.c:419
    at glyphs.c:173
    op=0x5a34af30a574 "DECgraphics") at options.c:3418
2024-03-31 08:06:42 -04:00
PatR
dfd5ca6cad more display of T-shirt/apron text at end-of-game
This doesn't directly affect nethack, but it should prevent HTML
dumplog for variants that include that from showing T-shirt and
apron slogan text in tooltips for the 'gameover' map.  And it makes
end-of-game attribute disclosure slightly less susceptible to being
unintentionally reverted.

Code in pull request #300 shows that it uses do_screen_description()
for tooltips and do_screen_description() uses distant_name() for
objects so that's where I added this change that will trigger the
code from commit c6992777f5.
2024-03-30 07:52:23 -07:00
nhmall
a1a1049890 follow-up for an apparent conflict in Qt5 2024-03-29 16:10:33 -04:00
nhkeni
055246f43d one more staticfn followup 2024-03-29 14:10:22 -04:00
nhkeni
22d64456a6 staticfn followup 2024-03-29 13:45:27 -04:00
nhmall
af3a0db083 onefile fix 2024-03-29 07:02:04 -04:00
PatR
e4ffda7386 blanking novels
Simplify converting novels into blank spellbooks via water damage.
Since that can occur, update cancellation to do it too.
2024-03-28 23:44:34 -07:00
PatR
636432e883 variant spellings of "master lich"
From a reddit thread:  after genociding "arch-lich", player's next
target was "master-lich".  The character was a monk who immediately
died of genocide.

("Master<almost anything>" other than "master mind[ ]flayer" or
"Master Thief" or "Master Assassin" matches level 30 monk rank "Master".)

Rather than muck about with fairly complicated matching code, just add
"master-lich" and "masterlich" as explicit variations.
2024-03-28 03:10:38 -07:00
PatR
c6992777f5 end-of-game attribute disclosure in wizard mode
Disclosing final inventory while wearing an alchemy smock reported
the apron's slogan accurately but then disclosing attributes gave
different text if it was conferring poison resistance and/or acid
resistance.  The extra text was unneeded/unwanted there anyway, so
simply suppress it rather than force it to be accurate.

3.6.x had the same issue but it wasn't detectable there because it
only had extra text for T-shirts and they don't confer attributes.
2024-03-27 23:52:37 -07:00
PatR
18baf188ea fix github issue #1220 - shattering unseen weapon
Reported by NetSysFire:  if hero dealt a weapon-shattering melee
blow to an unseen target, the weapon was accurately described in
the accompanying message
|Its <formatted-weapon-description> is shattered from the force...!

If the hero can't see or sense the monster, report
|Its weapon is shattered from the force of your blow!

If the monster isn't seen but is sensed, then
|<Monster>'s weapon is shattered from the force of your blow!

Fixes #1220
2024-03-26 13:29:29 -07:00
PatR
fddc966a3e alternate symbol parsing
Make the array of alternate symbol names 'static' and move it to the
top if its routine.

Add S_suit as another alternate for S_armor.
2024-03-26 11:22:42 -07:00
nhmall
1864480522 get rid of a [-Wformat-overflow=] warning 2024-03-26 08:25:32 -04:00
nhmall
875c83cc2c fix build when ENHANCED_SYMBOLS is not defined 2024-03-25 21:25:27 -04:00
nhmall
80fb1b5f54 provide way for developer to verify custom colors and symbols in effect
' #wizcustom
2024-03-25 20:42:48 -04:00
nhmall
dc7df7c407 deal with added field in shuffle_customizations() 2024-03-25 00:15:06 -04:00
nhmall
e3409fd4af reinstate 256 color 2024-03-24 23:47:24 -04:00
nhkeni
e43564bee4 clarify panic message from #panic 2024-03-24 19:53:48 -04:00
nhmall
29495f77f7 runtime toggle of ENHANCED_SYMBOLS customsymbols 2024-03-24 19:39:36 -04:00
nhmall
780d0912ee indent bit 2024-03-24 17:01:41 -04:00
nhmall
0b35079acc add customcolors option
customcolors (default) and !customcolors toggle whether the
custom colors get applied to the glyphmap.
2024-03-24 16:55:23 -04:00
nhmall
d15ab932e7 more code moves
move an ENHANCED_SYMBOLS function from glyphs.c to utf8map.c
2024-03-24 15:36:19 -04:00
nhmall
17578590ea tidy up glyphs.c a little bit 2024-03-24 15:25:57 -04:00
nhmall
750cf7f619 rename glyphmap nhcolor field to customcolor 2024-03-24 11:04:31 -04:00
nhmall
e2121ecfab take another stab at shuffle_customizations() 2024-03-24 10:21:19 -04:00
nhmall
8abbb2bca1 unused variable warning fix 2024-03-24 07:22:50 -04:00
Pasi Kallinen
f131942dd2 Another tamedog message
Give a different message when a peaceful creature was tamed.
Allow suppressing this and the previous message, when the caller
handles messaging.
2024-03-24 10:48:29 +02:00
nhmall
340588e907 follow-up fix a regression on color naming 2024-03-23 16:51:51 -04:00
PatR
d2928ce2ba symset customization warning fixes 2024-03-23 13:39:23 -07:00
nhmall
ba00dc9066 sever extracolors from utf8map and ENHANCED_SYMBOLS
move the custom color data into its own field in the glyphmap
and disassociate it from the unicode/utf8 stuff.

move the glyphcache stuff during options processing and parsing
into new file glyphs.c and out of utf8map.c, and make it
general, and not part of ENHANCED_SYMBOLS.

Do the groundwork for allowing glyph color customizations to
work when any symset is loaded and not restrict it only to
the enhanced1 H_UTF8 symsets.

The customizations in effect are still affiliated with a particular
symset.

Also closes #1224, but the PR itself references a data structure
made obsolete by this commit. The curses comment from the PR was
added into the code.

The PR also made several suggestions, but only the first
one has been included in this commit (and no longer based on
the handler), that being:
"allow defining colors if other symbol handling modes are used
(possibly limited to the standard 16 colors)."

FredrIQ also wrote the following suggestions in PR#1224:

Something I was also contemplating, unrelated to implementation of this
support in curses, would be the ability for the following:

allow defining colors if other symbol handling modes are used (possibly limited to the standard 16 colors)
allow defining attributes (for example: glyph:G_pet_female_kitten:U+0066/red/underline)
allow specifying glyphs as wildcards for defining global color/attribute changes

Something I also want to see are keywords for "don't change the current defined data". If this
were to be added, you could for example do this:
OPTIONS=glyph:G_*_fox:U+0064/blue
OPTIONS=glyph:G_statue_*:basechar/gray/underline
for "make all foxes use a blue color, make all statues gray with underline" without needing
to specify the relevant character for every statue. This ("basechar", "basefg", etc)
should perhaps also be added for MENUCOLORS and statushilites, so that you can, for
example, underline all items being worn without needing to specify a bunch of
near-duplicate rules for combining BUC colors + underline worn items
as per #1064
2024-03-23 15:36:22 -04:00
PatR
ef17c7ac2b unix check_panic_save
Inspired by self-recover, sort of.  Enabled for unix by default; can
be disabled by commenting out '#define CHECK_PANIC_SAVE' in unixconf.h.

When starting the game, if there is no save file to restore and no
lock/level files to recover, check whether a panic save file exists.
If there is one, tell the player that it's there and that it might be
viable, then ask whether to start a new game.

It doesn't convert the panic save into a reconverable one (rename by
nethack, then continue trying to restore) or tell the player how to
make it viable (rename to remove ".e" by game admin), just whether it
is present.  If player opts to start a new game, the panic save is
left alone and will trigger the "there's a panic save file" situation
again once the new game finishes and player starts another.
2024-03-23 10:11:35 -07:00
Pasi Kallinen
4d206c1c40 Make tamedog give a message
People seemed to be confused when a monster next to them was tame
after stepping on a magic trap; this is also an accessibility issue.
2024-03-23 18:37:12 +02:00
Pasi Kallinen
e0cb6e2206 Query menu for putting ring on left or right hand 2024-03-23 13:22:29 +02:00
Pasi Kallinen
720c62c340 Ring of aggravate monster increases level difficulty 2024-03-23 12:35:54 +02:00
Pasi Kallinen
a26f3d1838 yn_function menu code cleanup 2024-03-23 11:05:38 +02:00
Pasi Kallinen
82a698f333 Comment typofix 2024-03-23 10:36:00 +02:00
PatR
19e985fa26 fix #K4123 - pair of u_init.c macros not used
W_MULTSTART and W_MULTEND were last used in nethack 2.3.
Time to finally Get rid of them.
2024-03-22 20:43:15 -07:00