Commit Graph

3006 Commits

Author SHA1 Message Date
Pasi Kallinen
ac5aadf0e3 Add #fuzzer wiz-mode command
Move the debug_fuzzer boolean out of the full options menu
and turn it into #fuzzer extended command
2022-08-20 08:34:52 +03:00
PatR
c1337773f5 'color' in simple options menu
'color' appears in the simplified O menu for curses, but was not
showing up for tty.  That's because it is hidden when tiles are in
use, and tty has had a bogus value for iflags.wc_tiled_map.

Presence of USE_TILES is not a reliable way to tell whether tiles
are available in a multi-interface binary.  Nor is the setting of
DEFAULT_WC_TILED_MAP from config.h.
2022-08-19 14:54:59 -07:00
nhmall
8fb6e0be83 fix comment 2022-08-19 10:00:47 -04:00
copperwater
df3fc20ed0 Fix: double documentation for 'tilenm' in PCHAR2 2022-08-19 06:16:47 -07:00
PatR
2108abd30d pets eating containers
Apply the patch from entrez that makes pet gelatinous cubes who eat
containers engulf rather than digest the contents, like non-tame
g.cubes.  Unlike the latter, tame ones will immediately drop the
stuff they just engulfed and might subsequently eat it all anyway.
2022-08-18 01:09:52 -07:00
nhmall
d3208fa1c3 correct an rng mistake in 6e0d55df from Jan 2019
Reported by entrez
2022-08-17 20:32:07 -04:00
Pasi Kallinen
c05a6f3199 Expose some debug flags in options
Show and allow changing the debugging flags in options:

debug_fuzzer: turn on the fuzzer
debug_hunger: prevent hunger
debug_mongen: prevent monster generation
debug_overwrite_stairs: allow level generation overwrite stairs

These are wizard-mode only, cannot be set via config file,
and the fuzzer cannot change these either.
2022-08-17 20:17:30 +03:00
PatR
b07fe59b3c attack/damage by trapper and lurker above
Change trappers and lurkers above to remove digestion damage.  They
fold themselves around rather than swallow the victim.  There were
are lot of places that assumed that an engulfer which is an animal
would swallow and digest the victim.  In hindsight, it might have
been simpler to take the M1_ANIMAL flag off of trappers and lurkers
above.

This adds a new digests() predicate for creatures with AT_ENGL+AD_DGST
(purple worm) and also enfolds() for AT_ENGL+AD_WRAP (both 't'-class
critters).

There are several minor fixes mixed in with this.  I didn't record
them as I went along but the two I remember are
1) if poly'd into a holder and holding on to a monster, the '<' and
   '>' commands refursed to work; release the held creature first
   and then treat those commands as normal;
2) throwing a non-weapon while engulfed by an ochre jelly reported
   "the <item> vanishes into the ochre jelly's /currents/".

This needs a lot more testing.  I found and fixed multiple minor
details before my own testing burned out.
2022-08-15 04:14:36 -07:00
copperwater
549dfb92ea Remove obsolete find_skates function
find_skates was still in use for its one intended case, but objdescr_is
has been around for a few years now and can do just as good a job
without having to hardcode the first and last boots in objects[].
2022-08-14 10:12:54 +03:00
Pasi Kallinen
9be2e581b7 Macros for checking is object artifact 2022-08-12 19:37:34 +03:00
PatR
3dac38eb0f look_here() arguments
Add LOOKHERE_NOFLAGS to use instead of 0 for look_here()'s 2nd arg.
Fix the call to look_here() that passed FALSE.
2022-08-10 18:02:57 -07:00
Pasi Kallinen
d91915dba3 Migration-safe monster movement iteration
The monster knockback could mess with the monster linked list while
the code was going through it for monster movements. (For example,
a monster knocked back another into a level teleport trap)

Add iter_mons_safe, which first grabs all the monster pointers in
the list into an array, and goes over that array instead of relying
on the "next monster" pointer. This is possible because dead monsters
are not removed from the linked list until after all the monsters
have moved.

Testing is very minimal, and I'm not sure the vault guard check
for migration is correct - it should probably check for more states?

Also the iterator could be improved by not continually allocating
and freeing the monster pointer array.
2022-08-10 11:04:04 +03:00
PatR
e9ec89a903 fix issue #836 - engulfing mounter hero
Reported by copperwater:  if an engulfer swallowed a mounted hero,
odd things could happen if the hero dismounted.  The steed would be
silently expelled and float-down flooreffects were attempted.

It turns out that if the engulfer is classified as an animal (so
purple worm, lurker above, trapper), the hero got "plucked from
<steed>'s saddle" and was forcibly dismounted prior to completing
the engulf operation, but non-animals (vortices, air elemental,
ocher jelly, Juiblex) swallowed the hero+steed intact.  The most
straightforward fix to dismounting-while-engulfed issues is to change
engulfing to always pluck the hero from the saddle even when the
engulfer isn't an animal.

If there's no room on the level to place the former steed, it gets
killed off.  I looked at changing that to put the steed into limbo,
waiting to migrate back to the current level if hero leaves and
subsequently returns, but that breaks movemon()'s assumption that
when monsters are in the process of moving, only the currently moving
one can be taken off the fmon list to be placed on migrating_mons.

