Commit Graph

243 Commits

Author SHA1 Message Date
Patric Mueller
8564ee95b0 Record number of wishes and artifact wishes in xlogfile 2020-06-07 16:39:58 +02:00
PatR
330728a8c7 boolean option processing
Option parsing for booleans tried to accept "optname:true" or
"optname:yes" or "optname:false" or "optname:no" but it didn't work
because boolean options with a value were rejected before getting
to that.  Make parsing for booleans get far enough to handle those
values, treat them as case-insensitive, and add "on" and "off" as
additional choices.  "true" and "false" can be truncated to 3
letters, the other values need to be fully spelled out but are all
only 2 or 3 letters long.
2020-06-06 13:44:48 -07:00
PatR
5427b54d64 fixes typo 2020-06-03 07:50:40 -07:00
PatR
bb566e8a04 fix stone-to-flesh on petrified long worm
montraits() didn't have any handling for long worm tails, makemon()
didn't have any provision for creating a long worm without a tail,
replmon() uses place_wegs() to put tail segments on the map when
replacing a dummy new monster with the mtraits one but place_wsegs()
wasn't updating the head segment since it isn't put on the map.

That turned out to be key because there is always an extra segment
co-located with the monster and when its coordinates were wrong,
worm_known() gave bad results for visibility checking.  The
statue-goes-away message was the one for not being able to see the
monster that it just animated into, even though 'w' appeared at the
spot.  It took quite a while to track down what was going on there.

Sanity checking for worms has been updated and could conceivably
start triggering complaints about things that it used ignore.
2020-06-03 03:00:13 -07:00
PatR
503df6823d fix github issue #354 - stealarm() impossible
A thieving monster could be killed while the hero was busy taking
off armor which needs multiple turns (normally a suit) and if that
happened on the same turn as the take-off finished, the warning
"stealarm(): dead monster stealing" was issued.  Cited case was
having the thief be killed by a stinking cloud but it could happen
if the death was caused by a pet or by some other monster trying
to attack the hero.  If the thief died sooner, the situation was
silently ignored.  So this could have been fixed by just getting
rid of the impossible() feedback.

'stealmid' and 'stealoid' should have been static in steal.c rather
than global and as such should have been moved into 'struct g'.
This moves them there and then takes advantage of having access to
'stealmid' outside of steal.c.  That's just a minor optimization
since m_detach() could call new thiefdead() unconditionally and the
latter could check whether the dead monster matches 'stealmid'.

Fixes #354
2020-06-01 06:17:07 -07:00
PatR
8c1120261a fix github issue #352 - geno'd monsters in quest
The recent change to mkclass() was letting genocided monsters be
created when role-specific monsters were chosen for quest levels.

makemon(Null) -> rndmonst() -> qt_montype() -> mkclass() -> mk_gen_ok()
was accepting members of the quest-specified class even when they
should have been rejected.  I'm still not sure why the revised bit
manipulation didn't work as intended; the re-revised code does.

G_IGNORE was a bug waiting to happen since it gets passed to
mkclass() as a mons[].geno flag but is used to control the use of
mvitals[].mvflags values.  It's still being misused but at least
it doesn't conflict with any of the other flags now.

Fixes #352
2020-05-30 16:00:29 -07:00
PatR
e9f53ab7f6 fix #K1139 - corpse removed from ice box by monst
Rot and revive timers are turned off when a corpse gets put inside
an ice box.  They get turned back on when taken out of the ice box
by the hero but were being left off if taken out by a monster.
That resulted in corpses of arbitrary type behaving like lizard
corpses and never rotting away.

This fixes that.  It also changes troll corpse behavior.  Once put
in an ice box, a troll corpse will not get a new revive timer when
taken out, just an ordinary rot timer.
2020-05-30 13:33:16 -07:00
PatR
c29ffe1d82 fix github issue #349 - out of depth liches
Change mkclass() to always honor the hell-only monster generation
flag for L class, preventing master and arch-liches outside Gehennom.
For other classes, honor hell-only and outside-hell-only most (89%)
of the time.  When not honored (11%), it allows demons and devils to
appear outside of Gehennom as they have in the past.  [That part
might need to be re-done since it is done for all monsters in the
class on any mkclass() call instead of being done on a class-member
by class-member basis within each such call.]

This prevents out of depth liches in the Castle and ought to do same
for themed rooms of type 'Mausoleum' although I haven't figured out
how to test that.

Fixes #349
2020-05-27 14:05:42 -07:00
nhmall
3d3fa958c6 add an indicator of thonged portion to aklys tile 2020-05-26 11:16:54 -04:00
PatR
82ccfaa3ac fix github issue #346 - duplicate 'head_engr' defs
Post-3.6.x issue.  head_engr has been defined in engrave.c for ages
but the definition was relatively recently duplicated in decl.c.
gcc 10 defaults to more rigorous checking (-fno-common) and complained
about the duplicate.  Remove the original definition from engrave.c.

