]> granicus.if.org Git - nethack/log
nethack
3 years agoNO_TILE_C => no USE_TILES in tile.c
PatR [Fri, 31 Dec 2021 21:49:43 +0000 (13:49 -0800)]
NO_TILE_C => no USE_TILES in tile.c

Compiling with NO_TILE_C defined results in preventing USE_TILES
from being defined and that causes display.c to use alternate code.
Construct src/tile.c such that nethack links successfully if the
configuration specifies NO_TILE_C but the Makefile goes ahead and
builds tile.c, compiles it, and links with it, otherwise it conflicts
with that alternate code.  Prior to this, linking gave two complaints
about duplicate symbols and failed.

3 years agochange MacOSX to MacOS in version display
nhmall [Fri, 31 Dec 2021 21:44:15 +0000 (16:44 -0500)]
change MacOSX to MacOS in version display

3 years agomacOS homebrew qt@5
nhmall [Fri, 31 Dec 2021 21:06:30 +0000 (16:06 -0500)]
macOS homebrew qt@5

Once 'brew update' and 'brew upgrade' had been done, the qt@5
package did become available for installation and the original
line in the hints file worked, so put it back as it was.

3 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Fri, 31 Dec 2021 19:24:08 +0000 (14:24 -0500)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

3 years agoDefine engulfing_u, making clearer code
Pasi Kallinen [Fri, 31 Dec 2021 19:12:12 +0000 (21:12 +0200)]
Define engulfing_u, making clearer code

3 years agolinux-minimal hints was used with the CI
nhmall [Fri, 31 Dec 2021 19:02:35 +0000 (14:02 -0500)]
linux-minimal hints was used with the CI

3 years agoLeprechauns bury their gold after teleporting
Pasi Kallinen [Fri, 31 Dec 2021 16:48:44 +0000 (18:48 +0200)]
Leprechauns bury their gold after teleporting

3 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Fri, 31 Dec 2021 14:24:08 +0000 (09:24 -0500)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

3 years agohints updates
nhmall [Thu, 30 Dec 2021 21:46:07 +0000 (16:46 -0500)]
hints updates

move out-of-date hints files to the outdated folder.

rename the hints files, and hints/include files that are currently
named *.2020 to *.370 (next release number).

3 years agoQt splash code
PatR [Fri, 31 Dec 2021 09:53:46 +0000 (01:53 -0800)]
Qt splash code

Move the handling for the Qt interface's splash window into its own
routine to unclutter the constructor for QtBind.  Also, don't load
nhsplash.xpm if OPTIONS=!splash has been specified.

3 years agosync linux.2020 topology with macOS.2020
nhmall [Thu, 30 Dec 2021 23:05:45 +0000 (18:05 -0500)]
sync linux.2020 topology with macOS.2020

3 years agoQt map column 0
PatR [Thu, 30 Dec 2021 22:07:59 +0000 (14:07 -0800)]
Qt map column 0

Column 0 ought to be suppressed like it is for tty and curses (not
sure about X11 or Windows GUI), but until that happens, display it as
'nothing'.  The glyph overhaul not too long ago resulted in it being
shown as a column of giant ants.

We ought to have some special 'none of the above' tile #0 that will
stand out enough to be reported and fixed.  Glyph #0 too.

3 years agoremove qt-specifc hints file
nhmall [Thu, 30 Dec 2021 21:27:02 +0000 (16:27 -0500)]
remove qt-specifc hints file

3 years agomacOS homebrew Qt5 build fix
nhmall [Thu, 30 Dec 2021 20:36:59 +0000 (15:36 -0500)]
macOS homebrew Qt5 build fix

I had to revert this line in order to build on macOS Monterey.

