Commit Graph

1022 Commits

Author SHA1 Message Date
nhmall
3d6fabf730 nhclose
Changes to be committed:
	modified:   include/extern.h
	modified:   src/bones.c
	modified:   src/do.c
	modified:   src/files.c
	modified:   src/music.c
	modified:   src/restore.c
	modified:   src/save.c
	modified:   sys/share/pcmain.c
	modified:   sys/share/pcsys.c
	modified:   sys/share/pcunix.c

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.
2015-04-06 10:12:10 -04:00
Derek S. Ray
b4142b5894 Merge branch 'master' into win32-x64-working
* master: (354 commits)
  Add missing protos
  a warning bout lc_error
  Add S_poisoncloud to Guidebooks
  ...

Conflicts:
	.gitattributes
	dat/.gitattributes
	doc/.gitattributes
	doc/Guidebook.mn
	include/config.h
	include/decl.h
	include/extern.h
	include/flag.h
	include/hack.h
	include/ntconf.h
	include/sys.h
	include/wceconf.h
	src/apply.c
	src/attrib.c
	src/bones.c
	src/botl.c
	src/dbridge.c
	src/dig.c
	src/do.c
	src/do_name.c
	src/dog.c
	src/dungeon.c
	src/eat.c
	src/end.c
	src/files.c
	src/fountain.c
	src/hack.c
	src/invent.c
	src/light.c
	src/makemon.c
	src/mhitu.c
	src/mklev.c
	src/mkmaze.c
	src/mkobj.c
	src/mkroom.c
	src/mon.c
	src/objnam.c
	src/options.c
	src/pager.c
	src/pickup.c
	src/potion.c
	src/pray.c
	src/questpgr.c
	src/read.c
	src/restore.c
	src/rnd.c
	src/role.c
	src/rumors.c
	src/save.c
	src/shk.c
	src/sit.c
	src/sp_lev.c
	src/sys.c
	src/teleport.c
	src/trap.c
	src/u_init.c
	src/uhitm.c
	src/wield.c
	src/worn.c
	src/zap.c
	sys/amiga/.gitattributes
	sys/mac/.gitattributes
	sys/msdos/.gitattributes
	sys/msdos/pctiles.c
	sys/msdos/vidvga.c
	sys/os2/.gitattributes
	sys/share/.gitattributes
	sys/share/pcmain.c
	sys/unix/.gitattributes
	sys/unix/hints/.gitattributes
	sys/unix/sysconf
	sys/unix/unixmain.c
	sys/vms/.gitattributes
	sys/wince/.gitattributes
	sys/wince/mhstatus.c
	sys/winnt/.gitattributes
	sys/winnt/Makefile.msc
	sys/winnt/nhsetup.bat
	util/lev_comp.l
	util/makedefs.c
	win/X11/winmenu.c
	win/X11/winstat.c
	win/gnome/gnstatus.c
	win/share/tilemap.c
	win/tty/termcap.c
	win/tty/topl.c
	win/tty/wintty.c
2015-04-05 23:42:15 -04:00
Derek S. Ray
07e0bc592c fire effects should burn green slime globs, too
On floor, in inventory, whatever. This probably needs to be extended to
support a much wider group of objects, but this will do to start.
2015-04-05 21:56:15 -04:00
Pasi Kallinen
71401a7db8 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.
2015-04-05 12:31:55 +03:00
nhmall
b383cc6a2c 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.
2015-04-04 21:20:34 -04:00
Derek S. Ray
0b4383e32e 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.
2015-04-03 13:03:55 -04:00
nhmall
7a3e7aaf64 missed a conflict 2015-04-02 19:24:10 -04:00
nhmall
c43e8f9d31 Merge branch 'master' into nhmall-booktribute
Conflicts:
	include/context.h
2015-04-02 19:19:50 -04:00
Pasi Kallinen
c8e781c418 Add menucolors
-Add a boolean option menucolors to toggle menu color
-Add MENUCOLOR -config file option

TODO:
-Better support for win32
-Support more windowports
-Update Guidebook
-Allow changing menucolor lines in-game
2015-04-02 20:16:25 +03:00
Pasi Kallinen
884d9d4be5 Record in xlogfile if any bones were loaded 2015-04-02 13:06:45 +03:00
Derek S. Ray
af5ed436b8 Merge branch 'master' into derek-farming
* master: (160 commits)
  Add doors correctly
  bug fixes for nhsub
  Generate oracle monsters after subroom
  Generate minetown guards after subrooms
  ...

Conflicts:
	src/do.c
	src/files.c
	src/hack.c
	src/mon.c
	src/vision.c
2015-04-01 17:40:25 -04:00
Pasi Kallinen
fa4dda377d Move isqrt into hacklib, other minor fixage 2015-04-01 16:38:56 +03:00
Pasi Kallinen
323b8b4038 Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource into paxed-new_lev_comp
Conflicts:
	src/trap.c
	sys/winnt/Makefile.msc
