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.
PatR [Sun, 2 Feb 2020 23:22:42 +0000 (15:22 -0800)]
muse looting
Give better feedback than "<Monster> rummages through something"
when hero sees a monster looting a container.
Have monster take out up to 4 items at a time instead of always 1.
(Hero can take out an arbitrary number in one move.)
When deciding what to try to take out, 'count' (now 'nitems') was
initialized to 1 instead of 0, giving the monster a 1 out of N+1
chance of not trying to take anything out. It wasn't clear whether
that was intentional (there's already a chance for not taking things
out when deciding whether to use the container). I kept that result
in and made it more explicit now.
When deciding whether the chosen item could be moved from container
to monster's inventory, the can_carry(item) check was counting the
weight of the item twice, once explicitly when considering adding it
to minvent but also implicitly as part of the carried container's
weight already in minvent.
PatR [Sun, 2 Feb 2020 08:55:26 +0000 (00:55 -0800)]
fix github issue #285 - spellcasting monster
After casting a spell, a monster got a chance to make a regular attack
despite the apparent attempt to set up a return value indicating that
it wouldn't move.
When looking over the return value situation, I noticed 'wormhitu()'
for the first time. It gives worms additional attacks when the hero
is adjacent to some of the tail, that only works if the head is within
reach of a melee attack. The hidden tail segment at head's location
always met that criterium so gave an extra attack that didn't make
sense; change wormhitu() to skip that segment.
Do some formatting in mcastu.c; no change in actual code there.
PatR [Sun, 2 Feb 2020 01:53:07 +0000 (17:53 -0800)]
failing level change messsage confusion
While testing the changes to dungeon and special level handling, I got
|A mysterious force prevents you from descending!
|You materialize on a different level!
The mystery force is handled by goto_level() so level_tele() doesn't
know that the failure is going to happen when it sets up the message
for deferred delivery. Suppress the message if you don't change levels.
PatR [Sun, 2 Feb 2020 01:33:50 +0000 (17:33 -0800)]
get_table_str use
Some cleanup when chasing a memory leak. get_table_str() and
get_table_str_opt() return a value from dupstr() and it wasn't always
being freed. I'm not sure that I found the problem--maybe it involved
pointers turned over to Lua garbage collection--but did find a couple
of suspicious things in dungeon setup.
PatR [Sat, 1 Feb 2020 16:59:19 +0000 (08:59 -0800)]
splitting cmd.c, phase I
Preparation for moving enlightenment and conduct into new source
file insight.c. Right now it's a stub that shouldn't break anything
whether included or omitted. Once makefiles and project files have
been updated to compile and link it, the actual code will be moved.
unix/Makefile.src has been updated;
vms/Makefile.src and vmsbuild.com have been updated but not tested.
PatR [Fri, 31 Jan 2020 21:36:22 +0000 (13:36 -0800)]
loadlua() simplification
nhl_loadlua() went from too simple to too complicated, now somewhere
in between. Still doesn't assume that an entire file can be scooped
up with a single fread(), but no longer mucks about with the contents
of the file in order to insert a comment containing the file's name.
In order to have useful filename feedback in Lua error messages, just
use a different liblua routine to feed the file's contents to it.
PatR [Fri, 31 Jan 2020 20:58:24 +0000 (12:58 -0800)]
fix 'Couldn't place lregion type 1' on Orc town
Stairs up from Orcish Town variation of Mine Town were being forced
to be near the bottom of the left side of the level due to a bogus
exclusion region in the level description. If that small area was all
solid rock then a warning was issued and no stairs up were created.
PatR [Fri, 31 Jan 2020 13:10:00 +0000 (05:10 -0800)]
royal jelly
Applying royal jelly listed all of inventory as likely candidates for
what to rub it on, including itself.
Applying it to anything took no time.
After the "you smear royal jelly on <foo>" message,
unsuccessfully applying it to non-eggs gave no other feedback;
successfully applying it to eggs gave no additional feedback.
Allow #rub to use royal jelly too.
Also, require hands to apply or #rub anything.
Not done: fumbling and/or slippery fingers should have a chance to
drop the jelly or to drop whatever gets rubbed with it.
Pasi Kallinen [Fri, 31 Jan 2020 08:39:37 +0000 (10:39 +0200)]
Allow applying royal jelly on an egg
Royal jelly applied on an egg will change a killer bee egg to
a queen bee egg. Cursed jelly will kill the egg, uncursed and blessed
will revive it. Blessed jelly will also make the creature think
you're the parent.
PatR [Fri, 31 Jan 2020 01:35:32 +0000 (17:35 -0800)]
more simplification of achievement tracking
Instead of hardcoding the "prize" type and then watching for that
to be created, specify it in the level description.
Also, instead of giving both Sokoban end levels 50:50 chance for
either prize, bias the one that used to always have the bag of
holding to now have 75% chance for that and 25% chance for amulet
of reflection, with the other one having those chances reversed.
So still 50:50 overall.
PatR [Wed, 29 Jan 2020 17:47:36 +0000 (09:47 -0800)]
new 'mention_decor' option
Somewhat similar to 'mention_walls', 'mention_decor' is a way to
request additional feedback when moving around the map. It reports
furniture or unusual terrain when you step on that. Normally stepping
on furniture only mentions it when it is covered by object(s). And
moving onto (rather than into) water or lava or ice doesn't bother
saying anything at all. With the new option set there will be a
message. It uses Norep so won't repeat when moving from one water
spot to another or one lava spot to another or one ice spot to another
unless there has been at least one intervening message. There is also
a one-shot message when moving from water or lava or ice onto ordinary
terrain (not Norep, just once since there's no land to land message).
Having the verbose flag Off doesn't inhibit these new messages but it
does shorten them: "A fountain." instead of "There is a fountain here."
The Guidebook gets a new subsection "Movement feedback" of the "Rooms
and corridors" section and it covers more than just 'mention_decor'.
As usual, Guidebook.tex is untested.
'mention_decor' persists across save/restore, so 'struct flags' has
changed and EDITLEVEL is being bumped, hence save files are invalided.
nhmall [Wed, 29 Jan 2020 14:15:55 +0000 (09:15 -0500)]
recover fix
recover had deviated somewhat from NetHack in its
file expectations:
1) A couple of 3.7 fields needed to be accommodated.
2) hard-coded file size values had deviated.
The file sizes are now in an added header file named "filesize.h",
which is included at the bottom of config.h.
There will likely be another commit to write the filename size ahead
of the file name so that the precise number of characters can be read,
but since that will break existing saves, it can go in along with another
save-breaking commit.
This commit doesn't not alter savefiles written by nethack so does not
require an editlevel bump. It does alter the read-in expectation in
recover to match the game and this get recover working again.
PatR [Tue, 28 Jan 2020 23:28:31 +0000 (15:28 -0800)]
level teleport "you materialize" mesg sequencing
If level teleport took you somewhere special, things like shop entry
or quest summons or valley atmosphere messages were being given first,
then "you materialize on a different level" after. schedule_goto()
takes before-change-message and after-change-message arguments; it
ought to be extended to have a mid-change-message one too but I didn't
think of that until just now.
PatR [Tue, 28 Jan 2020 23:01:41 +0000 (15:01 -0800)]
black and white ice
Like lava when that looks the same as water with color Off, render ice
in inverse video if it looks the same as the floor of a room. (I tried
bold first but the result didn't look very good.)
Done for tty and curses; others may want to follow suit.
PatR [Tue, 28 Jan 2020 20:49:38 +0000 (12:49 -0800)]
beauty no longer in eye of the beholder
There was a complaint that despite charisma of 13 being above average,
the character was described as "ugly". The cut-off was actually >14
for "beautiful" or "handsome" vs <=14 for "ugly". This adds several
more grades of appearance.
Ray Chason [Sun, 26 Jan 2020 00:02:18 +0000 (19:02 -0500)]
Add set_tile_type, stretch_tile and free_tile
set_tile_type frees tileset memory not in use for the current tile
type (paletted or full color).
stretch_tile and free_tile support resizing tiles at run time.