Commit Graph

3971 Commits

Author SHA1 Message Date
PatR
e9d729733b bargethrough/monster-vs-monster displacing
Fix the regression that monster movement flag unification
introduced for monsters able to swap places with adjacent
monsters.  It used to be restricted in order to prevent
Riders swapping places with other Riders so that they didn't
repeatedly exchange places when one was right behind the other
and the farther one moved first.  Then when displacer beasts
were added, that restriction was extended to prevent them
swapping places with Riders (but not the other way around.)
The flags change inadvertently let any displacer swap with any
other displacer.
2020-12-13 15:51:23 -08:00
PatR
04724fc5a0 Qt: remove "Search [______]" from Help menu
Prevent Qt from inserting an extra entry in the Help dropdown
menu displayed in the menu bar across the top of the screen
when nethack has focus.  "Search [______]" lets the user enter
a string to search for but doesn't give nethack any control
over that so we can't have it.

I haven't found a sane way to get rid of it.  The insane way
of not naming any menu "Help" works.  This uses "\177Help" so
that it still looks like "Help" but won't match that string.
2020-12-13 13:45:04 -08:00
Pasi Kallinen
4729062846 Make Death revive faster
Death will revive faster than the other riders.
Make all the riders revive after 67 turns, instead of 500.
There was practically a zero chance a rider would revive at 500,
so keep it somewhat sensible.
2020-12-13 12:28:45 +02:00
PatR
25bcbe3846 fix github pull request #418 - towel wetness
Fire damage would dry out a wet towel but never all the way to 0.
Water damage would wet a towel but if it was already wet, its
wetness might decrease.

This uses the pull request's change for increasing the wetness
but changes dry_a_towel so that the original code for decreasing
that will work as is.  Using wet_a_towel() to set wetness to 0
doesn't make much sense, so still won't do so; dry_a_towel() does
and now will.

This also adds missing perm_invent update for towels in inventory
changing wetness.

Fixes #418
2020-12-12 12:04:20 -08:00
Pasi Kallinen
704b11fb05 Add some new demonic and angelic maledictions
From SpliceHack
2020-12-12 20:54:04 +02:00
PatR
8d65d6dbf0 fix #H3134 - selling container for credit
If a container holds anything that a shop wouldn't ordinarily
buy and sell and you sell it for gold, the 'foreign' contents
are marked no_charge and hero still owns them.  But selling the
same container+contents for credit instead of gold would take
shop possession of all the contents without increasing the
credit amount.

The fixes entry is longer than the fix.  It solves cited case but
I won't be surprised much if it messes up some other case(s).
2020-12-11 22:32:38 -08:00
nhmall
6dc033e5d8 don't miss the special furniture checks during liquid flow
Closes #405
2020-12-11 16:28:59 -05:00
Pasi Kallinen
ea93c17fa7 Monsters can revive corpses on floor with undead turning
... but only if the corpse is in direct line from the monster to hero
2020-12-11 19:49:25 +02:00
nhw_cron
ee6645cdaf This is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt 2020-12-11 09:29:52 -05:00
nhmall
69455f404e Guidebook date bump 2020-12-11 08:46:39 -05:00
PatR
6f5a1ccc63 fix Guidebook thinko
Fix the recently revised description of "#version".
'windowtype' doesn't have an underscore in it.
2020-12-11 05:26:00 -08:00
nhw_cron
6e960a4667 This is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt 2020-12-10 20:24:37 -05:00
PatR
80a3c0c4d2 key rush.numpad/M-5 doc 2020-12-10 15:32:23 -08:00
PatR
fd5ef1ecaa more key bindings
number_pad==1 adds
 '5' => 'G'
 M-5 => 'g'
 '0' => 'i'
number_pad==2 swaps 5 and M-5 and adds M-0
 '5' => 'g'
 M-5 => 'G'
 '0' => 'i'
 M-0 => 'I'

M-5 and M-0 were missing from the bound key handling; they still
used hardcoded digits even though the actions for plain 5 and
plain 0 can be bound to other keys these days.  This implements
the M-5 variation as NHKF_RUSH2.  Changing numpad from 1 to 2
or vice versa will swap the NHKF_RUN2 and NHKF_RUSH2 actions
regardless of what keys they're assigned to.  I haven't done
anything for unimplemented NHKF_DOINV2 though (and am not
planning to in case someone else wants to jump in...).

