Commit Graph

10769 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
nhmall
f4c1e84bdd ignore windows link workfiles 2020-06-07 08:49:27 -04: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
6f9cd70226 comment clarification 2020-06-03 14:33:17 -07:00
nhmall
2c83e2e7e1 recognize visual studio 16.6 (released spring 2020) 2020-06-03 13:40:09 -04:00
PatR
f050d5b140 dead thief bit
Inside the afternmv routine is too late to tweak nomovemsg.
2020-06-03 07:55:06 -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
ac364b3e20 message when going from fainting back to weak
Implement the suggested revised wording when eating something
ends fainting back leaves the hero still weak.
2020-05-31 17:39:52 -07:00
nhmall
157d54ca27 Cross-compiling doc update 2020-05-31 12:41:36 -04:00
PatR
8a91a22df9 fix issue #351 - summoned critters while Hallu
If a monster uses the 'summon insects' spell (which will resort to
snakes if all 'a' class critters are genocided or extinct) while the
hero is hallucinating, report the summoning of something unusual
rather than of insects or snakes.  I bypassed "random creature"
direct to "hallucinatory creature" for the something unusual.

Fixes #351
2020-05-30 22:48:18 -07:00
PatR
54bea16f0e Revert "fix issue #351 - summoned critters while Hallu"
This reverts commit e430669f50.
It accidentally included my local config.h settings.
2020-05-30 22:35:35 -07:00
PatR
e430669f50 fix issue #351 - summoned critters while Hallu
If a monster uses the 'summon insects' spell (which will resort to
snakes if all 'a' class critters are genocided or extinct) while the
hero is hallucinating, report the summoning of something unusual
rather than of insects or snakes.  I bypassed "random creature"
direct to "hallucinatory creature" for the something unusual.

Fixes #351
2020-05-30 22:24:21 -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
nhmall
0fed5a06db Cross-compiling, msdos Makefile 2020-05-30 08:41:20 -04:00
PatR
4e677294b3 data.base formatting bit
Only two of the umpteen quote attributions were separated from their
quote by a blank line, so remove those two extra blank lines.
2020-05-28 17:20:01 -07:00
PatR
c5d089f5e5 tribute typo: Jingo #2
Reported directly to devteam; transcription typo:  had "Vines", should
be "Vimes".

I double checked that long passage and found two other mistakes:
"proffered" was misspelled with 2nd 'r' doubled,
| 'Quoted statement,' someone said.  'Another statement.'
lacked the opening quote on the second sentence.

My source uses double quotes (normal American usage).  I'm not sure
why the passages which refer to it--the page number annotations
specify that same source--were transcribed with single quotes (normal
British usage), but I've left those as is.

The sentence with "Vines" was also separated from the previous one by
a single space when nearly everything in dat/tribute uses double space.
A quick regexp search found half a dozen or so other instances of that.
This fixes those but the searching wasn't rigorous and it's sometimes
ambiguous whether an elipsis or long dash constitutes the end of a
sentence before another starts or is just in the middle of a long one.
2020-05-28 12:50:21 -07:00
PatR
fe88fa80d8 refine the issue #349 fix
Accept or ignore the in-hell-only and non-in-hell-only flags on
a monster type by monster type basis instead of all or nothing
for a given mkclass() call.  Prevents demon summoning outside of
Gehennom from bringing in only succubi and incubi 10 times out
of 11 and mixture of demons the other time.
2020-05-27 16:18:12 -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
PatR
c63165e5dc data.base descriptions for new monsters
Displacer beast and genetic engineer lacked data.base entries so
I've made a couple up from thin air.  I tried to look up "genetic
engineering" in _the_Concise_Dictionary_of_Biology_ (after seeing
that the quantum mechanic quote comes from _Concise_Dictionary_of_
_Physics_) but could only view the first sentence so don't know
whether it had anything more useful.  I also skipped the AD&D
Monster Manual for displacer beast except for remembering the
puma-like bit from previously checking it.  So regardless of any
old copyright issues in data.base, there shouldn't be any new ones.
2020-05-26 12:12:14 -07:00
nhmall
3d3fa958c6 add an indicator of thonged portion to aklys tile 2020-05-26 11:16:54 -04:00
nhmall
149592eb29 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-05-24 16:28:43 -04:00
nhmall
009c969a00 slash'em had a different palette defined 2020-05-24 16:24:58 -04:00
PatR
6f7fc6012f "you resume the last bite of your meal"
is nonsense, grammatically speaking.  Change the variant wording of
"you resume your meal" to be "you consume the last bite of your meal".

