Commit Graph

89 Commits

Author SHA1 Message Date
keni
6120c3dd0b can we commit across directories? src/detect.c and util/makedefs.c 2011-12-29 23:29:43 +00:00
keni
4e5e720334 display version and build info at startup (trunk only)
Tested on the unix port; I've updated as many other ports as I can figure
out but they're not tested.  See window.doc for info on the changed banner
lines.  Also adds the ability to override the generic "Unix" port - used now to get
"MacOSX" into the version line instead of "Unix" (so we don't scare people who don't
know what's going on).
2011-10-11 02:37:31 +00:00
nethack.rankin
cd8eefb622 more makedefs dat/options (trunk only)
More dat/options:  include "and" in front of the final entry in
the comma separated lists of options and windowing systems.  For the
multi-line options list, fill the paragraph better by splitting lines at
individual words within options rather than at whole option strings.

     Also, tweak yesterday's check for DEFAULT_WINDOW_SYS being undefined
so that it actually works as intended.
2011-09-23 23:20:36 +00:00
nethack.rankin
795c0a3a8d 'makedefs' handling for DEFAULT_WINDOW_SYS (trunk only)
Change the windowing system section of generated file dat/options
to omit "with a default of <foo>" when it has listed just one enabled
windowing system.

     This also adds checks to make sure DEFAULT_WINDOW_SYS is defined,
at least one xxx_GRAPHICS option is enabled, and that the default matches
[one of] the enabled xxx_GRAPHICS.
2011-09-23 02:05:43 +00:00
keni
e04caf9a27 makedefs manpage, conditionals, and related bits
Add a man page for makedefs so mdgrep is documented better.
Add missing INSURANCE to mdgrep.h. (yes, LIFE leaks in as well)
Add makefile bits to build makedefs.txt.
Pass dungeon.def through mdgrep internally to makedefs - this will make
it possible to commit the LIFE patch and have config.h actually turn it
all the way off (by skipping bigrm-6).
2010-05-01 20:57:17 +00:00
keni
5c0a627ce2 makedefs internal version formatter
Add -svs so the Makefile can get "343" or "3.4.3" (etc) when automating
package builds.
2009-12-17 19:46:42 +00:00
keni
4036a6727c Add RCS version lines 2009-05-06 10:55:43 +00:00
keni
8593cf6547 Add recordfile control to SYSCF.
Add sys/unix/sysconf, a sample sysconf file.
Move defines from topten.c to config.h so they can be seen globally.
Add persmax, pers_is_uid, entrymax, and pointsmin to struct sysopt, use
 in topten.c, populate in files.c
Warning cleanup in files.c.
BUGFIX: don't crash in unixmain.c if WIZARDS left unspecified.
hints/macosx10.5: don't hardcode "keni"; install sample sysconf; install
 sample ~/nethackrc
makedefs: add "system configuration" to compiled-with options list.
BUGFIX: if a game doesn't meet the criteria for making the record file it's
 shown to the user as having zero points because t1->points is set to zero
 to indicate that it doesn't get written back; display u.urexp instead.
2009-05-03 14:08:15 +00:00
nethack.rankin
a86187b398 summary text for block messages (trunk only)
[Make use of recent message history changes.]

     Add support to makedefs and the core for including a line of summary
text with quest messages that don't use pline() delivery.  The multi-line
record structure of quest.txt begins each entry with %C and ends with %E.
makedefs now examines the %E lines looking for "[anything]" and adds that
to quest.dat where deliver_by_window() can find it.  The square brackets
are required in the input and intentionally carried along to the output.
putmsghistory() is used to put the summary text into the message history
buffer for use by ^P, without being displayed first.  (So this is a no-op
for interfaces which haven't implemented putmsghistory yet.  Maybe
genl_putmsghistory() should pass such text to pline() as a quick hack?)

     This adds a few summary lines to quest.txt so that the feature can
be tested.  Most of them were written by <Someone> nearly three years
ago.  I'm planning to add a couple of new control codes that'll allow some
of them to expand into shorter text.  (The one where the Archeologist
leader tells you that the nemesis stole the artifact so your mission is
to find the goal level, defeat the nemesis, and return with the artifact
ends up being roughly 160 characters long.)
2009-04-06 02:50:41 +00:00
keni
bb43b56eac first conditionalized docs (TRUNK ONLY)
plus various related missing bits and tids
2008-06-26 15:08:54 +00:00
keni
ff14fa7120 regenerate mdgrep.h (TRUNK ONLY)
now that this should have the right version numbers in it, save the new file
2008-06-25 19:04:38 +00:00
keni
bf3501d9d2 mdgrep.pl tids (TRUNK ONLY)
aka "try again before the wireless drains my laptop battery"
2008-06-25 19:02:38 +00:00
keni
41479c040a makedefs --grep prep, misc cleanup (TRUNK ONLY)
use makedefs --grep in Makefile.doc
call make clean in doc from make clean in top
add commented out rule to produce mdgrep.h from mdgrep.pl
macosx1.5: don't chown/chgrp for single-user install
unixmain.c: work around C90 warning for Mac-specific code, fix last fix
makedefs.c: temporarily disallow blank after control introducer until docs
 catch up
mdgrep.pl: add ALLDOCS, clean up generated file's header
2008-06-25 18:56:47 +00:00
nethack.allison
91016cff99 makedefs build on non-C99 compilers follow up
Pat Rankin wrote:
>      That patch looks incorrect.  `CONSUME' increments argv,
> so now a different value is being passed to the function when
> initializing that variable than was passed before.
2008-05-21 02:15:09 +00:00
nethack.allison
3a75bf5ab7 makedefs build on non-C99 compilers
..\util\makedefs.c(426) : error C2143: syntax error : missing ';' before 'type'
..\util\makedefs.c(427) : error C2065: 'p' : undeclared identifier
..\util\makedefs.c(428) : error C2065: 'p' : undeclared identifier
2008-05-13 11:38:46 +00:00
keni
4fb08f1366 mdgrep.pl tid
Use the right name for the output file in all places.
Thanks Pat.
2008-04-23 10:48:04 +00:00
keni
c7858a6d37 more warning cleanup, makedefs grep bits (trunk only)
drop -Wcast-qual
warning cleanup (lev_comp)
comment bits
makedefs grep cleanup: drop magic constant, add --grep-define, --grep-undef,
 #ifdef out code not needed yet, update mdgrep.h, mdgrep.pl
2008-04-22 23:20:44 +00:00
keni
7b2fb4d0b5 more warning cleanup (trunk only)
More warning bits that never got committed.
More appropriate compiler flags for warning checks (macosx only for the moment).
The changes in dgn*[lc] just rename line_number to nh_line_number to avoid a
clash, so no need to regenerate the lex output.
2008-04-18 17:37:33 +00:00
keni
d175a3f7fe makedefs conditional grep (trunk only)
This code (except for some of the argument parsing changes) is not used yet.
mdgrep.pl generates mdgrep.h; like the lex and yacc files we ship mdgrep.h
 pre-generated; there is no need for perl on end-user/end-compiler systems.
 (In fact mdgrep.h is so simple mdgrep.pl is probably overkill.)
mdgrep.h creates an array reflecting the compiler options in effect
The changes to makedefs break the Mac OS9 compile; if necessary the fix is
 simple and documented (but I think that port is permanently dead).
With that port out of the way, makedefs can be allowed to take real options;
 none of the current options have been changed.  Instead, a second sub-main
 routine has been added to handle options starting with two hyphens and all
 the new options start with two hyphens:
--input specifies the input file (- is stdin)
--output specifies the output file (- is stdout)
--grep causes the input file to be filtered into the output file
--grep-showvars dumps the info from the array in mdgrep.h
--grep-trace turns on tracing of the grep filtering
Docs for the filtering language are in the source.
2008-04-06 00:48:40 +00:00
nethack.rankin
a675cc6ed7 vms file access
Fix the problem From a bug report.  His system has a logical name "DATA" pointing at some disk, and
when the dlb utility tried to open "data" for inclusion in the library
being built at install time, it attempted to access the wrong thing and
failed.  He then attempted to fix it in a manner which let dlb finish, by
modifying dlb_main.c to append "." to file names that lack a dot, but
then nethack couldn't access "dungeon" in the library because string
comparison didn't match the altered dlb directory entry of "dungeon.".

     NetHack was working around this unintended interaction with the
environment issue in fopen_datafile(), and dlb was doing so for fopen()
but not open().  This moves nethack's fixup out of src/files.c and into
sys/vms/vmsfiles.c, adds another routine there so that both open() and
fopen() are covered, and updates the vms Makefiles so that the various
utility programs all link with vmsfiles.  (The build script vmsbuild.com
puts object files into a library and gets that last bit for free.)
2007-10-28 09:37:56 +00:00
nethack.rankin
4c83db0294 fix #H1232 - hole in ice is described as moat [1 of 2] (trunk only)
From a bug report, when ice on the Valkyrie
quest home level was melted and a boulder filled the resulting pool, that
pool was described as a moat.  This was actually a terrain issue rather
than a formatting glitch, so instead of tweaking waterbody_name() with an
extra special case, extend the level compiler to allow specifying ice as
frozen pool instead of always being frozen moat.  There's no provision
for having both types of ice on the same level, just a level-wide flag to
control which of the two applies for ice on that level.

     This change has a side-effect for the V quest levels:  once ice has
been melted, a second blast of fire will now boil away the pool and leave
a pit.  The unfrozen water locations on the home level already behaved
that way (ie, they are pools rather than moats) so this should be ok.  I
also added <Someone>'s suggestion to make one of the two drawbridges
on the goal level start in random state instead of always being open.
2007-08-03 01:05:50 +00:00
nethack.rankin
9e7d032c79 random initial drawbridge state (trunk only)
Suggested by <Someone>:  in the special level compiler, support
"random" in addition to "open" and "closed" for a drawbridge's inital
state.  Drawbridge shares code with door, so the necessary parsing was
already present.  This just treats random as valid for drawbridge instead
of explicitly rejecting it, and makes the special level loader process it.

     He also suggested that the two drawbridges on the bottom level of
the Valk's quest be changed from open to random, but this patch doesn't
go that far.  I think it's a good idea, but since the player can't use a
musicial instrument on those bridges, this has more impact on game play
than it might at first seem.  I don't really want to see Valkyries be
required to use magic for occasions where both bridges start out closed.
2007-04-21 01:54:56 +00:00
nethack.rankin
697ec97812 hangup hangup bit (trunk only)
Accidentally left out  of the previous patch.
2007-01-18 05:12:36 +00:00
nethack.rankin
176a59bb0a SELECTSAVED in #version (trunk only)
makedefs wasn't including this optional feature in dat/options for
display via ``#version''.  It doesn't affect save and bones files but it
is something that may be of interest to users.  This change won't work for
UNIX+QT_GRAPHICS because that config is defining SELECTSAVED in files.c
instead of in unixconf.h.

     I think there are some other new things which are missing here too.
2006-12-10 05:30:23 +00:00
keni
951e0d87fa Pad rumors to improve distribution of delivered rumors. 2006-10-12 00:17:17 +00:00
nethack.allison
fcf38a5e35 recover (trunk only)
Bring recover process up to date with current save file contents
(self_recover and external recover)
2006-08-04 03:58:46 +00:00
nethack.allison
174b985267 Allow makefile build with VC2005 (trunk only) 2006-06-25 22:40:58 +00:00
nethack.rankin
a71d270a21 more rumors processing (trunk only)
This fix should work for both DLB and non-DLB without forcing binary
mode for the latter.  And it should continue to work even if we later
decide to force that mode (which I think we should do...).  Use actual
file positions to calculate the size of the true and false sections,
rather than counting the bytes of each rumor (that counting has been left
in place but it gets overridden now.)  Those two sizes will be bigger on
platforms which use CR+LF line ends and maintain dat/rumors as non-DLB
text file.  But due to the way that nethack uses the sizes, such size
differences don't matter.

     The branch variant shouldn't need any corresponding fix.  It uses
the counting method when the output is binary, where the accumulated
value is accurate, and the check end-of-file shortcut when using text,
which should not be affected by stdio converting CR+LF into \n for text
input and back to CR+LF again for text output.  (The original bug was due
to starting out with the EOF shortcut when input had CR+LF line ends, but
then writing less data due to binary output keeping just LF instead of
putting CR back.)
2006-05-07 05:31:27 +00:00
nethack.rankin
85865eb106 more thorough rumor processing (trunk only)
To fix the gibberish rumor observed by at least a couple of players on
Windows (where if rumors.tru had <cr><lf> line ends and DLB was defined,
makedefs built a file that caused nethack to end up in the wrong place when
it reached EOF and tried to jump back to the first false rumor), change
the way that makedefs builds the rumors file.  It now will collect more
information about the true and false rumors.  Instead of one hex value on
the second line, there are nine values (three groups of three).

1,2,3;4,5,6;7,8,9

1 = number of true rumors; not previously collected and not currently used
2 = size in bytes for all true rumors (in decimal, as is #1)
3 = offset to first true rumor (in hexadecimal; not previously collected)
4,5,6 = same as 1,2,3 but for the false rumors section
7,8 = always 0 (imaginary third section has no entries, no size)
9 = offset to end-of-file (could be used for sanity checks; currently isn't)

Adding #2 with #3 yields #6; adding #5 with #6 yields #9.  The old format's
lone entry was the same as the new format's #6.  #2, #3, and #5 are values
which nethack was previously calculating on the fly after opening the file.

     This also extends rumor_check() a little bit (displays the last rumor
for both sections in addition to the first), but I think it can probably
now be demoted to ``#if 0'' and removed from the extended commands list.
2006-05-06 04:55:57 +00:00
nethack.allison
a3b216e475 work around win32 rumor issues (#H80)
With makedefs changed to open the files as binary, the
rumors generation and retrieval seems to work consistently.

win32tty
T start=000067 (000043), end=020658 (0050b2), size=020591 (00506f)
F start=020658 (0050b2), end=043641 (00aa79), size=022983 (0059c7)
T 000067 A blindfold can be very useful if you're telepathic.
F 020658 "So when I die, the first thing I will see in heaven is a score list?"

win32gui
T start=000067 (000043), end=020658 (0050b2), size=020591 (00506f)
F start=020658 (0050b2), end=043641 (00aa79), size=022983 (0059c7)
T 000067 A blindfold can be very useful if you're telepathic.
F 020658 "So when I die, the first thing I will see in heaven is a score list?"
2006-05-02 22:10:54 +00:00
nethack.allison
660d3589c5 experimental - dungeon overview (trunk only)
Add Hojita Discordia's Dungeon Map overview as
conditional code for experimentation and testing.
Everything is guarded by
#ifdef DUNGEON_OVERVIEW
#endif

The notes that accompanied the original patch follow.

Dungeon Map Overview Patch for Nethack 3.4.3
Version 3
=============================================================================
Changelist:
    v3: Changed #level to #annotate to avoid #levelchange collision.  Fixed
        handling of elemental planes and astral plane (oops).  Changed
	formatting to be slightly closer to print_dungeon()'s.  Should be
	"final" version for 3.4.3.
    v2: Added tracking of trees.  Changed ctrl-m command to ctrl-o.  Portals
        displayed as "sealed" instead of "closed".
    v1: First release.
    (Note: all versions are mutually save compatible.)
=============================================================================
This patch creates a dungeon map overview that is recorded as the player
explores the dungeon.  I was tired of returning to a game a few days later
and having no idea what the dungeon looked like.  Trying to name pieces
of armor with shorthand didn't work so well as an intermediate solution
either, especially around nymphs.

It can be assumed that this map is in the mind of the hero and thus
can't be stolen, can be read when blind, or when buried, or when the hero
doesn't have any hands, or eyes, or hands free, or...etc. On the other hand,
this implies that the hero doesn't remember all of the details ("a fountain",
"some fountains", "many fountains") and that the map is subject to amnesia
when applicable.

This overview tracks fountains, altars, stores, temples, sinks, thrones,
trees, and dungeon branches.  It attempts to not spoil the player nor
reveal more information than the hero knows.  For this reason, it only
tracks dungeon features found in the guidebook and dungeon branches.

This patch breaks save file compatibility.  Sorry.

Added commands
=============================================================================
#overview (ctrl-o, if not in wizard mode) - displays overview
#annotate (ctrl-n, if using numpad) - names current level

Example Output From #overview
=============================================================================
The Dungeons of Doom: levels 1 to level 15
   Level 1:
      A fountain
   Level 3: (My stash.)
      An altar, some fountains
      Stairs down to The Gnomish Mines
   Level 7:
      Many fountains
   Level 8:
      Stairs up to Sokoban, level 7
   Level 15:
      A general store
      Sealed portal to The Quest
The Gnomish Mines: levels 4 to level 7
   Level 7: <- You are here
      Many stores, some fountains, a temple

More Details
=============================================================================
The overview shows only levels that have anything interesting to display and
doesn't show branches that don't have any interesting levels.

To avoid the map revealing more information than the hero knows, the overview
only displays things that the hero has seen or touched.  (If the hero
blinds herself, levitates above a known fountain, and obliterates it with a
wand of digging, the overview will still say that there is a fountain.)

This is done, sadly, by adding 6 bits to the rm struct to track the last
known dungeon type.  On the other hand, this change could potentially allow
a window port to do something like drawing an item and a fountain on the same
square.

Things That Could Be Better And Maybe Some Feedback Would Help
=============================================================================
"<- You Are Here" is pretty goofy
    -...but an indicator of some sort is nice.
=============================================================================
Many thanks to all the kind folks on r.g.r.n. who had very good feedback
about this patch, in particular L (for the trees), <Someone> Papaganou (for the
#annotate suggestion and some formatting feedback), and <Someone> (for the suggestion
of just overriding ctrl-o instead of using the very broken ctrl-m.)
=============================================================================
20060311. Hojita Discordia. (My usenet email is bogus. Sorry.)
2006-04-20 00:57:45 +00:00
nethack.rankin
2ca87d8a5e more health food shops (trunk only)
Allow health food stores to carry eggs and tins of veggy contents in
their stock.  The tins will almost always contain spinach because random
tins containing meat are converted into that.

     Also, allow health food stores to be placed with the level compiler
(not tested) and to be forcibly placed in wizard mode via SHOPTYPE setting
of "V".  Increments EDITLEVEL in patchlevel.h because lighting store in
Minetown got renumbered and the special level for it needs to be rebuilt.
2005-03-13 05:29:01 +00:00
nethack.allison
fd205fc1db followup to compression changes 2005-01-23 14:34:29 +00:00
nethack.allison
ab1872b928 zlib support; also internal compression changes
o Add support for zlib compression via ZLIB_COMP in config.h (ZLIB_COMP
  and COMPRESS are mutually exclusive).
o rlecomp and zerocomp are run time options available if RLECOMP and
  ZEROCOMP are defined, but not turned on by default if either COMPRESS
  or ZLIB_COMP are defined.
o Add information to the save file about internal compression options
  used when writing the save file, particularly rlecomp and zerocomp
  support.
o Automatically adjust rlecomp and zerocomp (if support compiled in)
  when reading in an existing savefile that was saved with those options
  turned on.  Still allows writing out of savefile in preferred format.
o In order to support zlib and not conflict with compress and uncompress
  routines there, the NetHack internal functions were changed to
  nh_uncompress and nh_compress as done in the zlib contribution received
  in 1999 from <Someone>.

I tagged the sources NETHACK_3_5_0_PREZLIB prior to applying these
changes.
2005-01-22 15:28:15 +00:00
nethack.allison
e9b022d579 housekeeping: mark trunk sources 3.5 (misc) 2005-01-02 17:21:18 +00:00
nethack.allison
aa6f3df889 new context_info struct in compat checks (trunk only)
lev_main needed to reflect the change too.
2004-02-02 12:44:58 +00:00
nethack.allison
42f202f4c0 new context_info struct in compat checks (trunk only)
Add the context_info struct to the version compatibility checks.
This increments EDITLEVEL rendering prior save/bones files useless.
2004-02-02 01:30:31 +00:00
nethack.allison
89c785e366 monsters moving other monsters (trunk only)
For now, the code is conditional on BARGETHROUGH
being defined, while it gets tested further. While behavior is
different with and without BARGETHROUGH defined, savefiles
are the same either way.

After this patch is applied, only the riders have the M3_DISPLACES
bit set, but the Wizard and Vlad probably should too. Any others?
2003-11-16 20:10:30 +00:00
nethack.allison
c0349ec918 autopickup_exceptions build option
Add config.h experimental option AUTOPICKUP_EXCEPTIONS.

It's an interface-only change which allows you to add lines to your
config file to selectively avoid autopickup of items based on their
text description that is displayed when you pick them up. It does
it by matching a pattern against the xname singular return value.

For example:

autopickup_exception = "*corpse" will avoid picking up corpses, even if
food (%) is in your pickup_types.

autopickup_exception = "*brown*"
will avoid picking up any brown items (why, I do not know)

autopickup_exception = "*loadstone"
will NOT avoid picking up loadstones, unless they are already
identified, because the xname string will be "gray stone", so no
match there.

The matching has no knowledge of in-game objects, it is just
a text pattern match, thus it is an interface change, not a gameplay
change, and it is meant as a convenience for players.
2003-11-15 01:05:32 +00:00
nethack.allison
d290e918c6 flag adjustment followup (trunk only) 2003-11-09 16:05:51 +00:00
cohrs
d82c7e671b support engraving in blood in special level files
the file format and sp_lev.c supported it, but the level parser didn't
2003-10-23 02:36:23 +00:00
jwalz
0b284f75a0 compilation bit 2003-09-08 00:48:37 +00:00
nethack.allison
eb398e0b2a save/bones compatibility info followup 2003-09-07 18:19:24 +00:00
kmhugo
1282e5c623 Synch recent 3.4.2 changes to main trunk
This is merely a synchronization of recent changes for the
Macintosh Carbon port, which were committed to the 3.4.2
branch, to the main trunk.
2003-08-30 00:45:58 +00:00
cohrs
14c12765a0 U433 - infinite loop with place_branch
This solution is mostly a band-aid.  Make sure information set by join_map
that is overlaid by the MAP is cleared out.  This ensures that place_branch
will never consider invalid data.  A new function, remove_rooms(), with a
helper, remove_room(), takes care of this, but only for rooms created by
join_map, which addresses the only known case that causes this problem.
There's a possibility that some other strange behavior, especially in
minetn-6, will be fixed by this as well.  The problem of disconnected caves
on minetn-6 is not yet addressed.

Also, add a check to lev_comp.y to make sure the required fg semantics of
joined levels (fg must be ROOM or CORR) are actually met.  Doesn't affect
any levels currently included in the distro, but might address levels
others are trying to make.
2003-05-20 02:05:45 +00:00
nethack.allison
e1aa6d5148 GOLDOBJ compat (main trunk only)
This patch gives game and savefile compatibility
whether GOLDOBJ is defined or not.

You can build with GOLDOBJ defined or not, and
still load your saved games. Rebuild with the
opposite, and load the same game.

That way GOLDOBJ can be experimented with
more easily.

1. Leave the "you" struct and the "monst"
   struct the same under the hood between
   GOLDOBJ and !GOLDOBJ.

2. Always write out gold as an
   object on the player and monster
   inventory chains.

On a restore of the savefile with GOLDOBJ
not defined,  take the gold objects out of
the inventory chains and put it into u.ugold
or mtmp->mgold as appropriate.

On a restore of the savefile with GOLDOBJ
defined, nothing special is done.
2003-04-11 22:32:08 +00:00
nethack.allison
5122409416 Several things that break savefile compatibility
- Version change from 3.4.x
- timed_delay feature ignore in makedefs
- several flags from iflags to flags
- use offsets from mons array entries in save file rather than storing
  the ptr and calculating the distance from beginning of array
2003-03-05 04:39:47 +00:00
nethack.allison
14c53eb840 typo in <email deleted>
#ifdef HOLD_LOCKFILE_OPEN
"exlusive lock on level 0 file",
#endif
2003-03-05 02:45:21 +00:00
nethack.allison
1620f9e44e USER_SOUNDS follow-up
Make the support of user sounds apparent in the
#version command.  Also add a small section on
them to the Guidebook.

(The doc/Guidebook.mn version of this section
needs testing)
2002-09-03 02:36:16 +00:00
nethack.allison
98d53c93a8 win32 recover; also a core bit from Yitzhak 2002-09-02 14:10:05 +00:00