]> granicus.if.org Git - nethack/log
nethack
2 years agodon't negate new moon with a lizard corpse
PatR [Sun, 31 Jul 2022 23:12:40 +0000 (16:12 -0700)]
don't negate new moon with a lizard corpse

The only effect of a new moon was to make hearing a cockatrice's
hissing (whichs happens with 1 in 3 chance) always start the turn to
stone sequence instead just having a 1 in 10 chance to do so, but
that was negated by carrying a lizard corpse.

Keep the hiss-always-starts-petficiation part and remove the
carrying-a-lizard-corpse-negates-that part.  So the effect of a new
moon no longer gets controlled by the contents of hero's inventory.

2 years agomonster eating stalker corpse
PatR [Sun, 31 Jul 2022 01:30:16 +0000 (18:30 -0700)]
monster eating stalker corpse

Extend 8d2407f1f21cc60ac99e08f00233975b32321eef
"Monsters can gain resistances by eating corpses"
to include invisibility from stalker corpses.

2 years agodwarf + pick-axe feedback
PatR [Fri, 29 Jul 2022 23:11:35 +0000 (16:11 -0700)]
dwarf + pick-axe feedback

When you see a dwarf wield a pick-axe,
|The dwarf wields a pick-axe!
avoid the exclamation point if that dwarf just intends to dig.
|The dwarf wields a pick-axe.

2 years ago\#wizkill tweak
PatR [Fri, 29 Jul 2022 22:55:53 +0000 (15:55 -0700)]
\#wizkill tweak

If wizard mode player targets 'I' with #wizkill and there is no
monster there, remove that 'I'.

2 years agofixes entry for PR #796 - MUSE digging
PatR [Fri, 29 Jul 2022 22:08:27 +0000 (15:08 -0700)]
fixes entry for PR #796 - MUSE digging

Pull request from entrez:  nothing happened--except spending a wand
charge--if a monster zapped a wand of digging down at a spot where
holes can't be dug.  If a pit can be dug there, dig one and then trap
the monster in it.  No-op if a pit or other trap is already present.

Closes #796

2 years agoLet fleeing monsters dig pits in undiggable floor
Michael Meyer [Thu, 9 Jun 2022 16:48:41 +0000 (12:48 -0400)]
Let fleeing monsters dig pits in undiggable floor

When the hero zaps a wand of digging down in an undiggable level, it
creates a pit.  When a fleeing monster did the same thing, it had no
effect.  Bring this closer to the behavior experienced by the hero: if a
monster tries to use a wand of digging to create a hole in an undiggable
floor, a pit will be made (and the monster will fall into it, if not a
flyer).

2 years agoGreased saddle is slippery
Pasi Kallinen [Fri, 29 Jul 2022 09:27:08 +0000 (12:27 +0300)]
Greased saddle is slippery

2 years agogithub issue #828 - confuse monster effect when \
PatR [Thu, 28 Jul 2022 20:42:35 +0000 (13:42 -0700)]
github issue #828 - confuse monster effect when \

hero is invisible without being able to see invisible

Issue reported by EndHack:  you could see your hands glow red when
reading a scroll of confuse monster or casting the spell of confuse
monster even if you were unable to see yourself.

Switch to the blind feedback (tingling instead of glowing red) if
invisible without see invisible.

Also, have uncursed scroll or low skilled spell confer 1..2 turns
of glowing hands instead of always just 1.  (Blessed/highly skilled
stays at 2..9 turns.)

Fixes #828

2 years agoMake failed polearming or jumping return correct value
Pasi Kallinen [Thu, 28 Jul 2022 19:10:01 +0000 (22:10 +0300)]
Make failed polearming or jumping return correct value

2 years agoupdate 'mydogs' comment
PatR [Thu, 28 Jul 2022 15:16:23 +0000 (08:16 -0700)]
update 'mydogs' comment

2 years agoGrappling location feedback
Pasi Kallinen [Thu, 28 Jul 2022 10:50:57 +0000 (13:50 +0300)]
Grappling location feedback

2 years agoSpell location feedback
Pasi Kallinen [Thu, 28 Jul 2022 10:15:37 +0000 (13:15 +0300)]
Spell location feedback

Casting some spells at high enough skill allows picking for
the spell location. Say which locations are out of range
when picking the location.

2 years agofix broken migrating monster arrival
PatR [Thu, 28 Jul 2022 07:51:18 +0000 (00:51 -0700)]
fix broken migrating monster arrival

If the first monster on the migrating_mons list couldn't arrive and
was put back on the list to try again later, 'later' would happen
immediately and the program looped forever trying and failing to
bring that monster to the level.