3 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
nhmall [Thu, 30 Dec 2021 20:15:39 +0000 (15:15 -0500)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

3 years agoqt6 support follow-up
nhmall [Thu, 30 Dec 2021 20:11:49 +0000 (15:11 -0500)]
qt6 support follow-up

encompass Qt6 support in the common hints file macOS.2020 instead
of a separate macOS.2020-qt6, which had already diverged and would
likely be a maintenance headache.

From the Makefile perspective:
WANT_WIN_QT=1 will default to Qt5
WANT_WIN_QT5=1 will assume Qt5
WANT_WIN_QT6=1 will assume Qt6

You must have the appropriate Qt installed, of course.
I expect some additional fine-tuning will be needed as this gets
tried out.

3 years agoQt vs C() macro
PatR [Thu, 30 Dec 2021 19:29:03 +0000 (11:29 -0800)]
Qt vs C() macro

Our C() macro conflicts with Qt6 usage, so #undef C has added.  Move
that from nearly every qt_*.cpp into qt_pre.h where other similar
fixups are handled.

3 years agoFix: chameleon quickmimic not reset after eating
Michael Meyer [Thu, 30 Sep 2021 04:26:01 +0000 (00:26 -0400)]
Fix: chameleon quickmimic not reset after eating

finish_meating was checking whether the monster in question was a
chameleon/shapechanger, rather than whether it was a mimic, in deciding
which monsters should be allowed to maintain their current appearance
once they finish eating.  This meant that true mimics had their
appearance reset, while a chameleon, vampire, etc, who ate a mimic
would maintain their appearance as a tripe ration even after they had
finished eating and resumed their normal behavior.  The result?  An
amazing living tripe ration which followed the hero around throughout
the level.

3 years agoHave the '$' command include gold in your pack
HMM [Mon, 18 Oct 2021 19:04:14 +0000 (15:04 -0400)]
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.

3 years agoMerge branch 'Qt6' into NetHack-3.7
PatR [Thu, 30 Dec 2021 19:07:07 +0000 (11:07 -0800)]
Merge branch 'Qt6' into NetHack-3.7

3 years agofixes entry for Qt6 support
PatR [Thu, 30 Dec 2021 19:06:29 +0000 (11:06 -0800)]
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

3 years agoMake amnesia drain training to appropriate level
George Edward Bulmer [Sat, 23 Oct 2021 13:25:53 +0000 (14:25 +0100)]
Make amnesia drain training to appropriate level

When amnesia drains your skills the skill training would be set
to a random amount rather than a random valid amount for the new
level of skill.

This meant that, for example, you could have Master skill level in
martial arts but with the training amount of Basic.

Attempts to retrain to level martial arts to Grand Master would
then take an extraordinary amount of time compared to usual.

Fix taken from Evilhack

3 years agoMerge branch 'Qt6'
PatR [Thu, 30 Dec 2021 18:56:28 +0000 (10:56 -0800)]
Merge branch 'Qt6'

3 years agoUse QApplication::desktop for screen size on Qt5
Ray Chason [Wed, 29 Dec 2021 06:44:02 +0000 (01:44 -0500)]
Use QApplication::desktop for screen size on Qt5

5.15 has QWidget::screen, but older versions don't.

3 years agoChanges for Qt 6 on MacOS
Ray Chason [Mon, 27 Dec 2021 18:45:54 +0000 (13:45 -0500)]
Changes for Qt 6 on MacOS

3 years agoDon't erase Elbereth when monster steps into a pit or hole dug by you
HMM [Sun, 31 Oct 2021 20:12:25 +0000 (16:12 -0400)]
Don't erase Elbereth when monster steps into a pit or hole dug by you

Elbereth was fading when offscreen monsters stepped into
pits or holes dug elsewhere on the level. This was happening
because monsters falling into traps set by you were calling
setmangry() as if you had just attacked them. The behavior
made it unsafe to use Elbereth if you've dug down anywhere
else on the level, making it a bit harder to get archeologists
off the ground.

3 years agoCorrect the genders of DCSS bogusmons
RojjaCebolla [Sat, 18 Dec 2021 08:07:04 +0000 (03:07 -0500)]
Correct the genders of DCSS bogusmons

Reference: https://github.com/crawl/crawl/blob/master/crawl-ref/source/mon-data.h

3 years agoMake extended commands return defined flags
Pasi Kallinen [Thu, 30 Dec 2021 16:46:30 +0000 (18:46 +0200)]
Make extended commands return defined flags

Instead of returning 0 or 1, we'll now use ECMD_OK or ECMD_TURN.
These have the same meaning as the hardcoded numbers; ECMD_TURN
means the command uses a turn.

In future, could add eg. a flag denoting "user cancelled command"
or "command failed", and should clear eg. the cmdq.

Mostly this was simply replacing return values with the defines
in the extended commands, so hopefully I didn't break anything.

3 years agoadd new TODO item to Qt status: tool tips
PatR [Wed, 29 Dec 2021 19:39:57 +0000 (11:39 -0800)]
add new TODO item to Qt status: tool tips

3 years agoApply a wielded polearm with fire-command
Pasi Kallinen [Wed, 29 Dec 2021 17:40:23 +0000 (19:40 +0200)]
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.

3 years agomakedefs.c comment typo
PatR [Wed, 29 Dec 2021 11:16:31 +0000 (03:16 -0800)]
makedefs.c comment typo

3 years agono USED_SOUNDS option parsing bit
PatR [Wed, 29 Dec 2021 10:21:13 +0000 (02:21 -0800)]
no USED_SOUNDS option parsing bit

If the program is build without USER_SOUNDS and encounters any SOUND
or SOUNDDIR directive when parsing the run-time config file it only
issues an error message about the first one.  When finished parsing,
have it include suppressed ones in the count of errors encountered.

3 years agoQt paper doll fix for two-handed weapons
PatR [Wed, 29 Dec 2021 10:13:34 +0000 (02:13 -0800)]
Qt paper doll fix for two-handed weapons

Allowing optional arguments can be risky.  The recent glyph changes
added a new argument to the routine that constructs a mirror image
of a tile but not to the call to that routine.  Because an existing
argument was optional, the compiler didn't complain about the new
one being missing.

Obsolete optional 'fem' argument ought to removed but this doesn't
tackle that.

3 years agoUse QApplication::desktop for screen size on Qt5
Ray Chason [Wed, 29 Dec 2021 06:44:02 +0000 (01:44 -0500)]
Use QApplication::desktop for screen size on Qt5

5.15 has QWidget::screen, but older versions don't.

3 years agoSplit leprechaun avoidance into separate function
Pasi Kallinen [Tue, 28 Dec 2021 17:11:30 +0000 (19:11 +0200)]
Split leprechaun avoidance into separate function

3 years agoMerge branch 'pr645' into NetHack-3.7
nhmall [Tue, 28 Dec 2021 13:43:07 +0000 (08:43 -0500)]
Merge branch 'pr645' into NetHack-3.7

3 years agoMerge branch 'libnethack-target-fixes' of https://github.com/dextercd/NetHack into...
nhmall [Tue, 28 Dec 2021 13:41:35 +0000 (08:41 -0500)]
Merge branch 'libnethack-target-fixes' of https://github.com/dextercd/NetHack into pr645

3 years agomore possible build fixes
nhmall [Tue, 28 Dec 2021 13:04:59 +0000 (08:04 -0500)]
more possible build fixes

Once again, I need to commit these first and observe the CI results
afterwards to verify the results.

3 years agopossible build fix catch-up for Windows Makefile.gcc
nhmall [Tue, 28 Dec 2021 02:43:46 +0000 (21:43 -0500)]
possible build fix catch-up for Windows Makefile.gcc

Verification once CI attempts a build as no local testing capability

3 years agoXcode build fix
nhmall [Tue, 28 Dec 2021 02:33:01 +0000 (21:33 -0500)]
Xcode build fix

3 years agoQt misuse of Role_if()
PatR [Mon, 27 Dec 2021 22:27:35 +0000 (14:27 -0800)]
Qt misuse of Role_if()

The Qt paper doll highlights known blessed/uncursed/cursed items with
a color border.  It was trying to force obj->bknown for non-blinded
priest[ess] but passed the old role letter argument to Role_if()
instead of the monster number that's used these days.  It was also
potentially modifying an invent item in a way that's observable to
the player but not updating persistent inventory to show that.

Probably didn't matter though; I don't think the situation it checks
for can occur anymore.  On the off chance that it could, move the
check-and-set out of #if ENHANCED_PAPERDOLL so that same inventory
update would occur for ordinary paper doll even though that doesn't
care about displayed items' bless/curse state.

3 years agoChanges for Qt 6 on MacOS
Ray Chason [Mon, 27 Dec 2021 18:45:54 +0000 (13:45 -0500)]
Changes for Qt 6 on MacOS

3 years agored dragon's sight
PatR [Sun, 26 Dec 2021 22:57:29 +0000 (14:57 -0800)]
red dragon's sight

Since wearing red dragon scales/mail confers infravision, give that
ability to red dragons.  Matters when the hero is polymorphed into one.
Also give it to the Chromatic Dragon, where I don't think it matters.

3 years agohero_seq followup
PatR [Sun, 26 Dec 2021 22:40:03 +0000 (14:40 -0800)]
hero_seq followup

Make sure g.hero_seq has a sane value during restore before moveloop()
has a chance to update it.

Have curses use g.hero_seq for messages delivered via putmsghistory().

3 years agofix #K3503 - boulder-carrying monster killed twice
PatR [Sun, 26 Dec 2021 17:44:10 +0000 (09:44 -0800)]
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.

3 years agocurses message management
PatR [Sun, 26 Dec 2021 08:43:24 +0000 (00:43 -0800)]
curses message management

Switch from 'moves' to 'hero_seq' for tracking whether consecutive
messages were issued on the same move and for whether current move
is still same one after played has responded to --More-- with ESC.

3 years agohero_seq
PatR [Sun, 26 Dec 2021 08:16:55 +0000 (00:16 -0800)]
hero_seq

'moves' is actually turns and there hasn't been any straightforward
way to track actual hero moves.  Add hero_seq for that.  It isn't a
counter but is distinct each time the hero makes a move.  I wanted
it for curses ^P support but so far use it for checking stethoscope
usage and for shopkeeper behavior when items in a shop are broken by
the hero.

Increment EDITLEVEL due to change in save file contents.

3 years agodragon armor fix
PatR [Sat, 25 Dec 2021 22:31:33 +0000 (14:31 -0800)]
dragon armor fix

Fix a segfault when polymorphed into a dragon and using ^X.

One inconsistency I've spotted that I hadn't noticed earlier:  if
you wear red dragon scales/mail you obtain infravision ability, but
if polymorph into a red dragon, you don't.

3 years agodragon armor properties
PatR [Sat, 25 Dec 2021 18:26:44 +0000 (10:26 -0800)]
dragon armor properties

Special abilities conferred by wearing dragon armor was implemented in
a somewhat half-assed fashion; extend it to 3/4-assed.  Abilities came
from wearing dragon armor but not from being poly'd into a dragon or
for monsters that were wearing dragon armor or actually were dragons.
This covers much of that.

There are umpteen calls of 'resists_foo(mon)' and some are now
'resists_foo(mon) || defended(mon, AD_FOO)' but the second part ought
to be incorporated into update_mon_intrinics() so that the extra
'|| defended()' doesn't have to be spread all over the place and the
ones being put in now could/should be removed.

While testing, I noticed that a monster wielding Fire Brand did not
resist being hit by a wand of fire.  This fixes that and should also
fix various comparable situations for other artifacts.  But so far it
has only been done for zapping (and any other actions which use the
zapping code).  Folding defended() checks into update_mon_intrinsics()
matters more than that probably sounds.

3 years agoMake vrocks emit a poison cloud when they flee
Pasi Kallinen [Sat, 25 Dec 2021 08:47:20 +0000 (10:47 +0200)]
Make vrocks emit a poison cloud when they flee

3 years agoanother Makefile.msc comment tidbit
nhmall [Fri, 24 Dec 2021 14:37:52 +0000 (09:37 -0500)]
another Makefile.msc comment tidbit

3 years agoMakefile.msc comment tidbit
nhmall [Fri, 24 Dec 2021 14:36:43 +0000 (09:36 -0500)]
Makefile.msc comment tidbit

3 years agoupdate Windows test build to Visual Studio 17.0.4
nhmall [Fri, 24 Dec 2021 14:33:56 +0000 (09:33 -0500)]
update Windows test build to Visual Studio 17.0.4

3 years agosickness countdown
PatR [Thu, 23 Dec 2021 03:36:52 +0000 (19:36 -0800)]
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).

