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".
PatR [Thu, 16 Jan 2020 13:22:18 +0000 (05:22 -0800)]
command line triggered buffer overruns
Prevent extremely long command line arguments from overflowing local
buffers in raw_printf or config_error_add. The increased buffer
sizes they recently got to deal with long configuration file values
aren't sufficient to handle command line induced overflows.
choose_windows(core): copy and truncate the window_type argument in
case it gets passed to config_error_add().
process_options(unix): report bad values with "%.60s" so that vsprintf
will implicitly truncate when formatted by raw_printf().
nhmall [Mon, 20 Jan 2020 16:10:16 +0000 (11:10 -0500)]
travis-ci bits: try to avoid failure-flagging on transient connectivity issues
Attempt to test whether Lua fetch succeeded (and pdcurses for windows
and msdos as well)
If those prerequisite fetches and untars didn't work, just exit without
marking the travis-ci build as a failure so that the development team
isn't notified about something transient that they don't need to fix
in the code.
Pasi Kallinen [Wed, 15 Jan 2020 18:17:02 +0000 (20:17 +0200)]
Fix warning on nonexistent quest.lua text
Cavemen don't have goal_alt message - before lua, that one
fell through into goal_next message, but now it tried to
load the "common" message. Add ability to define message fallbacks,
and make goal_next the fallback for goal_alt.
PatR [Sun, 19 Jan 2020 02:47:01 +0000 (18:47 -0800)]
losing via #offer to Moloch
Recently added "you hear an invisible choir chant in Latin ..." is
jarring. Unfortunately, something like "in an archaic language" would
make the message too long so just take out "in Latin".
PatR [Fri, 17 Jan 2020 12:03:14 +0000 (04:03 -0800)]
implicit_uncursed, mention_walls
Move 'implicit_uncursed' and 'mention_walls' from iflags to flags to
make their current setting persist across save/restore. Invalidates
existing save files.
PatR [Fri, 17 Jan 2020 10:43:32 +0000 (02:43 -0800)]
fix #K188 - trying to move past edge of level
Trying to move into a wall or solid rock fails and doesn't do anything
(unless the 'mention_walls' option is On) and doesn't use a turn, and
trying to move off the edge of the map window also doesn't do anything
(except for 'mention_walls') but that did use a turn. Don't.
Pasi Kallinen [Fri, 20 Dec 2019 13:16:12 +0000 (15:16 +0200)]
Prevent accessing outside the mons array
Fix another out-of-bounds error
Monster trying to decide if a tin could cure stoning looking at
a special or empty tin would do acidic(&mons[-1])