Defer repeat attempts at migration until losedogs() has been through
the whole migrating_mons list.  mon_arrive() now populates a new
list called failed_arrivals and losedog() moves its contents, if any,
to migrating_mons prior to returning.

2 years ago\#migratemons
PatR [Thu, 28 Jul 2022 07:34:31 +0000 (00:34 -0700)]
\#migratemons

Extend the wizard mode #migratemons command.  Instead of just asking
for how many random new monsters to be sent to the next level, first
describe how many migrating monsters there already are, then if that's
non-zero ask whether to show them.  Choices are 'c' for ones scheduled
to arrive at the current level if hero leaves and returns, 'n' for
ones aimed at the next level, 'o' for ones that aren't in either of
those two categories, 'a' for all migrating monsters, and 'q' to skip.
After that, ask how many to make for the next level.  The default for
that is still zero.

For the 'o' and 'a' cases, they're displayed in the reverse order of
when they went onto migrating_mons, not sorted by destination level.

2 years agoHoles and trapdoors have predetermined exit level
Pasi Kallinen [Wed, 27 Jul 2022 19:51:13 +0000 (22:51 +0300)]
Holes and trapdoors have predetermined exit level

Same hole/trapdoor will always take you to the same level.

2 years agocomment typofix
Pasi Kallinen [Wed, 27 Jul 2022 10:13:49 +0000 (13:13 +0300)]
comment typofix

2 years agoEnable migrating mons debugging
Pasi Kallinen [Wed, 27 Jul 2022 09:21:07 +0000 (12:21 +0300)]
Enable migrating mons debugging

2 years agoFix knockbacked monster migrating or killed
Pasi Kallinen [Tue, 26 Jul 2022 20:17:54 +0000 (23:17 +0300)]
Fix knockbacked monster migrating or killed

Fix a case where a monster knocked back another monster into a trap,
and the trap either killed or migrated the monster, then the actual
damage dealing later could try to detach the already detached monster.

If the monster migrated, the monster is gone before the damage from
the hit is dealt to the monster.

2 years agoFix monster hiding under consumed candle
Pasi Kallinen [Tue, 26 Jul 2022 19:53:57 +0000 (22:53 +0300)]
Fix monster hiding under consumed candle

2 years agoAllow cutting a known spider web by force-fighting it
Pasi Kallinen [Mon, 25 Jul 2022 15:05:59 +0000 (18:05 +0300)]
Allow cutting a known spider web by force-fighting it

Original code from xNetHack by copperwater <aosdict@gmail.com>.

2 years agoCall it "danger sense" when warning finds a monster
Pasi Kallinen [Sun, 24 Jul 2022 16:13:20 +0000 (19:13 +0300)]
Call it "danger sense" when warning finds a monster

2 years agopull request #817 - merge scimitar skill w/ saber
PatR [Sun, 24 Jul 2022 06:14:12 +0000 (23:14 -0700)]
pull request #817 - merge scimitar skill w/ saber

Pull request from Kufat:  combine a pair of single item skills into
one skill by changing scimitar to use saber skill and removing no
longer used scimitar skill.

I don't think skill values end up in save files but decided to
increment EDITLEVEL to be safe.

Closes #817

2 years agoMerge scimitar skill into saber skill
Kufat [Sat, 9 Jul 2022 23:32:00 +0000 (19:32 -0400)]
Merge scimitar skill into saber skill

Deleted scimitar skill, changed scimitar to use saber skill.
Adjusted Barbarian's max saber mastery basic->skilled for consistency
with former scimitar skill.

2 years agopull request #823 - getpos confusion
PatR [Sun, 24 Jul 2022 00:05:48 +0000 (17:05 -0700)]
pull request #823 - getpos confusion

Pull request from entrez:  typing map symbols during a getpos
operation was using incorrect values and might end up moving the
cursor to walls or other terrain that it classifies as uninteresting
and intends to ignore.

Fixes #823

2 years agoAnother getpos cmap followup
Michael Meyer [Sat, 16 Jul 2022 16:32:45 +0000 (12:32 -0400)]
Another getpos cmap followup

Hot on the heels of my previous commit, here's a way to do it without
any assumptions about the order of defsyms.

2 years agogetpos cmap vs glyph followup
Michael Meyer [Sat, 16 Jul 2022 16:21:40 +0000 (12:21 -0400)]
getpos cmap vs glyph followup

This is a bit more efficient, since everything up to S_hcdoor is
skipped anyway, but it's a little harder to understand so needs more
comments.  Not sure if it's worth it or not...

2 years agoFix: getpos cmap vs typ/glyph confusion
Michael Meyer [Fri, 15 Jul 2022 23:53:47 +0000 (19:53 -0400)]
Fix: getpos cmap vs typ/glyph confusion