Fixes #346
2020-05-18 11:46:23 -07:00
PatR
ce4658abd6 curses vertical status
For status on the left or right of the map, show conditions in columns
rather than just space separated.  Shows two conditions per line, 12
characters wide, unless the overall status becomes too tall for its
window.  If that happens, they'll be condensed back to three per line,
8 characters wide.  Hunger and encumbrance are always 12 characters
wide when non-blank.
 old:
  |Hungry Burdened
  |Blind Conf Lev
 new:
  |Hungry       Burdened
  |Blind        Conf
  |Lev
(As before, if hunger is blank then encumbrance is left justified.
If they're both blank, their line is omitted and conditions move up.)
2020-05-17 00:01:14 -07:00
PatR
62ff82b8c3 sysconf parsing
Treat most sysconf problems as warnings and revert to conservative
default value instead of as errors that prevent the game from running
since an individual player might not be able to fix things.

Allow a user's config file to include SEDUCE=1 as long as sysconf
hasn't set SEDUCE=0.  Not much point since it only works when it's a
no-op but there's even less point to issue a warning for that no-op.

If PORTABLE_DEVICE_PATHS is encountered in sysconf for a non-Windows
configuration, report it as "not supported" rather than "unknown".

Many sysconf error messages ended with redundant ".." because the
message strings had final "." and the delivery routine uses "%s."
to format those strings.
2020-05-15 15:14:22 -07:00
PatR
b42535fb2c add "ec2-user" to sysconf's list of generic users
Pull request #330 would add "ec2" ("ec2-user" after dash and whatever
follows has been stripped off) to GENERICUSERS for Amazon Linux.  Now
that dashes-in-username handling has been fixed, that doesn't need to
be obscure and the full user name can be included instead.

I also added a commented out entry for PORTABLE_DEVICE_PATHS to the
default sysconf, then cloned that for Windows' sysconf.template.

Fixes #330
2020-05-15 13:49:11 -07:00
PatR
c7dba5fbc4 encumbrance feedback fix
Wishing for an item uses hold_another_object to put it into inventory
and hold_another_object wasn't reporting changes in encumbrance.  That
feedback would happen at start of next turn so its lack usually wasn't
noticeable, but encumbrance could be off for remainder of the current
turn which might include additional move(s).  Report indicated that
dropping something seemed to increase encumbrance instead of decrease
it, but it was dropped on an extra move and actually a delayed report
of the increase that hold_another_object failed to show.

I fixed a couple of other things with hold_another_object:  it would
add an item to inventory, which triggered an update of persistent
inventory if that was enabled, then remove it from inventory in order
to drop it if fumbling or inventory had too many items or encumbrance
was going to become too high, triggering a second update of persistent
inventory to reverse the first one.  Also, "encumbrance becoming too
high" was using hardcoded Stressed instead of the 'pickup_burden'
option that manages the same situation during pickup.  Not because
hold_another_object isn't pickup, but because its use of hardcoded
Stressed predated implementation of that option.

There was another fix for hold_another_object recently and I've moved
the fixes entry for that one to group it with the new ones.

Also, update an obsolete (from !GOLDOBJ config) comment in makewish().
2020-05-14 14:27:49 -07:00
PatR
41ae223585 hyphenated Unix user names
Fix for $USER, $LOGNAME, getlogin() values that have dashes in them:
keep dash and whatever follows as part of the name instead of stripping
it off for role/race/gender/alignment.

Before:
% USER=test-bar-fem ./nethack
|Shall I pick your female Barbarian's race and alignment for you?
and character ended up named 'test'.

After:
% USER=test-bar-fem ./nethack
|Shall I pick character's race, role, gender and alignment for you?
and character ends up named 'test-bar-fem'.  However,
% ./nethack -u test-bar-fem
still behaves like the 'before' case.
|Shall I pick your female Barbarian's race and alignment for you?

Dash handling is only changed when the dash comes from user name (or
from envionment overriding user name), not from direct player input
or run-time config file.
2020-05-12 16:38:12 -07:00
PatR
1afa961416 fix github issue #343 - scattered objects
landing on water or lava without being affected.

Reported for exploding bag of holding but has been a latent issue
for scatter() for ages.

Fixes #343
2020-05-12 15:26:28 -07:00
PatR
3165dd942e fix #K965 - dropped fragile items don't break
when the drop is being caused by encumbrance or punishment triggering
a fall while going down stairs.

