Commit Graph

13852 Commits

Author SHA1 Message Date
SHIRAKATA Kentaro
b3b09bca5a split "letknow" into separate function 2022-07-22 13:07:22 -07:00
Pasi Kallinen
82f0b1e8ea Scared hostile monster which cannot move away will attack 2022-07-21 20:21:10 +03:00
Pasi Kallinen
8747d2ddce Sitting on amorphous corpse 2022-07-21 18:27:50 +03:00
PatR
01209cab7a 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.
2022-07-21 00:54:51 -07:00
PatR
13e645ffe1 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
2022-07-20 14:41:25 -07:00
SHIRAKATA Kentaro
58b32e76f0 split starving dog into separate function 2022-07-20 14:40:50 -07:00
Pasi Kallinen
8a52716936 Wielding Giantslayer prevents knockback from monsters 2022-07-20 14:44:15 +03:00
Pasi Kallinen
ced920df54 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.
2022-07-20 09:42:28 +03:00
Pasi Kallinen
b1a5a9c390 Demonbane changes
Demonbane is now a mace, the first sac gift for priests,
and gets an invoke ability to banish demons.
2022-07-19 21:23:26 +03:00
Pasi Kallinen
d713c1826b 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.
2022-07-19 15:14:55 +03:00
Pasi Kallinen
0bca93be87 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.
2022-07-18 23:01:11 +03:00
Pasi Kallinen
7bf02ade48 Bigroom 2 can have ice floor in unlit areas 2022-07-18 17:58:45 +03:00
Pasi Kallinen
e4cb3f0832 Rangers always succeed in disarming bear traps 2022-07-18 17:22:19 +03:00
Pasi Kallinen
88ec641770 Allow entering a known pit without taking damage 2022-07-18 17:00:20 +03:00
Pasi Kallinen
aa09f3eef5 Use macro unhideable_trap 2022-07-18 13:27:39 +03:00
Pasi Kallinen
06efa695be Abort wiztelekinesis if changing levels 2022-07-18 13:14:11 +03:00
Pasi Kallinen
a4ef5ee533 timed_delay doc bits 2022-07-18 08:33:10 +03:00
PatR
094da9b983 more #819 - magic harp
The log message for commit 231bd75b7f
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.
2022-07-17 16:38:39 -07:00
PatR
50e98c7e36 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
2022-07-17 16:21:35 -07:00
Michael Meyer
cc46da90e0 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
2022-07-17 16:12:39 -07:00
PatR
70b8bc04e7 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.
2022-07-17 14:25:51 -07:00
PatR
ad56ce0d1f 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'.
2022-07-17 14:24:34 -07:00
Pasi Kallinen
7c96825525 Demote elf-queen to a lady 2022-07-17 21:47:32 +03:00
Pasi Kallinen
823a6f247b Unify picking crawl goodpos 2022-07-17 21:37:31 +03:00
Pasi Kallinen
6fe0f7c132 Unify impaired movement direction checks 2022-07-17 12:23:49 +03:00
Pasi Kallinen
1ae2bc7063 Wielding a bec de corbin makes ravens generate peaceful 2022-07-17 09:04:15 +03:00
nhmall
b56e70fa93 remove Catalina build in CI
macOS 10.15 builds have been deprecated and are triggering a warning
2022-07-16 21:06:27 -04:00
nhmall
0649783a6d some windows startup
noticed that "do you want to destroy the savefile" was not being
handled correctly in Windows startup.
2022-07-16 20:43:24 -04:00
nhmall
3fb45dfa4c comment typo 2022-07-16 20:38:00 -04:00
PatR
3ce02fedc8 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.
2022-07-16 15:36:25 -07:00
Pasi Kallinen
94c1e94d20 Move mtrack push and clear to separate functions 2022-07-16 18:43:22 +03:00
PatR
fcbeed21cc 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.
2022-07-16 06:36:45 -07:00
nhmall
cb036d11e2 update tested versions of visual studio 2022-07-16 09:19:03 -04:00
PatR
231bd75b7f 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
2022-07-16 05:08:26 -07:00
nhmall
29afd90bad Merge branch 'quiet-vlen-unused-but-set' of https://github.com/entrez/NetHack into NetHack-3.7 2022-07-16 08:05:41 -04:00
PatR
1b3d2c6781 \#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.
2022-07-15 23:57:10 -07:00
Michael Meyer
0c517679c4 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.
2022-07-16 00:15:29 -04:00
PatR
f4e38b8b3e 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.)
2022-07-15 15:51:01 -07:00
PatR
e5977a3a2d \#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.
2022-07-15 14:36:03 -07:00
PatR
b37f922cf7 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....
2022-07-15 13:48:29 -07:00
PatR
5aca2fc590 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.
2022-07-14 23:58:34 -07:00
PatR
32636099ce 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.
2022-07-14 16:29:08 -07:00
PatR
66dc16b61f 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.
2022-07-14 16:13:47 -07:00
PatR
5ddf8c9815 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).
2022-07-14 15:17:30 -07:00
PatR
b14b830b49 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.
2022-07-14 14:46:32 -07:00
PatR
62a9510109 \#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.
2022-07-14 13:38:09 -07:00
Pasi Kallinen
486ed29077 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.
2022-07-14 14:04:27 +03:00
PatR
67ec92165e another comment typo/thinko 2022-07-14 00:54:43 -07:00
PatR
6efb8c528e comment typo/thinko 2022-07-14 00:48:10 -07:00
PatR
aba500b482 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.
2022-07-13 15:19:51 -07:00