When some parts of getpos were rearranged in 7404597, tests of terrain
types and glyphs were moved to a loop which iterated through the defsyms
array without being updated to handle cmap values instead.  Consequently
they weren't excluding certain terrain types from being 'jumped to' as
intended.  (Though it seems as though they actually worked by chance to
some extent, just because there's some overlap between terrain types and
defsyms in terms of where the 'walls/doors' blocks start and end.)

I also noticed that cmap_to_type was missing S_darkroom (it fell through
to the default case so that the function returned STONE), so I added it.

2 years agofixes entry for PR #821 - engulfer vs closed door
PatR [Fri, 22 Jul 2022 22:30:14 +0000 (15:30 -0700)]
fixes entry for PR #821 - engulfer vs closed door

Pull request from entrez:  don't allow an amorphous engulfer who
has swallowed the hero to move to a closed door location.  If some
hypothetical amorphous holder existed, it could move to such a spot
while holding the hero adjacent.

Closes #821

2 years agoPrevent amorphous mon from carrying hero into door
Michael Meyer [Fri, 15 Jul 2022 02:40:41 +0000 (22:40 -0400)]
Prevent amorphous mon from carrying hero into door

An amorphous engulfer like a fog cloud could engulf the hero, then carry
him into a closed door.  If it was killed or decided to spit out the
hero, he would be left occupying the same spot as a closed/locked door.
Make an amorphous monster unable to move into a door if currently
engulfing the hero.

Something more complicated could be done along the lines of allowing the
move if the hero is himself in an amorphous polyform, but that verges on
being a little too silly, maybe.

I also included fixes to a couple miscellaneous, unrelated formatting
issues that I noticed recently.

2 years agofinding level's vault guard
PatR [Fri, 22 Jul 2022 21:11:16 +0000 (14:11 -0700)]
finding level's vault guard

Extend findgd() to bring a migrating guard back 'early' if there is
one and an active guard is wanted but none is present on the level.
It the level is full then the found guard is likely to be sent into
limbo (scheduled to migrate back), so one can end up moving back and
forth.  Unlikely to occur during normal play.

Also, when a guard is needed and there's a dead one parked at <0,0>,
revive it.  The dead guard has temporary corridor info in its
mon->mextra->egd that a new one won't have.  (This might introduce
unexpected changes in vault behavior but if so, the old behavior was
probably buggy.)

When the hero is in a vault, don't find a guard unless u.uinvault is
ready to bring it into play.  It was finding one every turn and then
ignoring the result for 29 turns out of 30.

Change guard appearance timing:  the first appearance is still after
30 turns, but if it goes away, bring it back after 15 more turns
rather than another 30 and repeat as needed.

2 years agopull request #826 - vault guard feedback
PatR [Fri, 22 Jul 2022 20:07:50 +0000 (13:07 -0700)]
pull request #826 - vault guard feedback

From argrath, replace use of 'goto' by splitting shared feedback
into a separate routine.

Closes #826

2 years agosplit "letknow" into separate function
SHIRAKATA Kentaro [Sun, 26 Jun 2022 13:58:05 +0000 (22:58 +0900)]
split "letknow" into separate function

2 years agoScared hostile monster which cannot move away will attack
Pasi Kallinen [Thu, 21 Jul 2022 17:21:10 +0000 (20:21 +0300)]
Scared hostile monster which cannot move away will attack

2 years agoSitting on amorphous corpse
Pasi Kallinen [Thu, 21 Jul 2022 15:27:50 +0000 (18:27 +0300)]
Sitting on amorphous corpse

2 years agosome new feedback for #timeout
PatR [Thu, 21 Jul 2022 07:54:51 +0000 (00:54 -0700)]
some new feedback for #timeout

Add a couple of non-timer, non-(property & TIMEOUT) timeout values
for the wizard-mode #timeout command: uswldtim and uinvault.  The
swallowed counter goes down and explusion or total digestion occurs
when it hits zero.  The in-vault counter goes up when you're in a
vault or the temporary corridor.  If you make it out of the vault-
and-corridor it gets reset to zero.

2 years agopull request #815 - eliminate starving dog 'goto'
PatR [Wed, 20 Jul 2022 21:41:25 +0000 (14:41 -0700)]
pull request #815 - eliminate starving dog 'goto'

Pull request from argrath:  move pet starving code into a separate
routine instead of using 'goto' to use it from a second place.

Closes #815

2 years agosplit starving dog into separate function
SHIRAKATA Kentaro [Sun, 26 Jun 2022 20:22:05 +0000 (05:22 +0900)]
split starving dog into separate function

2 years agoWielding Giantslayer prevents knockback from monsters
Pasi Kallinen [Wed, 20 Jul 2022 11:44:15 +0000 (14:44 +0300)]
Wielding Giantslayer prevents knockback from monsters