Also, remove a couple instances of 'if (obj==GOLD) contexl.botl=TRUE'
when dropping gold.  They were held over from the obsolete !GOLDOBJ
configuration.  Both are immediately followed by freeinv() which
calls freeinv_core() whichs starts off by setting the botl flag when
taking gold out of inventory.
2020-05-11 17:51:25 -07:00
Alex Smith
0bc0997d00 Fixes entry for prayer timeout scaling 2020-05-12 00:32:14 +01:00
nhmall
0422696e67 move currently unmaintained code to outdated subfolder
rename {sys => outdated/sys}/amiga/.gitattributes (100%)
 rename {sys => outdated/sys}/amiga/Build.ami (100%)
 rename {sys => outdated/sys}/amiga/Install.ami (100%)
 rename {sys => outdated/sys}/amiga/Makefile.agc (100%)
 rename {sys => outdated/sys}/amiga/Makefile.ami (100%)
 rename {sys => outdated/sys}/amiga/NetHack.cnf (100%)
 rename {sys => outdated/sys}/amiga/amidos.c (100%)
 rename {sys => outdated/sys}/amiga/amidos.p (100%)
 rename {sys => outdated/sys}/amiga/amifont.uu (100%)
 rename {sys => outdated/sys}/amiga/amifont8.uu (100%)
 rename {sys => outdated/sys}/amiga/amigst.c (100%)
 rename {sys => outdated/sys}/amiga/amii.hlp (100%)
 rename {sys => outdated/sys}/amiga/amimenu.c (100%)
 rename {sys => outdated/sys}/amiga/amirip.c (100%)
 rename {sys => outdated/sys}/amiga/amistack.c (100%)
 rename {sys => outdated/sys}/amiga/amitty.c (100%)
 rename {sys => outdated/sys}/amiga/amiwind.c (100%)
 rename {sys => outdated/sys}/amiga/amiwind.p (100%)
 rename {sys => outdated/sys}/amiga/clipwin.c (100%)
 rename {sys => outdated/sys}/amiga/colorwin.c (100%)
 rename {sys => outdated/sys}/amiga/grave16.xpm (100%)
 rename {sys => outdated/sys}/amiga/ifchange (100%)
 rename {sys => outdated/sys}/amiga/mkdmake (100%)
 rename {sys => outdated/sys}/amiga/txt2iff.c (100%)
 rename {sys => outdated/sys}/amiga/winami.c (100%)
 rename {sys => outdated/sys}/amiga/winami.p (100%)
 rename {sys => outdated/sys}/amiga/winchar.c (100%)
 rename {sys => outdated/sys}/amiga/windefs.h (100%)
 rename {sys => outdated/sys}/amiga/winext.h (100%)
 rename {sys => outdated/sys}/amiga/winfuncs.c (100%)
 rename {sys => outdated/sys}/amiga/winkey.c (100%)
 rename {sys => outdated/sys}/amiga/winmenu.c (100%)
 rename {sys => outdated/sys}/amiga/winproto.h (100%)
 rename {sys => outdated/sys}/amiga/winreq.c (100%)
 rename {sys => outdated/sys}/amiga/winstr.c (100%)
 rename {sys => outdated/sys}/amiga/xpm2iff.c (100%)
 rename {sys => outdated/sys}/atari/.gitattributes (100%)
 rename {sys => outdated/sys}/atari/Install.tos (100%)
 rename {sys => outdated/sys}/atari/atarifnt.uue (100%)
 rename {sys => outdated/sys}/atari/nethack.mnu (100%)
 rename {sys => outdated/sys}/atari/setup.g (100%)
 rename {sys => outdated/sys}/atari/tos.c (100%)
 rename {sys => outdated/sys}/atari/unx2atar.sed (100%)
 rename {sys => outdated/sys}/be/.gitattributes (100%)
 rename {sys => outdated/sys}/be/README (100%)
 rename {sys => outdated/sys}/be/bemain.c (100%)
 rename {sys => outdated/sys}/mac/.gitattributes (100%)
 rename {sys => outdated/sys}/mac/Files.r (100%)
 rename {sys => outdated/sys}/mac/Install.mw (100%)
 rename {sys => outdated/sys}/mac/MacHelp (100%)
 rename {sys => outdated/sys}/mac/NHDeflts (100%)
 rename {sys => outdated/sys}/mac/NHrsrc.hqx (100%)
 rename {sys => outdated/sys}/mac/NHsound.hqx (100%)
 rename {sys => outdated/sys}/mac/News (100%)
 rename {sys => outdated/sys}/mac/README (100%)
 rename {sys => outdated/sys}/mac/carbon.plist (100%)
 rename {sys => outdated/sys}/mac/dprintf.c (100%)
 rename {sys => outdated/sys}/mac/maccurs.c (100%)
 rename {sys => outdated/sys}/mac/macerrs.c (100%)
 rename {sys => outdated/sys}/mac/macfile.c (100%)
 rename {sys => outdated/sys}/mac/machelp.hqx (100%)
 rename {sys => outdated/sys}/mac/macmain.c (100%)
 rename {sys => outdated/sys}/mac/macmenu.c (100%)
 rename {sys => outdated/sys}/mac/mactopl.c (100%)
 rename {sys => outdated/sys}/mac/mactty.c (100%)
 rename {sys => outdated/sys}/mac/macunix.c (100%)
 rename {sys => outdated/sys}/mac/macwin.c (100%)
 rename {sys => outdated/sys}/mac/mgetline.c (100%)
 rename {sys => outdated/sys}/mac/mmodal.c (100%)
 rename {sys => outdated/sys}/mac/mrecover.c (100%)
 rename {sys => outdated/sys}/mac/mrecover.hqx (100%)
 rename {sys => outdated/sys}/mac/mttymain.c (100%)
 rename {sys => outdated/sys}/os2/.gitattributes (100%)
 rename {sys => outdated/sys}/os2/Install.os2 (100%)
 rename {sys => outdated/sys}/os2/Makefile.os2 (100%)
 rename {sys => outdated/sys}/os2/nhpmico.uu (100%)
 rename {sys => outdated/sys}/os2/os2.c (100%)
 rename {sys => outdated/sys}/wince/.gitattributes (100%)
 rename {sys => outdated/sys}/wince/Install.ce (100%)
 rename {sys => outdated/sys}/wince/bootstrp.mak (100%)
 rename {sys => outdated/sys}/wince/ceinc/.gitattributes (100%)
 rename {sys => outdated/sys}/wince/ceinc/assert.h (100%)
 rename {sys => outdated/sys}/wince/ceinc/errno.h (100%)
 rename {sys => outdated/sys}/wince/ceinc/fcntl.h (100%)
 rename {sys => outdated/sys}/wince/ceinc/sys/.gitattributes (100%)
 rename {sys => outdated/sys}/wince/ceinc/sys/stat.h (100%)
 rename {sys => outdated/sys}/wince/celib.c (100%)
 rename {sys => outdated/sys}/wince/cesetup.bat (100%)
 rename {sys => outdated/sys}/wince/cesound.c (100%)
 rename {sys => outdated/sys}/wince/defaults.nh (100%)
 rename {sys => outdated/sys}/wince/keypad.uu (100%)
 rename {sys => outdated/sys}/wince/menubar.uu (100%)
 rename {sys => outdated/sys}/wince/mhaskyn.c (100%)
 rename {sys => outdated/sys}/wince/mhaskyn.h (100%)
 rename {sys => outdated/sys}/wince/mhcmd.c (100%)
 rename {sys => outdated/sys}/wince/mhcmd.h (100%)
 rename {sys => outdated/sys}/wince/mhcolor.c (100%)
 rename {sys => outdated/sys}/wince/mhcolor.h (100%)
 rename {sys => outdated/sys}/wince/mhdlg.c (100%)
 rename {sys => outdated/sys}/wince/mhdlg.h (100%)
 rename {sys => outdated/sys}/wince/mhfont.c (100%)
 rename {sys => outdated/sys}/wince/mhfont.h (100%)
 rename {sys => outdated/sys}/wince/mhinput.c (100%)
 rename {sys => outdated/sys}/wince/mhinput.h (100%)
 rename {sys => outdated/sys}/wince/mhmain.c (100%)
 rename {sys => outdated/sys}/wince/mhmain.h (100%)
 rename {sys => outdated/sys}/wince/mhmap.c (100%)
 rename {sys => outdated/sys}/wince/mhmap.h (100%)
 rename {sys => outdated/sys}/wince/mhmenu.c (100%)
 rename {sys => outdated/sys}/wince/mhmenu.h (100%)
 rename {sys => outdated/sys}/wince/mhmsg.h (100%)
 rename {sys => outdated/sys}/wince/mhmsgwnd.c (100%)
 rename {sys => outdated/sys}/wince/mhmsgwnd.h (100%)
 rename {sys => outdated/sys}/wince/mhrip.c (100%)
 rename {sys => outdated/sys}/wince/mhrip.h (100%)
 rename {sys => outdated/sys}/wince/mhstatus.c (100%)
 rename {sys => outdated/sys}/wince/mhstatus.h (100%)
 rename {sys => outdated/sys}/wince/mhtext.c (100%)
 rename {sys => outdated/sys}/wince/mhtext.h (100%)
 rename {sys => outdated/sys}/wince/mhtxtbuf.c (100%)
 rename {sys => outdated/sys}/wince/mhtxtbuf.h (100%)
 rename {sys => outdated/sys}/wince/mswproc.c (100%)
 rename {sys => outdated/sys}/wince/newres.h (100%)
 rename {sys => outdated/sys}/wince/nhico.uu (100%)
 rename {sys => outdated/sys}/wince/resource.h (100%)
 rename {sys => outdated/sys}/wince/winMS.h (100%)
 rename {sys => outdated/sys}/wince/winhack.c (100%)
 rename {sys => outdated/sys}/wince/winhack.rc (100%)
 rename {sys => outdated/sys}/wince/winhcksp.rc (100%)
 rename {sys => outdated/sys}/wince/winmain.c (100%)
 rename {win => outdated/win}/Qt3/.gitattributes (100%)
 rename {win => outdated/win}/Qt3/Info.plist (100%)
 rename {win => outdated/win}/Qt3/Install.Qt (100%)
 rename {win => outdated/win}/Qt3/knethack.lnk (100%)
 rename {win => outdated/win}/Qt3/knh-mini.xpm (100%)
 rename {win => outdated/win}/Qt3/knh.xpm (100%)
 rename {win => outdated/win}/Qt3/qpe-nethack.control (100%)
 rename {win => outdated/win}/Qt3/qt3_clust.cpp (100%)
 rename {win => outdated/win}/Qt3/qt3_clust.h (100%)
 rename {win => outdated/win}/Qt3/qt3_kde0.h (100%)
 rename {win => outdated/win}/Qt3/qt3_win.cpp (100%)
 rename {win => outdated/win}/Qt3/qt3_win.h (100%)
 rename {win => outdated/win}/Qt3/qt3_xpms.h (100%)
 rename {win => outdated/win}/Qt3/qt3tableview.cpp (100%)
 rename {win => outdated/win}/Qt3/qt3tableview.h (100%)
 rename {win => outdated/win}/Qt3/tileedit.cpp (100%)
 rename {win => outdated/win}/Qt3/tileedit.h (100%)
 rename {win => outdated/win}/gem/.gitattributes (100%)
 rename {win => outdated/win}/gem/Install.gem (100%)
 rename {win => outdated/win}/gem/bitmfile.c (100%)
 rename {win => outdated/win}/gem/gem_rsc.uu (100%)
 rename {win => outdated/win}/gem/gem_rso.uu (100%)
 rename {win => outdated/win}/gem/gr_rect.c (100%)
 rename {win => outdated/win}/gem/gr_rect.h (100%)
 rename {win => outdated/win}/gem/load_img.c (100%)
 rename {win => outdated/win}/gem/tile2img.c (100%)
 rename {win => outdated/win}/gem/title.uu (100%)
 rename {win => outdated/win}/gem/wingem.c (100%)
 rename {win => outdated/win}/gem/wingem1.c (100%)
 rename {win => outdated/win}/gem/xpm2img.c (100%)
 rename {win => outdated/win}/gnome/.gitattributes (100%)
 rename {win => outdated/win}/gnome/README (100%)
 rename {win => outdated/win}/gnome/gn_xpms.h (100%)
 rename {win => outdated/win}/gnome/gnaskstr.c (100%)
 rename {win => outdated/win}/gnome/gnaskstr.h (100%)
 rename {win => outdated/win}/gnome/gnbind.c (100%)
 rename {win => outdated/win}/gnome/gnbind.h (100%)
 rename {win => outdated/win}/gnome/gnglyph.c (100%)
 rename {win => outdated/win}/gnome/gnglyph.h (100%)
 rename {win => outdated/win}/gnome/gnmain.c (100%)
 rename {win => outdated/win}/gnome/gnmain.h (100%)
 rename {win => outdated/win}/gnome/gnmap.c (100%)
 rename {win => outdated/win}/gnome/gnmap.h (100%)
 rename {win => outdated/win}/gnome/gnmenu.c (100%)
 rename {win => outdated/win}/gnome/gnmenu.h (100%)
 rename {win => outdated/win}/gnome/gnmesg.c (100%)
 rename {win => outdated/win}/gnome/gnmesg.h (100%)
 rename {win => outdated/win}/gnome/gnomeprv.h (100%)
 rename {win => outdated/win}/gnome/gnopts.c (100%)
 rename {win => outdated/win}/gnome/gnopts.h (100%)
 rename {win => outdated/win}/gnome/gnplayer.c (100%)
 rename {win => outdated/win}/gnome/gnplayer.h (100%)
 rename {win => outdated/win}/gnome/gnsignal.c (100%)
 rename {win => outdated/win}/gnome/gnsignal.h (100%)
 rename {win => outdated/win}/gnome/gnstatus.c (100%)
 rename {win => outdated/win}/gnome/gnstatus.h (100%)
 rename {win => outdated/win}/gnome/gntext.c (100%)
 rename {win => outdated/win}/gnome/gntext.h (100%)
 rename {win => outdated/win}/gnome/gnworn.c (100%)
 rename {win => outdated/win}/gnome/gnworn.h (100%)
 rename {win => outdated/win}/gnome/gnyesno.c (100%)
 rename {win => outdated/win}/gnome/gnyesno.h (100%)
 rename {win => outdated/win}/gnome/mapbg.xpm (100%)