3 years agomore urgent_pline()'s
PatR [Thu, 23 Dec 2021 02:29:01 +0000 (18:29 -0800)]
more urgent_pline()'s

countdown messages for turning to stone or slime or being strangled
drowning
burning in lava
feeling feverish
changing form

3 years agocurses: urgent messages
PatR [Wed, 22 Dec 2021 20:23:50 +0000 (12:23 -0800)]
curses: urgent messages

This is comparable to the recent fix for tty.  When messages aren't
currently being suppressed by use of ESC at --More-- (">>" for
curses), if an urgent message itself triggers --More--, don't start
suppressing messages if player dismisses it with ESC.

3 years agocurses: fix "---" separators in ^P output
PatR [Wed, 22 Dec 2021 19:33:35 +0000 (11:33 -0800)]
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 99ed00012e076be07846edceb85e3e5e53f2bb02 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.]

3 years agoswitch makedefs from malloc() to alloc()
PatR [Wed, 22 Dec 2021 08:18:37 +0000 (00:18 -0800)]
switch makedefs from malloc() to alloc()

Avoids any need for MONITOR_HEAP hackery.  Link src/alloc.o and
util/panic.o into util/makedefs.

When replacing the realloc() call in fgetline(), I noticed that
fgetline() would miss the last line of an input file if it lacked a
terminating newline.  This was hard to test because OSX seems to be
supplying one when it is missing (VMS would do that too).  I had to
modify epitaph (my test bed) to take off the final character, run
'makedefs -s' under debugger control and strip away final newline
that stdio added back, build new nhdat and move it into place, then
run nethack and execute #wizrumorcheck all multiple times before
the fix and once more after it.  Much effort for little gain...

