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.
Ray Chason [Sat, 25 Jan 2020 18:49:26 +0000 (13:49 -0500)]
Call the window function directly if supported
Some BIOSes allow calling the window function directly, bypassing the
logic that distinguishes this call from other BIOS calls. Should be
faster on some systems.
Ray Chason [Sat, 25 Jan 2020 18:38:02 +0000 (13:38 -0500)]
Use 8 bit mode if available
This was not previously done because the palette was not correctly set
up, and QEMU gave incorrect colors. The palette setup function now
falls back to the standard BIOS function if the VESA BIOS function
fails, which resolves the issue with QEMU. The mode selection logic now
favors 8 bit color if the tile set is compatible.
Using 8 bit mode means fewer writes to memory and fewer uses of the
BIOS window function.
PatR [Sun, 26 Jan 2020 20:23:50 +0000 (12:23 -0800)]
more wizard mode wishing for terrain
Try a lot harder to keep terrain/level flags in a sane state. They're
overloaded so it's not simple.
Creating a fountain or sink incremented the corresponding counter (for
controlling ambient sounds) but removing one by wishing for something
else in its place didn't decrement.
Allow wish for "disturbed grave" to create a grave with the 'disturbed'
flag set, similar to existing "magic fountain" and 'blessedftn' flag.
(I didn't add "looted throne", "looted tree", and several other things
that use the 'looted' overload of 'rm.flags'.)
Automate block_point (tree, cloud, secret corridor, or secret door in
open doorway) and add unblock_point (use Pass_wall to move into wall
or tree or stone, or just walk onto a cloud, then make iron bars or
almost any other wishable terrain to replace the blocking feature).
PatR [Sun, 26 Jan 2020 12:57:13 +0000 (04:57 -0800)]
limit rate of long worm growth
Make long worms grow more slowly (although that didn't seem to make
as much a difference as expected) and limit the amount of HP they
acculate if they shrink and then re-expand. Shrinking doesn't take
away max HP but growing used to always add to max. Now it won't add
to max HP unless the number of segments is at that worm's peak, so
shrinking will inhibit the exhorbitant HP expansion that idle worms
have had.
PatR [Sat, 25 Jan 2020 22:12:10 +0000 (14:12 -0800)]
worm.c cleanup
Mostly removing 'register', but also clear stale wgrowtime[] values
at the time they become obsolete instead of waiting for initworm()
to replace them when eventually re-used.
PatR [Sat, 25 Jan 2020 01:00:49 +0000 (17:00 -0800)]
disclose achievements
When disclosing conduct at end of game (but not during except in
wizard mode), display achievements too. They're also included in
dumplog if it's enabled. Previously they were only output as an
extra field in xlogfile.
PatR [Fri, 24 Jan 2020 21:54:23 +0000 (13:54 -0800)]
simplify achievement tracking for special objects
This turned out to be a lot more work than I anticipated, but it is
definitely simpler (other than having #wizmakemap take achievements
away if you replace the level that contains the 'prize', which wasn't
handled before).
I cheated and made Mine's End into a no-bones level because the new
flagging scheme for luckstone, bag, and amulet can't carry over from
one game to another. It probably should have been no-bones all along.
Sokoban didn't have this issue because it's already no-bones.
PatR [Fri, 24 Jan 2020 21:26:01 +0000 (13:26 -0800)]
loading Lua scripts
When loading a Lua script, modify it with a comment containing the
file name (or DLB module name) so that error reporting doesn't just
show the first 60 bytes of the script. Also, don't assume that it's
possible to load an entire script in one fread(). Unfortunately
that got way out of hand and the result isn't pretty. But something
of the sort is necessary. (Reading the script into one string first
and then applying modifications while copying it into a second one
would probably be a lot cleaner than mixing the two operations.)
If a script starts with a comment or a blank line, the insertion of
the file name comment won't disturb the line number reported in an
error message. But if the script starts out with code on its first
line, error reports will be off by one for the line number. Showing
the file name is more useful than keeping that number accurate.
PatR [Fri, 24 Jan 2020 20:52:35 +0000 (12:52 -0800)]
Lua error reporting buffer overflow
nhl_error() was clobbering the stack. I assume that the 'source'
field in the Lua debugging structure is normally a file name, but
nethack loads an entire Lua script into one long string because it
usually comes out of the DLB container, and 'source' contained the
full string. That would overflow the local buffer in nhl_error()
if nethack encountered a Lua problem and tried to report it. (In
my case, the problem was in a level description file modification.)
[Not something under user control unless user can modify dat/*.lua
and put the result into $HACKDIR/nhdat.]
PatR [Wed, 22 Jan 2020 02:29:23 +0000 (18:29 -0800)]
wizard mode un-polymorph
When already polymorphed, polymorphing into 'human' (or character's
species) to revert to normal when at low level has the infuriating
tendency to yield "your new form isn't healthy enough to survive".
Allow specifying your own role as a way to rehumanize() instead of
going through newman() and level/sex/characteristics randomization
which that performs.
PatR [Wed, 22 Jan 2020 01:03:54 +0000 (17:03 -0800)]
half poison gas damage from wearing a wet towel
Make wearing a wet towel confer new attribute Half_gas_damage in
addition to the usual blindness. It reduces damage from being inside
a gas cloud region and from being hit by poison gas breath attack.
It also fully blocks breathing of potion vapors.
Might make the Plane of Fire easier although overcoming its blindness
with telepathy won't reveal elementals. Definitely has the potential
to make blind-from-birth conduct easier which wasn't the intent and
probably isn't significant.
PatR [Tue, 21 Jan 2020 23:36:33 +0000 (15:36 -0800)]
no more headless eyewear
Noticed while working on something else: hero kept wearing a towel
after polymorphing into a form without any head. And when not already
wearing one, could put on a blindfold/towel/lenses while in a headless
form.
PatR [Tue, 21 Jan 2020 23:11:59 +0000 (15:11 -0800)]
wielded tin opener
For simplified weapon description (used by ^X and a few other places),
show "tin opener" instead of generic "tool" for that item since there
are cases where it is expected to be wielded.
Also, don't describe a wielded "glob of <foo>" as "food".