2020-05-10 11:31:25 -04:00
Patric Mueller
6fcb3fc0c7 Only generate shop items on solid floor squares
This commit addresses one issue raised in #338 that shop items were generated
on lava squares.
2020-05-10 14:23:34 +02:00
PatR
59818fb6ab implement #986 - camera flash 'tweak'
Implement the suggested feature that a camera's flash actually update
hero's memory of the map as it traverses across the level.  Turned
out to be more work than anticipated despite having the code for a
thrown or kicked lit candle or lamp to build upon.

Among other things it needed to update the circle code to handle
previously unused radius 0 to operate on the center point only.  I've
never touched that before and hope this hasn't introduced any bugs.

Also removes several instances of vision code operating on column #0.
(At least one is still present.)
2020-05-09 13:07:35 -07:00
PatR
7817e69c41 two new monsters from slash'em
Adds two monsters originally from slash'em.  I used the slash'em
tiles this time, also its code as a starting point but made various
revisions.  Both the tiles could benefit from some touch-ups.

displacer beast:  blue 'f'.  Attempting a melee hit (ie, trying to
  move to its spot) has a 50:50 chance for it to swap places with you.
  Fairly tough monster to begin with, then half your ordinary attacks
  effectively miss and if you try to face a mob by retreating to a
  corridor or backing into a corner you can end up being drawn back
  into the open.  I added bargethrough capability, and also it won't
  be fooled about hero's location by Displacement.  [It only swaps
  places during combat when contact is initiated by the hero, not
  when attacked by another monster or when attacking.]