This also fixes the description of the 'I' command.  The extended
command name for that still misleadingly refers to "type" rather
than "class" though.
2020-12-10 15:06:26 -08:00
Pasi Kallinen
0dc6792b80 Fixes bit for unifying the traps 2020-12-10 19:04:31 +02:00
nhw_cron
68b69380fb This is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt 2020-12-10 09:58:41 -05:00
PatR
3e183d0c6a yet more key bindings - lack of same...
When ?i shows key bindings, at the end of each group (movement,
prefixes, general, game, debug) report any commands for that
group which don't have any key assigned.  Movement and prefixes
all have keys; they'd be pretty useless without and key bindings
won't override movement commands. For general, the "keyless" are
|#exploremode
|#herecmdmenu
|#therecmdmenu
after this adds the relevant flag to their command definitions;
for game, "#terrain" is the only one; the debug section has 20.

There is a known problem that I've going to pretend that I didn't
notice:  if I use BIND=D:takeoffall then 'A' becomes unassigned,
'D' invokes #takeoffall, "#droptype" becomes keyless, and ?i
reports those correctly.  But if I use BIND=M:takeoffall, 'A'
becomes unassigned, 'M' continues to be its usual prefix, and
the "#takeoffall" command is nowhere to be seen.  The code that
tracks assignments is letting that case fall through the cracks.
'M' ends up assigned to both and the ?i code deliberately only
shows the first.
2020-12-10 01:07:07 -08:00
PatR
241cb2a8d3 Guidebook catchup
The command rename "#seegold" to "#showgold" that also revised
a few of the short command desctipions didn't include a Guidebook
update.  So here one is.
2020-12-10 01:01:04 -08:00
PatR
1bec4a66cd keylist help (? i) fixes
I was implementing a routine to show all the key bindings
when I discovered that we already have one.  This fixes a few
small problems:  'n' prefix for number entry was missing for
number_pad mode.  Meta+<direction> for running in number_pad
mode was missing too.  ^A was present but being suppressed by
lack of #define for obsolete #if REDO.  And ^C was shown as ^c
while all other ^ characters appear in upper case.  Once ^A
appeared as the line before it, the inconsistency stood out.

I also changed the slightly verbose "Shift-<direction>" and
"Ctrl-<direction>" entries below the direction grid to use plus
instead of minus signs.  Plus emphasizes that two things are
combined so seems more intuitive.  (I left "M-c" alone.)
2020-12-08 15:58:02 -08:00
PatR
9f79ad56d9 NOSUSPEND
Provide a hook to inhibit unixconf.h from defining SUSPEND
without the need to modify it:  #define NOSUSPEND in config.h
or add -DNOSUSPEND to CFLAGS.  Similar to long-standing NOSHELL
for inhibiting SHELL.
2020-12-08 12:58:36 -08:00
k21971
3d7a3fcc72 Fix: genetic engineers dropping Schroedinger's cat box.
Only quantum mechanics are supposed to have a chance of death-dropping the
Schroedinger's cat box.

Slash'Em already had this but it was missed when Genetic engineers were ported
over.
2020-12-07 22:42:24 +01:00
PatR
87818188e1 fix #3120,#3122 - dwarf pass_wall without digging
I couldn't reproduce this so can't confirm that this fix works,
but inspection of the code reveals that something was missing
in the unified mon movement flags code.  I think what has been
happening is that a dwarf without a pick-axe might not bother
wielding that but movement behaved as if it had, then digging
decided it wasn't.
2020-12-07 12:46:46 -08:00
PatR
197d8130d0 Qt extended commands enhancement
For Qt's pick-an-exetended-command dialog, allow a player to
toggle the grid layout from column-oriented to row-oriented
and vice versa and when in wizard mode to cycle the set of
shown (and typable) commands from 'all' to 'normal mode-only'
to 'wizard mode-only' back to 'all'.  The most recent values
are saved by Qt along with tile size, font size, and some other
stuff.  The extended command dialog has a Reset button to force
them (the two extended command values) back to their defaults.

The dialog layout has a slight change to conserve screen space
as well as three additional control buttons:
Was                                  Now
| [             Cancel            ]  | [Cancel] [Filter][Layout][Reset ]
|#                                   |#            Grid Title
|             Grid title             | [cmd 1] [cmd R+1] [cmd 2*R+1] ...
| [cmd 1] [cmd R+1] [cmd 2*R+1] ...  | [cmd 2] [cmd R+2]
| [cmd 2] [cmd R+2]                  |...
|...                                 | [cmd R] [cmd 2*R]
| [cmd R] [cmd 2*R]
'#' is the prompt where typed text gets echoed and 'R' is the
number of rows in the grid and varies by the set of commands
from the current filter.  Grid dimensions have been adjusted:
'all' is 13x9, 'normal' is 13x7, and 'wizard' is 7x4 or 4x7
depending on layout orientation.

