Commit Graph

4394 Commits

Author SHA1 Message Date
Pasi Kallinen
a6816824c7 Lua: Pass more data to room contents function 2022-01-23 13:27:00 +02:00
Pasi Kallinen
9d64d135b8 Curses: fix extended command input
The extended command input prompt was behaving in an unintended way:
Typing #a<enter> executed #adjust. Spaces in the entry prevented matching
any command. No error message was given when no command was matched.

Fix all of those, so it behaves more like the tty.

Clean up the tty, curses, and X11 windowport code, so they don't use
the extcmdlist array directly, but query with extcmds_match
and extcmds_getentry.
2022-01-22 14:32:53 +02:00
PatR
6a72e48a40 fix rest_on_space
When rest_on_space is On, assign same function as for #wait to the
<space> key.  When Off, set that key to Null instead.  Binding some
other command to <space> when rest_on_space is Off doesn't work but
I would classify that as something to be discouraged anyway.
2022-01-21 15:51:05 -08:00
PatR
75fed4b92b autodig '>'
This fixes moving in direction '>' while wielding a pick-axe with
the 'autodig' option On.  Attempting to dig assumed size-to-side
activity because u.dz wasn't being set, so the pick-axe was swung at
thin air instead making a pit or turning an existing pit into a hole.

dodown() and doup() should probably call set_move_cmd() instead of
manipulating u.dz directly.  But they would also need to suppress
g.move_attempting or the game says "you can't get there from here..."
after successfully digging or plunging into a pit.
2022-01-21 14:27:21 -08:00
PatR
182abe6b60 wet towel tweaks
When hitting with a wielded wet towel, use "you lash <mon>" like
bullwhip.  If you continue with the towel after it has dried out,
message reverts to ordinary "you hit <mon>".

Enhance damage slightly and double the wetness bonus when target
is an iron golem.  Damage was (tmp=rnd(1..7), max(tmp,6)); now it's
rnd(1 + 1..7) for other monsters, rnd(1 + 2*(1..7)) for iron golem,
with no cap of 6 for either.

Sequencing:  defer "your towel dries" until after the lash message.
2022-01-21 11:38:21 -08:00
PatR
76df2ffcf5 slippery fingers
When the hero has the Glib condition, ^X reports "you have slippery
fingers" or "you have slippery gloves" but self-probing (either wand
or stethoscope aimed at self) was reporting "you have slippery hands."
Change self-probing to match enlightenment for this.
2022-01-20 16:31:34 -08:00
PatR
aaa49e3e96 fix #K3520 - typo in dry_a_towel()
Message shown when hero sees a monster's wet towel become less wet:
"<Mon>'s {moist|wet} towel drie[ out]."  Corresponding message for
hero's towel spelled "dries" correctly.

Reported for to-be-3.7 but present since 3.6.0.
2022-01-19 00:58:08 -08:00
PatR
9f6f6c1250 fix #K3518 - "WHAMMM!!!" vs deafness
Kicking a door can produce "WHAMMM!!!".  "Wham" doesn't necessarily
imply any noise but there's a strong suggestion that it does, so a
deaf hero shouldn't be able to hear it.  Give alternate feedback,
"Thwack!!" when deaf, and sometimes give that even when not deaf.

Also tone down "WHAMMM!!!" to Whammm!!".
2022-01-18 14:13:56 -08:00
PatR
f420b9672f Qt: more '#' support
Add an entry for running an extended command to Qt's 'game' menu.
2022-01-17 14:38:16 -08:00
nhw_cron
9cca0d88d8 This is cron-daily v1-Jan-11-2022. 005guidebook updated: doc/Guidebook.txt 2022-01-17 12:51:40 -05:00
nhw_cron
d781c4172e This is cron-daily v1-Jan-11-2022. 001datesub updated: ./doc/Guidebook.tex ./doc/Guidebook.mn 2022-01-17 12:51:25 -05:00
Pasi Kallinen
2e144e814d Change repeat into extended command 2022-01-17 17:13:59 +02:00
nhw_cron
8fa1e1ffa6 This is cron-daily v1-Jan-11-2022. 005guidebook updated: doc/Guidebook.txt 2022-01-16 12:59:47 -05:00
nhw_cron
0f12d6db39 This is cron-daily v1-Jan-11-2022. 001datesub updated: ./doc/Guidebook.tex ./doc/Guidebook.mn 2022-01-16 12:59:33 -05:00
Pasi Kallinen
e7fa065203 Change special keys into extended commands
Changes most of the special keys used in the main input loop
into extended commands:

- movement keys are now bound to extended commands, eg.
  #movewest and so on.

- m-prefix is now #reqmenu extended command, still bound to
  the 'm' key.

- run, rush, and fight are now extended commands, still bound
  to the same keys as previously.

- nopickup and runnopickup keys are removed.
  Nopickup was using 'm' key, the same as the m-prefix, so
  allow #reqmenu to modify movement commands to disable pickup.

- multiple prefix commands are allowed. This lets user to
  use #reqmenu, followed by #run, followed by movement to simulate
  runnopickup behaviour. (If necessary, adding runnopickup back
  as an extended command would be easy)
2022-01-16 14:48:24 +02:00
PatR
689aed55ca remove unused roles[].femalenum, races[].femalenum
and rename {roles,races}[].malenum to {roles,races}[].mnum.

Pull request #653 from entrez.  Male and female player character
monsters are no long separate even when their title's differ and all
the entries for femalenum in the roles[] and races[] arrays were set
to NON_PM (meaning not used in this case).

The update in the pull request overlooked win/Qt/qt_plsel.cpp which
had four references to .malenum so this is more than just the fixes
entry.

Closes #653
2022-01-14 14:09:00 -08:00
PatR
c954c267c0 fixes entry for unpaid_cost regression fix
Pull request #654 from entrez:  the change to avoid impossible
"unpaid_cost: object wasn't on any bill" when examining inventory
while in a wall shared by multiple shops didn't work correctly for
shop-owned objects inside hero-owned containers (which worked prior
to that change).

Not fixed, and possibly not going to be:  if a hero-owned container
holds items from more than one shop, the cost appended to those items'
inventory entries might show the wrong amount if the relevant code
picks the wrong shk.  Presumably the wrong amount can also happen if
player puts items from one shop into a container owned by another
shop.

Closes #654
2022-01-14 13:33:17 -08:00
PatR
6d6a266eed fixes entry for flyers 'swooping' down levels
Pull request from entrez:  flying hero who uses a hole or trap door to
move down to a lower level shouldn't fall to the floor when arriving.

Closes #655
2022-01-14 12:59:46 -08:00
PatR
5c14f3e81d fix #K3514 - unpaid_cost() impossible
Fix the reported bug of using Passes_walls to carry an unpaid item
from inside a shop into the wall it shares with another shop
producing a situation where examining inventory issued an impossible
"unpaid_cost: object wasn't on any bill" when trying to append the
cost to the formatted inventory line.  u.ushops[], u.ushops0[], and
others are lists that can have up to four entries and the relevant
code was only checking the first one.

Not mentioned in the report:  continuing another step into the other
shop didn't get recognized as robbing the first shop, for a similar
reason.

For either of these bugs, digging a breach in the wall, paying off
the miffed shopkeeper, then stepping into the breach before it gets
repaired will probably trigger the same results without the need for
polymorphing into a xorn or earth elemental.  But not on the tourist
goal level test case since walls there are undiggable.

I didn't go looking for other instances of not checking all relevant
shopkeepers.  It wouldn't surprise me if there are some more.
2022-01-11 23:32:13 -08:00
nhmall
0dd5d69da9 Guidebook.txt update from cron job 2022-01-11 17:38:46 -05:00
nhw_cron
ce3923e208 This is cron-daily v1-Jan-11-2022. 001datesub updated: ./doc/Guidebook.tex ./doc/Guidebook.mn 2022-01-11 17:37:18 -05:00
Kenneth Lorber
3a4cee5955 Enable automated date generation on the Guidebook source files. 2022-01-11 15:39:20 -05:00
PatR
ffeb0e27a8 fix recent Wounded_legs fix
Wounded_legs was changed from (HWounded_legs || EWounded_legs) to
just (HWounded_legs), but when the timeout code decremented the timer
to 0, HWounded_legs became 0 and heal_legs() operated as if there was
nothing to repair and hero didn't recover from temporarily lost Dex.
Change Wounded_legs back to (HWounded_legs || EWounded_legs).
2022-01-11 10:25:50 -08:00
PatR
1069777bc6 Qt player selection dialog
During role/race/gender/alignment selection, when gender gets toggled
replace the gender-specific role titles and their icons to reflect
new gender value.  And enable or disable Valkyrie choice depending
upon the gender value, not just current race value.

