Commit Graph

13871 Commits

Author SHA1 Message Date
PatR
e13e514556 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.
2022-07-28 00:51:18 -07:00
PatR
1a367c7ff5 \#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.
2022-07-28 00:34:31 -07:00
Pasi Kallinen
05761bada6 Holes and trapdoors have predetermined exit level
Same hole/trapdoor will always take you to the same level.
2022-07-27 22:51:17 +03:00
Pasi Kallinen
543a3c1b9a comment typofix 2022-07-27 13:14:00 +03:00
Pasi Kallinen
0da356c540 Enable migrating mons debugging 2022-07-27 12:21:07 +03:00
Pasi Kallinen
810744a27d 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.
2022-07-26 23:20:54 +03:00
Pasi Kallinen
f0774e0da4 Fix monster hiding under consumed candle 2022-07-26 22:53:57 +03:00
Pasi Kallinen
f07f065f7d Allow cutting a known spider web by force-fighting it
Original code from xNetHack by copperwater <aosdict@gmail.com>.
2022-07-25 18:06:10 +03:00
Pasi Kallinen
63997a6fe5 Call it "danger sense" when warning finds a monster 2022-07-24 19:14:41 +03:00
PatR
75abc65bab 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
2022-07-23 23:14:12 -07:00
Kufat
296a3ac246 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.
2022-07-23 23:11:13 -07:00
PatR
d3f0a1fcde 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
2022-07-23 17:05:48 -07:00
Michael Meyer
47a35ba8a7 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.
2022-07-23 17:04:12 -07:00
Michael Meyer
e9fb226dbf 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...
2022-07-23 17:04:12 -07:00
Michael Meyer
8fe02be5ae 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.
2022-07-23 17:04:12 -07:00
PatR
c1e22b9e75 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
2022-07-22 15:30:14 -07:00
Michael Meyer
ac0d6a98ce 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.
2022-07-22 14:38:14 -07:00
PatR
04e8fbf249 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.
2022-07-22 14:11:16 -07:00
PatR
96084b2c68 pull request #826 - vault guard feedback
From argrath, replace use of 'goto' by splitting shared feedback
into a separate routine.

Closes #826
2022-07-22 13:07:50 -07:00
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