2 years agoAdjust Demonbane invoke ability
Pasi Kallinen [Wed, 20 Jul 2022 06:42:24 +0000 (09:42 +0300)]
Adjust Demonbane invoke ability

Demon lords and princes have a chance to resist the effect.
Demons in quest when nemesis is alive have a very high chance
of resisting.
When invoked in Gehennom, teleports the demons within the same
level.

2 years agoDemonbane changes
Pasi Kallinen [Tue, 19 Jul 2022 18:23:23 +0000 (21:23 +0300)]
Demonbane changes

Demonbane is now a mace, the first sac gift for priests,
and gets an invoke ability to banish demons.

2 years agoBuzz macros and related stuff
Pasi Kallinen [Tue, 19 Jul 2022 12:14:40 +0000 (15:14 +0300)]
Buzz macros and related stuff

Add macros to convert AD_foo, WAN_foo, and SPE_foo to relative values
for passing to BZ_U_foo and BZ_M_foo macros.

Change some return values in monster spellcasting function from
magic numbers to MM_MISS or MM_HIT.

Make buzzmu consider hero resistances - previously the
monster with innate zapping ray (Angels and Asmodeus) would
just keep doing that attack, but they will now just curse if
it saw the hero resist the attack.

2 years agoLarge monster can knock back smaller ones
Pasi Kallinen [Mon, 18 Jul 2022 20:01:08 +0000 (23:01 +0300)]
Large monster can knock back smaller ones

When a monster at least two sizes larger hits another one,
there's a chance the smaller defender will be knocked back.

This applies also to hero, attacking when polymorphed to
a large monster, or defending from a large monster.

Most of the monsters that can knock back are giants and dragons.

Idea and some of the code from EvilHack.

2 years agoBigroom 2 can have ice floor in unlit areas
Pasi Kallinen [Mon, 18 Jul 2022 14:58:25 +0000 (17:58 +0300)]
Bigroom 2 can have ice floor in unlit areas

2 years agoRangers always succeed in disarming bear traps
Pasi Kallinen [Mon, 18 Jul 2022 14:22:19 +0000 (17:22 +0300)]
Rangers always succeed in disarming bear traps

2 years agoAllow entering a known pit without taking damage
Pasi Kallinen [Mon, 18 Jul 2022 14:00:20 +0000 (17:00 +0300)]
Allow entering a known pit without taking damage

2 years agoUse macro unhideable_trap
Pasi Kallinen [Mon, 18 Jul 2022 10:27:39 +0000 (13:27 +0300)]
Use macro unhideable_trap

2 years agoAbort wiztelekinesis if changing levels
Pasi Kallinen [Mon, 18 Jul 2022 10:14:11 +0000 (13:14 +0300)]
Abort wiztelekinesis if changing levels

2 years agotimed_delay doc bits
Pasi Kallinen [Mon, 18 Jul 2022 05:33:10 +0000 (08:33 +0300)]
timed_delay doc bits

2 years agomore #819 - magic harp
PatR [Sun, 17 Jul 2022 23:38:39 +0000 (16:38 -0700)]
more #819 - magic harp

The log message for commit 231bd75b7f5ddc3ef0f745a75ea3566cc4055d99
said that magic harp was changed to behave the same as scroll/spell
of taming, but the scroll and spell pacify an angry shopkeeper even
if the shk resists.  Change magic harp to do likewise.

2 years agofixes entry for issue #812 fix - bad stairways
PatR [Sun, 17 Jul 2022 23:21:35 +0000 (16:21 -0700)]
fixes entry for issue #812 fix - bad stairways

Save and restore or recovery or both could mess up the stair data
about where stairs went.  I'm not entirely sure what is going on here
but the steps to reproduce by Meklon2007 worked and the suggested fix
by entrez solved the problem.

Closes #812

2 years agoFix #812: recovered stair dlevel
Michael Meyer [Fri, 1 Jul 2022 16:29:47 +0000 (12:29 -0400)]
Fix #812: recovered stair dlevel

Stair dlevels weren't being restored with the correct values when
recovered after the game crashed, apparently because they weren't being
reset back to their 'absolute' level from a 'relative' level.  I'm not
totally sure of why this affected only recovered games (maybe that's the
only time when the 'relative' stair values are used?) but this fix seems
to work.

Fixes #812

2 years agofix recover
PatR [Sun, 17 Jul 2022 21:25:51 +0000 (14:25 -0700)]
fix recover

I tried to reproduce #812 so that I could check whether the suggested
fix worked but I discovered that external 'recover' was broken by the
coordxy changes.

The fix is trivial but I haven't gone back to #812.