genetic engineer:  green 'Q'.  Its attack causes the target to be
  polymorphed unless that target resists.  Hero will almost always
  have magic resistance by the time this monster is encountered, but
  it can make conflict become risky by hitting and polymorphing other
  monsters.  Slash'em flagged it hell-only but I took that flag off;
  I also took away its ability to teleport.  Slash'em polymorphs the
  hero if a genetic engineer corpse is eaten; that's included and I
  introduced that for monsters too.

I added both of these to the list of candidates for monster spell
'summon nasties' and for post-Wizard harassment.

I also gave all the 'f's infravision.  Probably only matters if the
hero polymorphs into a feline.

Displacer beast is originally from AD&D which depicts it as a six-
legged cougar with a pair of tentacles; it has Displacement rather
be able to affect an attacker's location.  I think genetic engineer
is original to slash'em where it expands Q class but seems mainly to
be the base monster for Dr.Frankenstein (a unique monster with a
one-level side-branch lair in slash'em's incarnation of Gehennom).
2020-05-03 14:13:08 -07:00
PatR
488e045156 Double Trouble trouble
From the newsgroup:  if cloned Wizard arrives out of view of the
hero (and vice versa), it will sit and wait until hero moves into
his view or until suffering some damage (usually via pet).  So if a
mob causes the clone to arrive on the far side of a wall, he might
not come into play until the hero goes to another level and some
future harassment action pulls him off the migrating monsters list.
Treat clones like the resurrected Wizard:  don't start out waiting.
2020-05-01 12:12:47 -07:00
PatR
5457cbe0e3 liquid_flow when digging pit
Part of github issue #338 that isn't about shops:  objects at the
spot where a dug pit fills with lava (or water) weren't being
effected by that.