2015-04-01 16:09:53 +03:00
Pasi Kallinen
ca80675d59 Allow admin to disable explore mode
Some public servers want to disable explore mode, so
make it configurable in sysconf.
2015-03-31 18:14:16 +03:00
PatR
f0eae55d34 add .gitignore entries: tile.h, NetHack.ad
Add a couple of missing .gitignore entries for files put into
place when building.  include/tile.h is genearated for tiles
and dat/NetHack.ad is copied for X11 resource definitions.
2015-03-31 00:18:00 -07:00
Pasi Kallinen
84a067a016 Options to create the character blind or nudist
For those pro players who really want to try their hand
at that zen samurai, without needing to reroll thousands
of times to start with blindfold.  Nudist starts without
any armor, and keeps tabs whether you wore any during
the game, for even more bragging rights.

Also makes the Book of the Dead readable even while
blind, for obvious reasons.
2015-03-30 22:12:54 +03:00
Derek S. Ray
ca60cac105 Merge branch 'master' into derek-farming
* master: (41 commits)
  Add more explicit helpless reasons
  add data.base suggestion for whistle
  Use existing function to count containers
  ...

Conflicts:
	src/do.c
	src/hack.c
	src/invent.c
	src/mon.c
	src/objnam.c
2015-03-29 17:32:12 -04:00
Pasi Kallinen
411ee58593 Add more explicit helpless reasons
Instead of just "while helpless", the death reason will tell
more explicitly why the player was helpless.  For example:
"while frozen by a monster's gaze"
2015-03-29 22:12:19 +03:00
Pasi Kallinen
1e49567937 Use dark gray color for black glyphs in TTY
This is Michael Deutschmann's use_darkgray -patch.
Adds a boolean option use_darkgray, settable in config file.

This patch has been in use on NAO for years, and I have heard
once someone say their terminal didn't support the dark gray
color.
2015-03-29 15:51:11 +03:00
nhmall
c035402c14 flavor enhance zap downwards/upwards when hiding
Changes to be committed:
	modified:   doc/fixes35.0
	modified:   include/extern.h
	modified:   src/apply.c
	modified:   src/zap.c

    On 3/23/2015 6:41 PM, a bug reporter wrote:
    > When you're hiding under an item (e.g. via garter snake polyform), and
    > that item gets polyshuddered into nonexistence, you continue hiding
    > (under nothing).
    This was addressed previously.

    > (Incidentally, it's a bit weird that you use > to aim at items that are
    > flavorwise above you at the time.)

    This addresses the flavorwise concern.
2015-03-28 11:20:44 -04:00
Pasi Kallinen
2fce0074b3 Show legal polearm hit positions
User can press $ to display valid positions when asked
for a position to pick, and the positions will be hilighted
2015-03-28 13:32:24 +02:00
Pasi Kallinen
5bb4a02ffe Remember position of monster you hit with polearm
If you hit a monster with a polearm, following polearm applications
will try to automatically suggest the monster's position
2015-03-27 23:34:13 +02:00
Pasi Kallinen
870b124f14 Allow reading many more items
You can now also read alchemy smocks, credit cards, cans of grease,
magic markers, gold, the Orb of Fate, and candy bars.
2015-03-27 21:04:18 +02:00
Pasi Kallinen
2e2d020a59 Show t-shirt text at end of game inventory disclose
Restricting the text display only to the end of game disclose,
so it doesn't clutter the inventory during gameplay and so that
the readability of t-shirts is not given away.
2015-03-27 16:08:06 +02:00
Derek S. Ray
335c7fc003 Merge branch 'master' into derek-farming
* master: (49 commits)
  Fix 'fetch' syntax, include sparkly 'git log' trick
  Show object symbols in menu headings
  Fix a memory leak on termination.
  ...

Conflicts:
	include/obj.h
	src/do.c
	src/files.c
	src/hack.c
	src/invent.c
	src/mkobj.c
	src/mon.c
	src/objnam.c
2015-03-25 17:23:59 -04:00
Pasi Kallinen
f41c51aef0 Show object symbols in menu headings
... in menus where those object symbols act as menu accelerators.
Toggleable via "menu_objsyms" boolean option, defaults to off.
2015-03-25 22:13:28 +02:00
Pasi Kallinen
d787f45dcb Add an option to give feedback when bumping walls
Boolean option "mention_walls", defaults to off.
Useful for blind players.
2015-03-24 22:01:29 +02:00
Pasi Kallinen
2d6f9686a7 Merge branch 'paxed-new_lev_comp' of https://rodney.nethack.org:20040/git/NHsource into paxed-new_lev_comp
Conflicts:
	include/obj.h
	include/patchlevel.h
	src/topten.c
	src/trap.c
	sys/winnt/Makefile.msc
2015-03-24 19:59:40 +02:00
Pasi Kallinen
0a9248c7f1 Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource into paxed-new_lev_comp
Conflicts:
	doc/fixes35.0
	include/extern.h
	include/ntconf.h
	include/obj.h
	include/patchlevel.h
	src/dig.c
	src/do.c
	src/files.c
	src/fountain.c
	src/mklev.c
	src/objnam.c
	src/options.c
	src/potion.c
	src/rumors.c
	src/save.c
	src/topten.c
	src/trap.c
	src/wield.c
	sys/share/pcmain.c
	sys/unix/unixmain.c
	sys/winnt/Makefile.msc
	util/lev_main.c
	util/makedefs.c
