Commit Graph

4638 Commits

Author SHA1 Message Date
PatR
00fd2b79de simulated mouse click for #therecmdmenu
The #therecmdmenu command calls getdir() which issues an "in what
direction?" prompt.  This allows you to answer with "_" instead of a
regular direction, then it will call getpos() to allow you to move
the cursor and type "," (or ";") to behave as if a left-click had
been done or type "." (or ":") to behave as right-click.

Ordinarily I would think of the 'normal' getpos() response of "."
as suitable for left-click, then one of the other getpos finishers
for right-click, but comma is left of period on a standard keyboard
and that seems useful for remembering which is used for which click.

Left clicking on a spot farther than one step away offers travel,
throw iff lined up, and also click-look as choices.  If you right
click farther than one step away, it will only offer click-look.
The look choice for either left or right click isn't inhibited by
having the clicklook option set to False.  After all, player is
explicitly choosing the menu entry to look at something.

New getdir.mouse can be bound to some other key than "_" and the
getpos.pick* responses could already be re-bound, but there's no
separate getdir.left/right that could be used to bind different keys
from those used for the four getpos responses.
2022-06-13 16:06:06 -07:00
PatR
fe34d4e3e3 noxious quest nemeses
Refine the code added by pull request #763 to check the quest nemesis
death message for reference to noxious fumes rather than having the
three relevant roles be hardcoded.
2022-06-12 13:19:13 -07:00
PatR
14fec29c13 fixes entry for pull request #770 - wizard splbook
Pull request from matteverett:  for generating starting equipment,
mark a wizard as having received a level 1 spellbook when getting
guaranteed force bolt so that the random second spellbook can be
level 1, 2, or 3 as intended rather than unintentionally be forced
to be level 1.

Closes #770
2022-06-11 15:32:37 -07:00
nhmall
18fe0bef02 cleaning-up on gd_move() pr #791
Closes #791
2022-06-11 11:06:08 -04:00
PatR
542ab25da1 saving/freeing ball and chain
Reported by entrez:  fix memory being accessed after having been
freed by trying to keep ball&chain data up to date when they're
processed by the save code.  This fix is a little more elaborate
than this suggested one.  I'm crossing my fingers on this one....
2022-06-11 00:08:17 -07:00
PatR
e2d694ed32 fix github issue #769 - revive panic
Issue #769, reported by k2 and diagnosed by entrez:  eating a troll
corpse that revives on the last turn of the meal was using up the
corpse while the revival was in progress (unless the hero couldn't
observe the resulting monster), leading to a panic when trying to
use it up at the end of revival.  Brought on by a recent change to
interrupt an occupied hero who can observe a hostile monster being
created nearby.

The fix isn't perfect.  If revival fails because there's no place
to put the revived troll, the meal will be interrupted with one bite
left instead of finishing.  If that happens, the interruption will
include a "you stop eating" message, just with no explanation why.
The partly eaten--almost completely eaten--corpse will remain.

Closes #769
2022-06-10 11:35:07 -07:00
nhmall
62131b96ba remove extraneous file 2022-06-09 00:46:49 -04:00
nhmall
0ba9278b69 a couple of argrath pull requests
Closes #777 https://github.com/NetHack/NetHack/pull/777
Closes #793 https://github.com/NetHack/NetHack/pull/793
2022-06-09 00:43:35 -04:00
nhmall
3b0fbb6601 fixes entry: vampire shapeshifting in a door #794
Closes #794
2022-06-09 00:35:00 -04:00
nhmall
b11007968b fixes entry for pr #783
Resolves #783
2022-06-08 23:45:02 -04:00
PatR
faf3d6f08a death from touching silver ring or wand
From a reddit thread:  NAO's list of causes of death shows
|killed by handling a(n) ring of shock resistance
|killed by handling a(n) wand of fire
along with various other rings and wands and the poster wondered how
that could have killed characters.  Someone quickly figured out that
the heroes involved had lycanthropy and the items listed happened
to be silver in those games.