The wizard mode-only filter setting probably isn't very useful
because you can only type--or click on--commands which are
visible.  So when set to wizard mode-only, you can't #quit for
instance.  (Via extended command; there are still menu choices
for that particular action.  And it's trivial to change filter.)
2020-12-06 02:58:05 -08:00
PatR
edefa14834 readable conical hats
Let tourists read cornuthaum ("WIZZARD") and dunce cap ("DUNCE").
One out of three will have those words, the other two will yield
"you can't find anything to read on this ___" where ___ is either
"conical hat" or "cornuthaum" or "dunce cap" depending upon hat
type and discovery status.

Even when a dunce cap says "DUNCE" it won't become discovered,
just offer the player an opportunity to apply a name.

Other roles still fall through to the "That's a silly thing to
read" feedback.

Not intended to be logical...
2020-12-05 12:29:38 -08:00
Pasi Kallinen
55b4946305 Fix AD_DCAY mhitm armor erosion type 2020-12-04 19:05:24 +02:00
PatR
0ba4184206 couple more command tweaks
Rename "seegold" to "showgold".  The character to invoke it ('$')
is similar to those for the various "seeXYZ" commands ('[','=',&c)
but unlike them, it isn't part of "seeall" ('*').

Expand or replace the one-line description of several commands
(shell, showgold, showtrap, suspend, versionshort).
2020-12-04 02:58:03 -08:00
Pasi Kallinen
d28489e55d Fixes bit for mhitm/uhitm/mhitu unification 2020-12-04 09:49:24 +02:00
PatR
3e7283e8fd Qt fix for typing "#version"
The #version command is a leading substring of the #versionshort
command and for Qt, it couldn't be executed by typing, only via
mouse click or one of the Qt-specific menus.  #version<return>
or #version<space> now works for that.

The #versionshort command ought to be renamed to something else.
2020-12-02 16:11:53 -08:00
PatR
4d6a140d34 saving vs ball&chain
I started activating new program_state.saving and discovered that
saving of ball and chain could access freed memory.  The change
for the former and fix for the latter are mixed together here (but
easily distinguishable).

The saving flag inhibits status updating and perm_invent updating,
also map updating that goes through flush_screen().  That should
fix the exception triggered after an impossible warning was issued
during a save operation.  impossible() goes through pline() which
tries to bring the screen up to date before issuing a message.
During save, data for that update can be in an inconsistent state.

The code to save ball and/or chain when not on floor or in invent
(I think swallowed is the only expected case) was examining the
memory pointed to by uball and uchain even if saving the level had
just freed floor objects and saving invent had just freed carried
objects.  So for the usual cases, stale pointer values for uball
and uchain would be present and checking their obj->where field
was not reliable.
2020-12-02 06:29:58 -08:00
nhmall
2c19db61aa daily cron update doc/Guidebook.txt 2020-11-30 20:22:18 -05:00
PatR
516af11dc7 reduce the number of #seeXYZ commands
Noticed while working on Qt's extended command handling, there
are an awful lot of "seeXYZ" commands.  Keep the inventory display
ones (named versions of ')' to show wielded weapon(s), '[' for
worn armor, '"' for worn amulet, &c) and rename the others:
| #seenv     -> #wizseenv     debugging command
| #seespells -> #showspells   '+' command
| #seetrap   -> #showtrap     '^' command

Also, expand the descriptions of #shell and #suspend a bit in
the Guidebook.  LaTeX version is untested.
2020-11-30 16:16:14 -08:00
PatR
f8fcab3400 move 'g.restoring' to 'g.program_state.restoring'
Move the core's global restoring flag (not the same as main()'s
local resuming flag) to a more logical place.  Add a saving flag
in the process, but it isn't being set or cleared anywhere yet.
(Once in use it will probably fix the exception during save that
was just reported, but before that it would be useful to figure
out what specifically caused the event.)

The program_state struct really ought to be standalone rather
than part of struct g but I haven't made that change.

Removing an unused variable for wishing and some reformatting
that whent along with it got mixed in.  Removes some trailing
whitespace in sfstruct.c too.