This ended up revising a lot of the NetHackQtPlayerSelector code,
eliminating some redundancies and being more careful with the use of
validrace()/validgend()/validalign().  That still isn't bulletproof.

It also changes the two instances of buttonPressed that were drawing
Qt6 warnings from connect() at run-time with buttonClicked.  That
works as intended with Qt5 and might eliminate those.

The code to use female player character tiles looks correct to me
but when I toggle gender, role titles change but their icons don't.
I don't know what's going on here.  Some ealier code always specifies
MALE but that code isn't used according to various prints to stderr
that I temporarily inserted.
2022-01-10 13:23:09 -08:00
SHIRAKATA Kentaro
a2a40c6b0b fix typo in Guidebook.tex 2022-01-10 21:36:16 +09:00
PatR
88d2c8ae24 parsebindings() vs commas
The set-but-not-used warning for 'ret' revealed an actual bug this
time.  Parsing sysconf cares whether any errors were encountered
when parsing its contents, but BINDINGS=key1:cmd1,key2:cmd2 only
returned the result of the first key in the comma-separated list
because the result from recursive calls was lost to the set-but-
not-used variable.  Just adding use of that variable would have
ended up reporting success if any key bound succesfully rather than
requiring that they all do as sysconf parse handling intends.

Also, binding comma to a command required that it be specified by
its numeric value because parsing via recursion ate up the actual
commas.  Now allow "BINDINGS=,:cmd" or "keyM:cmdM,,:cmdN" or
"BINDINGS=\,:cmd" or "keyM:cmdM,\,:cmdN".

It also recognizes "BINDINGS=',':cmd" and "keyM:cmdM,',':cmdN" but
that yields an invalid key error for "','".  I thought txt2key()
supported that but it doesn't.  I've left this in because the error
about ',' not being recognized as a key seems better than one about
"'" not being a valid key bind and then accidentally binding single
quote via post-comma "':command".
2022-01-08 12:32:49 -08:00
PatR
86343af200 Qt: force 'toptenwin' option On
'toptenwin' defaults to false, so the high scores list at end of game
gets written to stdout by default.  stdout might be a bit bucket if
the game is started from a menu somewhere or from Explorer or Finder
or something comparable.  Even when started from a terminal, writing
to stdout is bad if running asynchronously ('nethack &').

Have Qt init force the 'toptenwin' option to true to show the high
scores in a pop-up text window.  The "since you were in wizard mode
your score is ignored" line also goes to a pop-up text window now too.
An extra <return> is needed to dismiss that when quitting if you go
through the full disclosure sequence.

'nethack -s' writes scores to stdout before interface initialization
takes place, so isn't affected by this change.  That's intentional so
that 'nethack -s > ~/myscores' can be used to capture the output.
2022-01-06 12:25:17 -08:00
Pasi Kallinen
c300f9f084 Fixes entry 2022-01-06 14:34:33 +02:00
PatR
f4b30e872e fixes entry for PR #651 - single-char engraving
Pull request from vultur-cadens:  when engraving with a weapon, the
occupation routine doesn't dull it on the last character, so engraving
a single character never dulled the weapon.  Didn't apply to engraving
with other types of items.

Closes #651
2022-01-06 01:44:45 -08:00
PatR
9d34b727e2 Qt: more ant extermination
After the fairly recent glyph changes, the icons shown for roles and
races during the character selection dialog all were all depicted by
the giant ant tile.  I might have noticed this sooner but usually
have '-@' on the command line to bypass selection.
2022-01-04 11:54:05 -08:00
Pasi Kallinen
07451ca32c Update lua api docs 2022-01-04 21:29:06 +02:00
nhmall
565ed29caf fixes entry for ubuntu 21.10 change
Note: Previous commit incorrectly stated 20.10 when it should have
stated 21.10 for impish.
2022-01-04 08:48:21 -05:00
PatR
292a4f9d03 wounded legs fixes
Document 'HWounded_legs' vs 'EWounded_legs'; they aren't used the way
other properties use their intrinsic and extrinsic values.  And they
switch from hero to steed when riding.  (Can't start riding when
hero's legs are wounded and the steed's legs magically heal when hero
dismounts, so existing wounds never transfer from one to the other.)

