Commit Graph

15090 Commits

Author SHA1 Message Date
Pasi Kallinen
2a7be0b050 Tutorial: hunger and eating food
Reset hunger when exiting the tutorial.
Add an optional second parameter to lua pline, forcing a more-prompt.
2023-03-18 14:08:13 +02:00
Pasi Kallinen
633487849b Tutorial: looting containers, zapping wands 2023-03-18 12:07:46 +02:00
Pasi Kallinen
20dbd989f1 Tutorial: Firing missiles and quiver 2023-03-18 11:48:19 +02:00
Pasi Kallinen
3f3c275ed5 Tutorial: throwing items 2023-03-18 11:04:27 +02:00
Pasi Kallinen
5ca4e166b1 More fuzzer branch teleporting 2023-03-18 10:46:10 +02:00
Pasi Kallinen
9340197c4c Remove extra full stop 2023-03-18 09:11:18 +02:00
Pasi Kallinen
e37428d5cd Fix fuzzer teleporting out of Fort Ludios 2023-03-18 08:51:37 +02:00
Pasi Kallinen
f360dee4dd Engraving sanity checking 2023-03-18 07:30:25 +02:00
PatR
0d9801e17f vampshifting via polymorph
When a vampire that's already in bat or fog form gets polymorphed,
sometimes take on base vampire form instead of always toggling to
fog or bat.
2023-03-17 16:21:43 -07:00
PatR
1c24f208f3 genetic engineer attacks
When a genetic engineer polymorphs someone it normally teleports away.
Also set mspec_used so that it can't polymorph someone [else] on its
next turn, it case of a no-teleport level or it happens to randomly
land adjacent to the target.
2023-03-17 16:00:44 -07:00
Pasi Kallinen
aa83dadc1e Add stormy level flag
Which makes clouds create lightning bolts at random.
This flag is used on the plane of air.

Breaks saves and bones.
2023-03-17 20:13:32 +02:00
Pasi Kallinen
4799fc937a Add level flag for plane of fire fumaroles
Also reduce the size of the gas clouds.

Breaks saves and bones.
2023-03-17 19:36:00 +02:00
Pasi Kallinen
f2b75c3b0e Fuzzer randomly teleports between dungeon branches
Previously the fuzzer usually stayed in the Dungeons of Doom,
only very rarely going to other dungeon branches. Now, it will
randomly choose a dungeon branch and a level in that branch
to level teleport to.
2023-03-17 14:17:23 +02:00
Pasi Kallinen
da0a681688 Make lua map and terrain commands use same routine 2023-03-17 13:25:43 +02:00
Pasi Kallinen
a5934470dd Fix boulder-on-lava sanity error
Special level creation could make levels with boulders on top
of lava or water; this was caused by mazewalk populating the maze
before the rest of the level was created.

Add a post-level-creation map cleanup routine, where boulders
and traps on liquid terrain are removed.
2023-03-17 13:13:24 +02:00
PatR
0178ed81e1 fix #K3886 - "%USERPROFILE%\NetHack\" in Guidebook
Report was that recent Guidebook.txt contained a couple of instances
of spurious "(rq".  In Guidebook.mn, "\\%USERPROFILE%\\NetHack\\(rq"
needed three backslashes near the end, the first two to insert one
into the output and the third for intended "\(rq" directive.  It also
shouldn't have leading backslashes; expansion of %USERPROFILE% doesn't
need that.  "\%" would work but isn't necessary.

Also, prevent "%USERPROFILE\NetHack\" from being hyphenated, plus a
minor change in wording so that it won't be in position to warrant
that.
2023-03-16 22:34:58 -07:00
nhmall
da0e2571a0 fix a spelling mistake in the code 2023-03-16 22:44:42 -04:00
nhmall
de79240dea some comment spelling fixes 2023-03-16 22:27:01 -04:00
Pasi Kallinen
90906ed05a Hellfill: Pillars of lava or water 2023-03-16 12:30:45 +02:00
PatR
3d24607494 fix #K3860 - figurine of an Angel
If asked to create an Angel when MM_EMIN isn't specified, makemon()
will either create an ordinary monster of type Angel without any
emin extension or add emin and create a minion affiliated with the
god for randomly chosen alignment.  Figurines didn't specify emin
so could result in either type, but wishing for them offered no
opportunity to specify alignment for the second type.

Change figurine activation to force the first type:  an ordinary
monster of type Angel, not affiliated with any particular deity.
2023-03-16 02:24:52 -07:00
PatR
3a30e434d8 "<mon> hits [again]"
Add "again" to the hit message when an attack sequence has
consecutive attacks of same type and they hit.  A {bite, claw, claw}
sequence won't give that for first claw attack regardless of whether
the bite hits but will give it for the second claw attack when both
of the claw attacks hit.