2015-03-24 19:46:38 +02:00
Derek S. Ray
5ccae41702 add glob merging for obvious cases
flooreffects() covers most dropped/thrown/etc. cases, and the hooks in
invent and mon handle "deathdrops" along with picking up items.
still need to check putting into/removing from containers
2015-03-23 23:13:53 -04:00
nhmall
d792f7625d Merge branch 'master' into nhmall-booktribute
Conflicts:
	sys/winnt/Makefile.msc
2015-03-22 15:22:17 -04:00
nhmall
74c5f489ae adjust PREFIXES_IN_USE for SYSCF 2015-03-22 11:11:41 -04:00
nhmall
c3c968f87c options and config file handling
With SYSCF, the SYSCF_FILE name was overwriting the
default config file name making it unavailable for
subsequent user config file options handling.

- Keep the name of the last config file successfully opened.
- Do it without orphaning the default config file name needed
  for the next pass.
2015-03-22 10:44:36 -04:00
nhmall
41ac4aef92 fix SYSCF so that things build when first defined
Things won't build for ports that first
define SYSCF.

This moves assure_syscf_file() from unixmain.c
to files.c and adjusts extern.h to get it
out from under #ifdef UNIX.

The call to assure_syscf_file() in options.c was
only #ifdef SYSCF, SYSCF_FILE and not UNIX,
so new ports #defining SYSCF would get an erro.

assure_syscf_file() will be utilized by mswin
when SYSCF is defined.
2015-03-21 15:38:31 -04:00
Pasi Kallinen
2649cb385c Merge branch 'master' into paxed-new_lev_comp
Conflicts:
	.gitignore
	doc/fixes35.0
	include/obj.h
	include/patchlevel.h
	src/dig.c
	src/mklev.c
	src/rumors.c
	src/save.c
	src/topten.c
	src/trap.c
	sys/winnt/Makefile.msc
	util/makedefs.c
	win/win32/levstuff.mak
2015-03-21 19:39:48 +02:00
nhmall
f2a132adca more book tribute - store index right in obj 2015-03-21 11:02:52 -04:00
nhmall
a0d3224834 Merge branch 'master' into nhmall-booktribute
Conflicts:
	sys/winnt/Makefile.msc
2015-03-21 10:59:49 -04:00
nhmall
e3eb74166f obj change to support some upcoming work
This is an enabling patch for upcoming work. It breaks
save/bones so editlevel is incremented.

I'd like to a second overloadable int field in struct obj,
instead of just the one that is typically overloaded - corpsenm.

The second one can be used for things that are being tallied
up as opposed to a static one time assignment for reference/linkage
purposes.

The differentiation will allow both uses to co-exist for the
same object.
2015-03-21 10:46:11 -04:00
nhmall
d7ff451301 More book tribute integration 2015-03-21 10:33:59 -04:00
Pasi Kallinen
2ec4ff0b8c Fix C343-108 (e- leaves prompt on screen)
You'll get "You mime eating something."
2015-03-20 19:25:24 +02:00
Derek S. Ray
7f03ee4216 Changes for Win32; update precompiled files
Also fix Orctown probabilities; fixed support for snprintf;
update Win32 makefile to allow level compiler use

Conflicts:
	win/win32/levstuff.mak
2015-03-20 15:14:31 +02:00
nhmall
0a8d24d87d more updates to the bookstore tribute 2015-03-20 00:58:29 -04:00
Pasi Kallinen
3cc3709d95 Save xlogfile time_t fields correctly 2015-03-19 17:41:14 +02:00
nhmall
d01bec9fae rare books store tribute 2015-03-18 21:47:18 -04:00
Pasi Kallinen
debdf7ca48 Move some hard-coded string arrays into data files.
Random epitaphs, engravings and hallucinatory monsters now
live in text data files.
2015-03-18 22:05:10 +02:00
Pasi Kallinen
27add21e7e Merge branch 'paxed-xlogfile' 2015-03-18 18:57:52 +02:00
Pasi Kallinen
56699486a0 Catch up with post-343 lev_comp changes
- Iced pools vs. iced moats
- allow making map outer edges nonpasswall & nondiggable,
  so eg. xorns cannot be teleported there
2015-03-17 18:57:39 +02:00
Pasi Kallinen
c9d5bb9d68 Fix some level flags, sokoban premapping 2015-03-17 18:52:53 +02:00
Pasi Kallinen
47bb9abace New level compiler: code changes 2015-03-17 18:52:42 +02:00
PatR
d4467fc594 allow DEBUGFILES to be overridden via getenv()
If getenv("DEBUGFILES") yields a value then it takes precedence over
sysconf.DEBUGFILES or sys.c's #define DEBUGFILES.  (It probably should
only be controlled via environment since it is not a system-wide
attribute, but I haven't taken out the SYSCF handling for it.)
2015-03-17 18:47:38 +02:00