Avoid that sort of confusion in future by specifying "handling a
silver ring" or "handling a silver wand" instead of the specific
type of item when inflicting silver damage.  It still uses specific
item for other classes of objects where silver isn't shuffled among
potential items at start of game.
2022-06-08 12:50:49 -07:00
PatR
f710a3175f magic portal traversal feedback
Replace the old message "you feel dizzy for a moment, but the sensation
passes" when going through a magic portal.  The sensation doesn't just
pass anymore; you arrived stunned these days.  Suggested by entrez.
2022-06-08 10:46:51 -07:00
PatR
d1d0f1103c artifact name formatting bit
All the quest artifacts are named "The <something> of <someone>".
Change xname() to force "the" instead of "The" when that occurs in
the middle of "a skeleton key named The Master Key of Thievery" or
"a pair of lenses named The Eyes of the Overworld".

This change isn't applied to user-assigned names; they're used as-is.
2022-06-06 16:15:07 -07:00
PatR
f5642d8bc4 fixes entry for PR #784 - reset just-picked-up
Pull request from entrez:  the just-picked-up flag on recently
picked up items was being reset when you stepped on other items
without picking anything else up.

Closes #784
2022-06-03 12:48:38 -07:00
nhmall
ff00c14893 wished-for doors in wizmode always vertical
Closes #788
2022-06-03 15:30:18 -04:00
nhmall
dca1cd7526 alter wording in last commit fixes entry 2022-06-02 19:24:52 -04:00
nhmall
6fbc8ccf0f spelling in last fixes message 2022-06-02 19:22:18 -04:00
nhmall
516df172d0 fix message when monster's two-handed weapon welds
K3610 reported to devteam:
When you see a monster wield a cursed two-handed weapon,
the weapon "welds itself to the foo's hand" instead of its "hands."

Observed on hill orcs wielding a cursed two-handed sword.
2022-06-02 19:20:21 -04:00
PatR
afbb7e2827 fix #K3603 - multiple stacks of gold in container
When taking stuff out of a container, specifying a subset count for
an item and getting the pickup_burden prompt, answering 'q' undid the
subset split but answering 'n' did not.  If the item in question was
a stack of gold, the container would end up with two stacks.  That
action could be repeated as long as any of the stacks was big enough
to trigger pickup_burden confirmation so an arbitrary number of gold
stacks could be produced.  (Eventually they would be too small for a
subset to cause an increase in encumbrance, or possibly all reduced
to just one gold piece, then no more stacks could be created.)

Situation occurred for all menustyles; traditional and via-menu needed
separate fixes.  It didn't occur for pickup off the floor.

Report was for 3.6.6 but the bug was still present in dev version.
2022-06-02 14:44:30 -07:00
nhmall
8848a81990 restrict stunning effect to is_xport trap types
The issue first arose in commit 6a65b412.
Reported to devteam via email by entrez.
2022-06-02 09:41:47 -04:00
nhkeni
6c2b02aa8c clarify fixes entry 2022-06-01 14:02:13 -04:00
nhmall
db86ebd9e7 fixes3-7-0.txt update for pull request 782 2022-06-01 12:40:17 -04:00
nhmall
ae6a622c2b fixes entry 2022-05-31 21:56:40 -04:00
nhmall
81cff2390f typo fix in fixes 2022-05-28 20:39:09 -04:00
PatR
48060dbebb pull request #774 - 'just-picked' pseudo obj class
Pull request from entrez:  fixes the combination of A and P for
menustyle:Full.  For menustyle:Traditional, it fixes selecting P for
putting stuff into a container.  Using P for multi-drop (D) already
worked and I haven't tried to figure out why the two commands behave
differently with just-picked.

Closes #774
2022-05-28 16:56:26 -07:00
nhmall
16c2c3b32f update fixes3-7-0.txt for newcham() changes 2022-05-28 19:48:13 -04:00
PatR
07a2ba6b54 display lua warnings instead of ignoring them
This will be an annoyance for wizard mode until someone actually
figures out and fixes the problem.  The complaints from lua during
garbage collection aren't new, they were just being ignored before.
2022-05-28 12:49:08 -07:00
nhmall
39ecdd6075 writing type-named scrolls pr#551
entrez commented in https://github.com/NetHack/NetHack/pull/551 on Jul 16,
2021:
"When using a marker, it is possible to write a scroll based on the
 type-name assigned to it by the user. Somewhat unintuitively, this
 system broke down if the assigned name was identical to the real name of
 a scroll type: trying to write a scroll by its previously-assigned name
 'scare mon' or 'id' would be guaranteed to succeed, but this wouldn't be
 the case if the user-assigned name was 'scare monster' or 'identify'.

 Revise dowrite(write.c) to prefer a user-assigned type-name to the
 real name of a scroll that isn't already formally known, while
 continuing to prefer the real name of an identified scroll to both."

