Commit Graph

8615 Commits

Author SHA1 Message Date
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
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
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
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
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
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
PatR
3ab5e7b380 eliminate static analysis complaints about eat.c
This is fairly ridiculous but it prevents the bogus complaints
when compiling eat.c with 'gcc -fanalyzer' about some fields in
gc.context.victual being used without having been initialized.

There's bound to be a better way to handle this and I'm curious
whether it will work with the 'onefile' testing.
2023-03-05 16:19:32 -08:00
PatR
b3d5158e64 git issue #994 - killed by a touch of death
Issue reported by vultur-cadens:  cause of death reason for touch
of death and death due to loss of strength only showed the cause,
not the monster spellcaster who was responsible.

This changes
|Killed by a touch of death.
to
|Killed by the touch of death inflicted by the Wizard of Yendor.
and
|Killed by terminal fraility.
to
|Killed by strength loss inflicted by a chameleon imitating an arch-lich.
(The 'imitating' part doesn't fit on the tombstone but will be present
in logfile/xlogfile.)

Noticed while implemented this:  touch of death was modifying u.uhpmax
and basing death vs damage on that even when hero was polymorphed.
It now rehumanizes the hero in that situation.

Closes #994
2023-03-05 15:11:25 -08:00
PatR
f0e7f4d273 egraving fix
Fix a "format is not literal" warning.
2023-03-05 14:49:45 -08:00
nhmall
32ca917d2c sym-changes - add engravings to the map
1. Add "engraved room floor" pchar sym (S_engroom). The symbol that
displays at the engraved part of a room (not a corridor though).
The default symbol is '`' which is currently never shown if people
have defined the boulder symbol to '0' and statues are displayed as
monster symbols. It is bright blue.

Add some stylized variations of the S_engroom symset to some of
the symsets.

2. Add "engraved corridor" pchar sym (S_engrcorr). The symbol that
displays at the engraved part of a corridor. The default symbol is
'#', and it matches the symbol for corridor from for whatever the
current symset uses. It is bright blue to match the color of the
S_engroom symbol. Using the normal corridor symbol for display
preserves the lines of the corridor so is not as visually-disruptive
as a smaller symbol would be. Explicit entries that match the S_corr
symbol have been added to the symset file.

Magic mapping and clairvoyance impacts yet to be determined.

The Guidebook updates will come later.
2023-03-05 17:35:49 -05:00
Pasi Kallinen
0b5956ba34 Tutorial: reset inventory letters 2023-03-05 17:54:14 +02:00
Pasi Kallinen
db0441bf02 Split level temperature message into function 2023-03-05 12:34:33 +02:00
Pasi Kallinen
3cd6b00ab7 Split stuck-cannot-go-up/down into separate function 2023-03-05 11:58:23 +02:00
Pasi Kallinen
ce0d25129e Spell of knock can knock back small monsters
Differentiates the spell from the wand of opening,
and the spell name sounds like it should do that ...
2023-03-04 19:07:34 +02:00
Pasi Kallinen
c6a2803f49 Better algo for picking a room to put stairs in 2023-03-04 18:04:38 +02:00
Pasi Kallinen
10df388245 Untrap tip 2023-03-04 11:02:06 +02:00
Pasi Kallinen
08a2a2a1a4 Saving grace
Once per game, if receiving a killing blow from above 90% HP,
allow the hero to survive with 1 HP.
2023-03-03 17:38:48 +02:00
Pasi Kallinen
075c2832a1 Adjust archeologist and valkyrie intrinsics
I felt it was strange that archeologist started out both
fast and stealthy, but didn't gain searching until level 10.
So, archeologists now start with searching, gain stealth at 5,
and fast at 10.

Similarly valkyries starting out stealthy felt odd, so now they'll
get it at level 3.

This leaves only the rogue starting out innately stealthy, which
feels appropriate.
2023-03-03 11:50:44 +02:00
nhmall
b55d11b4f2 Revert "up/down level feedback"
This reverts commit 9ce98594a4.
2023-03-02 20:14:04 -05:00
PatR
f35abea80b change 'm #tip' behavior
Using the 'm' prefix with #tip was putting up a menu to pick between
one or more floor containers and 'choose from invent', but that
interfered with choosing Tip as a context-sensitive item-action for
carried container.  Change 'm' to behave like it does with #eat and
\#quaff and several other commands:  skip possible candidates on the
floor and go directly to picking something from inventory.

That prevents using 'm' to force a menu of
|a - <floor container>
|i - pick a container being carried
for any menustyle when there is one floor container.  For menustyles
other than traditional, I think that's inconsequential; player needs
to answer 'n' for floor container and then get the choose-from-invent
prompt instead of 'i' and then choose.  When there are two or more
containers on hero's spot, 'm' prefix isn't needed to get that menu.

Unfortuately using 'm' to override menustyle:Traditional is still a
thing players might want to do.  Keep the prior behavior for that
style when multiple containers are present (dotip() already skipped
that menu despite 'm' when there was just one container).  Use the
new behavior (skip floor containers) when one (or none) is present.
That's inconsistent but seems more useful than alternatives.  It is
relatively unlikely that anyone who uses traditional non-menu item
selection will also use newfangled inventory item-actions so the menu
isn't likely to interfere with the latter.  Update the Guidebook to
describe how Traditional differs just in case.
2023-03-02 05:33:16 -08:00
nhmall
d801736d09 opt out of bgcolor highlighting via bgcolors 2023-03-01 19:17:47 -05:00
nhmall
76e82d1312 fix remaining contrived issues re HANGUPHANDLING 2023-03-01 12:01:43 -05:00
Pasi Kallinen
77f241581c Split dungeon.lua level reading to separate function 2023-03-01 18:33:24 +02:00
nhmall
fd3057483f fix an issue when HANGUPHANDLING isn't defined
This is a contrived issue since HANGUPHANDLING is probably
defined for UNIX
2023-03-01 10:54:04 -05:00
copperwater
69d37be878 Fix: using a selection in a lit des.region modified it
The intuitive behavior when passing a selection to des.region, e.g.

    local foo = selection.area(07,02,10,24)
    des.region(foo, "lit")

