Sean Hunt [Fri, 3 Apr 2015 18:07:53 +0000 (14:07 -0400)]
Implement a new system-based matching harness.
The intent is to look for platform-specific facilities for regex
matching, to provide portable MENUCOLORS configuration files.
This is a prototype implementation being committed to see if Windows can
use the POSIX regex implementation provided with the C++11 standard
library. If this works, I will write a harness for POSIX regexes and for
pmatch(), and those can be linked in by platforms as appropriate.
pmatch() should be used only as a very last resort, because it breaks
compatibility between platforms.
Add pmatchi() to perform case-insensitive wildcard matching, and
pmatchz() which is also case-insensitive and ignores spaces, dashes,
and underscores like the type of matching done during wish parsing.
At the moment, neither is being used, although DEBUGFILES handling
uses pmatch and needs to be taught to distinguish between case-
sensitive and case-insensitive filenames so will eventually use
pmatchi when appropriate.
From a bug report two years ago, mithril armor should have color
HI_SILVER rather than HI_METAL. Tolkien describes mithril as "like
silver which never tarnishes". (The bug report had a more precise
quote, and a github URL for a patch which I've ignored.) The Amulet
of Yendor has material set to MITHRIL but I haven't changed its color.
All amulets are HI_METAL, so if any modification is needed for it,
change the material rather than the color.
Mithril-coats are displayed as cyan both before and after this patch,
so it's hard to tell whether any change actually happened.
The previous USE_OLDARGS worked with gcc on Intel, but was inherently
unsafe. This method is completely safe, just obnoxiously intrusive.
It you disliked debugpline*(), you're bound to hate this....
Sean Hunt [Thu, 9 Apr 2015 17:26:43 +0000 (13:26 -0400)]
Make WALLIFIED_MAZE into a level flag.
It should now be randomly disabled for a 3rd of Gehennom, to make things
a tad more interesting there. It's also disabled in Baalzebub's lair,
to make things a little more interesting.
Pasi Kallinen [Thu, 9 Apr 2015 14:53:40 +0000 (17:53 +0300)]
Add sortloot -patch
Adds the "sortloot" compound option, with possible values
of "none", "loot", or "full". It controls the sorting of
item pickup lists for inventory and looting.
Remove the requirement for <stdarg.h> that was introduced to lev_comp.
USE_STDARG still works. USE_OLDARGS required hackery but has been
tested and actually works, although I wouldn't trust it on platforms
where 'long' and 'char *' aren't the same size. USE_VARARGS didn't
require any hackery--aside from the conversion to core's pline code--
but has not been tested: <varargs.h> supplied with OSX won't compile,
with an #error directive that basically says "switch to <stdarg.h>".
I changed several printf formats of %i and %li to %d and %ld because
I'm not sure how widespread the 'i' variant was back in days of yore.
[TODO: avoid use of snprintf since pre-ANSI systems won't have it.]
DEBUGFILES set to "wintty.c" reported a bad cursor positioning attempt
at the end of the RIP tombstone, and when set to "questpgr.c wintty.c"
reported a whole bunch right at the start of the game when enumerating
all the quest messages for the chosen role. Both were triggered by
this x==0 call to tty_curs() near the end of process_text_window().
if (i == cw->maxrow) {
if(cw->type == NHW_TEXT){
tty_curs(BASE_WINDOW, 0, (int)ttyDisplay->cury+1);
cl_eos();
}
...
The x value is always decremented in tty_curs, so passing in 0 yields
a bad value of -1. The bad call returns without doing anything, and
when DEBUG is disabled, it does so silently.
No fixes entry; it was caused by a post-3.4.3 fix for something else.
In order to get level file locking correctly again post 3.4.3
with the newer compilers for windows, I had to funnel close()
calls to an intercepting routine.
I had two choices:
1. Surround every close() in at least 9 source files with messy:
#ifdef WIN32
nhclose(fd);
#else
close(fd);
#endif
OR
2. Replace every close() with nhclose() and
deal with the special code in the nhclose()
version for windows, while just calling
close() for other platforms (in files.c).
It is also possible, although not done in this commit,
to
#define nhclose(fd) close(fd)
in a header file for non-windows, rather than funnel
though a real nhclose() function in files.c.
Derek S. Ray [Sun, 5 Apr 2015 22:04:22 +0000 (18:04 -0400)]
several fixes for farming changes
* don't let player wish for multiple globs
* use newsym() to clean up merged globs on floor
* food effects should match original corpse effects
* tidy up remaining crash when merging in place
Pasi Kallinen [Sun, 5 Apr 2015 09:17:57 +0000 (12:17 +0300)]
Add poison cloud glyph, fumaroles to fire plane.
When a gas cloud that deals damage is created, it uses
a poison cloud glyph instead of the cloud glyph.
(A bright green '#', or a bright-green recolor of the
cloud tile)
The plane of fire has random "stinking clouds", or
fumaroles, centered on lava pools.
Also make poison cloud glyph override lava, pool and
moat glyphs.
Changes to be committed:
modified: src/shknam.c
modified: src/trap.c
modified: src/zap.c
While polymorph was clearing the name because poly_obj
actually creates a brand new obj and copies field values
over, water_damage does not so the name persisted on
the blank spellbook. In this case, that isn't really
appropriate. Clear the name.
Ensure that cancellation has no effect on these
ordinary books.
Make the second-hand bookstore an option for holding
the book tribute item too.
update book tribute
Changes to be committed:
modified: doc/fixes35.0
modified: include/extern.h
modified: src/do_name.c
modified: src/objnam.c
This pretty much completes the code portion of the book tribute.
- The book will appear in the rare books shop.
- When you read the book, a random passage is drawn for a
tribute file (suggested by Mike).
- The book cannot be renamed because it already has a
name (observed/suggested by Sean).
The data file (dat/tribute) has a few test passages, but needs to be
filled out. Sean and Mike Stephenson have indicated that
possibly they may be able to help contribute to that. Ideally,
there should be at least one passage from each of the books.
Derek S. Ray [Fri, 3 Apr 2015 17:03:55 +0000 (13:03 -0400)]
clean up handling, roll everything into merged()
it should be possible to wish for globs now; also hero's
inventory, containers, ground, monster inventories will all
honor the globbiness.
basically, any way you bring two globs together (adjacent on floor,
same inventory, same bag) should cause them to merge, combining
weight and nutrition as appropriate.
20 seems low-ish on nutrition for a pudding (kelp fronds are 30!)
at first glance but this is easy enough to fix later; don't really
want players to be able to stock up on food _this_ way and accidentally
obsolete all the other food-generation methods.