2 years agotype mismatch fix
PatR [Sun, 17 Jul 2022 21:24:34 +0000 (14:24 -0700)]
type mismatch fix

The new routine to find an adjacent spot expects to be passed a pair
of 'coordxy *' but the code to crawl out of water was passing 'int *'.

While in there, the removal of inline code to pick a spot to crawl to
made in easy to eliminate 'goto crawl'.

2 years agoDemote elf-queen to a lady
Pasi Kallinen [Sun, 17 Jul 2022 18:47:32 +0000 (21:47 +0300)]
Demote elf-queen to a lady

2 years agoUnify picking crawl goodpos
Pasi Kallinen [Sun, 17 Jul 2022 18:37:31 +0000 (21:37 +0300)]
Unify picking crawl goodpos

2 years agoUnify impaired movement direction checks
Pasi Kallinen [Sun, 17 Jul 2022 09:23:49 +0000 (12:23 +0300)]
Unify impaired movement direction checks

2 years agoWielding a bec de corbin makes ravens generate peaceful
Pasi Kallinen [Sun, 17 Jul 2022 06:04:12 +0000 (09:04 +0300)]
Wielding a bec de corbin makes ravens generate peaceful

2 years agoremove Catalina build in CI
nhmall [Sun, 17 Jul 2022 01:06:27 +0000 (21:06 -0400)]
remove Catalina build in CI

macOS 10.15 builds have been deprecated and are triggering a warning

2 years agosome windows startup
nhmall [Sun, 17 Jul 2022 00:43:24 +0000 (20:43 -0400)]
some windows startup

noticed that "do you want to destroy the savefile" was not being
handled correctly in Windows startup.

2 years agocomment typo
nhmall [Sun, 17 Jul 2022 00:38:00 +0000 (20:38 -0400)]
comment typo

2 years agoglyph macro formatting
PatR [Sat, 16 Jul 2022 22:36:25 +0000 (15:36 -0700)]
glyph macro formatting

Change some more
  (first_line <op> \
   second_line)
to
  (first_line \
   <op> second_line)
for various values of <op> besides '&&' and '||'.  Also clean up some
indentation and backslash+newline alignment.

For object_is_piletop() don't bother to validate that an object which
is classified as being on the floor is actually on the floor at its
specified map coordinates.  That check was propagating to expansions
of multiple macros and if it ever failed it would just be hiding a
very serious bug without helping to fix that.

2 years agoMove mtrack push and clear to separate functions
Pasi Kallinen [Sat, 16 Jul 2022 15:43:22 +0000 (18:43 +0300)]
Move mtrack push and clear to separate functions

2 years agomontraits vs monst->mstate
PatR [Sat, 16 Jul 2022 13:36:45 +0000 (06:36 -0700)]
montraits vs monst->mstate

The new test in m_detach(mon) to check whether mon was already detached
is being tripped for trolls who died, revived, and died again.  Clear
out the MON_DETACH bit when saving montraits.

2 years agoupdate tested versions of visual studio
nhmall [Sat, 16 Jul 2022 13:19:03 +0000 (09:19 -0400)]
update tested versions of visual studio

2 years agogithub issue #819 - magic harp vs shopkeeper
PatR [Sat, 16 Jul 2022 12:08:26 +0000 (05:08 -0700)]
github issue #819 - magic harp vs shopkeeper

Issue reported by youkan700:  for shopkeepers, taming via magic harp
behaved differently than taming via scroll or spell.