While fixing it, I noticed that hero's steed wasn't affected either.
Also, when conjoined pits are filled in, monsters other than the
steed are at risk but weren't being handled.  Presumably they fell
in on their next move.
2020-05-01 00:42:18 -07:00
PatR
696858346a failure to hold another object when swallowed
If hold_another_object() decides that the object must be droped, drop
it into u.ustuck's minvent when swallowed instead of magically through
the engulfer direct to the floor.
2020-04-29 12:43:54 -07:00
PatR
54cfb86936 fix pull request #340 - untrap steed sanity
When a failed #untrap attempt while mounted caused hero to be moved
onto the trap, it neglected to set the steed's coordinates to match.
If 'sanity_check' was On, that would trigger warnings about steed's
anomalous position.  Eventually a normal move would put steed's
coordinates back in sync with the hero's.

The pull request code set u.usteed->{mx,my} directly.  I've used
u_on_newpos() instead.  I also replaced some direct manipulations of
u.{ux,uy} with u_on_newpos() so that if clipping is in effect it will
be updated.

Fixes #340
2020-04-27 11:48:55 -07:00
PatR
c67f1dd710 Sting vs level teleport's "materialize" message
When level teleporting, Sting/Orcrish/Grimtooth would start or stop
glowing based on occupants of the new level before "you materialize
on another level".  That wasn't necessarily incorrect for the glow
stopping but was clearly wrong for it starting.  This fix uses a flag
as a hack to avoid finding and changing all the calls to docrt() and
see_monsters().  It ought to be fixed properly....
2020-04-27 05:09:19 -07:00
PatR
09f9b3598f fix issue #339 - duplicate feature messages
while 'mention_decor' is enabled.  When stepping onto different
terrain and one or more objects remained on the new spot after
autopickup, describe_decor() was issuing its new-terrain message
right before look_here()'s similar under-the-objects message.  If
autopickup grabbed everything or there weren't any objects to begin
with, look_here() doesn't issue any dfeature (terrain) message.
describe_decor() isn't smart enought to know whether that is going
to happen.  Give look_here() a new flag argument so that its caller
can ask for the dfeature message to be skipped for the case where a
similar message has already been given.
2020-04-27 04:25:26 -07:00
PatR
7b9ce40388 fix issue #332 - mon vs mon double hit message
One monster hitting another with an artifact within the hero's view
gave "<Mon1> swings his <Artifact> at <Mon2>." followed either by
"<Mon1> misses <Mon2>." _or_ the two messages "<Mon1> hits <Mon2>."
and "The <Artifact> hits <Mon2>."  Defer the <Mon1> hits <Mon2> one
when Mon1 is using an artifact and only deliver it if there is no
artifact hit message.