The alternate wording is intended to handle the case where no "you're
finally finished" message occurs (#H8922) but I don't remember how to
reproduce that so got both "you consume last bite" and "you finish".
2020-05-24 11:47:56 -07:00
PatR
e2fae16d22 minor object identification wording tweak
When everything is identified and you read a scroll of identify, you
get
|You have already identified all of your possessions.
That's unchanged.  Same situation, except learning scroll of identify
at the time and you've just been told "this is a scroll of identify":
old |You have already identified all the rest of your possessions.
new |You have already identified the rest of your possessions.
2020-05-24 11:09:43 -07:00
PatR
b720b0f469 questpgr memory management
Fix a complaint from 'heaputil' about freeing a Null pointer.  ANSI C
allows that but but older implementations could have problems.

This code is from four months ago and I don't remember how thoroughly
it was tested at that time.  It's only had minimal testing now.
2020-05-24 03:06:18 -07:00
PatR
298331fe04 improved regexp handling
If regex_compile() fails, free the regexp before doing anything else
in case failure reason is "out of memory".  Feedback to the user is
highly likely to panic or crash after memory runs out; this should
let the regex failure message be issued and the game continue.

User sound regular expressions were never freed.  This frees them
when FREE_ALL_MEMORY is enabled.
2020-05-23 12:51:01 -07:00
nhmall
1d7ee022e6 remove outdated header files from Xcode project 2020-05-23 14:08:45 -04:00
nhmall
305ad3c58e remove outdated Xcode references 2020-05-23 14:00:34 -04:00
nhmall
e726bfe98a Xcode bit 2020-05-23 13:52:17 -04:00
nhmall
36d2da1b80 travis naming: platform-build-compiler-other 2020-05-20 11:34:24 -04:00
Patric Mueller
9372b35c46 Demons summoning other demons only when near hero
Commit 2fbf9573d5 dropped erroneously the range condition for demons summoning
other demons.
2020-05-20 16:40:40 +02:00
PatR
ed5a2ea11e unix/Makefile.top bit
Guard against SYSCFLAGS someday containing space-separated tokens.
2020-05-19 11:07:48 -07:00
nhmall
a8d813b696 .travis.yml bit 2020-05-18 23:28:23 -04:00
nhmall
696aaf8b8d remove added hints file
append the -fno-common to the existing Makefile
2020-05-18 23:24:29 -04:00
nhmall
98ba1bdf20 travis update - have a build with and without -fno-common 2020-05-18 22:49:05 -04:00
nhmall
ee41403af2 add -fno-common build to travis 2020-05-18 22:39:49 -04:00
PatR
ce5eebcb9b fix lua tmpname() vs mkstemp() on linux
Avoid the warning that tmpname should be replaced by mkstemp by
replacing tmpname with mkstemp.  lua has code to do that but it isn't
trivial to activate while leaving the lua distribution unmodified.
[I've no idea whether nethack's usage even results in liblua ever
creating any temporary files.]

Using nethack's hints to pass -DLUA_USE_POSIX from top Makefile to
lib/lua-$(LUA_VERSION)/Makefile has been tested, building liblua.a
on linux with that has not.
2020-05-18 12:01:23 -07: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
nhmall
c1cd4eb0ae Windows Makefile.msc update for more recent VS 2019 2020-05-15 17:49:50 -04: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