Having one leg become injured when the other already was would cure
the other leg but keep the longer of their two timeouts for the new
injury.  Eliminate that mystery cure.  Since their timeouts aren't
tracked separately, the best that can be done is to make both legs
eventually recover at the same time.

Make ^X report which leg is the wounded one when only one of them is.
(It already implicitly reports the both-legs case by using plural.)

When zapping a wand of probing downward while riding, include wounded
leg feedback for the steed.

Simplify wounded leg feedback when probing self a little bit.

Make drinking blessed potions of full healing cure wounded legs for
hero when not mounted or for steed when mounted.  (The latter is a
bit strange--hero drinks potion, steed gets affected--but it's magic.)

Make drinking uncursed potions of full healing or blessed potions of
extra healing cure wounded legs for hero (but not steed; the magic
either isn't that strong or maybe not that reliable...).
2022-01-03 13:44:05 -08:00
Pasi Kallinen
0f132470c7 Allow tipping container directly into another 2022-01-01 16:15:29 +02:00
PatR
f96d1b4342 Qt tiles file loading
Redo how Qt retries if it can't load the primary tiles file.
2021-12-31 15:29:10 -08:00
Pasi Kallinen
2591a21cf0 Leprechauns bury their gold after teleporting 2021-12-31 18:48:44 +02:00
HMM
706b1a939b Have the '$' command include gold in your pack
In verbose mode, the gold in your wallet is totaled separately from
that in containers in your pack, and the two are listed separately.
In terse mode, just print the total of both.

Only known gold is mentioned.
2021-12-30 21:12:38 +02:00
PatR
24c9f79aa5 fixes entry for Qt6 support
I had a minor merge issue when incorporating Ray's Qt6 port from
github.com/chasonr/NetHack/Qt6 but it got resolved.  This still builds
with Qt5 (and that's the only aspect I've been able to test) but is
supposed to work with Qt6 too.  It adds a new hints file for OSX and
someone might need to create a comparable one for linux.  Or maybe
the differences can be folded into the existing hints as conditional.

Closes #525
2021-12-30 11:06:29 -08:00
Pasi Kallinen
fa41d5fe66 Apply a wielded polearm with fire-command
Wield a polearm and use 'f'ire to automatically hit with it,
if there's a single valid target.
With fireassist-option, will swapweapon to a polearm.
This only applies if quiver is empty and autoquiver is off.
2021-12-29 19:40:26 +02:00
PatR
9daefde0c4 fix #K3503 - boulder-carrying monster killed twice
A giant that is carrying a boulder and standing on ice who drowns when
the ice gets melted could die a second time if the resulting pool gets
plugged by the boulder.  It results in an impossible from dmonsfree()
about bookkeeping inconsistency when dead monsters are removed at the
end of the turn.  The fuzzer escalates that to a panic.
2021-12-26 09:44:10 -08:00
Pasi Kallinen
4b525374d0 Make vrocks emit a poison cloud when they flee 2021-12-25 10:51:20 +02:00
PatR
4eb0592959 sickness countdown
Give messages when sickness countdown has nearly expired to warn
player that hero is dying and also so that death at the end doesn't
seem so abrupt after an arbitrary period with just "TermIll" and/or
"FoodPois" on the status line.

Also, abuse constitution each turn when Sick (either variation, but
not a double amount if both).
2021-12-22 19:36:52 -08:00
PatR
29cadc0452 curses: fix "---" separators in ^P output
This one has me baffled, first how/when it happened and then why no
one reported it.  The line
 current_mesg->turn = g.moves;
vanished from mesg_add_line() at some point.  It is visible in diff
context of commit 99ed00012e from March,
2019 but I can't find any commit since that time which removed it.

[I've been using
 git log --no-min-parents --no-max-parents --patch win/curses/cursmesg.c
and then searching within the pager.  Maybe that's flaky, but if so,
things wouldn't be any less strange.]

The missing line resulted in mesg->turn being uninitialized, so when
^P compared consecutive messages to decide whether they were issued on
the same turn, arbitrary junk made them all seem to be from different
turns so "---" got inserted before every message.  I suppose that if
someone uses a malloc that zeroes the memory it hands out, mesg->turn
field would always be 0 and ^P would behave as if all messages were
from the same turn, so not show any "---" separators.  Then players
might not be aware that "---" between groups of messages was intended.

[The messages ought to be grouped by move rather than by turn, but
that's something the core would have to provide.]
2021-12-22 11:33:35 -08:00
Pasi Kallinen
b1ed92abad Apply runmode to multiturn actions 2021-12-21 17:37:48 +02:00
PatR
f08c7f2101 bullwhip and polearm attack feedback
When testing the urgent message for having weapon be snagged by a
bullwhip, in between the occasional weapon grabs (which mention
flicking the bullwhip) I saw lots of regular attacks that said
"<mon> swings his bullwhip."  That is accurate but seems odd, so
change it to "<mon> lashes his bullwhip."  Do same for the hero.

While working on that, I discovered that monsters using a polearm
for a ranged attack always showed "<mon> thrusts <a polearm>" even
for ones that aren't defined as piercing so should be swung rather
that thrust.  And they're allowed to do that when adjacent where
there isn't enough room to thrust or swing a long polearm.  Now it's
"<mon> bashes with <a polearm>" in that situation.
2021-12-21 02:56:59 -08:00
Pasi Kallinen
ef1eeed755 Give dragon armor extra effects
Dragon scales and dragon scale mails will provide some extra effects
when worn:

 - blue:   very fast speed
 - black:  level-drain resistance
 - green:  sickness resistance
 - gold:   hallucination resistance
 - orange: free action
 - red:    infravision
 - white:  slow digestion
 - yellow: stoning resistance

gray and silver don't have extra effects - those two are already the
best ones, so don't need any.
2021-12-20 23:30:27 +02:00
PatR
7ccc195155 fix #K3496 - leash description when pet changes
If persistent inventory is displayed and contains an entry for a leash
attached to a pet and the pet's type or name changes, the perm_invent
window didn't get updated to reflect the new leash information:
 x - leash (attached to <mon>)
Report was for polymorph but applied to growing into bigger form and
to being (re-/un-)christened as well.
2021-12-19 09:30:07 -08:00
PatR
9f41ab7bfe Qt paper doll fix
This fixes the broken paper doll display.  Changes for new glyphs
added code to an 'if' but not to the corresponding 'else'.

Showing map column 0 as something other than blank is still a problem.

The splash window shows a red dragon and says "loading".  I'm pretty
sure that that used to be a crisp image but it is now a fuzzy one.
It doesn't use glyphs or their tiles so shouldn't have been affected
by changes to them.
2021-12-19 03:46:21 -08:00
PatR
c5544a8011 'urgent' messages for curses
Have curses catch up with tty.  Some particular messages override
message suppression after --More-ESC (tty) or >>ESC (curses).
2021-12-18 11:07:23 -08:00
PatR
420d121f93 'urgent' messages
Follow up on some old groundwork.  For tty, if the core has designated
a message as 'urgent', override any message suppression taking place
because of ESC typed at the --More-- prompt.  Right now, "You die"
messages, feedback about having something stolen, feedback for
"amorous demon" interaction (mainly in case of armor removal), and
exploding a bag of holding are treated as urgent.

The "You die" case is already handled by a hack in top-line handling;
I left that in place so the conversion of 3 or 4 pline("You die.*")
to custompline(URGENT_MESSAGE, "You die.*") was redundant.  There
are probably various non-You_die messages which precede done() which
should be marked urgent too.

Other interfaces might want to do something similar.  And we ought to
implement MSGTYPE=force or MSGTYPE=urgent to allow players to indicate
other messages that they want have to override suppression.  But I'm
not intending to work on either of those.  I mainly wanted to force
the magic bag explosion message to be shown since a sequence of "You
put <foo> into <bag>." messages is a likely candidate for --More--ESC.
2021-12-17 17:46:49 -08:00