[The recently added monster knockback code violates that assumption
too when knocking the victim into a level changer trap.  It needs to
be fixed in one fashion or another.]
2022-08-09 16:22:50 -07:00
Pasi Kallinen
fd9745f9c6 Command repeating by using cmd queues
This replaces the old pushq/saveq arrays (which were used to save
the keys pressed by the user for repeating a previous command)
with a new command queue.  This means there's no hard-coded limit
to the saved keys, and it can repeat extended commands which are
not bound to any key.
2022-08-09 11:54:45 +03:00
PatR
4e6d3aba4f fix #K3656 - chest in pit
Using #loot while in a pit allows looting containers in that pit.
Using open and specifying the hero's spot when not in a pit allows
looting containers at hero's spot.  But using open while in a pit
complained about not being able to reach out of the pit before player
had a chance to give hero's spot at the place of interest, so did not
allow looting any container there.

Get a target spot before rejecting use of 'open' while in a pit.
The alternate prompt might be tty-centric.
2022-08-07 16:02:44 -07:00
Pasi Kallinen
b635160297 Minor ranged attack tweak
Make monsters with magic and gaze attacks avoid hero,
just like spitters and breathers already did.
Some small code cleanup related to the ranged attacks.
2022-08-07 22:33:47 +03:00
Pasi Kallinen
83f8ec1c43 Give pyrolisk a bite attack 2022-08-06 10:55:04 +03:00
PatR
a84025c36c more abandoned migrations when entering endgame
The earlier commit just removed monsters from migrating_mons and left
them orphaned.  Also it ignored migrating objects.

Actually release the monsters that can no longer arrive at their
migration destinations.  Release their inventories too.

Release objects that can no longer arrive at migration destinations.
2022-08-05 16:55:05 -07:00
PatR
dc381d0560 discard migrating monsters when entering endgame
When the hero enters the planes branch, all the rest of the dungeon
gets discarded since it can no longer be reached.  At the time that
that takes place, throw away any migrating monsters waiting to arrive
on any of those levels.
2022-08-05 14:36:11 -07:00
Pasi Kallinen
fa1b326e31 Save changed key binds to config file 2022-08-05 13:07:26 +03:00
Pasi Kallinen
45613ea771 Experimental #saveoptions command
Add a #saveoptions extended command, to allow saving configuration
settings from within the game. This is still highly experimental,
and gives plenty of warnings before asking to overwrite the file.

Lack of option saving is one of the biggest complaints new players
have, so this should help with it.  More experienced players with
highly customized config file should not use this feature, as it
completely rewrites the file, removing all comments and non-config
lines.
2022-08-05 10:33:55 +03:00
PatR
e5ddf400c6 'O' tweaks
Reformat most of optlist.h.  In the process, fix a couple of
conditionally included items which were mis-classified as set_in_game
when excluded.  Add "permablind" as an alias for the "blind" option.
[I don't understand the size value of 70 for #if BACKWARD_COMPAT
{curses,DEC,IBM,Mac}_graphics but didn't alter that.]

Include 'pickup_types' in the behavior section; it's useful from
turn 1 and does get adjusted from time to time during play.

Include 'color' in the map section, but hide it for wc_tiled_map.

Include 'showscore' and 'statuslines=2|3' in the status section.
I didn't rebuild with SCORE_ON_BOTL enabled so the showscore part
hasn't been tested.
2022-08-04 16:53:31 -07:00
Pasi Kallinen
4ff9537b0d Rudimentary key rebinding in game options
Currently shown only in the full options list, as it's not
quite complete. (For example, it doesn't handle movement commands,
or the getpos keys)
2022-08-04 14:42:45 +03:00
Pasi Kallinen
bfd262ebe8 Add optionsfull extended command
This is the previous, full options list. Adding it as
an extended command, so users can do

BIND=O:optionsfull

to go back to the old behaviour.
2022-08-03 19:18:44 +03:00
Pasi Kallinen
f3591ea07d User-friendly options menu
Make the default options menu only show the most important
options, split into categories. The full, traditional menu
can be accessed by using the m-prefix.
2022-08-03 14:08:31 +03:00
Pasi Kallinen
f4d0e99fad Reset map x/y start/size in single place 2022-08-02 17:02:25 +03:00
PatR
8a9dc00cde 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.
2022-07-31 16:12:40 -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
0da356c540 Enable migrating mons debugging 2022-07-27 12:21:07 +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
Pasi Kallinen
82f0b1e8ea Scared hostile monster which cannot move away will attack 2022-07-21 20:21:10 +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
aa09f3eef5 Use macro unhideable_trap 2022-07-18 13:27:39 +03: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
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
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
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
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
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
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
Pasi Kallinen
a1ca981907 Grid bugs don't have hands
Fixes #799
2022-07-13 11:21:21 +03:00
PatR
0059ced578 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.
2022-07-10 15:43:49 -07:00
PatR
fed367ccbd 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.
2022-07-10 11:14:10 -07:00