Make magic harp's taming be the same as [non-cursed] scroll of taming
and spell of charm monster:  angry shopkeepers will be pacified (even
though they can't be tamed).

Also, add something I've been sitting on for ages:  when taming magic
hits an already tame monster, give that monster a chance to become
tamer.  Not significant for monsters that eat (unless being starved
for some reason) but matters for ones who don't eat.  For tameness N
(which has a maximum of 20), if N is less than 10, have any taming
yield a 10-N out of 10 chance to increase the tameness by 1.  So the
closer a pet is to becoming feral, the more likely for it to improve
tameness a little.

Closes #819

2 years agoMerge branch 'quiet-vlen-unused-but-set' of https://github.com/entrez/NetHack into...
nhmall [Sat, 16 Jul 2022 12:05:41 +0000 (08:05 -0400)]
Merge branch 'quiet-vlen-unused-but-set' of https://github.com/entrez/NetHack into NetHack-3.7

2 years ago\#wizmakemap fix fix
PatR [Sat, 16 Jul 2022 06:57:10 +0000 (23:57 -0700)]
\#wizmakemap fix fix

Check for the possibility of dead monsters on fmon when removing
everything from fmon.  Mustn't pass a pending dead monster to
mongone() and get rid of it twice.

2 years agoSilence some -Wunused-but-set-variable warnings
Michael Meyer [Sat, 16 Jul 2022 04:15:29 +0000 (00:15 -0400)]
Silence some -Wunused-but-set-variable warnings

If NH_DEVEL_STATUS was set to NH_STATUS_RELEASED or NetHack was compiled
without DEBUG defined, the 'vlen' variable in a couple pline.c functions
wasn't used.  This could trigger compiler warnings.

2 years agofix github issue #820 - clinger vs pit
PatR [Fri, 15 Jul 2022 22:51:01 +0000 (15:51 -0700)]
fix github issue #820 - clinger vs pit

Issue from youkan700:  a previously undiscovered pit was being made
known before hero poly'd into clinging monster checked whether it was
already known.  So it always gave "you see a pit below you" instead
of "a pit opens up under you!" combined with "you don't fall in!".

(I think those exclamations are excessive but haven't touched them.)

2 years ago\#wizmakemap vs migrating monsters
PatR [Fri, 15 Jul 2022 21:36:03 +0000 (14:36 -0700)]
\#wizmakemap vs migrating monsters

The bookkeeping for number of dead or removed monsters got out of sync
if a shopkeeper, temple priest, or vault guard on the migrating_mons
list who was scheduled to return to the current level got passed to
mongone() when #wizmakemap destroyed the current level in order to
replace it.

When getting rid of such monsters, first put them on fmon.  Once 'gone'
they'll still be on that list and dmonsfree() will include them in the
tally of dead or removed monsters and hopefully the count will match
the number it thinks were pending.

This works for a vault guard; I didn't try for shopkeeper or priest.
Ditch pet(s) so that they won't kill stuff and open up map spots while
you're waiting for guard activity; enter vault away from the wall
nearest to 'civilization'; fill the level with lichens or other junk;
wait for guard to arrive; don't drop gold.  After a short while the
guard will try to teleport next to you but with the level full will
end up in limbo instead (migrating, scheduled to come back to current
level).  Then perform #wizmakemap.  Prior to this patch, there will be
an impossible about N removed not matching N+1 pending; after it, no
such impossible.

2 years agoviz_array[][] type
PatR [Fri, 15 Jul 2022 20:48:29 +0000 (13:48 -0700)]
viz_array[][] type

viz_array[][] is indexed by coordinates but the data it contains has
nothing to do with them so it shouldn't have been changed to coordxy.
'char' was sufficient; 'uchar' would have been better; this invents
'seenV' instead.  This led to a cascade of required changes.  The
result is warning free and seems to be working but my fingers are
crosssed....

2 years agoredundant "guard appears" messages
PatR [Fri, 15 Jul 2022 06:58:34 +0000 (23:58 -0700)]
redundant "guard appears" messages

When a vault guard was created it was producing a "guard appears"
message, then the vault code immediately produced a "vault's guard
enters" message.  Suppress the creation message.

While testing that, I noticed that if the hero was blind and lacked
telepathy, "someone enters" started the guard interrogation sequence
but if hero answered and dropped gold, the way out wasn't discernable.
Put a "remembered, unseen monster" glyph at the guard's spot in the
breeched vault wall.  The player will need to do <search><move> over
and over to actually follow the guard but at least will know where to
start doing that.

2 years agowizmgender fix
PatR [Thu, 14 Jul 2022 23:29:08 +0000 (16:29 -0700)]
wizmgender fix

The 'wizmgender' option is flagged as 'wizonly' in optlist.h but that
doesn't prevent it from being set in NETHACKOPTIONS or .nethackrc.
Apply the fix from entrez to only honor it when running in wizard
mode.

2 years agogulpmm "placing <mon> over itself"
PatR [Thu, 14 Jul 2022 23:13:47 +0000 (16:13 -0700)]
gulpmm "placing <mon> over itself"

Reported direclty to devteam by a hardfought player:
|placing tame fire vortex <56,18> over itself at <56,18>, [...]

An old map fixup when an engulfer and its victim temporarily share
the same map location got impacted by changes made a month or two
back for removing dead or migrated monsters from the map.  The old
fixup (for putting the engulfer back after removing the victim also
removed it) was no longer needed and using it resulted in a warning
from place_monster() about putting a monster on top of itself.

2 years agoout of bounds memory access during zap bounce
PatR [Thu, 14 Jul 2022 22:17:30 +0000 (15:17 -0700)]
out of bounds memory access during zap bounce

Apply the diff from entrez to deal with out of array bounds access by
wand or spell zap when deciding whether to bounce if that zap reached
the extreme edge of the map (not just the edge of the portion of the
map in use by current level).

2 years agosimplify glyph_is_cmap()
PatR [Thu, 14 Jul 2022 21:46:32 +0000 (14:46 -0700)]
simplify glyph_is_cmap()

I captured preprocessor output while debugging vault guard changes
and noticed that glyhp_is_cmap() was expanding to an excessive amount
of code.  Simplify it.

Also, a bunch of the cmap macro definitions were using old
 (foo && \
  bar)
instead of current
 (foo \
  && bar)
so this changes those.

2 years ago\#wizfliplevel fixes
PatR [Thu, 14 Jul 2022 20:38:09 +0000 (13:38 -0700)]
\#wizfliplevel fixes

Fix wizard mode issues pointed out by the #wizmakemap fix.  If a
shopkeeper or temple priest is on a different level and its home
level gets flipped, monst eshk or epri data became invalid and would
cause trouble if the shk or priest ever made it back to home level.

If a vault guard is maintaining a temporary corridor and the level
gets flipped, the data became invalid.  If you used #wizfliplevel
while the guard was leading you out, the corridor spots would be
flipped along with the rest of the map but the guards's temporary
corridor data didn't match.  Breaches in the vault walls would be
sealed, then the guard would just mill around, never finishing
leading the hero out.

2 years agoBlessed potion of polymorph asks user for monster to poly into
Pasi Kallinen [Thu, 14 Jul 2022 11:04:24 +0000 (14:04 +0300)]
Blessed potion of polymorph asks user for monster to poly into

... unless there's some other form that would override the choice,
such as a worn dragon armor, lycanthropy, or vampirism.

The polymorph will be in effect for 10-24 turns.

2 years agoanother comment typo/thinko
PatR [Thu, 14 Jul 2022 07:54:43 +0000 (00:54 -0700)]
another comment typo/thinko

2 years agocomment typo/thinko
PatR [Thu, 14 Jul 2022 07:48:10 +0000 (00:48 -0700)]
comment typo/thinko

2 years agofix #K3633 - vault guard parked at <0,0> brought \
PatR [Wed, 13 Jul 2022 22:19:51 +0000 (15:19 -0700)]
fix #K3633 - vault guard parked at <0,0> brought \

back into play with bad data

I don't have a test case to verify the fix, and I'm not absolutely
certain that the cause has been correctly diagnosed, but I think the
problem was caused by a guard being sent into limbo because the map
was too full to place it, then while it was on the migrating monsters
list waiting for a chance to come back the fuzzer executed #wizmakemap.
If the hero left the level and subsequently returned, the guard would
arrive back but monst->mextra->egd contained data for the previous
incarnation of the level that's invalid for wizmakemap's replacement.

Treat any shopkeeper, temple priest, or vault guard who is not on his
'home' level like the Wizard has been treated since 3.6.0.  When
leaving the level they're on, put them on the migrating monsters list
scheduled to return to present position instead of stashing them in
the level's data file.  That way they can be accessed from any dungeon
level, so wizmakemap can pull ones for the level it's replacing off
the migrating monsters list when removing the old level's monsters,
handling both migration-pending and already-arrived-on-another-level.

Bonus fix:  put monsters who are on the migrating_mons list solely in
order to be accessible from other levels back first when returning to
the level they're on so that pets and the hero can't hijack their spot
when those arrive.  The Wizard has been vulnerable to that.

Not fixed:  #wizfliplevel command needs to flip parts of shk->mextra->
eshk and priest->mextra->epri for shk or priest on migrating_mons.
Vault guards don't contain anything flippable when migrating, but do
have coordinates that need fixing up while they're maintaining a
temporary corridor to/from the vault.

2 years agoGrid bugs don't have hands
Pasi Kallinen [Wed, 13 Jul 2022 08:21:16 +0000 (11:21 +0300)]
Grid bugs don't have hands

Fixes #799

2 years agoValkyries start with a spear instead of a long sword
Pasi Kallinen [Tue, 12 Jul 2022 19:56:30 +0000 (22:56 +0300)]
Valkyries start with a spear instead of a long sword

Long swords are overused, and Knights already start with a long sword.
No other roles start with a spear. Lawful Valks shouldn't have an easy
way to get Excalibur.

There's also historical precedence for valkyries with spears, see eg.
Wagner's Ring Cycle.

This makes Valks early game damage slightly lower, although dwarven spear
does the same damage to small monsters as long sword, and there should be
plenty of chances to get one from the mines. Spears can also be thrown.

This change has been done in several variants, eg. xNetHack and Fourk.

2 years agoApplying a cursed lamp can make your hands slippery
Pasi Kallinen [Tue, 12 Jul 2022 19:12:52 +0000 (22:12 +0300)]
Applying a cursed lamp can make your hands slippery

2 years agoMore message variation on eating palatable corpses
Pasi Kallinen [Tue, 12 Jul 2022 18:51:41 +0000 (21:51 +0300)]
More message variation on eating palatable corpses

2 years agoAlways give a message when dipping an item into a fountain
Pasi Kallinen [Tue, 12 Jul 2022 18:10:19 +0000 (21:10 +0300)]
Always give a message when dipping an item into a fountain

2 years agoRejigger anti-magic traps
Pasi Kallinen [Tue, 12 Jul 2022 17:24:27 +0000 (20:24 +0300)]
Rejigger anti-magic traps

My changes were too drastic, so reduce the drain and damage so it
matches all the other traps. Now the anti-magic trap will always
ding your max energy a bit, in addition to the physical damage done
if wearing magic resistance.

2 years agobump EDITLEVEL
PatR [Sun, 10 Jul 2022 22:43:49 +0000 (15:43 -0700)]
bump EDITLEVEL

The most recent "simulated mouse" commit included changes to 'struct u'
that should have been accompanied by an increment in EDITLEVEL.  Do the
missing increment now.

2 years agosimulated mouse again
PatR [Sun, 10 Jul 2022 18:14:10 +0000 (11:14 -0700)]
simulated mouse again

Change u.{dx,dy,dz} from schar to int and get rid of unused u.di.

Remove just added getdir_ok2click; it was declared as int but being
assigned booleans.  Rename getloc_click to getdir_click and have
getdir() use it for both input and output.

A simulated mouse is becoming quite a nuisance for something which
will probably never be used by anyone in actual play.

2 years agorestore getdir simulated mouse click
PatR [Sun, 10 Jul 2022 13:55:16 +0000 (06:55 -0700)]
restore getdir simulated mouse click

When getdir is given '_' as a direction, it calls getpos to get a
map location rather than just a direction.  Have getdir()'s caller
explicitly enable that so using '_' for other than #therecmdmenu
doesn't produce a delta that's farther than one step away.

2 years agoPraying on an altar with pet corpse on it can revive the pet
Pasi Kallinen [Sun, 10 Jul 2022 09:56:20 +0000 (12:56 +0300)]
Praying on an altar with pet corpse on it can revive the pet

2 years agoMake sure getdir return values are in range
Pasi Kallinen [Sun, 10 Jul 2022 08:00:22 +0000 (11:00 +0300)]
Make sure getdir return values are in range

u.dx and u.dy should be [-1, +1]

2 years agoUnhide monster when object is dropped through hole
Pasi Kallinen [Sat, 9 Jul 2022 15:44:23 +0000 (18:44 +0300)]
Unhide monster when object is dropped through hole

Monster hiding under an object on a hole, the object got
knocked down the hole, the monster kept hiding.

2 years agorephrase some livelog messages
PatR [Sat, 9 Jul 2022 01:24:36 +0000 (18:24 -0700)]
rephrase some livelog messages

From entrez:  rephrase the terse livelog messages so that they form
complete sentences.

2 years agomaybe fix #K3634 - failed migrating mov arrival
PatR [Fri, 8 Jul 2022 18:07:36 +0000 (11:07 -0700)]
maybe fix #K3634 - failed migrating mov arrival

place_monster() sanity check complained that a long worm was being
put at the same location as another monster.  The long worm wasn't
on the map prior to that place attempt.  This probably fixes it but
I don't a test case so am not sure.

2 years agoFix monster hiding under candle burning away
Pasi Kallinen [Fri, 8 Jul 2022 10:39:19 +0000 (13:39 +0300)]
Fix monster hiding under candle burning away

Reveal the monster when the candle it was hiding under burned away.

2 years agoTrapped monster cannot move to swallow another
Pasi Kallinen [Fri, 8 Jul 2022 07:47:00 +0000 (10:47 +0300)]
Trapped monster cannot move to swallow another

The swallower kept their trapped-state, but could be moved to
another location. Just deal with it by not letting a trapped monster
swallow.

2 years agoUntrap monster when lregion removes the trap
Pasi Kallinen [Thu, 7 Jul 2022 09:27:28 +0000 (12:27 +0300)]
Untrap monster when lregion removes the trap

This check really should go in deltrap itself, but that would require
more effort than I have spoons for right now.

2 years agoUntrap monster in trap on melting ice
Pasi Kallinen [Wed, 6 Jul 2022 17:16:12 +0000 (20:16 +0300)]
Untrap monster in trap on melting ice

Monster trapped in a trap on melting ice, the monster stayed
trapped even as the trap was removed when the ice melted.

2 years agoconfig_error_add()'s terminating period
PatR [Wed, 6 Jul 2022 06:20:58 +0000 (23:20 -0700)]
config_error_add()'s terminating period

Have the config error reporting routine check whether the message
it's delivering already has end-of-sentence punctuation instead of
adding that unconditionally.