A check into github issue 364 confirmed that
ba6edbe5dc
had incorrectly updated the bwrite sizeof entry for sysflags.
The SYSFLAGS and MFLOPPY code is all in the outdated part of the tree, so just
remove it rather than re-correct it.
Closes#364Closes#207
Noticed when checking the sokoban conduct's counter. Breaking
a line of boulders in one zap reported seeing the first but only
hearing the others, despite the first one being gone by the time
the second one was hit and so on down the line for the rest.
Track sokoban cheating (taking actions that incur a luck penalty).
The pull request only reported the number of times (possibly zero)
that the player broke nethack's sokoban rules when reporting the
"you obtained the Sokoban prize" achievement, which is when the
count is most meaningful, but this implements it as a full-fledged
conduct instead. This way the #conduct command can be used after
"creative nethacking" to check immediately whether an action has
violated the Sokoban rules so a player willing to put in a bit of
effort can eventually learn which actions have a negative impact.
The new conduct is only shown during games where the character has
entered the Sokoban branch, but once that has happened it gets shown
no matter the location at the time of #conduct or end of game.
Most of this wasn't in the pull request: expanding the Guidebook to
give more information about sokoban and its conduct.
Bump EDITLEVEL to invalidate to-be-3.7 save files because u.uconduct
has been extended.
Fixes#355
fixes#361
Also, experminental introduction of vt_sounddata to enable tty to pass
a sound file index to the terminal side of things where perhaps someone
can add code to something like hterm to take the information relayed by
NetHack to trigger user_sounds locally even if playing on a server.
Compile time option TTY_SOUND_ESCCODES required to build that support in.
It should be independent of TTY_TILE_ESCCODES.
Add the "if these walls could talk" gag. Use an array of message
strings rather than switch/cases of pline calls, and add a couple
more messages.
Also, only give wall feedback if the map indicates a wall (so not
while blind unless the wall is already known) and prevent chat from
pinpointing secret doors (via lack of wall feedback when they're
shown as walls).
After writing the log message for the bell change, I decided to
test the Book and found some issues:
1) reading it while blind discovered the book's type but wasn't
marking the book object as if it had become seen (dknown);
2) reading it while blind gave sighted feedback if it was cursed;
3) reading (blind or not) when either of the other two invocation
tools are cursed referred to those as "artifacts" even though
they aren't artifacts; the discoveries list describes them as
"unique items" but that makes for a clumsy message--use "relics"
instead.
Allow a hero in silver-hating form to ring the Bell of Opening when
on the vibrating square so be able to perform the invocation ritual.
But only at that location and only if the stairs aren't there yet.
This is about on par with being able to read the Book of the Dead
while blind although that isn't limited to a specific location.
The report about problems after stone-to-flesh on a petrified
long worm included stethoscope feedback of 0(-1) hit points, after
life-draining. I was unable to reproduce a maximum hp of -1 and hope
that it was a side-effect of the [already fixed] stale mon->wormno
value used when resurrecting the long worm. Anyway, this changes
life-draining to never take mon->hpmax below mon->m_lev + 1 (the +1
is needed to cope with m_lev==0 monsters). The same limit is also
applied to monster life-saving but more to avoid replicating the
arbitrary minimum of 10 (four instances) then because it might be
less than m_lev+1 somehow.
Sanity checking now tests whether a monster's max HP is less than
its level + 1 so if there are ways other than life-drain attacks for
it to drop that low, the fuzzer will choke. The new check also tests
whether a monster's current HP is greater than max HP.
Polymophred hero killing a golem or vortex by vampire bite reported
"<Mon> dies." Give an alternate message since those aren't alive.
Adopt the contribution to use "you can't read the words" when
trying to read a novel when blind rather than defaulting to
spellbooks' "you can't read the mystic runes." An unseen novel
is already described as "a book" instead of "a spellbook" so the
alternate feedback doesn't give away any information.
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.
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.
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
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
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
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
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.
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.
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
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".
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.
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.
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.
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
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.
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().
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.
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.
This is a security fix, intended to avoid a DoS attack (that has
been used in practice against public servers) in which a situation
is created in which the same short loop of commands can be run
over and over indefinitely; this causes a lot of CPU usage on the
public server as it simulates the game turns, and requires hardly
any network or CPU usage for an attacker.
Once the turn counter goes above 100000, the average prayer timeout
increases by 1 for every additional 100 turns spent. Thus, even
with a ring of slow digestion, nutrition prayers will no longer
be possible after turn 2 million or so. This is unlikely to have
any noticeable effect on any strategy that does not rely heavily
on prayer for nutrition; even in an implausible 200000-turn game,
prayer timeout will only be increased by 1000 or so, which should
be easily manageable for a character that powerful.
Allow "esp helmet" to find "helm of telepathy" and "power gloves"
to find "gauntlets of power". Plus add a few item names used in
other games that have a close enough match in nethack.
An Undefined reference to decgraphics_mode_callback was possible
if built for tty only.
drawing.c had an #include "tcap.h" which is what actually defined
TERMLIB. It isn't needed in drawing.c anymore, but it is needed
in symbols.c, in order to get the define for TERMLIB so that
decgraphics_mode_callback variable gets defined.
The undefined reference was from win/tty/termcap.h in code that
was #ifdef TERMLIB, but win/tty/termcap.h has the #include "tcap.h"
Don't replace a monster that's been temporarily seen via camera
flash or thrown/kicked lit candle/lamp with "unseen, remembered
monster" glyph if it can be sensed via telepathy, warning, or
extended monster detection.
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.)
and out of save files so restore doesn't need to clear stale data.
Behavior should be the same as before, except that when entering
the endgame branch and discarding the main dungeon and its other
branches, lua theme context is now discarded for those too.