Plus some of the recent reformatting:  indent labels one space,
replace tabs with spaces, shorten or split wide lines.

3 years agoApply runmode to multiturn actions
Pasi Kallinen [Tue, 21 Dec 2021 15:37:48 +0000 (17:37 +0200)]
Apply runmode to multiturn actions

3 years agoMinor linewrap and comment fix
Pasi Kallinen [Tue, 21 Dec 2021 14:25:21 +0000 (16:25 +0200)]
Minor linewrap and comment fix

3 years agoGive message for genod shifter changing shape
Pasi Kallinen [Tue, 21 Dec 2021 11:10:03 +0000 (13:10 +0200)]
Give message for genod shifter changing shape

For accessibility, give a message when a monster changes shape
due to the previous shape being genocided.

3 years agobullwhip and polearm attack feedback
PatR [Tue, 21 Dec 2021 10:56:59 +0000 (02:56 -0800)]
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.

3 years agoVampire in a genocided shape
Pasi Kallinen [Tue, 21 Dec 2021 09:18:45 +0000 (11:18 +0200)]
Vampire in a genocided shape

When you genocided a monster a vampire was shapeshifted into,
the vampire might've stayed in the genocided form.
Always revert back to vampire form if we tried to pick a genocided form.

3 years agoGive dragon armor extra effects
Pasi Kallinen [Mon, 20 Dec 2021 21:22:07 +0000 (23:22 +0200)]
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.

