Commit Graph

16810 Commits

Author SHA1 Message Date
nhmall
8bbbe38fb5 fix garbled message on symset change from O menu 2024-04-11 20:24:38 -04:00
Pasi Kallinen
f15035868c Change Nalzok and Minion of Huhetotl to bright red
Disambiguate them from all the other red major demons.
The tiles are already bright red.
2024-04-11 21:39:22 +03:00
PatR
7da370d74a experimental hitpointbar change
For tty, make hitpointbar blink if current HP falls to the critical
HP threshold.  Doesn't require status highlighting.  Not changed:
when status highlighting is active, use the HP color but force the
attribute to be inverse (plus blink if the criterium is met) rather
than whatever the HP highlight specifies.

For curses, do the same thing.  It used to honor HP attribute for
hitpointbar, now it behaves the same as tty:  always inverse, maybe
combined with blink.  The new code assumes that inverse and color
can be turned off without turning off active blink in the process.

I had intended to make hitpointbar be a full-fledged status field
(which happens to be rendered on top of title) so that it could be
highlighted differently from hit points (mainly so that one could
highlight up and down changes while the other showed percentages).
This is less versatile than that but much simpler.
2024-04-11 11:06:29 -07:00
nhmall
16c693eedf fix lingering error on Windows nmake command line build
src\cmd.c(3453) : warning C4701: potentially uninitialized local variable 'func' used
src\cmd.c(3453) : error C4703: potentially uninitialized local pointer variable 'func' used
2024-04-11 12:23:56 -04:00
Pasi Kallinen
7cf7fe3c9b Init a possibly uninitialized variable 2024-04-11 18:52:51 +03:00
Pasi Kallinen
f1c77aa2fd Pets avoid a location hero just kicked
If hero kicks a location, pets and peacefuls will avoid moving
into that location for that turn.
2024-04-11 18:05:18 +03:00
Pasi Kallinen
62b78ba037 Hero movement affects water bubble direction 2024-04-10 21:57:05 +03:00
nhmall
46370fc124 another follow-up: move values that can't be indexes
Move the values that are not legal mons indexes out of the default
handling case in make_corpse().
2024-04-10 11:34:41 -04:00
nhmall
125208d30b follow-up bit to explit mon entries in make_corpse() 2024-04-10 11:29:31 -04:00
nhmall
a85cd7d5c8 let compiler catch missing additions during development
Take advantage of the ability of some compilers to warn if
not all values are covered in a switch statement, to draw
attention to the need to update make_corpse() when new
monsters are added to NetHack.

This adds explicit entries for the current "default" handling
in make_corpse().

It might be a good idea to review the explicit entries to see
if any of them represent others that are not being handled,
but should be.

To test this, I temporarily reverted 85c86444, and I did receive the
following warning:

mon.c:545:13: warning: enumeration value 'PM_GOLD_DRAGON' not handled in switch [-Wswitch]
  545 |     switch (mndx) {
      |             ^~~~
1 warning generated.
2024-04-10 11:07:40 -04:00
Pasi Kallinen
85c8644469 Gold dragon should drop scales 2024-04-09 08:40:56 +03:00
PatR
6cc8630c22 feedback for #wizbury
Noticed when trying all the extended commands.  #wizbury didn't have
any feedback (other than clearing the adjacent floor if any objects
were present).

Also, prevent #wizbury from burying boulders.
2024-04-08 17:16:21 -07:00
PatR
fc56ca0767 barbded devil and ice devil difficulty ratings
I enabled 'extmenu' and went through all the extended commands under
curses and try to find out what github issue #1229 refers to and
didn't spot anything out of the ordinary, except for #wizmondiff
which reported that the calculated diffculty ratings for ice devil
and barbed devil didn't match the values in their definitions.  They
were each given an extra ability about 6 months ago and it was enough
to have a higher rating.

Issue #1239 remains open.
2024-04-08 15:59:05 -07:00
PatR
c96f2e7eb5 horses can't vomit
No idea about unicorns though...
2024-04-08 12:46:41 -07:00
PatR
f545ca8f22 fix #K4138 - untrapping a monster while blind
If a tame or peaceful monster was trapped and blind hero hadn't seen
the trap yet, attempting to swap places would report that the monster
couldn't "move out of that trap".  And if the 'tips' option was True,
the game would suggest attempting #untrap.  But #untrap would report
that the hero wasn't aware of any trap at the spot, and fail.

Change the original message to "move out of that <type-of-trap>" and
if hero hasn't seen it yet, map it and vary the wording slightly
"... a|an <type-of-trap>".  If #untrap is attempted, it will now be
dealing with a known trap.
2024-04-07 16:56:02 -07:00
nhmall
5294b0a320 follow-up comment wording 2024-04-07 17:22:03 -04:00
nhmall
b573538253 fix reported segfault during configfile processing 2024-04-07 13:14:12 -04:00
Pasi Kallinen
0c29f88d0e Move showdamage to Advanced options 2024-04-07 17:19:25 +03:00
Pasi Kallinen
712a735111 Guidebook: hitpointbar is also available in curses 2024-04-07 12:24:19 +03:00
PatR
f16a5f49ed mfrozen sanity check
Add another monster sanity check case:  if a monster has the mfrozen
counter set to non-zero, make sure that mcanmove is zero.
2024-04-06 18:59:45 -07:00
PatR
97000bd64b leader of orcs that raided mine-town
Changing a newly created monster's peaceful state should call
set_malign().
2024-04-06 18:43:28 -07:00
PatR
2b6b056f0e fix github issue #1230 - sleeping orc catches gold
Issue reported by Ryton:  a sleeping orc caught a thrown gold piece.
Throwing one at some other sleeping monster woke it up.

That is actually intentional.  Sleeping monsters with the 'greedy'
attribute will wake up without becoming angry and catch thrown or
kicked gold that is aimed at hit them.  The fix here is to augment
the catch message to say so.  Non-greedy monsters wake up and treat
it as an attack, but the gold always misses.

Both cases only happen for monsters who are asleep for an indefinite
period of time.  Any monster that is asleep (or paralyzed, or busy
putting on armor) for N turns effectively doesn't notice.  If it can
be seen, the gold "harmlessly hits" (if it can't be seen, the gold
misses), and the target continues doing--or not doing--whatever it
is doing.  That's suboptimal; another case where lumping multiple
can't-move situations into a single monst->mfrozen countdown timer
causes timed sleep to be indistinguishable from timed paralysis.

Closes #1230
2024-04-06 18:39:11 -07:00
Pasi Kallinen
7ecc778173 Curses: fix pile hilite background color
The curses colorpair rework I did changed the pile hilite background
color from blue to red. Change it back to blue, and use a function
to get the color pair instead of hardcoding the value.
2024-04-05 20:15:21 +03:00
Pasi Kallinen
969c87c0a1 Unblind telepathy range and carried artifacts 2024-04-05 09:44:52 +03:00
nhmall
080c6747fd follow-up bit
minor, but inner loop assignments to glyph and mapsym
are only needed when corr_next2u is TRUE
2024-04-04 16:51:51 -04:00
PatR
2b0459e2b8 undo a dodgy 'O' menu optimization
Normally the 'O' menu covers the status display, but not always.

Toggling 'time' or 'showexp' via the "simple 'O'" menu should update
the status lines.

Toggling 'hitpointbar' already does so so.  I didn't try to figure out
why.  Presumeably it triggers a different bot() call somewhere and the
code here sees 'disp.bot' as reset to False.

I didn't check the behavior when adding or removing a status highlight
but those can change the current status display.
2024-04-04 13:35:51 -07:00
Pasi Kallinen
28ed8e7962 Unblind telepathy range
Unblind telepathy range depends on the number of telepathy granting
items worn.

Breaks saves.
2024-04-04 23:22:28 +03:00
PatR
12873e2773 cmd.c formatting bit
Move '||' from the end of the first half of a continuation line to
the start of the second half.  Wrap or condense a few wide lines.
2024-04-04 06:57:34 -07:00
PatR
ca5fd442b8 fix is_cmap_stairs() and is_cmap_lava()
A couple of predicates in sym.h didn't cover all the relevant map
symbols.

is_cmap_stairs() only affects the MS-DOS position-bar.  It appears
that it would have been overlooking the extra stairs to the mines
and to sokoban but I have no way to verify that.

is_cmap_lava() affects getpos() and #lookaround.  lava-wall wasn't
being treated as lava.
2024-04-04 06:44:23 -07:00
PatR
8558981d9d "can't #offer" phrasing
When you attempt #offer at a non-altar location, the feedback
"you are not standing on an altar" made it sound as if you wouldn't
be able to #offer if you were levitating.  Since that is possible,
change the feedback.
2024-04-04 05:28:22 -07:00
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
Pasi Kallinen
c4d4bafb44 Fix NO_TERMS compile, rename func
... to match others, from tty_curs_set to term_curs_set
2024-04-02 14:31:33 +03:00
Pasi Kallinen
7030b0b9fe tty: hide cursor unless waiting for user input
Use vi (cursor_invisible) and ve (cursor_normal) to hide and show
cursor, if the terminal supports those.  This way on a slower
connection the cursor doesn't jump all over the place when doing
map or menu updates.
2024-04-02 10:28:20 +03:00
PatR
de69dd750b some zap.c formatting 2024-04-01 14:18:25 -07:00
nhmall
40e3b3b64a doc update VIEWDEPRECATIONS=1 2024-04-01 15:12:28 -04:00
nhmall
d0c543748e follow-up: use VIEWDEPRECATIONS instead of KEEPDEPRECATIONS 2024-04-01 15:04:07 -04:00
nhmall
61252f5c02 allow KEEPDEPRECATIONS=1 on make command line to see what's deprecated 2024-04-01 14:59:41 -04:00
nhmall
459f5f77c1 pass NETHACK_VERSION to package subproject 2024-04-01 09:24:09 -04:00
nhw_cron
9ba045b264 This is cron-daily v1-Dec-5-2024. 000files updated: Files 2024-04-01 08:59:09 -04:00
nhmall
69ecd69871 follow-up re: vs2017 2024-03-31 21:38:57 -04:00
nhw_cron
31bab7eae6 This is cron-daily v1-Dec-5-2024. 000files updated: Files 2024-03-31 21:34:18 -04:00
nhmall
410c1b6cbd stop support & testing of nearly 7 year old vs2017 2024-03-31 21:31:34 -04:00
nhmall
0a4f9de695 follow-up: remove explicit Windows SDK reference 2024-03-31 20:43:15 -04:00