Only lightly tested...
2020-11-30 11:40:21 -08:00
PatR
69dd0485fb Qt message window: horizontal scrolling
Multiple stints of flailing about without a clue finally led to
a breakthrough.  When writing a new message to the multi-line
message window, force the view back to showing the starts of
lines if player has scrolled it to the side and left it that way.
Put another way, if it has been scrolled to the right, scroll it
as far as possible back to the left.
2020-11-29 16:58:56 -08:00
nhmall
0d6481ad8c spelling correction tidbit
Closes #415
2020-11-28 08:59:03 -05:00
PatR
daf1381cc2 autodescribe vs MSGTYPE
I was baffled about why moving the cursor across a fire elemental
kept putting up --More-- until I remembered that I once used
 MSGTYPE=stop "[Ff]ire"
to test Qt's handling for that.  Turns out that I left it in my
config file.  autodescribe feedback should not be honoring that;
honoring MSGTYPE=norepeat is not as clear-cut but this disables
it too.

User sounds were also kept enabled during autodescribe but I have
no way to test them.  Like norepeat, disabling just falls into
place.

The pline.c change is unrelated.  It just eliminates a wide line
(from adding 'g.') in the source by using a shorter variable name.
2020-11-27 11:10:44 -08:00
PatR
bb9df368af fix github issue #401 - roast/rust/rot in peace
This tries to fix the problem of the extra message when a tame
golem is completely destroyed (paper or straw golem burned, iron
golem rusted, wood or leather golem rotted) being issued at odd
times.  I basically punted on the visibility aspect since the
original logic was strange:  you had to be able to see both the
attacker's and defender's spots and at least one of those two
monsters.  Now mon-attacks-mon visibility requires that you be
able to see one of the two and if you don't see both, the unseen
one will be referred to as "it".  The "may the iron golem rust
in peace" message is independent of that and may be displayed
after "you have a sad feeling", but now that's intentional and
will refer to an unseen pet by name or monster type, not "it".

This needs a lot of testing and hasn't attempted to address
issue #402:  only some attacks that should compeletely destroy
a golem actually do so.  (So a hit by fire elemental against a
paper golem does, but passive fire counterattack when a paper
golem hits a fire elemental doesn't, nor does a wand of fire
or being hit by Firebrand.)

Fixes #401
2020-11-27 02:38:17 -08:00
PatR
ec153a27bd options help
The revamped options handling was't doing dynamic help properly.
After listing the booleans, it listed them again amongest the
compound options.  Since their description field is Null, that
could be a big problem.  sprintf(buf,"%s",NULL) on OSX produces
"(null)" but most sprintf()'s would probably crash instead.

The 'other' options (autopickup exceptions, menucolors, &c) were
not listed at all.  (I don't remember whether that was also the
case before the revamp.)  Now they're listed but not explained.

The 'msg_window' description was unhelpful; this replaces it.
A couple of others were longer than necessary so they've been
shortened.  The rest of optlist.h is reformatting wide lines.

Recently added 'safe_wait' option was included in the Guidebook
but not in dat/opthelp; add it.
2020-11-26 02:20:00 -08:00
PatR
2db51cf8bd fix #K3016 - kicking a bag of gold in a shop
Kicking a container that had gold in it took the gold amount
away from hero's credit or added to hero's debt, then didn't
give a refund if the container and its gold landed within the
shop.  Throwing behaved likewise, just less verbosely.

The problem is caused by addtobill() treating gold specially
and then subfrombill() not being able to perform a reverse
operation.  Actually, it may be possible for subfrombill() to
do that, but verifying all its uses is too much work.  This
moves the gold handling for drop+selling into its own routine
and adds calls to that for the throwing and kicking refunds.
The other calls to subfrombill() outside of shk.c appear to be
ok as-is.  (The calls inside that file are the ones that still
need evaluation if the gold handling is to move to there.)

bill_dummy_object() now uses the same o_id assignment for its
dummy object as split_object() does for its new partial stack.
I don't know whether the old code led to any price glitches.
2020-11-25 14:33:14 -08:00
PatR
6df9ebc1af add Guidebook description of rogue level
This is in response to the bug report we got however long ago
about the map display breaking when the [unfamiliar to player]
rogue level was reached.  It probably wouldn't have helped back
then since the subset of players who read the documentation is
about same subset as those who expect the Spanish Inquisition.

I wasn't sure whether appending "'s" to an italicized word
should be italicized itself and made it revert to the regular
font instead.  That should be changed if it's incorrect usage.
2020-11-25 10:21:43 -08:00
PatR
dde70b8d4a Guidebook bit: ascii_map and tiled_map
|ascii_map:
|If NetHack can, it should display an ascii character map if it can.
|tiled_map:
|If NetHack can, it should display a tiled map if it can.

Remove the "if {NetHack,it} can" redundancy and expand a little bit.