3 years agoadditional urgent messages
PatR [Mon, 20 Dec 2021 16:42:58 +0000 (08:42 -0800)]
additional urgent messages

Now I've remembered why I didn't follow through with these back when
I originally laid the groundwork.  New urgent messages:

 having an item of armor be destroyed
 having weapon be grabbed by a monster's bullwhip
 becoming engulfed
 being grabbed by an eel
 subsequently being drowned by an eel
 dying of petrification
 turning into slime then dying due to genocide
 dying due to fatal illness

There are lots more candidates.

3 years agosimplify issuing urgent messages
PatR [Mon, 20 Dec 2021 16:30:48 +0000 (08:30 -0800)]
simplify issuing urgent messages

Change
 custompline(URGENT_MESSAGE, mesg, ...);
calls to new
 urgent_pline(mesg, ...);

3 years agofix for urgent messages for tty
PatR [Mon, 20 Dec 2021 16:16:13 +0000 (08:16 -0800)]
fix for urgent messages for tty

If messages aren't currently being skipped due to --More--ESC when a
message flagged as urgent is issued and that urgent message itself
triggers --More-- to have the user acknowledge the previous message,
and the user types ESC at this new --More--, message suppression
starts.  With the overly simplistic existing code from a few days
ago, it was too late for the current message to override that.  Since
the urgent message gets buffered like any other (until another message
needs the top line or until input is needed), it wouldn't be shown
when the next message came along and discovered suppression in effect.

I'm not sure that all the changes here are necessary; there was some
flailing about involved.  But it seems to behave as intended now.

3 years agoregion save/restore
PatR [Mon, 20 Dec 2021 03:31:19 +0000 (19:31 -0800)]
region save/restore

When shortening/splitting wide lines I noticed that the save and
restore code for regions had a bunch of those and they could be
shortened by using an intermediate variable.  Easier to read too.

Also, change several 'unsigned int' to just 'unsigned' as is used in
most of the rest of the code.

At one point I omitted a (genericptr_t) cast (which should no longer
be necessary...) and discovered that bwrite() wasn't declaring the
input buffer it never modifies as 'const'.