Closes #551 (Github pull request)

Also,
Closes #436 (Github issue)
2022-05-27 16:41:46 -04:00
nhmall
2af1acce8b mdisplacem stoning and gloves had test backwards
Closes #773
2022-05-27 16:07:27 -04:00
nhmall
3a1d49710c cron daily Guidebook.txt update 2022-05-27 11:39:34 -04:00
nhmall
c414f3a648 manual bump of guidebook date to match last commit 2022-05-27 10:38:54 -04:00
PatR
e7923bafe9 github pull request #772 - displaying new glob
If a monster killed a pudding, the resulting glob was dropped on
the map but might now be shown depending upon interaction--or lack
of such--with nearby globs.

The commit also changed the indentation of a label; I've reversed
that.  Having labels always be indented one space means there's
no need to look into nested blocks to find them.  But having no
indentation at all interferes with GNU diff (which is used for git
diff) showing the function that a band of changes occurs in (done
by augmenting the change bars in front of the band).  That is based
on the most recent preceding line having a letter in the leftmost
column.  Back when we had K&R-style function definitions which
didn't indent their arguments, that diff feature wasn't useful.
But after switching to ANSI-style definitions it is--except when an
unindented label interferes.
2022-05-25 12:38:07 -07:00
PatR
4c5465a150 extend Guidebook description of #wizkill 2022-05-23 18:06:33 -07:00
Patric Mueller
ced5c2a92f Curses: fix clipped map crash due to uninitialized memory 2022-05-23 00:03:15 +02:00
PatR
af55e3d027 add new #wizkill command
Add a way to get rid of specific monsters in wizard mode without
fighting, zapping, &c.  #wizkill command lets you kill creatures by
picking them with getpos().

You can pick multiple monsters by targetting them one after another.
You don't have to be able to see or sense them but if you target a
spot that has no monster, the command ends.

By default, the hero gets credit or blame as if having killed the
targets but #wizkill can be preceded by 'm' prefix to treat their
deaths as if they had been caused by a monster.
2022-05-21 17:40:52 -07:00
nhmall
d93f8ebf69 fixes3-7-0.txt entries for pr765 and pr767 2022-05-20 17:59:42 -04:00
Pasi Kallinen
c6a3ae5c6c Curses: Obey timed_delay option 2022-05-19 18:40:15 +03:00
PatR
b562c8ac89 fix segfault with #therecmdmenu
The change to add a menu choice for naming an adjacent monster via
\#therecmdmenu was unintentionally requiring that the monster have
monst->mextra.  So it worked on pets (regardless of whether they
were already named) because they have mextra for 'edog' extension,
but not on the majority of monsters.  And when it failed the program
would crash with a 'segmentation fault' error.

Fix the check for whether a target monster already had a name when
deciding to use "name <mon>" or "rename <mon>" in the menu entry.
2022-05-16 09:41:21 -07:00
PatR
6af5555215 fix github issue #764 - misplaced corpses
Reported by jeremyhetzler and confirmed by k2:  dead monsters weren't
leaving corpses at the spot they died.

Don't set a monster's mx,my coordinates to 0,0 when taking it off the
map (unless it is migrating to another level; mx==0 is the bit of data
used to indicate that).  Corpse drop happens after that and expects
the dead monster's former map coordinates to be intact.

Fixes #764
2022-05-16 01:30:00 -07:00
PatR
a1bf4c2786 pull request #761 - writing novels
Pull request by entrez:  don't create a Pratchett novel by writing
"novel" or "paperback book" on a known blank spellbook with a magic
marker.

Blanking a novel produces a blank spellbook; there isn't any blank
novel.  That's intentional.  Writing "novel" on a blank spellbook
and getting a randomly chosen Pratchett one wasn't intentional.