Also, alphabetize "tiled_map" as if the underscore were a space
instead of something that happens to collate after letters.

As usual, the Guidebook.tex changes are untested.
2020-11-25 09:15:20 -08:00
PatR
7e87abb66f wizard mode buglet: simultaneous Lev+Fly timeout
Noticed while working on Qt status highlighting:  if levitation
and flying timed out at the same time, first Lev timeout called
float_down() which reported
 You have stopped levitating and are now flying.
and then Fly timeout left stale "Fly" on the status line due to
an optimization which got subverted.  ('was_flying' flag was
False due to Fly being blocked by Lev; that's correct behavior,
but the flag is effectively a cached value that becomes stale
when the Lev timeout code executes.)

The bug was wizard mode only because #wizintrinsic is the only
way to get timed flying.
2020-11-24 10:43:12 -08:00
PatR
f43421ae3c create monster creating concealed mimic revisisted
commit 03d7d64d15:
| [...] but fixing this specific case is trivial.

Not trivial enough to avoid getting the details wrong.  An old
commit log message (58137a608a,
June of 2006) claimed that this was fixed for bag of tricks but
that was for monsters in general; mimics could still be wrong.
2020-11-22 00:32:11 -08:00
PatR
efea46a93d tty: selecting gold in menus
Requested by a beta tester nearly four years ago: '$' is both an
inventory "letter" and a group accelator.  The letter only works
if gold is on the current menu page and was taking precedence
over the group accelator.  Allow '$' to toggle selection of gold
regardless of the page.

curses already behaves this way.  X11 and Qt menus aren't
paginated so also pick gold even if the '$' entry in the menu
isn't visible at the time.  No idea about Windows GUI...
2020-11-21 18:21:16 -08:00
PatR
3e9d8f9aa5 'showscore' vs containers
When SCORE_ON_BOTL is enabled, you could tell how much gold is
inside a container with unknown contents by having 'showsore' On
and watching how much the score changed on the status line when
picking the container up.
2020-11-21 17:37:01 -08:00
PatR
d48e730700 ki-rin body parts
Use horse/unicorn body parts.  The result for HAIR is "mane"
which is appropriate.  There's no field for SKIN so the question
of whether to specify "scales" is moot.  (Snakes and dragons
describe HAIR as "scales" but that wouldn't be right for ki-rin.)
2020-11-21 03:46:53 -08:00
PatR
03d7d64d15 create monster creating concealed mimic
From an old bug report (sent directly to devteam, June of 2017):
wand or scroll of create monster becomes discovered if it makes
a mimic that is concealed as an object or as furniture within
the hero's view.  Fixing this in the general case [when does
seeing a mimic as something other than a monster mean that the
mimic is being seen?] is a massive can of worms, but fixing this
specific case is trivial.
2020-11-20 18:56:35 -08:00
PatR
27b93148c0 ki-rin's horn
Let ki-rin cure themselves (of being stunned, confused, or blinded)
with their own horn, and make them be poison resistant.  They
aren't unicorns but their horn is very much like a unicorn horn.
They're flagged no-corpse so this hasn't changed them to leave
behind a horn upon death.

They were flagged as animals who neighed but they are also spell
casters.  I took the animal flag off (they're still no-hands so
shouldn't be able to use items; also, unicorns aren't flagged as
animals either) and changed sound to 'ms_spell'.
2020-11-18 11:16:21 -08:00
nhmall
9aeb4db3b2 wasm-bug-fixes-2 github PR #412 2020-11-18 08:21:07 -05:00
nhmall
03d1eed0b5 daily cron doc/Guidebook.txt update 2020-11-17 09:14:47 -05:00
PatR
cb8baa1d1c Qt status overhaul: add support for 'statuslines'
Condense the Qt status slightly, moving Alignment field from the
Conditons line to the Characteristics line and the Time and Score
fields from their own possibly blank line to the HP,&c,Gold line.

That's for statuslines:2, which is the default.  statuslines:3
restores the previous layout.  I tried to make that become the
default for Qt but it got messy fast and I gave up.

I also tried to make changing 'statuslines' back and forth on the
fly work but failed.  I left the code in as #if DYNAMIC_STATUSLINES
but that isn't defined anywhere.  For the time being at least,
'statuslines' is config file or NETHACKOPTIONS only for Qt, not
changeable via 'O' like for curses and tty.

Change the option description for 'statuslines'.  That depended
upon whether curses was compiled in when it should depend on which
interface is active.  This moves the alternate info to Guidebook.
2020-11-17 05:07:09 -08:00