3 years agofix #K3496 - leash description when pet changes
PatR [Sun, 19 Dec 2021 17:30:07 +0000 (09:30 -0800)]
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.

3 years agocreate_door() warning hackery
PatR [Sun, 19 Dec 2021 12:54:34 +0000 (04:54 -0800)]
create_door() warning hackery

Redo the warning suppression in create_door().  The unreachable 'goto'
was unnecessary and without it there's no need to toggle unreachable
code warnings off and back on.  Taking a step back, the whole 'default'
case is unnecessary since rn2(4) will always hit one of the 0..3 cases.
So instead of just getting rid of the unreachable 'goto', get rid of
the panic() too.

3 years agoQt paper doll fix
PatR [Sun, 19 Dec 2021 11:46:21 +0000 (03:46 -0800)]
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.

3 years ago'urgent' messages for curses
PatR [Sat, 18 Dec 2021 19:07:23 +0000 (11:07 -0800)]
'urgent' messages for curses

Have curses catch up with tty.  Some particular messages override
message suppression after --More-ESC (tty) or >>ESC (curses).

3 years ago'urgent' messages
PatR [Sat, 18 Dec 2021 01:46:49 +0000 (17:46 -0800)]
'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.

3 years agofixes entry for pull-req #643 - historic statues
PatR [Sat, 18 Dec 2021 00:29:53 +0000 (16:29 -0800)]
fixes entry for pull-req #643 - historic statues

monstone() was using a hardcoded value when flagging the statue of
a unique monster as historic and didn't get updated when the corpse
and statue flags kept in obj->spe were changed last June by commit
04a8ddcce1f2c679706a0e9413f742677dbb0f68.

Closes #643

3 years agoFix: gender, historicity of stoned monster statue
Michael Meyer [Thu, 2 Dec 2021 23:45:57 +0000 (18:45 -0500)]
Fix: gender, historicity of stoned monster statue

The way statues of stoned unique monsters were marked as "historic" was
not changed when mkcorpstat flags were updated in 04a8ddc, resulting in
unique statues which were no longer marked as historic and were instead
marked as female.

While fixing that, also use the gender-related mkcorpstat flags to
assign the gender of a stoned monster to the resulting statue.

3 years agomore reformatting - label placement
PatR [Thu, 16 Dec 2021 23:56:52 +0000 (15:56 -0800)]
more reformatting - label placement

Indent all labels one space.  Having uniform placement makes spotting
them much easier.  (Having no indent at all would impact the change
bars of 'git diff'.  Those display the last unindented line--which
doesn't start with punctuation--occuring before each band of changes,
so usually the name of the function being changed now that we no
longer have unindented K&R-style function argument declarations.)

While in there, shorten or split various wide lines and replace a few
tabs with spaces.

3 years agodate.c vs MONITOR_HEAP
PatR [Thu, 16 Dec 2021 02:39:29 +0000 (18:39 -0800)]
date.c vs MONITOR_HEAP

I tried building with MONITOR_HEAP defined for the first time in a
while.  It wasn't pretty.

date.c was calling libc's strdup() instead of our dupstr() so alloc.c
wasn't tracking those allocations when/if MONITOR_HEAP is enabled.
Then it called free() which is actually a call to nhfree() in that
situation.  If the file of allocations and releases was subsequently
fed to heaputil, it would complain about freeing pointers that hadn't
been allocated.

Worse, makedefs and tilemap wouldn't link.  For MONITOR_HEAP,
makedefs was undefining free() in order to avoid nhfree() but it now
links with date.o so got nhfree() calls anyway.  And it wouldn't link
because that routine isn't available without alloc.o.  tilemap
doesn't link with date.o but it does call malloc() and free() and it
wasn't undefining free(), so looked for nhfree() when linking and got
the same no-such-routine failure.

3 years agorefine #wizrumorscheck
PatR [Thu, 16 Dec 2021 00:45:52 +0000 (16:45 -0800)]
refine #wizrumorscheck

If #wizrumorscheck isn't able to open or read the rumors file,
continue on to check engravings, epitaphs, and bogusmons instead of
immediately returning.

3 years agoPlace libnh targets in $(TARGETPFX)
Dexter Castor Döpping [Wed, 15 Dec 2021 21:46:40 +0000 (22:46 +0100)]
Place libnh targets in $(TARGETPFX)