The message sequence
|The fire ant bites!  The fire ant bites!  You're on fire!
or |The fire ant bites!  The fire ant bites!  You avoid harm.
when the first bite was for physical damage and the second was
for fire damage seemed a little confusing.

This changes that to be
|The fire ant bites!  The fire ant bites again!  You're on fire!
or |The fire ant bites!  The fire ant bites again!  You avoid harm.
It still isn't crystal clear that both bites are from a single
attack and that the second bite is for different type of damage
but I think it's an improvement.
2023-03-16 01:54:29 -07:00
Pasi Kallinen
441d498300 Tutorial: being burdened, dropping items 2023-03-16 07:44:29 +02:00
PatR
9d11d6bf13 fix #K3884 - sequencing of "You avoid harm" by MC
Many damage handling routines were calling mhitm_mgc_atk_negated()
in advance so that the result could be used for u-vs-m and m-vs-u,
and m-vs-m variations of an attack.  But the monster versus you case
called hitmsg() to deliver a "<mon> <bites, claws, &c> you" message
after that.  When the negation checking routine recently began
issuing messages for some types of damage, they would be delivered
before that hit message when your armor/jewelry negated its damage.
|You avoid harm.      [when MC is about to block the shock]
|The grid bug bites.  [bite for electric damage]
or
|The fire ant bites.  [for physical damage]
|You avoid harm.      [when MC is about to block the fire]
|The fire ant bites.  [second bite for fire damage]

This fixes the sequencing issue at cost of making the code become
even more complicated.  It will probably require further refinement.
2023-03-15 13:59:06 -07:00
Pasi Kallinen
bf3a5ec3ed Hellfill: Fort 2023-03-15 20:55:38 +02:00
Pasi Kallinen
201874a85a Curses: delete curses window
When NetHack deletes a window, also free the curses window data.
2023-03-14 11:16:13 +02:00
Pasi Kallinen
2db6f20700 Curses: free all perm_invent data 2023-03-14 09:18:32 +02:00
PatR
01af084f43 non-digest engulfing
Be more consistent with the engulf attack feedback by creatures who
fold themselves around the victim (trapper, lurker above) rather than
swallow or directly engulf.

Replace an instance of a non-literal format string and the warnings
manipulation it needed with a literal one.
2023-03-13 12:49:22 -07:00
Pasi Kallinen
35273b8a8c Curses: prevent spurious cursor updates
While watching a ttyrec, I noticed strange behaviour in
the cursor updates; it was moved to approximately middle
of the map window every so often, usually when doing ranged
attacks. This wasn't really noticeable in normal gameplay,
as it was moving the cursor there, and then almost immediately
to where it was supposed to be.