is that foo will remain unmodified for further use. However, this wasn't
the case whenever making a lit region from it, because in order to light
walls adjacent to the lit area, the selection was having a grow
transformation applied as well. (This also seems like a problem - it
grows the selection even if what is being lit is not surrounded by
walls. I added a note in lua.adoc about this behavior.)

This fixes the selection mutation by cloning the passed-in selection and
growing the clone which leaves the original one unaffected.

This should not affect any special levels currently because the only
instance of des.region being used with a selection appears to be in
bigrm-2, which specifies *unlit* areas, which did not get grown.
2023-03-01 17:32:15 +02:00
Pasi Kallinen
ea2cd80349 done_hup is compile-time optional for some reason 2023-03-01 17:08:16 +02:00
Pasi Kallinen
fc7a32b86e Tutorial level
Add a tutorial level to teach commands to new players.
Very much a WIP.

Breaks save and bones compat.
2023-03-01 14:00:29 +02:00
nhmall
7aead98a49 fix a soundeffects typo 2023-02-28 16:15:56 -05:00
PatR
844e71e18e drawbridge revisited
Take the DEADMONSTER() check back out.  It adds some protection
against something that should never happen but also adds confusion
that it might actually happen.  Dead monsters aren't on the map.

Avoid 'if (cond) foo();' without braces if foo() might expand into
nothing.

Clean up the occupants[] array when finishing with drawbridge.
2023-02-28 12:14:23 -08:00
PatR
ffdaa5556e drawbridge fix - double death
Make sure a dead monster that hasn't been purged from the fmon list
yet can't be hit by opening/closing/destroyed drawbridge.  I don't
think that could happen because the monster gets removed from the
map, but add some bullet-proofing.

Also, give drawbridge smash/crash sound effects even when player
can see whatever is happening instead of just when only hearing the
activity.
2023-02-28 10:33:44 -08:00
nhmall
9168e1f30b remove a maintenance/synchronization requirement
adds a file include/seffects.h
2023-02-25 16:05:27 -05:00
nhmall
945241c3b2 add comment prior to soundeffect_automapping table 2023-02-25 14:38:53 -05:00
nhmall
536cc9aaf6 include the two new sounds to list of sought files 2023-02-25 14:26:15 -05:00
Pasi Kallinen
00c756ba75 Lua: Traps without victims
Traps may get corpses generated on them on early dungeon levels,
to warn off fragile starting heroes. Allow creating traps in lua
without the corpse.
2023-02-25 18:05:09 +02:00
PatR
4fd7d51cb2 fix #H2694 - egg hatching feedback
A bug report from ten and half years ago...
If a carried egg hatches, the message is
|<foo> drops from your pack.
and if tame, is followed by
|Its cries sound like {mommy,daddy}.
The latter was issued even when <foo> has no speech capability.

Replace "its cries sound like" with "its <vocalize>ing sounds like"
for suitable value of <vocalize>.

This adds two new monster sounds, MS_BELLOW and MS_CHIRP, also two
new sound effect codes, se_chirp and se_croc_bellow.

We had MS_SILENT for crocodile.  On wikipedia, crocodile is described
as the most vocal reptile.  Adult males make a load bellowing noise
and hatchlings make a chirping noise.

This changes crocodile, titanothere, and baluchitherium from MS_SILENT
to MS_BELLOW and baby crocodile from MS_SILENT to MS_CHIRP.  Chirp
might be appropriate for lizards and lizard-like amphibians but I've
left those as MS_SILENT.

[Noticed but not changed:  lizards and lizard-like amphibians aren't
flagged as oviparous.  Shouldn't they be?]
2023-02-25 07:02:19 -08:00
PatR
d75beae272 address github issue #987 - curses: arrow keys
Issue reported by jeremyhetzler:  left and right arrows produced
unexpected characters when trying to use them to edit text that is
being entered.

The curses interface converts arrow keys and function keys related
to the keypad into movement keys (hjkl or 4286 depending on the
number_pad setting).  But it was doing that all the time, not just
when nethack wanted movement keys.  This extends the existing
program_state.getting_a_command flag to getdir() so that it can be
used for controlling that in addition to 'altmeta' support.

Typing an arrow when interacting with the map (actual command or
getpos, now getdir too) will still work.  Typing one when making a
wish or naming a pet will issue a beep and be treated as if '\0' had
been typed, and that normally gets treated as if ESC had been typed.
[Possible room for improvement there.  Losing the whole text when
trying to back up a character feels a bit harsh.]

Treating left arrow as escape rather than as h or 4 will probably be
enough to train players not to try to edit text with it after they
get burned by that a time or two.

Bonus fix:  curses' keystroke conversion only supported traditional
number_pad behavior, not the inverted phone number pad layout.

Closes #987
2023-02-23 14:02:28 -08:00
Pasi Kallinen
4ce149b2cf Lava walls vs cold rays
Lava walls have a small chance of turning into solid stone wall
when hit by a cold ray. Before this they turned to floor, which
was obviously wrong.
2023-02-22 11:55:24 +02:00
nhmall
049ab7a5df remove some macgraphics references; some Amiga
Also closes #183
2023-02-21 22:54:56 -05:00
nhmall
da92b9b173 paste error in read.c 2023-02-21 11:52:36 -05:00
Pasi Kallinen
1efdbacd48 Remove extra backslash from EOL 2023-02-21 17:34:06 +02:00