Commit Graph

9699 Commits

Author SHA1 Message Date
RainRat
ef7046e9bf Merge branch 'NetHack:NetHack-3.7' into NetHack-3.7 2024-04-11 18:29:38 -07:00
RainRat
7b0ba4a562 Merge branch 'NetHack:NetHack-3.7' into NetHack-3.7 2024-04-11 14:00:18 -07: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
RainRat
2787bfdcbd Merge branch 'NetHack:NetHack-3.7' into NetHack-3.7 2024-04-10 23:26:14 -07: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
RainRat
7656804ae9 fix typos 2024-04-10 00:46:21 -07: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
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
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
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
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
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