Tested but not exhaustively so....

Fixes #332
2020-04-25 19:06:18 -07:00
Pasi Kallinen
978cf23cc9 Fixes entry 2020-04-25 19:19:36 +03:00
Patric Mueller
c00c307d57 Record amount of gold in hero's possession in xlogfile 2020-04-24 23:53:25 +02:00
Patric Mueller
0e4ff07cef Extended achievement and conduct fields for xlogfile
Introducing two new xlogfile fields "achieveX" and "conductX" which encode
achievements and conducts as a series of comma-separated strings which are
more easily parseable and also somewhat interpretable independent from knowing
the source code.

Example for a player that died shortly after picking up the luckstone from the
gnomisch mines:
achieveX=entered_the_gnomish_mines,entered_mine_town,entered_a_shop,entered_a_temple,obtained_the_luckstone_from_the_mines
conductX=polyless,polyselfless,wishless,artiwishless,genocideless
2020-04-24 23:41:25 +02:00
PatR
e63fed627c obj->oextra->{omid,olong}
Change obj->oextra->omid from a usually-Null pointer field in
oextra to a simple 'unsigned' that doesn't need any allocation
beyond obj->oextra itself.  Value 0 means that it is not in use;
it is used to hold a monst.m_id and those are always non-zero.

Delete unused obj->oextra->olong.  'olong' used to be the last
field in struct obj, put there to force alignment of anything
which followed it back when obj structures were over-allocated to
append extra information.  It had a comment about being used for
temporary gold but whatever that was, temporary gold was gone long
before obj->oextra got introduced.

Bump EDITLEVEL since this invalidates existing 3.7 save files.

Remove a bunch of tabs from obj.h and save.c.
2020-04-24 09:29:52 -07:00
PatR
6677003c8f fix issue #333 - obsolete "green slime corpse"
Issue was for dropping glob of green slime while swallowed by a
purple worm but also applied to pet eating habits.  Green slime
corpse doesn't exist any more; check for glob instead.

Fixes #333
2020-04-23 17:31:21 -07:00
PatR
ff483694af fix issue #319 - whip can fetch underwater items
Applying a bullwhip down while levitating or riding gives a chance
to pick up items from the unreachable floor.  Doing so over water
yields "you wrap your bullwhip around <item> on the water" when
that item is actually on the bottom.  Same for lava.  Don't fetch
items from beneath the surface.  Also, for the lava case subject
the whip to fire damage.

This has actually broken the seal on a can of worms.  Every item
at a water location sinks to the bottom even if it should float.
I'm not opening that can....

Fixes #319
2020-04-23 16:54:51 -07:00
PatR
3468129f5a fix issue #337 - crash on start with armhf arch
Fix "objects[0] class #1 not in order!" panic.  The new check to
make sure that the elements of objects[] were in ascending order
by object class uses a plain 'char' index so -1 to indicate 'no
previous value' didn't work on a system using unsigned chars.

Verfied by temporarily adding '-funsigned-char' to CFLAGS before
and after the revision.  Before: panic, after: no panic.

Fixes #337
2020-04-23 11:47:29 -07:00
Patric Mueller
f9f423b385 Allow nurses heal attack when wielding a non-weapon/weaptool
This matches the nurses' hitting behavior with their chatting messages.

Chatting to them suggested that the heal attack would happen but the check in
mhitu.c was just for wielding anything.

This opens up the possibility of a YAFM in MS_NURSE when wielding something
that allos the heal attack to proceed.  But I couldn't come up with a good
one.
2020-04-22 12:00:06 +02:00
PatR
b7030d1567 resurrect 'makedefs -m'
Have 'makedefs -m' output default mons[].difficulty values in the
stub 'monstr.c' that still gets generated for that option.  It
would be better to allow specifying which monsters are of interest
but I didn't want to get bogged down by interface issues.

I needed it for mons[PM_ELF].difficulty after changing that monster's
level, so it still has a purpose.  Code is from 3.4.3, reformatted
manually.
2020-04-21 14:04:03 -07:00
nhmall
23428d0fcc squadprob array had 5 elements but only 4 initialized
fixes #335
2020-04-21 14:32:14 -04:00
PatR
ca4e729216 detection bugs when vault guard is at <0,0>
Monster detection skipped dead monsters during fmon traversal but
found semi-dead guard parked at <0,0> waiting to remove temporary
vault corridor.  If that happened to be the only monster found then
the feedback was incorrect (a blank map showing no found monsters
instead of a strange feeling).  Object detection found semi-dead
guard's inventory and might report incorrectly too although the
chance of that being the only objects found on the level is a lot
less than it being the only monster.
2020-04-20 16:11:47 -07:00
PatR
5ec96751ba fix issue #325 - wishing for "garlic" doesn't work
Wishing allowed "royal jelly" to match "lump of royal jelly" as a
special case, but not "wolfsbane" to match "sprig of wolfsbane" or
"tricks" to match "bag of tricks".  Handle that sort of match in a
more general way.