I managed to trace it down to the refresh() in curses_delay_output().
That call updates the terminal to match the ncurses stdscr window,
but the stdscr window cursor position wasn't updated by NetHack.
2023-03-12 19:21:51 +02:00
PatR
d86f966ee6 uhitm.c formatting
Shorten or wrap a bunch of too-wide lines in uhitm.c.
2023-03-11 15:51:08 -08:00
nhmall
ae9b236ee6 a few more coordxy inconsistencies 2023-03-11 15:12:02 -05:00
PatR
74ed2999de knockback feedback
Adjust the message given when an attack knocks its target back.  Say
|<defender> is knocked backward by <attacker>
if target will actually move or
|<defender> is knocked back by <attacker>
if there's something preventing the move.  Most players probably won't
even notice the difference.  (Possibly "rocked back" would be better
when not changing location but this hasn't gone that far.)

Also make the knock back distance be 1 step 2/3 of the time or 2 steps
1/3 instead of 50:50 chance for 1 or 2 steps.
2023-03-11 11:21:09 -08:00
PatR
754e9333f5 fix pet picking something up while eating
I don't know when this behavior started, but a pet who was eating
something while standing on an item could pick that item while busy.
This would be wrong even for pets that didn't need to use their
mouth to do the picking up.

This fix may be overly simplistic.  It prevents the pickup-while-
eating misbehavior but could possibly interfere with something else.
2023-03-11 10:49:53 -08:00
nhmall
8e05a06d24 fix off-by-one (premature-truncation, not overflow) 2023-03-10 13:54:44 -05:00
nhmall
b61f55f0e4 Use-after-free when saving Qt message history #996
Possibly resolve #996
2023-03-10 11:27:11 -05:00
Pasi Kallinen
62476fe101 Stop blinking cursor on hero when farlooking
I happened to notice when looking at a ttyrec that farlooking
with automatic description would blink the cursor on hero for
one frame, and then back on the farlooked map location.
2023-03-10 14:11:56 +02:00
nhmall
ecf74d5308 some pline()-like function usage 2023-03-08 19:12:52 -05:00
nhmall
d9b43ce357 adjust wording preceding "Being confused,..." 2023-03-08 19:09:15 -05:00
PatR
30de551f02 more curses key handling
Some bits made when attempting and failing to figure out the curses
problem (which turned out to be an early return skipping reset of
input timeout and fixed by paxed).
2023-03-08 14:38:53 -08:00
PatR
6a13ecaf12 \#retravel feedback
Using #retravel when no destination was set up just silenty finished,
effectively a no-op.  Could happen for the first travel attempt on
the current dungeon level, or after most recent #travel successfully
reached and cleared its destination.

Using #retravel when already at previously set but unreached--via
travel--destination, or explicitly picking your own spot as travel
destination using #travel, actually traveled from your current spot
to the same spot.  Usually nothing interesting occurred and you got
no feedback.  However, if you happened to be stuck in a trap at that
spot you tried to walk out of it and got trap feedback about that.
(Then probably right back into the trap if you succeeded in escaping
it.  I didn't try to test that.)
2023-03-08 14:35:24 -08:00
nhmall
8c7b3b05b5 Merge branch 'NetHack-3.7' of https://github.com/nulla-git/NetHack into NetHack-3.7 2023-03-08 13:29:36 -05:00
nhmall
22b3525f0b scroll labeling while blind #986
Adjust the wording a little as discussed in #986.

Close #986.
2023-03-08 13:07:47 -05:00
nulla-git
e70a40c2b2 update readme with latest release version 2023-03-08 11:54:57 -06:00
Pasi Kallinen
96587d2acf Fix curses quitting when trying to move
parse_escape_sequence changed getch timeout, but when receiving
a certain escape sequence, it returned without changing the
timeout back. This caused all subsequent getch calls be
non-blocking, and getch returns ERR when there's no input
waiting in that mode.

NetHack interprets ERR as the terminal going away, so performs
an automatic save.
2023-03-08 12:19:57 +02:00
PatR
4021a63bcf wand/spell/breath killer reason
Extend "killed by the touch of death inflicted by <monster>" to buzz().
"Killed by a bolt of cold" becomes "killed by a bolt of cold zapped by
<monster>" or "killed by a blast of cold" becomes "killed by a blast
of cold exhaled by <monster>" and so forth.

More work than expected; the zap code isn't passed enough context.

BZ_M_WAND() was producing the wrong value for wands zapped by monsters.
2023-03-07 02:47:42 -08:00
Pasi Kallinen
8e6cf385b1 Fix subroom doors
Doors weren't getting added to the correct subrooms in certain cases.

Also fix one of the themerooms, because doors have to be added
after subrooms; there was a possibility of no door to the subroom(s)
in that themeroom, because the subrooms overwrote the doors in
the parent room.

Test case for the subroom doors:

Large room, with a medium subroom, with a tiny subroom inside that.
The doors go from outermost room <-> tiny innermost room <-> middle room.

des.room({ type = "ordinary", x = 1, y = 1, w = 10, h = 10,
   contents = function()
      des.room({ type = "ordinary", w = 6, h = 6, x = 2, y = 2,
         contents = function()
            des.room({ type = "ordinary", w = 2, h = 2, x = 0, y = 0,
               contents = function()
                  des.door({ state="random", wall="south", pos = 1 });
               end
            });
            des.door({ state="random", wall="north", pos = 1 });
         end
      });
   end
});

Before this fix:

ROOM: ndoors:1, subrooms:1
  SUBROOM: ndoors:1, subrooms:1
    SUBROOM: ndoors:1, subrooms:0

after this fix:

ROOM: ndoors:1, subrooms:1
  SUBROOM: ndoors:1, subrooms:1
    SUBROOM: ndoors:2, subrooms:0
2023-03-07 09:43:44 +02:00
nhmall
f0e88bbc68 one more follow-up for #954 2023-03-06 16:06:43 -05:00
nhmall
a58a2df119 follow-up for #954 2023-03-06 15:49:28 -05:00
nhmall
57fceb0112 replace a couple of tabs 2023-03-06 15:42:53 -05:00
nhmall
436e2617c7 replace tab 2023-03-06 15:39:43 -05:00
nhmall
a66954a2f5 Use suggestion from issue #954
As suggested by lynn.

Closes #954
2023-03-06 15:11:11 -05:00