On some platforms this may require:
make spotless
make fetch-lua
I did attempt to force a reminder message about the latter to
Makefile.top this time, and hope that works correctly for everyone.
Valkyrie player monster was set to be chaotic even though valk
hero is lawful by default and can also be neutral but not chaotic.
Change it to be lawful. Warrior quest monsters attending leader
were also chaotic; change to lawful to match revised valk. If
hero is a neutral valk then both the player monster and warriors
get changed to neutral at start of game (and stay that way even
if hero changes alignment). The leader defaults to neutral but
gets changed to lawful for lawful valk hero.
Attentdant quest monsters with the healer leader were lawful but
if they gain enough experience they get promoted to healer, so
make them neutral like the latter.
I've added some miscellaneous comments and done a small amount of
reformatting. Comment about alignment changing in bones applies
to all roles that can be played with different alignments, not
just to valkyries. It isn't new; I just thought that it ought to
be mentioned somewhere.
Fixes#521
More for issue #524.
The revised append_str() was still vulnerable to unsigned subtraction
overflowing from small negative value to huge positive one, if caller
ever passed an outbuf buffer which already had more than BUFSZ
characters in it.
Also the semantics were changed. If there wasn't room for the whole
" or "+string to be appended, it used to add as much as would fit.
The revised version changed that to all-or-nothing. This changes it
back, although players will probably never know the difference.
Add a page citation for passage #1 and change the wording of that
passage to match the book: the second "does not need" should be
"doesn't even need".
Also make the comments about various added passages (for other
books) be more consistent.
Like /m for nearby monsters and /O for all objects, implement /^
and /" to view a list of nearby traps or all known traps. Only
lists discovered traps (or mimics immitating traps, or detected
door or chest traps iff still shown as such on map), but lists
map traps even when an object or monster at the same location is
blocking view of them.
For traps on the Water and Air levels that have been mapped, they
will only be listed when within line of sight so that this feature
can't be used to track portal location as it moves around. However,
when within line of sight it does allow the portal to be recognized
if that has become covered.
When using '//' or ';' to examine the map and player uses '^' to
move the cursor to the next displayed trap, have cursor go to
locations containing webs, the vibrating square, or other non-'^'
trap when such is the next trap symbol up. Otherwise looking at
webs is very tedious because '"' is treated as a look-at command
rather than than a target symbol.
For the baalz 'lit=0' fix, I first tried 'lit=false'. That isn't
supported and triggered an error, but the error reporting passed
a null pointer to sprintf() for a %s argument. OSX's stdio shows
"null" instead of crashing in that situation; most implementations
wouldn't be so forgiving.
It intends to complain about "false" but that won't work if the
unexpected value doesn't get put into the lua table. I don't know
how to fix that aspect of this. This fix just avoids passing a
null pointer to sprintf. Plus some miscellaneous reformatting.
Revise Makefile.top to remove the obsolete commands which change
the last modified date of save and bones files during 'make update'.
Using file dates to validate save files against nethack hasn't been
useful for many years.
Also, update assorted comments.
Allow killing your quest leader, just to make games winnable if you
converted before doing the quest.
Boost the quest leaders and give them some equipment. King Arthur
gets Excalibur. Killing quest leader gives really bad luck and
makes your god angry at you, and killing quest guardians gives
smaller penalties.
This is based on both the EvilHack implementation by
k21971 <keith.simpson1971@gmail.com>, and xNetHack
implementation by copperwater <aosdict@gmail.com>.
Another SliceHack feature. However, the math implemented by SliceHack
seemed incorrect, so I tweaked it.
Pets previously attacked monsters of up to one level higher than them as
long as they were above 25% health. Now, they will attack monsters as
follows:
100%: up to level + 2 (pets could not attack this high before)
80%+: up to level + 1
60%+: up to same level
40%+: up to level - 1
25%+: up to level - 2
The case that prevents any attacks below 25% health still exists.
Despite active explosion attacks being called explosions in-game,
they only affected a single target, and were handled differently
from actual explosions. Make them do an actual explosion instead.
This should make spheres more interesting and inspire different
tactics handling them.
Because spheres deal more damage on average and can destroy items
in their explosions, their difficulty has been increased slightly.
Polyselfed hero exploding won't cause elemental damage to their
own gear.
Originally from xNetHack by copperwater <aosdict@gmail.com>.
Adds possible callbacks for "start_new_game", "restore_old_game",
"moveloop_turn", and "game_exit" which when defined, will be called
from core code at the appropriate time.
Adds lua hooks for dump_fmtstr (only if DUMPLOG), dnum_name, u.moves,
u.uhave_amulet, and u.depth.
The #version command retrieves the lua version number to include
in its output, but it was leaving the 'in_lua' flag set. So if a
later 'O' command tried to complain about a bad option value, the
error reporting routine crashed.
Grappling hook used to have an undiscovered description of "iron hook"
and when that was removed, the oc_name_known flag was left set as if
for something that could become discovered. I'm not sure whether that
made any difference anywhere.
Gold piece was in a similar situation, except that it wasn't because
an alternate description had been present and then removed. That one
definitely didn't make any difference anywhere.
Fixes#515
... and make them actually deal damage based on the energy
it would've drained, if you have Antimagic.
Also prevent them appearing too early in the dungeon.
Allow drain energy attacks (and anti-magic traps) drain more
than your level of energy.
Make eating magical monsters such as wizards and shamans give
the same tiny buzz bonus as eating a newt.
Add missing italics to several words in passage 1.
Add three new passages, bringing the total to 13.
The third one ended up being fairly long. I made note of it
intending just the bacon joke but when transcribing I backed up
quite a ways. The context is fairly unusual for a Discworld story.
Higher charisma will make it more likely for monsters to be affected.
Conflict will also now require the monster to see the hero.
Originally from SporkHack by Derek Ray.
Applying a novel to flip through its pages described them as having
"ink" rather than "magical ink" but that wasn't a very suitable way
to distinguish them from spellbooks since their ink never fades.
The Book of the Dead's pages "glowed faintly red" even when the
hero couldn't see them.
Fixes#513
level-drained below level 1. No "you die" or equivalent, just
straight to being life-saved or to "do you want your possessions
identifed?". Change it to issue "Goodbye level 1." The fact
that it is has been fatal will become obvious. An issue comment
on github pointed out where the fix was needed.
Fixes#511
When the fuzzer is running, don't allow a randomly generated M-X
keystroke to switch from debug mode to explore mode.
[Unintended side-effect of the combination of two earlier changes:
assigning M-X as default key for #exploremode and allowing someone
in debug mode to voluntarily downgrade to explore mode (which should
never impact normal play and makes some types of testing simpler).]
Fixes#512
Touch of death will now do 50 + 8d6 damage, and drain max HP for half
of that. If the drain is equal or greater than your max HP, then it
will kill you instantly.
Change originally from SporkHack by Derek Ray.
If monsters see you resist something, generally elemental or magical
attack, or if they see you reflect an attack, they learn that and
will adjust their attack accordingly.
Originally from SporkHack, but this version comes via EvilHack with
some minor changes.
Characters who start out knowing non-magic armor should not know
cornuthaum and dunce cap. (Which suggests that those probably
ought to be classified as magic.)
Take away knowledge of polearms from barbarians and valkyries.
Add knowledge of all bows/crossbows, arrows/bolts, and spears to
rangers.
Add knowledge of all daggers to rogues. (Very minor; non-elves
recognize elven daggers and non-orcs recognize orcish daggers.)
[From 14 months ago; I've got an old email for this but can't find
it in the bug list.]
Some things shouldn't hurt the hero when thrown upward and falling
back on head. I've been pretty conservative about what won't do
any harm.
Fix a couple of places that set obj->dknown to 0 to deal with some
special cases where it should be left at 1. (Other places do that
but deal with potions where hardcoded 0 remains appropriate.)
A recent change made it possible for a glob to have its dknown flag
cleared and that exposed globby_bill_fixup() passing Null shopkeeper
to get_cost(), triggering a crash.
Make the routine that clears dknown/known/bknown/&c also be the
routine used to initialize those flags for a new object so that it
is the place that handles various special cases. That hides the
shop bug again.
But also fix the shop bug even though it won't be triggered.
Fixes#509
Fix some bad code for "no saddle" caused by careless editing that
changed (uncomitted)
char *ns = 0;
if (foo)
ns = "foo";
else if (bar)
ns = "bar";
by splicing lines together and accidentally ended up with
char *ns;
ns = foo ? ns = "foo" : bar ? ns = "bar" : 0;
when
char *ns;
ns = foo ? "foo" : bar ? "bar" : 0;
was intended.
I'm a bit surprised that the intermediate form without any
parentheses around 'ns = "bar"' compiles at all. C99? I don't
think that it would have if it had been processed as C90 or pre-ANSI.
---
insight.c: In function ‘status_enlightenment’:
insight.c:937:28: warning: ‘ (’ directive writing 2 bytes into a region of size between 0 and 255 [-Wformat-overflow=]
937 | Sprintf(buf, "%s %s (%s)", ustick ? "holding" : "held by",
| ^~
In file included from ../include/config.h:631,
from ../include/hack.h:10,
from insight.c:15:
../include/global.h:274:24: note: ‘sprintf’ output 5 or more bytes (assuming 260) into a destination of size 256
274 | #define Sprintf (void) sprintf
insight.c:937:9: note: in expansion of macro ‘Sprintf’
937 | Sprintf(buf, "%s %s (%s)", ustick ? "holding" : "held by",
| ^~~~~~~
insight.c:918:29: warning: ‘%s’ directive writing up to 255 bytes into a region of size 252 [-Wformat-overflow=]
918 | Sprintf(buf, "%s by %s",
| ^~
919 | is_animal(u.ustuck->data) ? "swallowed" : "engulfed",
920 | heldmon);
| ~~~~~~~
In file included from ../include/config.h:631,
from ../include/hack.h:10,
from insight.c:15:
../include/global.h:274:24: note: ‘sprintf’ output 5 or more bytes (assuming 260) into a destination of size 256
274 | #define Sprintf (void) sprintf
insight.c:918:9: note: in expansion of macro ‘Sprintf’
918 | Sprintf(buf, "%s by %s",
| ^~~~~~~
---
zap.c:475:1: warning: old-style function definition [-Wold-style-definition]
475 | release_hold()
| ^~~~~~~~~~~~
Add page citations for first two passages and some missing italics
to the first one. Fix spelling of "fossil" in passage 8.
Add two short, new passages bringing total to 13.
Allow creating webs without spiders in the lua level scripts:
des.trap({ type = "web", spider_on_web = 0 });
Based on xNetHack commit by copperwater <aosdict@gmail.com>.
Also changes the Spider nest themed room to generate without
spiders when the level difficulty is 8 or less.
For the time being at least, take out "uninjured/barely wounded/
slightly wounded/wounded/heavily wounded/nearly dead" description
on monsters examined with ';' or '//' or '/m' and on final tombstone
and logfile entry if hero gets directly killed by a monster.
Maybe it will be revisited later....
Allow specifying "waiting" for monsters created via lua level scripts.
This sets the monster strategy to make it wait for the hero
to be in visual range before allowing the monster to move.
Also makes the monster inside the Mausoleum themed room use this feature,
to prevent out of depth liches bothering the player unprovoked.
For example:
des.monster({ class = "D", waiting = 1 });
when compressing or uncompressing a save file. Defining
VAR_PLAYGROUND forces PREFIXES_IN_USE to be defined, and the latter
causes docompress_file() to be called with save file name containing
a full path instead of just save/xyzzy.Z relative to the playground.
Depending on the value of VAR_PLAYGROUND, that could be too long for
the buffer used to make a copy of the name with ".Z"/".gz"/".bz2"
appended.
Probably only applies to Unix/linux/OSX configurations.
Fixes#507