While in there, add a minor glob bit:  instead of giving a random
corpse (because monster is flagged as no-corpse) if someone wishes
for "gray ooze corpse" give "glob of gray ooze".

Fixes #325
2020-04-20 14:57:17 -07:00
PatR
63b1bf54e8 fix wishing crash
After 05403182eb (I think, possibly the
change to objnam.c which followed that one) from a couple of days ago,
wishing for a monster name dereferenced a Null pointer and crashed.
2020-04-20 13:28:43 -07:00
PatR
2337252acf fix issue #326 - can't wish for were-foo corpse
"were{rat,jackal,wolf}" each occur twice in mons[], once for the
beast form and second time among '@' for the human form.  Wishing
for werecreature corpse or tin always matches the first entry so
yields the beast form, but all their beast forms are flagged as
no-corpse so the wish would fallback to a corpse with random monster
type.  Wishing for werecreature figurine worked but always produced
one that created its beast form if/when activated.

This fix allows specifying "human werecreature" to match the second
entry.  It's optional for corpse and tin; the wish code will now
switch to that implicitly if it gets a no-corpse were-form for
those.  It has to be specified explicitly to get a figurine that
will activate as the human form.  It works for ^G too.

Fixes #326
2020-04-19 05:28:18 -07:00
PatR
05403182eb wishing fix
name_to_mon() has a bunch of alternate monster names, such as
"gray-elf" to match "grey-elf" and "ki rin" to match "ki-rin".  Those
worked as intended when they occurred at the end of a wish, but only
worked in the middle if their length was the same or one character
less than the canonical name in mons[].mname.

djinni figurine     -> h - a figurine of a djinni
genie figurine      -> i - a figurine of a djinni
figurine of mumak   -> j - a figurine of a mumak
mumak figurine      -> k - a figurine of a mumak
figurine of mumakil -> l - a figurine of a mumak
mumakil figurine    -> nothing fitting that description exists

(The one-less case worked because its following space ended up being
implicitly removed when skipping ahead by the length of mons[].mname;
subsequent explicit removal didn't find a space so was a no-op.)
2020-04-19 04:58:18 -07:00
PatR
51180274df fix issue #331 - steam clouds vs moats
Water locations on Medusa's level didn't show steam clouds.  It
wasn't because the location was a moat rather than a pool, it was
because the moat location was unlit (and in line of sight) and
tested pool locations were lit.  Poison gas clouds explicitly
override the lit/unlit issue but other region types weren't.

Fixes #331
2020-04-18 15:28:53 -07:00
Pasi Kallinen
9b74ea0b22 Shaped and themed rooms
Allows creating shaped or themed rooms for the Dungeons of Doom
via lua script.

Invalidates bones and saves.

Makefiles updated for unix/linux by adding themerms.lua, but other
OSes need to have that added.
2020-04-18 19:55:09 +03:00
PatR
cf9e0d9434 map updating change to fix tty 2020-04-17 16:45:41 -07:00
PatR
274321d4ec adopt pull request #328 - steam clouds
This adds a superset of the code from github pull request #328
to create a short-lived cloud of steam when fire hits a pool or
fountain.  The original code required C99; this doesn't.  It also
allowed vapor clouds on the Plane of Water where they don't work
sanely becaure regions don't understand air bubble movement and/or
vice versa.  This inhibits the clouds there [the same ought to be
done for scrolls of stinking cloud].  It also left as-is the code
that reported when fountains got used up even though conceptually
the steam should interfere with being able to see that.  This adds
a glyph-check hack to augment cansee() so that fountains that boil
away entirely are hidden at the time.

Regions that block line of slight should be calling block_point()
when created and unblock_point() when removed but a naive attempt
to introduce that didn't work as expected so I'm giving up on.

Fixes #328
2020-04-17 14:56:47 -07:00
PatR
263ee3015f tty: S_unexplored
Screen erasure leaves the map set to spaces.  If S_unexplored is
something other than <space>, tty wasn't drawing with S_unexplored
after a menu or long message line got erased following temporary
overwrite of part of the map.

This seems to work but is not the correct way to do things.
clear_screen(), cl_eos(), and cl_end() should all be taught to
flag the map as needing to be refreshed after they erase part of it.
tty_clear_nhwindow(WIN_BASE) is also lacking since it erases the
message line, full map, and status lines but leaves their internal
windows with stale data about what is shown instead of marking them
blank.
2020-04-17 01:06:37 -07:00
PatR
c09733f2e4 health food store
When a food shop gets converted into a health food shop (minetown
when playing as a monk), the shop type and underlying room type
weren't changed to match.
2020-04-16 01:00:31 -07:00