Closes #761
2022-05-13 16:04:02 -07:00
PatR
1ce457f801 display former possessions of dead monster
Reported directly to devteam by a hardfought player and also by
entrez.  The recent mon_leaving_level() change resulted in objects
dropped by a dying monster not being displayed immediately.

It justed needed the relobj(mon, 0, FALSE) to relobj(mon, 1, FALSE)
change in m_detach() but this does some related cleanup in
mon_leaving_level()'s callers.  wormgone() takes a long worm off the
map but leaves its stale coordinates set because some code relied on
that.  This takes away the need for that but still doesn't actually
clear them.

This adds redundant 'return' statements at the end of a few void
functions that are longer than fits within a typical screen display.
They make searching for the end of the current routine in an editor
or pager easier without resorting to regular expressions and can
also be used to search for the beginning if/when preceding routine
ends in 'return' too.
2022-05-13 14:46:02 -07:00
PatR
ebf8396444 redundant "shopkeeper disappears" message
Reported directly to devteam by entrez, the rloc() monst vanishes/
appears nearby/&c message was being given before "satisified, <shk>
suddenly disappears" making the latter redundant.  As discussed, the
fix isn't as simple as suppressing one message or the other because
both are given conditionally.

This seems to solve it but has only been lightly tested.
2022-05-11 13:12:25 -07:00
nhmall
c87f779755 split getting kick damages into separate function
Closes #758 by argrath
2022-05-09 17:15:31 -04:00
nhmall
a01a26f0a7 split adjusting attributes into separate function
Closes #757 by argrath
2022-05-09 09:05:58 -04:00
nhmall
011405a15c split kicking empty space into separate function
Closes #754 by argrath
2022-05-09 09:03:24 -04:00
nhmall
d3f98917e9 fixes entry for pr748 2022-05-09 08:55:40 -04:00
PatR
da83c9324a magic whistle fix
Restore old behavior of magic whistle causing pets to be moved to
different locations even when already adjacent to the hero.

This lets rloc() give its relatively new, more verbose messages if
a magic whistle isn't discovered yet but suppresses those when
already discovered in order to issue its own message.  For a single
pet that starts within view and arrives elsewhere within view it says
"shifts location" rather than "vanishes and reappears".  For multiple
pets, it gives one summary message instead of a separate one for each
pet affected by whistling.
2022-05-09 03:21:53 -07:00
nhmall
12773da1b5 Guidebook.txt cron daily update 2022-05-07 11:27:05 -04:00
nhmall
cb0c21e91d ENHANCED_SYMBOLS
A new feature, enabled by default to maximize testing, but one which can
be disabled by commenting it out in config.h

With this, some additional information is added to the glyphmap entries
in a new optional substructure called u with these fields:
    ucolor          RGB color for use with truecolor terminals/platforms.
                    A ucolor value of zero means "not set." The actual
                    rgb value of 0 has the 0x1000000 bit set.
    u256coloridx    256 color index value for use with 256 color
                    terminals, the closest color match to ucolor.
    utf8str         Custom representation via utf-8 string (can be null).

There is a new symset included in the symbols file, called enhanced1.

Some initial code has been added to parse individual
OPTIONS=glyph:glyphid/R-G-B entries in the config file.

The glyphid can, in theory, either be an individual glyph (G_* glyphid)
for a single glyph, or it can be an existing symbol S_ value
(monster, object, or cmap symbol) to store the custom representation for
all the glyphs that match that symbol.

Examples:
   OPTIONS=glyph:G_fountain/U+03A8/0-150-255

(Your platform/terminal font needs to be able to include/display the
character, of course.)

The NetHack core code does parsing and storing the customized
entries, and adding them to the glyphmap data structure.

Any window port can utilize the additional information in the glyphinfo
that is passed to them, once code is added to do so.

Also, consolidate some symbol-related code into symbols.c, and remove it from
files.c and options.c
2022-05-07 10:25:13 -04:00
PatR
7d140c6a70 fix github issue #752 - characteristics init
Issue #752 by vultur-cadens:  initialization of characteristics had
off by one errors when reducing over-allocation and when increasing
under-allocation, biasing Str over Cha.

This simplifies the code very slightly but it still seems somewhat
confusing to me.

A couple of reformatting bits are included.

Closes #752
2022-05-07 00:25:03 -07:00