3 years agoFix build failing for libnh when using TARGETPFX
Dexter Castor Döpping [Wed, 15 Dec 2021 21:36:50 +0000 (22:36 +0100)]
Fix build failing for libnh when using TARGETPFX

Compiling with WANT_LIBNH=1 and TARGETPFX=(...) failed because ioctl.o
could not be found.

This is because the targets are specified with the $(TARGETPFX) but the
libnh targets consumed these targets without the $(TARGETPFX).

3 years agoDecouple mon state adjustment from find_roll_to_hit
Pasi Kallinen [Wed, 15 Dec 2021 20:11:19 +0000 (22:11 +0200)]
Decouple mon state adjustment from find_roll_to_hit

If you have a function named like that, and it goes and
changes the monster state, that's just wrong.

Move waking up the monster from the hit into separate function.

3 years agoremove duplicate novel titles
PatR [Wed, 15 Dec 2021 01:15:17 +0000 (17:15 -0800)]
remove duplicate novel titles

For novel title lookups, have the variant spelling substitutions use
the entries from array of titles instead of explicit strings which
duplicate those.

3 years agosome reformatting
PatR [Tue, 14 Dec 2021 15:43:40 +0000 (07:43 -0800)]
some reformatting

Replace some
  (foo &&
   bar)
that had crept back into the code with
  (foo
   && bar)
to match the reformatting which took place before 3.6.0.  There are a
couple of lines ending in '||' still present but they look intentional.
isaac64.c has some trailing '|' bit operators that could/should be
moved to the start of the next line but I didn't touch that file.

While in the affected files, I tried to shorten most overly wide lines
(the right margin is supposed to at column 78 and there are quite a
few lines which are 79 characters long, but I left most of those
rather than introduce new line splits).  Also replace a handful of
tabs with spaces.  I was a little surprised not find any trailing
spaces (in the dozen or so files being updated).  I didn't look for
trailing arithmetic or '?'/':' operators which aught to be moved to
the start of the next line.

3 years agodocument obj->owornmask
PatR [Tue, 14 Dec 2021 13:49:31 +0000 (05:49 -0800)]
document obj->owornmask

ship_object() and obj_delivery() use obj->owornmask for something
other than tracking what slot(s) an object is worn in.

3 years agoinsufficient spell power feedback
PatR [Tue, 14 Dec 2021 10:38:17 +0000 (02:38 -0800)]
insufficient spell power feedback

If attempting to cast a spell without having enough power, you get
 |You don't have enough energy to cast that spell.
Recently that was augmented to
 |You don't have enough energy to cast that spell yet.
if your current power is at maximum and not enough.  Augment again to
 |You don't have enough energy to cast that spell anymore.
if current power is at maximum and that maximum is less than the peak
value it once had and that peak value would have been enough.

3 years agoglob update
PatR [Mon, 13 Dec 2021 15:04:30 +0000 (07:04 -0800)]
glob update

Initialize glob weight sooner in mksobj() and have weight() skip the
fix up it had been doing when it was passed a glob with weight 0.
This allows shrink_glob() to be simplified slightly in the situation
where a glob inside a container shrinks away to nothing.

weight(glob) with glob->owt==0 now yields 0 instead of 20.  That was
only needed for 'obj->owt=weight(obj)' during object creation and
the new earlier weight init makes the 0 to 20 fixup obsolete.  In
turn, that allows a glob which has shrunk to 0 while in a container
to not have to be removed before updating the container's weight.

3 years agopickup.c bits
PatR [Mon, 13 Dec 2021 13:07:30 +0000 (05:07 -0800)]
pickup.c bits

This started out as just some minor reformatting but ended up including
a couple of new comments and a revision in how the use_container()
decides whether it is feasible to put something into the container.
Behavior isn't changing.

3 years agoattrcurse() on 'see invisible'
PatR [Sun, 12 Dec 2021 19:32:09 +0000 (11:32 -0800)]
attrcurse() on 'see invisible'

If hero has intrinsic see-invisible and a gremlin steals that, the
map wasn't being updated to hide invisible monsters (until the next
iteration of moveloop() after other monsters finished current turn).

3 years agoAccessibility: give a message when teleporting a monster
Pasi Kallinen [Mon, 6 Dec 2021 22:06:17 +0000 (00:06 +0200)]
Accessibility: give a message when teleporting a monster

