PatR [Wed, 19 Feb 2020 23:47:55 +0000 (15:47 -0800)]
Wounded_legs condition
Mounting a steed while legs are wounded would offer to cure them
but wasn't going through the heal_legs() routine so didn't update
the status line when Wounded_legs condition is enabled.
Move some common code for describing left/right/both legs into a
new routine used for feedback by jumping, kicking, and ridiing.
For ^X, distinguish between one wounded leg and both but don't
bother with left vs right when it is just one.
PatR [Tue, 18 Feb 2020 21:33:00 +0000 (13:33 -0800)]
monster sound changes
MS_MOO was placed among the humanoid sounds, resulting in a minotaur
being able to articulate "I'm hungry". Move it to the animal sounds,
which causes almost all the sounds to be renumbered.
Give MS_MOO to rothes.
Change mumak from MS_ROAR to new sound MS_TRUMPET and mastodon from
silent to that.
I changed MS_ORC from a synonym for MS_GRUNT into a distinct type
which also just grunts. Grunt is in the animal group of sounds and
orc is now in the 'other' group (neither animal nor understandable
humanoid). [There are a bunch of other humanoid monsters (gnomes and
ogres, for example) that still use MS_GRUNT. They aren't animals so
that's not right.]
Have pets who beg for food but happen to have 'other' sounds between
animal and humanoid be described as looking hungry instead of being
skipped.
Hat tipped to a peaceful humanoid will behave as non-peaceful if
Conflict is active (without giving the monster a resistance check).
Despite mons[].msound getting new values, save files should be ok.
PatR [Tue, 18 Feb 2020 11:14:22 +0000 (03:14 -0800)]
fix #K376 - tipping cap
Allow #tip to do something if you pick your worn helmet instead of
a container. It's mostly just a variation of #chat but probably adds
several new bugs....
Patric Mueller [Mon, 17 Feb 2020 09:27:38 +0000 (10:27 +0100)]
Stop monsters from interacting with protected items on the floor
This fixes the issue of chests with the wand of wishing on the castle level
being stolen by soldiers.
Commit b12ea03d1 revealed that searches_for_item() didn't check for onscary()
and allowed monsters to pick up items even though they were protected by a
scroll of scare monsters.
PatR [Sun, 16 Feb 2020 21:04:12 +0000 (13:04 -0800)]
controlling u.ustuck
Setting or clearing u.ustuck now requires that context.botl be set,
so make a new routine to take care of both instead of manipulating
that pointer directly.
Pasi Kallinen [Sun, 16 Feb 2020 19:46:45 +0000 (21:46 +0200)]
Fix symset menu
Symset entry index numbers weren't initialized when the symsets were
read from file, making the menu behave erratically. This looks like
a merge mistake.
PatR [Sun, 16 Feb 2020 01:44:41 +0000 (17:44 -0800)]
yet more Guidebook tweaks
A couple of indentation adjustments: a bit more space for continued
lines in the table for suits of armor, and restore the indentation of
the list of Achievements in the Postscript version (lost when dealing
with the wouldn't-span-page-boundary issue).
PatR [Sat, 15 Feb 2020 23:41:24 +0000 (15:41 -0800)]
new status conditions
Several conditions result in stale data on the status line when
starting or stopping because things which didn't used to affect it
haven't been setting context.botl to force an update. This wasn't
systematic; there are bound to be lots more.
PatR [Sat, 15 Feb 2020 22:42:00 +0000 (14:42 -0800)]
Guidebook.dat typo
A typo in Gbk-1pg-sfx.mn resulted in " /" as a "last word" on the
end-of-data marker line of the intermediate 12345 line single page.
That was effectively invisible because it immediately got deleted
during the post-processing which strips off that marker through to
the end (producing a 5266 line single page at present).
PatR [Sat, 15 Feb 2020 21:55:51 +0000 (13:55 -0800)]
fix github issue #293 - raven vs raven
The saying /corvus oculum corvi non eruit/ (Latin) means "a crow
doesn't pluck out the eye of another crow" (roughly). Something
along the lines of "like-minded people stick together". Honor the
literal meaning by preventing a raven's blinding attack that gets
directed at another raven from being able to cause blindness.
PatR [Sat, 15 Feb 2020 13:19:23 +0000 (05:19 -0800)]
Achievements documentation
> Todo: redo the recently revised Achievements table again. Current
> formatting isn't spanning page boundaries, resulting in a big chunk
> of blank space preceding it so that it will start on the next page.
The '.SD i' environment was causing this, and also changing the font
somehow when forcing the text to start on the next page (but not when
it fit on current page?). Taking '.SD i' out loses the indentation
that Guidebook.ps had (one of the explicit differences between it and
Guidebook.txt), which looks a little inferior, but fixes the page
boundary issue.
PatR [Sat, 15 Feb 2020 02:15:25 +0000 (18:15 -0800)]
Guidebook.dat, one-page edition of Guidebook.txt
Update sys/unix/Makefile.doc to be able to build Guidebook.dat, an
unpaginated copy of the plain text Guidebook. It's generated from
the 'roff source rather than by attempting to post-process the
regular text Guidebook.
PatR [Sat, 15 Feb 2020 00:24:49 +0000 (16:24 -0800)]
fix #K355 - grammar issues with monster+container
Mon rummages in <container> and Mon takes <item> from <container>
was missing an() for the container itself and should have been
using doname() rather than xname() for any items taken out (when
done adjacent to hero).
PatR [Fri, 14 Feb 2020 23:28:28 +0000 (15:28 -0800)]
Guidebook update
This adds a new figure that shows the 3-line status. Also expands
a couple of status items.
In the commands section, redo the hjkl direction diagram to make
"Figure 2" (now Figure 3) line up with the rest of the table. Lot's
of trial and error involved, and the plain text version didn't come
out as expected (but still looks better than before).
Modify suit of armor table to wrap an additional line and make the
table narrower. Having the pair of columns closer together is a bit
easier on eyes when tracking from the suit names to the AC number.
Todo: redo the recently revised Achievements table again. Current
formatting isn't spanning page boundaries, resulting in a big chunk
of blank space preceding it so that it will start on the next page.
(Only noticeable at the moment with the Postscript output; plain
text had enough room on its current page to not need to force next.)
nhmall [Thu, 13 Feb 2020 21:57:37 +0000 (16:57 -0500)]
Windows options dynamically
There are two executables int the windows binary, each of which
have different options and capabilities. Sharing of one dat/options
file hasn't really been an accurate approach.
Produce that information dynamically for the Windows exe files.
PatR [Thu, 13 Feb 2020 23:38:59 +0000 (15:38 -0800)]
unseen pet drowning
The "you have a sad feeling for a moment" message was only given when
one monster kills another (and the latter is an unseen pet). Give it
for drowning too. There are probably a bunch of other circumstances
which warrant it as well but I've settled for handling minliquid().
PatR [Thu, 13 Feb 2020 02:56:41 +0000 (18:56 -0800)]
plug a couple of memory leaks in sp_lev.c, take II
[...]
| Change selection_free(foo) to also free(foo) after freeing foo's
| fields. Every use was already
| selection_free(foo);
| free(foo);
| except for the two instances of memory leak.
And except for the three which aren't in sp_lev.c, one of which was
dealing with memory managed by Lua. This time it seems to be working
as intended.
PatR [Wed, 12 Feb 2020 22:35:37 +0000 (14:35 -0800)]
add some new, easier achievements
Introduce eight achievements that can be attained by more players.
Entered Gnomish Mines - self explanatory
Entered Mine Town - the town portion, not just the level
Entered a shop - any tended shop on any level
Entered a temple - likewise for temple
Consulted the Oracle - bought at least one major or minor oracle
Read a Discworld Novel - read at least one passage
Entered Sokoban - like mines
Entered the Big Room - not always possible since not always present
The novel and bigroom ones aren't always achieveable since novels are
only guaranteed if a book or scroll shop gets created and bigroom is
only guaranteed in wizard mode. No one ever claimed that every
possible achievement can be attained in a single game. (If one for
entering the Fort Ludios level--or perhaps entering the Fort itself--
eventually gets add, that won't be possible in every game either.)
The mine town one probably needs some tweaking. Two of the town's
seven variants have no town boundary (despite a rectangular area of
pre-defined map) and at present simply arriving on either of those
levels is enough to be credited with the entered-town achievement.
Bump EDITLEVEL because u.uachieved[] has increased in size. This
time it has been expanded to the maximum that xlogfile's bitmask of
achievements can handle, enough for up to 9 more achievements without
another EDITLEVEL increment.
PatR [Wed, 12 Feb 2020 19:43:25 +0000 (11:43 -0800)]
Guidebook.mn streamlining
Set up variable 'fF' once and use it to conditionalize between
fixed-width font Guidebook.txt and proportional-width font
Guidebook.ps instead of making the width comparison of 'f' and 'F'
each time. There are four instances where it is used; three that
suppress some indentation for the plain text output and one that
manually wraps a couple of long lines for it.
This change shouldn't produce different output from before (last
night) and doesn't need any corresponding change in Guidebook.tex.
PatR [Wed, 12 Feb 2020 10:35:35 +0000 (02:35 -0800)]
Guidebook update: Achievements
Redo the Achievements section in Guidebook.mn to be more compact.
It's also become more complicated because it formats Guidebook.txt
differently from Guidebook.ps/.pdf.
Finally add the Achievements section to Guidebook.tex to catch up.
Not as complicated but also not tested.
PatR [Wed, 12 Feb 2020 01:21:39 +0000 (17:21 -0800)]
Guidebook update: armor and other objects
Condense the clunky one entry per line table of suits of armor and
their AC values in Guidebook.mn. Guidebook.tex uses a two-column table
that I've left alone.
Mention all the other types of armor instead of leaving out gloves and
shirts. For armor commands, mention that P and R work.
Rings: describe their interaction with gloves. For ring commands,
include a pointer to amulets.
Amulets: for amulet commands, mention that A, W, and T work.
Tools: mention that some can be worn and include a pointer to amulets
for the relevant commands. Also, that some can be wielded as weapons.
Boulders and statues: boulders can be pushed and smashed, statues can
be smashed.
Gold: not subject to blessing or cursing. goldX option affects BUCX
filtering.
PatR [Mon, 10 Feb 2020 22:23:47 +0000 (14:23 -0800)]
plug a couple of memory leaks in sp_lev.c
selection_floodfill() would free the contents of its temporary
selection structure when the check function was Null but neglected
to free the allocated structure itself. I don't know whether that
was ever triggered.
generate_way_out_method() did likewise when trying to make a hole
or trapdoor. It reused the 'ov3' pointer without freeing it first.
'heaputil' reported instances of non-freed memory that were
allocated at line 3612 by selection_clone(), only called within
generate_way_out_method().
Change selection_free(foo) to also free(foo) after freeing foo's
fields. Every use was already
selection_free(foo);
free(foo);
except for the two instances of memory leak.
PatR [Mon, 10 Feb 2020 19:21:44 +0000 (11:21 -0800)]
simplify Achievements display
The you-acquired-the-Amulet achievement uses alternate wording when
you were carrying it but just gave it up via #offer to ascend. That
wording looks much better when displayed right before "You ascended!",
without entered-endgame and entered-astral (and maybe always-blind or
never-wore-armor) achievements in between. That was and still is done
by taking it away. Adding it back in the desired spot is simpler than
leaving it out while tracking whether it was removed.
Effectively, ACH_UWIN (ascension) is forced to be very last--where it
will always be anyway, but at one point the blind and nudist ones came
after it--and ACH_AMUL (you obtained the Amulet) is sorted to right
before that. For non-ascending games, the Amulet achievement is left
in the position where it was attained.
PatR [Mon, 10 Feb 2020 08:17:54 +0000 (00:17 -0800)]
redo achievement tracking
Instead of an assortment of bits, assign numeric indices to the
potential achievements and keep an array of those in the order they
were attained. So disclosure might show the same subset occurring
differently in different games depending on the player's actions.
The encoded field in xlogfile doesn't care about that and remains
the same.
Modifies 'struct u', so EDITLEVEL has been incremented and existing
save files are invalidated.
PatR [Mon, 10 Feb 2020 00:56:23 +0000 (16:56 -0800)]
Achievements doc bit
Confusion on my part. "Entered Gehennom" achievement is recorded if
you enter the Valley of the Dead rather than requiring that you get
past that level.
The original incorrectly stated 'CONDITION_SIZE' (which
doesn't exist) instead of CONDITION_COUNT in one of the
paragraphs.
--- snip ---
eliminate the uses of the manually maintained BL_MASK_BITS
Use CONDITION_COUNT which does not require manual updating.
Also attempts to adjust win32 graphics window port for
the new fields.
That port has its own field names and should be adjusted
to using the following which are declared extern in
include/botl.h.
struct conditions[CONDITION_COUNT];
int cond_idx[CONDITION_COUNT];
The former contains the fields that were port-specifically
added to the win32 graphical port and more, plus it is
centrally maintained and currently utilized by tty and curses.
The cond_idx[] array contains the ranked ordering of the
condition fields from highest ranking to lowest. Instead
of indexing like this:
int i;
for (i = 0; i < CONDITION_COUNT; ++i) {
...conditons[i].enabled;
...condtions[i].text[0];
}
you can use the ranked ordering like this:
int i, ci;
for (i = 0; i < CONDITION_COUNT; ++i) {
ci = cond_idx[i];
...conditons[ci].enabled;
...condtions[ci].text[0];
}
nhmall [Sun, 9 Feb 2020 01:40:38 +0000 (20:40 -0500)]
eliminate the uses of the manually maintained BL_MASK_BITS
Use CONDITION_SIZE which does not require manual updating.
Also attempts to adjust win32 graphics window port for
the new fields.
That port has its own field names and should be adjusted
to using the following which are declared extern in
include/botl.h.
struct conditions[CONDITION_COUNT];
int cond_idx[CONDITION_COUNT];
The former contains the fields that were port-specifically
added to the win32 graphical port and more, plus it is
centrally maintained and currently utilized by tty and curses.
The cond_idx[] array contains the ranked ordering of the
condition fields from highest ranking to lowest. Instead
of indexing like this:
int i;
for (i = 0; i < CONDITION_COUNT; ++i) {
...conditons[i].enabled;
...condtions[i].text[0];
}
you can use the ranked ordering like this:
int i, ci;
for (i = 0; i < CONDITION_COUNT; ++i) {
ci = cond_idx[i];
...conditons[ci].enabled;
...condtions[ci].text[0];
}
PatR [Sun, 9 Feb 2020 01:15:18 +0000 (17:15 -0800)]
more level teleport feedback
Level teleporting to current level doesn't give any feedback but
is usually done intentionally to abort the level teleport. Being
on the bottom level of branch and attempting to teleport even lower
failed silently like choosing the current level. Have it give some
feedback about not being able to go any lower.
PatR [Sun, 9 Feb 2020 00:05:29 +0000 (16:05 -0800)]
new data.base quote: win/winner/winning
A quote about "winning team" doesn't fit nethack very well but this
is too good to pass up. I considered adding "/Rule Six/" as a false
rumor, but the rumors don't offer any way to specify attribution.
Also, give full attribution for another Douglas Adams quote that's
used for a random ungraving.
Pasi Kallinen [Sat, 8 Feb 2020 15:00:03 +0000 (17:00 +0200)]
Fix digging through iron bars from adjacent pit
It was possible to create a pit on top of iron bars, by first creating
a pit next to the bars, going down into the pit, and then digging sideways
towards the bars. This did not destroy the iron bars.
nhmall [Sat, 8 Feb 2020 06:03:25 +0000 (01:03 -0500)]
expand the pool of status condition fields
Most of the additional ones are "opt-in" meaning that unless you add them
to your config file to enable them, they won't show up.
Two that aren't "opt-in", but can be "opted-out" (as can they all) are
cond_grab (for an eel grabbing you and drowing being imminent) and
cond_lava which leads to a fatality.
All the ones that already existed are "opt-out" options, meaning that
they will still show if you do nothing.
Here's the complete list of status conditions following this patch:
config option internal default mask id mask text1 tex2 text3
"cond_barehanded" bl_bareh opt_in BL_MASK_BAREH 0x00000001L Bare Bar Bh
"cond_blind" bl_blind opt_out BL_MASK_BLIND 0x00000002L Blind Blnd Bl
"cond_busy" bl_busy opt_in BL_MASK_BUSY 0x00000004L Busy Bsy By
"cond_conf" bl_conf opt_out BL_MASK_CONF 0x00000008L Conf Cnf Cf
"cond_deaf" bl_deaf opt_out BL_MASK_DEAF 0x00000010L Deaf Def Df
"cond_iron" bl_elf_iron opt_out BL_MASK_ELF_IRON 0x00000020L Iron Irn Fe
"cond_fly" bl_fly opt_out BL_MASK_FLY 0x00000040L Fly Fly Fl
"cond_foodPois" bl_foodpois opt_out BL_MASK_FOODPOIS 0x00000080L FoodPois Fpois Poi
"cond_glowhands" bl_glowhands opt_in BL_MASK_GLOWHANDS 0x00000100L Glow Glo Gl
"cond_grab" bl_grab opt_out BL_MASK_GRAB 0x00000200L Grab Grb Gr
"cond_hallu" bl_hallu opt_out BL_MASK_HALLU 0x00000400L Hallu Hal Hl
"cond_held" bl_held opt_in BL_MASK_HELD 0x00000800L Held Hld Hd
"cond_ice" bl_icy opt_in BL_MASK_ICY 0x00001000L Icy Icy Ic
"cond_lava" bl_inlava opt_out BL_MASK_INLAVA 0x00002000L Lava Lav La
"cond_lev" bl_lev opt_out BL_MASK_LEV 0x00004000L Lev Lev Lv
"cond_paralyze" bl_parlyz opt_in BL_MASK_PARLYZ 0x00008000L Parlyz Para Par
"cond_ride" bl_ride opt_out BL_MASK_RIDE 0x00010000L Ride Rid Rd
"cond_sleep" bl_sleeping opt_in BL_MASK_SLEEPING 0x00020000L Zzz Zzz Zz
"cond_slime" bl_slime opt_out BL_MASK_SLIME 0x00040000L Slime Slim Slm
"cond_slip" bl_slippery opt_in BL_MASK_SLIPPERY 0x00080000L Slip Sli Sl
"cond_stone" bl_stone opt_out BL_MASK_STONE 0x00100000L Stone Ston Sto
"cond_strngl" bl_strngl opt_out BL_MASK_STRNGL 0x00200000L Strngl Stngl Str
"cond_stun" bl_stun opt_out BL_MASK_STUN 0x00400000L Stun Stun St
"cond_submerged" bl_submerged opt_in BL_MASK_SUBMERGED 0x00800000L Sub Sub Sw
"cond_termIll" bl_termill opt_out BL_MASK_TERMILL 0x01000000L TermIll Ill Ill
"cond_tethered" bl_tethered opt_in BL_MASK_TETHERED 0x02000000L Teth Tth Te
"cond_trap" bl_trapped opt_in BL_MASK_TRAPPED 0x04000000L Trap Trp Tr
"cond_unconscious" bl_unconsc opt_in BL_MASK_UNCONSC 0x08000000L Out Out KO
"cond_woundedl" bl_woundedl opt_in BL_MASK_WOUNDEDL 0x10000000L Legs Leg Lg
nhmall [Sat, 8 Feb 2020 05:48:03 +0000 (00:48 -0500)]
make a distinction between rock and unexplored area
This adds a pair of new glyphs: GLYPH_UNEXPLORED and GLYPH_NOTHING
GLYPH_UNEXPLORED is meant to be the glyph for areas of the map that
haven't been explored yet.
GLYPH_NOTHING is a glyph that represents that which cannot be seen,
for instance the dark part of a room when the dark_room option is
not set. Since the symbol for stone can now be overridden to
a players choice, it no longer made sense using S_stone for the
dark areas of the room with dark_room off. This allows the same
intended result even if S_stone symbol is mapped to something visible.
GLYPH_UNEXPLORED is what areas of the map get initialized to now
instead of STONE.
This adds a pair of new symbols: S_unexplored and S_nothing.
S_nothing is meant to be left as an unseen character (space) in
order to achieve the intended effect on the display.
S_unexplored is the symbol that is mapped to GLYPH_UNEXPLORED, and
is a distinct symbol from S_stone, even if they are set to the same
character. They don't have to be set to the same character.
Hopefully there are minimal bugs, but it is a deviation from a
fairly long-standing approach so there could be some unintended
glitches that will need repair.
PatR [Fri, 7 Feb 2020 01:42:15 +0000 (17:42 -0800)]
populate insight.c
Move enlightenment and conduct from cmd.c to insight.c. Also move
vanquished monsters plus genocided and/or extinct monsters from end.c
to there. And move the one-line stethoscope/probing feedback for
self and for monsters from priest.c to there.
Achievement feedback has been overhauled a bit. When no achievements
have been recorded, the header for them (after conducts) won't be
shown, and when at least one has been recorded, make the prompt for
asking whether to disclose conduct be about disclosing conduct and
achievements. Also, describe achievements in the Guidebook.
I ran out of gas before updating Guidebook.tex; it will catch up to
Guidebook.mn eventually.
Some of the MS-DOS Makefiles haven't been updated yet so linking
without insight.{o,obj} will break there.
Those tests were only checking the permonst mflags2 field
so anytime those tests were used in the code, they came
up false for things like an elven ranger. An elven ranger
should return true for an is_elf() test, as an example.
That happens because the profession monsters in monst.c
are defined with M2_HUMAN.
This augments those is_*() race tests to also check for a
matching player race as well.