Teleporting a monster only updated the map. Give a message
so blind players can get the same information.
Making a monster invisible gives the same message, if you
cannot detect invisible.
Several other places where monsters teleported themselves
now also give the same message.

3 years agoendless shrink_glob...
PatR [Sun, 12 Dec 2021 02:39:36 +0000 (18:39 -0800)]
endless shrink_glob...

A shrink_glob timer keeps running for a glob on the migrating objects
list so shink_glob() needs to be aware of that.

3 years agoshrink_glob bug when when glob is totally gone
PatR [Sat, 11 Dec 2021 04:16:30 +0000 (20:16 -0800)]
shrink_glob bug when when glob is totally gone

When a wielded glob shrank away to nothing, an impossible warning:
"obfree: deleting worn obj" would be issued.

If a glob is quivered or wielded or set up as swap weapon when it
shrinks away to nothing, clear the relevant weapon slot before
destroying the glob.

Won't happen for monsters since they never wield globs.  Also won't
happen for migrating objects (which overload obj->owornmask) because
they have to have arrived somewhere in order to have their shrink
timer execute.

3 years agoformatting bit
PatR [Thu, 9 Dec 2021 00:24:48 +0000 (16:24 -0800)]
formatting bit

3 years agowizard mode polyself to "priest"
PatR [Thu, 9 Dec 2021 00:08:57 +0000 (16:08 -0800)]
wizard mode polyself to "priest"

When polymorphing while already polymorphed, picking your own role
will rehumanize (wizard mode only; restores old characteristics and
experience level, unlike becoming a new man which can change those
and even be fatal if level drops below 1).  But it didn't work if
you were a priest or priestess because name_to_mon() yields aligned
cleric monster rather than cleric role.

3 years agoshape change while strangling
PatR [Wed, 8 Dec 2021 23:31:06 +0000 (15:31 -0800)]
shape change while strangling

Polymorphing into a vulnerable form while wearing an amulet of
strangulation says "your amulet still constricts your neck" if your
previous form was also vulnerable or "your amulet beings constricting
your neck" if previous form wasn't vulnerable.  But a change nearly
6 years ago to have the status line be updated to say "Strangling"
during the message--instead of next status update after it--caused
the "still constricts" variation to always be given even when the
"begins constricting" was appropriate.

3 years agolong worm growth again
PatR [Tue, 7 Dec 2021 23:54:46 +0000 (15:54 -0800)]
long worm growth again

The previous change could have resulted in a long worm losing HP when
gaining a segment (if it had gained levels while at the peak amount
for the previous number of segments).  I think this is finally right.

3 years agolong worm growth
PatR [Tue, 7 Dec 2021 11:10:57 +0000 (03:10 -0800)]
long worm growth

I think this is what was originally intended.

3 years agomisuse of hero_glyph
PatR [Sun, 5 Dec 2021 23:09:08 +0000 (15:09 -0800)]
misuse of hero_glyph

It isn't just the hero's normal glyph, it gets adjusted when poly'd.
So the way I tried to use it didn't work as intended.  Explicitly
check Upolyd separately so that hero_glyph won't be affected by tat
and only returns the player monster or race monster value.

3 years agoshowrace again...
PatR [Sun, 5 Dec 2021 01:18:00 +0000 (17:18 -0800)]
showrace again...

I'm fairly sure that the 'showrace' and PC rogue cases are covered
correctly now despite the approximation in deciding whether the
specified glyph represents the hero.  However, I'm not sure how the
accessibility handling ought to work when the hero is not in normal
form.  Right now it kicks in if the glyph is any monster, so the
hero is visible as a monster (whether normal or poly'd or on steed).
It does not kick it when mimicking an object (after eating a mimic
corpse or being poly'd into a mimic and then hiding) or furniture
(only if poly'd into mimic) because execution won't make it into the
is_you block in that situation.  Same situation applies to setting
the MG_HERO flag bit, but that doesn't seem to be used anywhere.

3 years agoremove a couple of tabs
nhmall [Sat, 4 Dec 2021 21:07:49 +0000 (16:07 -0500)]
remove a couple of tabs

3 years agorogue symset issues following expanded glyphs
nhmall [Sat, 4 Dec 2021 20:59:30 +0000 (15:59 -0500)]
rogue symset issues following expanded glyphs

Contributed by entrez

Also, remove the iflags.use_color test from the many if-statements
in reset_glyphmap(), and test and/or override it once before
the assignment to gmap->color.