Merge branch 'master' into win32-x64-working

Conflicts:
	include/config.h
	include/extern.h
	src/do.c
	src/files.c
	src/hack.c
	src/mkobj.c
	src/mon.c
	src/objnam.c
	src/vision.c
	sys/share/pcmain.c
	win/share/other.txt
	win/share/renumtiles.pl
This commit is contained in:
nhmall
2015-04-12 00:15:40 -04:00
68 changed files with 18299 additions and 16667 deletions
+34 -3
View File
@@ -24,6 +24,7 @@ CONTENTS
4. git configuration 4. git configuration
5. variable expansion 5. variable expansion
6. reserved names 6. reserved names
7. nhadd/nhcommit
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
1. email 1. email
Email to devteam@nethack.org will usually get a response, but it may take a Email to devteam@nethack.org will usually get a response, but it may take a
@@ -52,7 +53,9 @@ XXX windows
XXX linux XXX linux
B. Specify the prefix for variable substitution: B. Specify the prefix for variable substitution:
(This assumes you are not a member of DevTeam or any variant's development (This assumes you are not a member of DevTeam or any variant's development
team. If you are, this may be wrong. Look for more specific documentation.) team. If you are, this may be wrong. Look for more specific documentation.
For example, this file uses "MINE" for the substitution prefix - this will
almost always be wrong if you are working with someone else.)
Decide where you want to put this info; it should NOT be inside the Decide where you want to put this info; it should NOT be inside the
tree you cloned from git. I use ~/nethack/GITADDDIR; for that base, tree you cloned from git. I use ~/nethack/GITADDDIR; for that base,
create the needed directories and edit the file: create the needed directories and edit the file:
@@ -82,8 +85,7 @@ D. aliases
nhadd nhadd
nhcommit nhcommit
These two commands take the same options as the normal git add and commit These two commands take the same options as the normal git add and commit
commands but perform RCS/CVS-style variable substitution. Note that the commands but perform RCS/CVS-style variable substitution.
substitutions do not show up in the working directory.
Note that nothing terrible will happen if you do not use the nh* versions Note that nothing terrible will happen if you do not use the nh* versions
of the commands. of the commands.
@@ -94,6 +96,12 @@ D. aliases
MINE-Revision CVS style revision number MINE-Revision CVS style revision number
MINE-Branch the current git branch MINE-Branch the current git branch
For direct access to the substitution mechanism, use:
nhsub
See the section "nhadd/nhcommit" for details on those aliases.
Run "perldoc DEVEL/hooksdir/nhsub" for details on nhsub.
That's it. If you need to do something more when setting up your repository, That's it. If you need to do something more when setting up your repository,
keep reading. Otherwise, you are done with this section. keep reading. Otherwise, you are done with this section.
@@ -165,3 +173,26 @@ D. Using your own hooks
Anything that matches m/^nh/i or m/^nethack/i is reserved in all Anything that matches m/^nh/i or m/^nethack/i is reserved in all
namespaces (environment, file names, git config, etc). namespaces (environment, file names, git config, etc).
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
7. nhadd/nhcommit
nhadd is essentially "git nhsub $*; git add $*"
nhcommit is essentially "git nhsub $*; git commit $*"
As "git add" and "git commit" have complex arguments, nhsub attempts to
do the right thing - or at least something reasonable - for most arguments.
If nhadd/nhcommit don't do what you need, run "git nhsub" on its own then
add/commit.
So when do I need to use what?
The object is to get nhsub run right before git takes a snapshot of each
file. So for example:
- use "git nhcommit <filespec>" instead of "git commit <filespec>"
- use "git nhadd <filespec>" instead of "git add <filespec>"
- use either "git commit" or "git nhcommit" (because the snapshot was
already taken)
- if you use "git nhsub <filespec>" then you can "git add <filespec>" or
"git commit <filespec>"
For more complex situations, "git nhsub" takes -v and -n flags - see
"perldoc DEVEL/hooksdir/nhsub".
------------------------------------------------------------------------------
+1 -1
View File
@@ -7,7 +7,7 @@ rationale, etc.
============================================== ==============================================
FEATURE_NOTICE Alerts for a Release FEATURE_NOTICE Alerts for a Release
There is a code mechanism for alterting players to a change in behavior There is a code mechanism for alerting players to a change in behavior
over prior versions of the game. over prior versions of the game.
Here's how to do it: Here's how to do it:
+108 -10
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl #!/usr/bin/perl
# nhsub # nhsub
# $NHDT-Date: 1427913635 2015/04/01 18:40:35 $ # $NHDT-Date: 1427408239 2015/03/26 22:17:19 $
# Note: was originally called nhdate; the rename is not reflected in the code. # Note: was originally called nhdate; the rename is not reflected in the code.
@@ -27,7 +27,11 @@ my %codes = (
'd M'=>0, 'd D'=>0, 'd M'=>0, 'd D'=>0,
'c M'=>0, 'c D'=>0, 'c M'=>0, 'c D'=>0,
# M [ MD] updated in index 'dM '=>0, 'dMM'=>1, 'dMD'=>0,
'aM '=>0, 'aMM'=>1, 'aMD'=>0,
'cM '=>0, 'cMM'=>1, 'cMD'=>0,
'fM '=>0, 'fMM'=>1, 'fMD'=>0,
# M [ MD] updated in index
'dA '=>1, 'dAM'=>1, 'dAD'=>1, 'dA '=>1, 'dAM'=>1, 'dAD'=>1,
'aA '=>1, 'aAM'=>1, 'aAD'=>1, 'aA '=>1, 'aAM'=>1, 'aAD'=>1,
@@ -41,9 +45,17 @@ my %codes = (
'fD '=>1, 'fDM'=>1, 'fD '=>1, 'fDM'=>1,
# D [ M] deleted from index # D [ M] deleted from index
# R [ MD] renamed in index 'dR '=>0, 'dRM'=>1, 'dRD'=>0,
'aR '=>0, 'aRM'=>1, 'aRD'=>0,
'cR '=>0, 'cRM'=>1, 'cRD'=>0,
'fR '=>0, 'fRM'=>1, 'fRD'=>0,
# R [ MD] renamed in index
# C [ MD] copied in index 'dC '=>0, 'dCM'=>1, 'dCD'=>0,
'aC '=>0, 'aCM'=>1, 'aCD'=>0,
'cC '=>0, 'cCM'=>1, 'cCD'=>0,
'fC '=>0, 'fCM'=>1, 'fCD'=>0,
# C [ MD] copied in index
'aM '=>1, 'aA '=>1, 'aR '=>1, 'aC '=>1, 'aM '=>1, 'aA '=>1, 'aR '=>1, 'aC '=>1,
'fM '=>1, 'fA '=>1, 'fR '=>1, 'fC '=>1, 'fM '=>1, 'fA '=>1, 'fR '=>1, 'fC '=>1,
@@ -87,13 +99,48 @@ if ($^O eq "MSWin32")
$PDS = '\\'; $PDS = '\\';
} }
# pick up the prefix for substitutions in this repo # various command line options to consider and what the code actually does:
my $PREFIX = &git_config('nethack','substprefix'); #DONE nhcommit with no files should exit(0)
print "PREFIX: '$PREFIX'\n" if($opt{v}); #DONE nhadd with no files should exit(0)
#DONE commit -a?
# add root dir
#DONE commit -a + files -> exit(0)
#nothing: commit --interactive/--patch
#nothing: add -i/--interactive --patch/-p?
#nothing: add -u/--update?????? -A/--all/--no-ignore-removal???
#nothing (not quite right): add --no-all --ignore-removal???
#DONE add --refresh
#nothing: add -N/--intent-to-add
#DONE add -n - exit(0)
#DONE add --dry-run - exit 0
#DONE commit --dry-run - exit 0
#DONE?: add foo/\*/x (letting git expand the filenames)
my @rawlist0 = &cmdparse(@ARGV);
# Use git ls-files to expand command line filepaths with wildcards.
# Let's try this for all commands.
my @rawlist;
foreach my $e (@rawlist0){
if($e =~ m/[?*[\\]/){
my @rv = &lsfiles(undef, $e);
push(@rawlist, @rv) if(@rv);
if($opt{f}){
my @rv = &lsfiles('-i', $e);
push(@rawlist, @rv) if(@rv);
}
} else {
push(@rawlist, $e);
}
}
my @rawlist = &cmdparse(@ARGV);
push(@rawlist,'.') if($#rawlist == -1); push(@rawlist,'.') if($#rawlist == -1);
# pick up the prefix for substitutions in this repo
#TEST my $PREFIX = &git_config('nethack','substprefix');
my $PREFIX = "NHDT";
print "PREFIX: '$PREFIX'\n" if($opt{v});
while(@rawlist){ while(@rawlist){
my $raw = shift @rawlist; my $raw = shift @rawlist;
if(-f $raw){ if(-f $raw){
@@ -201,7 +248,21 @@ my $count = s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\x24]+))?)\$/&handlevar($2
my $ofile = $file . ".nht"; my $ofile = $file . ".nht";
open(TOUT, ">", $ofile) or die "Can't open $ofile"; open(TOUT, ">", $ofile) or die "Can't open $ofile";
die "write failed: $!" unless defined syswrite(TOUT, $_);
#XXX MUST add a loop here
# die "write failed: $!" unless defined syswrite(TOUT, $_);
my $offset = 0;
my $sent;
#print STDERR "L=",length,"\n";
while($offset < length){
$sent = syswrite(TOUT, $_, (length($_) - $offset), $offset);
die "write failed: $!" unless defined($sent);
#print STDERR "rv=$sent\n";
last if($sent == (length($_) - $offset));
$offset += $sent;
#print STDERR "loop: O=$offset\n";
}
close TOUT or die "Can't close $ofile"; close TOUT or die "Can't close $ofile";
rename $ofile, $file or die "Can't rename $ofile to $file"; rename $ofile, $file or die "Can't rename $ofile to $file";
} }
@@ -230,8 +291,14 @@ sub cmdparse {
last; last;
} }
if(m/^--/){ if(m/^--/){
if($opt{cmd} eq 'add' && $_ eq '--dry-run'){
exit 0;
}
if($opt{cmd} eq 'commit' && $_ eq '--dry-run'){ if($opt{cmd} eq 'commit' && $_ eq '--dry-run'){
$opt{'n'} = 1; exit 0;
}
if($opt{cmd} eq 'add' && $_ eq '--refresh'){
exit 0;
} }
shift @in; shift @in;
next; next;
@@ -244,6 +311,10 @@ sub cmdparse {
} elsif($opt{cmd} eq 'date'){ } elsif($opt{cmd} eq 'date'){
$opt{$single}++; $opt{$single}++;
} }
if($opt{cmd} eq 'add' && $single eq 'n'){
exit 0;
}
} }
} }
shift @in; shift @in;
@@ -253,6 +324,20 @@ sub cmdparse {
$mode = 'f' if($opt{cmd} eq 'date' && ($opt{f}||$opt{F})); $mode = 'f' if($opt{cmd} eq 'date' && ($opt{f}||$opt{F}));
$mode = 'f' if($opt{cmd} eq 'add' && $opt{f}); $mode = 'f' if($opt{cmd} eq 'add' && $opt{f});
if($opt{cmd} eq 'add' && $#in == -1){
exit 0;
}
if($opt{cmd} eq 'commit' && $#in == -1){
exit 0;
}
if($opt{cmd} eq 'add' && $opt{a} && $#in != -1){
exit 0;
}
if($opt{cmd} eq 'add' && $opt{a}){
my $x = `git rev-parse --show-toplevel`;
$x =~ s/[\n\r]+$//;
push(@in, $x);
}
return @in; # this is our file list return @in; # this is our file list
} }
@@ -286,6 +371,19 @@ sub handlevar {
} }
} }
sub lsfiles {
my ($flags, $ps) = @_;
open RV, "-|", "git ls-files $flags '$ps'" or die "Can't ls-files";
my @rv = <RV>;
map { s/[\r\n]+$// } @rv;
if(!close RV){
return undef if($! == 0);
die "close ls-files failed: $!";
}
return undef if($#rv == -1);
return @rv;
}
package PREFIX; package PREFIX;
use POSIX qw(strftime); use POSIX qw(strftime);
+5 -4
View File
@@ -1,4 +1,4 @@
This is a listing of all files in a full NetHack 3.5 distribution, organized This is a listing of all files in a full NetHack 3.6 distribution, organized
in their standard manner on a UNIX system. It indicates which files are in their standard manner on a UNIX system. It indicates which files are
necessary for which versions, so that you can tell which files may be deleted necessary for which versions, so that you can tell which files may be deleted
from or not transferred to your system if you wish. from or not transferred to your system if you wish.
@@ -17,7 +17,8 @@ cmdhelp data.base dungeon.def endgame.des gehennom.des
help hh history knox.des license help hh history knox.des license
medusa.des mines.des opthelp oracle.des oracles.txt medusa.des mines.des opthelp oracle.des oracles.txt
quest.txt rumors.fal rumors.tru sokoban.des symbols quest.txt rumors.fal rumors.tru sokoban.des symbols
tower.des wizhelp yendor.des tower.des wizhelp yendor.des tribute bogusmon.txt
engrave.txt epitaph.txt
doc: doc:
(files for all versions) (files for all versions)
@@ -265,8 +266,8 @@ petmark.uu resource.h rip.uu splash.uu tiles.mak
winMS.h winhack.c winhack.rc winMS.h winhack.c winhack.rc
(files for Visual Studio 2010 Express Edition builds) (files for Visual Studio 2010 Express Edition builds)
dgncomp.vcxproj dgnstuff.vcxproj dgnstuff.mak dlb_main.vcxproj levcomp.vcxproj dgncomp.vcxproj dgnstuff.vcxproj dgnstuff.mak dlb_main.vcxproj levcomp.vcxproj
levstuff.vcxproj levstuff.mak makedefs.vcxproj nethack.sln uudecode.vcxproj levstuff.vcxproj levstuff.mak makedefs.vcxproj NetHack.sln uudecode.vcxproj
nethackw.vcxproj tile2bmp.vcxproj recover.vcxproj tilemap.vcxproj tiles.vcxproj NetHackW.vcxproj tile2bmp.vcxproj recover.vcxproj tilemap.vcxproj tiles.vcxproj
This is a list of files produced by auxiliary programs. They can all be This is a list of files produced by auxiliary programs. They can all be
regenerated from the files in the distribution. regenerated from the files in the distribution.
+11 -11
View File
@@ -112,18 +112,18 @@ FLAGS: hardfloor
INIT_MAP: mines, '.' , 'P' , false , true , lit , false INIT_MAP: mines, '.' , 'P' , false , true , lit , false
GEOMETRY:center,center GEOMETRY:center,center
MAP MAP
...PPP.........PPPP..............PPPP... xxxxxxxxx......xxxx...........xxxxxxxxxx
.PPPP...........PP................PPPP.. xxxxxxx.........xxx.............xxxxxxxx
PP.................................PPP.. xxxx..............................xxxxxx
....................................PPP. xx.................................xxxxx
.....................................PP. ....................................xxxx
.......................................P .......................................x
........................................ ........................................
PP...................................PPP xx...................................xxx
.PPP...............................PPP.. xxxx..............................xxxxxx
..PP.............................PPPP... xxxxxx..........................xxxxxxxx
..PPP...........................PPPPPP.. xxxxxxxx.........xx..........xxxxxxxxxxx
....PPPP.........PPP.........PPPP..PP... xxxxxxxxx.......xxxxxx.....xxxxxxxxxxxxx
ENDMAP ENDMAP
# Dungeon Description # Dungeon Description
# The Isle of Glass is a Tor rising out of the swamps surrounding it. # The Isle of Glass is a Tor rising out of the swamps surrounding it.
+11 -11
View File
@@ -203,17 +203,17 @@ MAZE: "Mon-goal", ' '
INIT_MAP: mines, 'L' , '.' , false , false , unlit , false INIT_MAP: mines, 'L' , '.' , false , false , unlit , false
GEOMETRY:center,center GEOMETRY:center,center
MAP MAP
.L......L.LLL.......LL.... xxxxxx..xxxxxx...xxxxxxxxx
.LLL.......L......LL...... xxxx......xx......xxxxxxxx
LL.LL.............L.LL.... xx.xx.............xxxxxxxx
.......................... x....................xxxxx
......................LL.. ......................xxxx
......................LLL. ......................xxxx
LL........................ xx........................
.LL....................... xxx......................x
.LL................LL.L... xxx................xxxxxxx
..LL.....L.LL.......LLL... xxxx.....x.xx.......xxxxxx
.........LLL.........L.... xxxxx...xxxxxx....xxxxxxxx
ENDMAP ENDMAP
# Dungeon Description # Dungeon Description
$place = { (14,04),(13,07) } $place = { (14,04),(13,07) }
+11 -11
View File
@@ -186,17 +186,17 @@ MAZE: "Pri-goal", ' '
INIT_MAP: mines, 'L' , '.' , false , false , unlit , false INIT_MAP: mines, 'L' , '.' , false , false , unlit , false
GEOMETRY:center,center GEOMETRY:center,center
MAP MAP
.L......L.LLL.......LL.... xxxxxx..xxxxxx...xxxxxxxxx
.LLL.......L......LL...... xxxx......xx......xxxxxxxx
LL.LL.............L.LL.... xx.xx.............xxxxxxxx
.......................... x....................xxxxx
......................LL.. ......................xxxx
......................LLL. ......................xxxx
LL........................ xx........................
.LL....................... xxx......................x
.LL................LL.L... xxx................xxxxxxx
..LL.....L.LL.......LLL... xxxx.....x.xx.......xxxxxx
.........LLL.........L.... xxxxx...xxxxxx....xxxxxxxx
ENDMAP ENDMAP
# Dungeon Description # Dungeon Description
$place = { (14,04),(13,07) } $place = { (14,04),(13,07) }
+24 -24
View File
@@ -94,19 +94,19 @@ FLAGS: hardfloor,icedpools
INIT_MAP: mines, '.', 'I', true, true, lit, false INIT_MAP: mines, '.', 'I', true, true, lit, false
GEOMETRY:center,center GEOMETRY:center,center
MAP MAP
PPPP.... ....PPPPP. PPPPxxxx xxxxPPPPPx
PLP... .PPLLLPP PLPxxx xPPLLLPP
PPP ....................... PPPLLP PPP ....................... PPPLLP
.. ............................ PPPP xx ............................ PPPP
. ............................... .... x ............................... xxxx
................................. .. ................................. xx
.................................... . .................................... x
................................... ...................................
. .................................. . x .................................. x
.. .............................. PP xx .............................. PP
.PPP .......................... PLP xPPP .......................... PLP
.PLLP ..PLLP xPLLP xxPLLP
.PPPP.. ....PPPP xPPPPxx xxxxPPPP
ENDMAP ENDMAP
# Dungeon Description # Dungeon Description
REGION:(00,00,39,12),lit,"ordinary" REGION:(00,00,39,12),lit,"ordinary"
@@ -180,23 +180,23 @@ FLAGS: icedpools
INIT_MAP: mines, '.', 'L', true, true, lit, false INIT_MAP: mines, '.', 'L', true, true, lit, false
GEOMETRY:center,center GEOMETRY:center,center
MAP MAP
.L............................LLLLL xxxxxx.....................xxxxxxxx
LLL.........LLLLL.LLLLL.........LLL xxxxx.......LLLLL.LLLLL......xxxxxx
.LLL......LLLLLLLLLLLLLLL.......LL. xxxx......LLLLLLLLLLLLLLL......xxxx
.LLL.....LLL|---------|LLL.....L... xxxx.....LLL|---------|LLL.....xxxx
..LL....LL|--.........--|LL.....LLL xxxx....LL|--.........--|LL.....xxx
.......LL|-...LLLLLLL...-|LL.....L. x......LL|-...LLLLLLL...-|LL.....xx
.......LL|...LL.....LL...|LL....... .......LL|...LL.....LL...|LL......x
......LL|-..LL.......LL..-|LL...... ......LL|-..LL.......LL..-|LL......
......LL|.................|LL...... ......LL|.................|LL......
......LL|-..LL.......LL..-|LL...... ......LL|-..LL.......LL..-|LL......
.......LL|...LL.....LL...|LL....... .......LL|...LL.....LL...|LL.......
.......LL|-...LLLLLLL...-|LL....... xx.....LL|-...LLLLLLL...-|LL......x
..L.....LL|--.........--|LL.....LL. xxx.....LL|--.........--|LL.....xxx
..LL.....LLL|---------|LLL....LLLL. xxxx.....LLL|---------|LLL...xxxxxx
..LLL.....LLLLLLLLLLLLLLL...LLLLL.. xxxxx.....LLLLLLLLLLLLLLL...xxxxxxx
.LLLL.......LLLLL.LLLLL.....LLLL... xxxxxx......LLLLL.LLLLL.....xxxxxxx
..LL............................... xxxxxxxxx..................xxxxxxxx
ENDMAP ENDMAP
# Dungeon Description # Dungeon Description
REGION:(00,00,34,16),lit,"ordinary" REGION:(00,00,34,16),lit,"ordinary"
+239
View File
@@ -436,3 +436,242 @@ MONSTER:random,random
MONSTER:random,random MONSTER:random,random
MONSTER:random,random MONSTER:random,random
MONSTER:random,random MONSTER:random,random
# The Four Circles
LEVEL:"bigrm-6"
FLAGS:mazelevel
INIT_MAP:solidfill,' '
GEOMETRY:center,center
MAP
--------- --------- --------- ---------
---.......--- ---.......--- ---.......--- ---.......---
--...........-- --...........-- --...........-- --...........--
--.............-- --.............-- --.............-- --.............--
-...............- -...............- -...............- -...............-
|-...............---...............---...............---...............--
|.................-.................-.................-.................|
|........T.................T.................T.................T........|
|.......................................................................|
|......T.{.....................................................{.T......|
|.......................................................................|
|........T.................T.................T.................T........|
|.................-.................-.................-.................|
--...............---...............---...............---...............--
-...............- -...............- -...............- -...............-
--.............-- --.............-- --.............-- --.............--
--...........-- --...........-- --...........-- --...........--
---.......--- ---.......--- ---.......--- ---.......---
--------- --------- --------- ---------
ENDMAP
REGION:(01,01,72,17),lit,"ordinary"
STAIR:random,up
STAIR:random,down
NON_DIGGABLE:(00,00,72,18)
LOOP [15] {
OBJECT:random,random
}
LOOP [6] {
TRAP:random,random
}
LOOP [28] {
MONSTER:random,random
}
# Let's tilt it a bit
LEVEL:"bigrm-7"
FLAGS:mazelevel
INIT_MAP:solidfill,' '
GEOMETRY:center,center
MAP
-----
---------...---
---------.........L...---
---------.......................---
---------.................................---
---------...........................................---
---------.....................................................---
|--------...............................................................--|
|.........................................................................|
|.L.....................................................................L.|
|.........................................................................|
|--...............................................................--------|
---.....................................................---------
---...........................................---------
---.................................---------
---.......................---------
---...L.........---------
---...---------
-----
ENDMAP
$terrain = terrain:{ 'L', 'T', '{', '.' }
SHUFFLE:$terrain
REPLACE_TERRAIN:(00,00,74,18),'L',$terrain[0],100%
REGION:(01,01,73,17),lit,"ordinary"
STAIR:random,up
STAIR:random,down
NON_DIGGABLE:(00,00,74,18)
LOOP [15] {
OBJECT:random,random
}
LOOP [6] {
TRAP:random,random
}
LOOP [28] {
MONSTER:random,random
}
# Slanted
LEVEL:"bigrm-8"
FLAGS:mazelevel
INIT_MAP:solidfill,' '
GEOMETRY:center,center
MAP
----------------------------------------------
|............................................---
--.............................................---
---......................................FF.....---
---...................................FF........---
---................................FF...........---
---.............................FF..............---
---..........................FF.................---
---.......................FF....................---
---....................FF.......................---
---.................FF..........................---
---..............FF.............................---
---...........FF................................----
---........FF...................................---
---.....FF......................................---
---.............................................--
---............................................|
----------------------------------------------
ENDMAP
REGION:(01,01,73,16),lit,"ordinary"
STAIR:random,up
STAIR:random,down
NON_DIGGABLE:(00,00,74,17)
LOOP [15] {
OBJECT:random,random
}
LOOP [6] {
TRAP:random,random
}
LOOP [28] {
MONSTER:random,random
}
# The Eye
LEVEL:"bigrm-9"
FLAGS:mazelevel
GEOMETRY:center,center
MAP
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}................}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
}}}}}}}}}}}}}}}}}}}}}................................}}}}}}}}}}}}}}}}}}}}}
}}}}}}}}}}}}}}}............................................}}}}}}}}}}}}}}}
}}}}}}}}}}......................................................}}}}}}}}}}
}}}}}}}............................................................}}}}}}}
}}}}}.......................LLLLLLLLLLLLLLLLLL.......................}}}}}
}}}....................LLLLLLLLLLLLLLLLLLLLLLLLLLL.....................}}}
}....................LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL....................}
}....................LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL....................}
}....................LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL....................}
}}}....................LLLLLLLLLLLLLLLLLLLLLLLLLLL.....................}}}
}}}}}.......................LLLLLLLLLLLLLLLLLL.......................}}}}}
}}}}}}}............................................................}}}}}}}
}}}}}}}}}}......................................................}}}}}}}}}}
}}}}}}}}}}}}}}}............................................}}}}}}}}}}}}}}}
}}}}}}}}}}}}}}}}}}}}}................................}}}}}}}}}}}}}}}}}}}}}
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}................}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
ENDMAP
# Unlit, except 3 mapgrids around the "pupil"
REGION:(00,00,73,18),unlit,"ordinary"
REGION:(26,04,47,14),lit,"ordinary"
REGION:(21,05,51,13),lit,"ordinary"
REGION:(19,06,54,12),lit,"ordinary"
STAIR:random,up
STAIR:random,down
LOOP [15] {
OBJECT:random,random
}
LOOP [6] {
TRAP:random,random
}
LOOP [28] {
MONSTER:random,random
}
# Fog Maze
LEVEL:"bigrm-10"
FLAGS:mazelevel
GEOMETRY:center,center
MAP
.......................................................................
.......................................................................
.......................................................................
.......................................................................
...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C...
...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...
...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C...
...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...
...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C...
...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...
...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C...
...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...
...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C...
...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...
...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C...
.......................................................................
.......................................................................
.......................................................................
.......................................................................
ENDMAP
REGION:(00,00,70,18),lit,"ordinary"
# when falling down on this level, never end up in the fog maze
TELEPORT_REGION:(00,00,70,18),(02,03,68,15),down
LOOP [15] {
OBJECT:random,random
}
LOOP [6] {
TRAP:random,random
}
LOOP [28] {
MONSTER:random,random
}
MAZEWALK:(4, 2), south
# Stairs up, not in the fog maze
STAIR:(00,00,70,18),(02,03,68,15),up
STAIR:random,down
+2 -2
View File
@@ -24,10 +24,10 @@ LEVELDESC: roguelike
LEVEL: "oracle" "O" @ (5, 5) LEVEL: "oracle" "O" @ (5, 5)
LEVALIGN: neutral LEVALIGN: neutral
CHAINBRANCH: "Sokoban" "oracle" + (1, 0) up CHAINBRANCH: "Sokoban" "oracle" + (1, 0) up
RNDLEVEL: "bigrm" "B" @ (10, 3) 40 5 RNDLEVEL: "bigrm" "B" @ (10, 3) 40 10
CHAINBRANCH: "The Quest" "oracle" + (6, 2) portal CHAINBRANCH: "The Quest" "oracle" + (6, 2) portal
BRANCH: "Fort Ludios" @ (18, 4) portal BRANCH: "Fort Ludios" @ (18, 4) portal
RNDLEVEL: "medusa" "none" @ (-5, 4) 2 RNDLEVEL: "medusa" "none" @ (-5, 4) 4
LEVALIGN: chaotic LEVALIGN: chaotic
LEVEL: "castle" "none" @ (-1, 0) LEVEL: "castle" "none" @ (-1, 0)
CHAINBRANCH: "Gehennom" "castle" + (0, 0) no_down CHAINBRANCH: "Gehennom" "castle" + (0, 0) no_down
+28 -24
View File
@@ -163,43 +163,43 @@ INIT_MAP:mines,'.','}',true,true,unlit,false
# guarantee at least one open spot to ensure successful stair placement # guarantee at least one open spot to ensure successful stair placement
GEOMETRY:left,bottom GEOMETRY:left,bottom
MAP MAP
}}}}}}}} xxxxxxxx
}}...}}} xx...xxx
}}}...}} xxx...xx
}}}}.}}} xxxx.xxx
}}}}}}}} xxxxxxxx
ENDMAP ENDMAP
OBJECT:('`',"boulder"),random OBJECT:('`',"boulder"),random
GEOMETRY:right,top GEOMETRY:right,top
MAP MAP
}}}}}}}} xxxxxxxx
}}}}.}}} xxxx.xxx
}}}...}} xxx...xx
}}...}}} xx...xxx
}}}}}}}} xxxxxxxx
ENDMAP ENDMAP
OBJECT:('`',"boulder"),random OBJECT:('`',"boulder"),random
# lair # lair
GEOMETRY:center,center GEOMETRY:center,center
MAP MAP
..}}}}}.}}}}}.}}}}}.}}}}}.}}}}}.}}}}}.}}}}}.}}}}}.. xx}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}xx
.}}}.}}}}}..}}}..}}}}}..}}}..}}}}}..}}}..}}}}}.}}}. x}}}.}}}}}..}}}..}}}}}..}}}..}}}}}..}}}..}}}}}.}}}x
}}}...}}..}}.}.}}.}}.}}}...}}}.}}}..}}}..}}}}...}}} }}}...}}..}}.}.}}.}}.}}}...}}}.}}}..}}}..}}}}...}}}
.}}}.}}.}}}.}}.}}.}}...}}.}}.....}}.....}....}.}}}. x}}}.}}.}}}.}}.}}.}}...}}.}}.....}}.....}....}.}}}x
..}}}..}}}.}}.}}.}}..}}.....}}.}}}.}}.}}}}}}}}}}}.. xx}}}..}}}.}}.}}.}}..}}.....}}.}}}.}}.}}}}}}}}}}}xx
.}}}..}}}}}.}}.}}.}}...}}}}}.....}}.}}}}}}.....}}}. x}}}..}}}}}.}}.}}.}}...}}}}}.....}}.}}}}}}.....}}}x
}}}..}}...}}..}}.}}}.}}}...}}}.}}}.}.}}}}..P.P..}}} }}}..}}...}}..}}.}}}.}}}...}}}.}}}.}.}}}}..P.P..}}}
}}.}}}}...}}}}}.}...}}}..P..}}}.}.}}}.}}}}.....}}}} }}.}}}}...}}}}}.}...}}}..P..}}}.}.}}}.}}}}.....}}}}
}.}}}}.}}.}..}.}}}}}}}..P.P..}}}.}}}.}}..}}...}}}}. }.}}}}.}}.}..}.}}}}}}}..P.P..}}}.}}}.}}..}}...}}}}x
.}}}}.}}}}....}}}}}.}}}..P..}}}.}}}}.}}..}}...}}}.} x}}}}.}}}}....}}}}}.}}}..P..}}}.}}}}.}}..}}...}}}.}
}}}}..}}.}}..}}}}...}}}}...}}}.}}}}}.}}}}.}}}}}}.}} }}}}..}}.}}..}}}}...}}}}...}}}.}}}}}.}}}}.}}}}}}.}}
}}}...}}...}}}..}}}}}}}}}}}}.....}}}}.}}...}..}.}}} }}}...}}...}}}..}}}}}}}}}}}}.....}}}}.}}...}..}.}}}
.}}}..}}.}}}}....}}..}}}..}}.....}}}}.}}}.}....}}}. x}}}..}}.}}}}....}}..}}}..}}.....}}}}.}}}.}....}}}x
..}}}.}}}}..}}..}}..}}..}}..}}.}}}..}.}..}}}..}}}.. xx}}}.}}}}..}}..}}..}}..}}..}}.}}}..}.}..}}}..}}}xx
.}}}.}}}}....}}}}..}}....}}}}}}}...}}}....}}}}.}}}. x}}}.}}}}....}}}}..}}....}}}}}}}...}}}....}}}}.}}}x
}}}...}}}....}}}..}}}....}}}..}}...}}}....}}}...}}} }}}...}}}....}}}..}}}....}}}..}}...}}}....}}}...}}}
.}}}.}}}}}..}}}..}}}}}..}}}..}}}}}..}}}..}}}}}.}}}. x}}}.}}}}}..}}}..}}}}}..}}}..}}}}}..}}}..}}}}}.}}}x
..}}}}}.}}}}}.}}}}}.}}}}}.}}}}}.}}}}}.}}}}}.}}}}}.. xx}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}xx
ENDMAP ENDMAP
# Random registers # Random registers
$monster = monster: { 'j','b','P','F' } $monster = monster: { 'j','b','P','F' }
@@ -502,8 +502,8 @@ TRAP:"magic", random
# #
# The Baalzebub level # The Baalzebub level
# #
MAZE:"baalz",random MAZE:"baalz",' '
FLAGS: noteleport FLAGS: noteleport,corrmaze
GEOMETRY:right,center GEOMETRY:right,center
MAP MAP
------------------------------------------------- -------------------------------------------------
@@ -561,6 +561,10 @@ MONSTER:'V',random
# #
MAZE:"sanctum", ' ' MAZE:"sanctum", ' '
FLAGS: noteleport,hardfloor,nommap FLAGS: noteleport,hardfloor,nommap
# This is outside the main map, below, so we must do it before adding
# that map and anchoring coordinates to it. This extends the invisible
# barrier up to the top row, which falls outside the drawn map.
NON_PASSWALL:(39,00,41,00)
GEOMETRY:center,center GEOMETRY:center,center
MAP MAP
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
+2 -2
View File
@@ -186,8 +186,8 @@ as well as maintaining the X11 interface.
Ken Lorber, Haoyang Wang, Pat Rankin, and Dean Luick maintained the port Ken Lorber, Haoyang Wang, Pat Rankin, and Dean Luick maintained the port
of NetHack 3.6.0 for Mac. of NetHack 3.6.0 for Mac.
Michael Allison, Derek S. Ray, Yitzhak Sapir, Alex Kompel, and David Cohrs Michael Allison, Derek S. Ray, Yitzhak Sapir, Alex Kompel, Dion Nicolaas,
maintained the port of NetHack 3.6.0 for Microsoft Windows. and David Cohrs maintained the port of NetHack 3.6.0 for Microsoft Windows.
Jeff Bailey created and maintained a port of NetHack 3.6.0 for Chrome. Jeff Bailey created and maintained a port of NetHack 3.6.0 for Chrome.
+199
View File
@@ -217,3 +217,202 @@ MONSTER:random,random
MONSTER:random,random MONSTER:random,random
MONSTER:random,random MONSTER:random,random
MONSTER:random,random MONSTER:random,random
LEVEL:"medusa-3"
FLAGS: noteleport,mazelevel
INIT_MAP:solidfill,' '
GEOMETRY:center,center
#
# Here you disturb ravens nesting in the trees.
#
MAP
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
}}}}}}}}}}.}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.}}}}}}}}}}}}}}}}}}}}}}}}}}}}
}}}}}}}}T..T.}}}}}}}}}}}}}}}}}}}}..}}}}}}}}.}}}...}}}}}}}.}}}}}......}}}}}}}
}}}}}}.......T.}}}}}}}}}}}..}}}}..T.}}}}}}...T...T..}}...T..}}..-----..}}}}}
}}}...-----....}}}}}}}}}}.T..}}}}}...}}}}}.....T..}}}}}......T..|...|.T..}}}
}}}.T.|...|...T.}}}}}}}.T......}}}}..T..}}.}}}.}}...}}}}}.T.....+...|...}}}}
}}}}..|...|.}}.}}}}}.....}}}T.}}}}.....}}}}}}.T}}}}}}}}}}}}}..T.|...|.}}}}}}
}}}}}.|...|.}}}}}}..T..}}}}}}}}}}}}}T.}}}}}}}}..}}}}}}}}}}}.....-----.}}}}}}
}}}}}.--+--..}}}}}}...}}}}}}}}}}}}}}}}}}}T.}}}}}}}}}}}}}}}}.T.}........}}}}}
}}}}}.......}}}}}}..}}}}}}}}}.}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.}}}.}}.T.}}}}}}
}}.T...T...}}}}T}}}}}}}}}}}....}}}}}}}}}}T}}}}}.T}}...}}}}}}}}}}}}}}...}}}}}
}}}...T}}}}}}}..}}}}}}}}}}}.T...}}}}}}}}.T.}.T.....T....}}}}}}}}}}}}}.}}}}}}
}}}}}}}}}}}}}}}....}}}}}}}...}}.}}}}}}}}}}............T..}}}}}.T.}}}}}}}}}}}
}}}}}}}}}}}}}}}}..T..}}}}}}}}}}}}}}..}}}}}..------+--...T.}}}....}}}}}}}}}}}
}}}}.}..}}}}}}}.T.....}}}}}}}}}}}..T.}}}}.T.|...|...|....}}}}}.}}}}}...}}}}}
}}}.T.}...}..}}}}T.T.}}}}}}.}}}}}}}....}}...|...+...|.}}}}}}}}}}}}}..T...}}}
}}}}..}}}.....}}...}}}}}}}...}}}}}}}}}}}}}T.|...|...|}}}}}}}}}}}....T..}}}}}
}}}}}..}}}.T..}}}.}}}}}}}}.T..}}}}}}}}}}}}}}---S-----}}}}}}}}}}}}}....}}}}}}
}}}}}}}}}}}..}}}}}}}}}}}}}}}.}}}}}}}}}}}}}}}}}T..T}}}}}}}}}}}}}}}}}}}}}}}}}}
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
ENDMAP
$place = { (08,06),(66,05),(46,15) }
SHUFFLE: $place
REGION:(00,00,74,19),lit,"ordinary"
REGION:(49,14,51,16),random,"ordinary",unfilled
REGION:(07,05,09,07),unlit,"ordinary"
REGION:(65,04,67,06),unlit,"ordinary"
REGION:(45,14,47,16),unlit,"ordinary"
# Non diggable walls
# 4th room has diggable walls as Medusa is never placed there
NON_DIGGABLE:(06,04,10,08)
NON_DIGGABLE:(64,03,68,07)
NON_DIGGABLE:(44,13,48,17)
# All places are accessible also with jumping, so don't bother
# restricting the placement when teleporting from levels below this.
TELEPORT_REGION:(33,02,38,07),(0,0,0,0),down
STAIR:(32,01,39,07),(0,0,0,0),up
STAIR:$place[0],down
DOOR:locked,(08,08)
DOOR:locked,(64,05)
DOOR:random,(50,13)
DOOR:locked,(48,15)
#
FOUNTAIN:$place[1]
#
CONTAINER:('`',"statue"),$place[2],uncursed,montype:"knight",3,name:"Perseus" {
[75%]: OBJECT: ('[',"shield of reflection"),cursed,+0
[25%]: OBJECT: ('[',"levitation boots"),+0
[50%]: OBJECT: (')',"scimitar"),blessed,+2
[50%]: OBJECT: ('(',"sack")
}
#
CONTAINER:('`',"statue"),random { }
CONTAINER:('`',"statue"),random { }
CONTAINER:('`',"statue"),random { }
CONTAINER:('`',"statue"),random { }
CONTAINER:('`',"statue"),random { }
CONTAINER:('`',"statue"),random { }
CONTAINER:('`',"statue"),random { }
LOOP [8] {
OBJECT:random,random
}
OBJECT:('?',"blank paper"),(48,18)
OBJECT:('?',"blank paper"),(48,18)
#
TRAP:"rust",random
TRAP:"rust",random
TRAP:"board",random
TRAP:"board",random
TRAP:random,random
#
MONSTER:('@',"Medusa"),$place[0]
MONSTER:(';',"giant eel"),random
MONSTER:(';',"giant eel"),random
MONSTER:(';',"jellyfish"),random
MONSTER:(';',"jellyfish"),random
MONSTER:('n',"wood nymph"),random
MONSTER:('n',"wood nymph"),random
MONSTER:('n',"water nymph"),random
MONSTER:('n',"water nymph"),random
LOOP [30] {
MONSTER:('B',"raven"),random,hostile
}
LEVEL:"medusa-4"
FLAGS: noteleport,mazelevel
INIT_MAP:solidfill,' '
GEOMETRY:center,center
#
# Here the Medusa rules some slithery monsters from her 'palace', with
# a yellow dragon nesting in the backyard.
#
MAP
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
}}}}}}}}}}}}}}........}}}}}}}}}}}}}}}}}}}}}}}..}}}.....}}}}}}}}}}}----|}}}}}
}}}}}}..----------F-.....}}}}}}}}}}}}}}}}..---...}}}}....T.}}}}}}}....|}}}}}
}}}.....|...F......S}}}}....}}}}}}}...}}.....|}}.}}}}}}}......}}}}|......}}}
}}}.....+...|..{...|}}}}}}}}}}}}.....}}}}|...|}}}}}}}}}}}.}}}}}}}}----.}}}}}
}}......|...|......|}}}}}}}}}......}}}}}}|.......}}}}}}}}}}}}}..}}}}}...}}}}
}}|-+--F|-+--....|F|-|}}}}}....}}}....}}}-----}}.....}}}}}}}......}}}}.}}}}}
}}|...}}|...|....|}}}|}}}}}}}..}}}}}}}}}}}}}}}}}}}}....}}}}}}}}....T.}}}}}}}
}}|...}}F...+....F}}}}}}}..}}}}}}}}}}}}}}...}}}}}}}}}}}}}}}}}}}}}}....}}..}}
}}|...}}|...|....|}}}|}....}}}}}}....}}}...}}}}}...}}}}}}}}}}}}}}}}}.....}}}
}}--+--F|-+--....-F|-|....}}}}}}}}}}.T...}}}}....---}}}}}}}}}}}}}}}}}}}}}}}}
}}......|...|......|}}}}}.}}}}}}}}}....}}}}}}}.....|}}}}}}}}}.}}}}}}}}}}}}}}
}}}}....+...|..{...|.}}}}}}}}}}}}}}}}}}}}}}}}}}.|..|}}}}}}}......}}}}...}}}}
}}}}}}..|...F......|...}}}}}}}}}}..---}}}}}}}}}}--.-}}}}}....}}}}}}....}}}}}
}}}}}}}}-----S----F|....}}}}}}}}}|...|}}}}}}}}}}}}...}}}}}}...}}}}}}..}}}}}}
}}}}}}}}}..............T...}}}}}.|.......}}}}}}}}}}}}}}..}...}.}}}}....}}}}}
}}}}}}}}}}....}}}}...}...}}}}}.......|.}}}}}}}}}}}}}}.......}}}}}}}}}...}}}}
}}}}}}}}}}..}}}}}}}}}}.}}}}}}}}}}-..--.}}}}}}}}..}}}}}}..T...}}}..}}}}}}}}}}
}}}}}}}}}...}}}}}}}}}}}}}}}}}}}}}}}...}}}}}}}....}}}}}}}.}}}..}}}...}}}}}}}}
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.}}}}}}....}}}}}}}}}}}}}}}}}}}...}}}}}}
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
ENDMAP
#
$place = { (04,08),(10,04),(10,08),(10,12) }
SHUFFLE: $place
#
REGION:(00,00,74,19),lit,"ordinary"
REGION:(13,03,18,13),lit,"ordinary",unfilled
#
TELEPORT_REGION:(64,01,74,17),(0,0,0,0),down
TELEPORT_REGION:(02,02,18,13),(0,0,0,0),up
#
STAIR:(67,01,74,20),(0,0,0,0),up
STAIR:$place[0],down
#
DOOR:locked,(04,06)
DOOR:locked,(04,10)
DOOR:locked,(08,04)
DOOR:locked,(08,12)
DOOR:locked,(10,06)
DOOR:locked,(10,10)
DOOR:locked,(12,08)
#
BRANCH:levregion(27,00,79,20),(0,0,0,0)
#
NON_DIGGABLE:(01,01,22,14)
#
OBJECT:('(',"crystal ball"),(07,08)
#
CONTAINER:('`',"statue"),$place[1],uncursed,montype:"knight",3,name:"Perseus" {
[75%]: OBJECT: ('[',"shield of reflection"),cursed,+0
[25%]: OBJECT: ('[',"levitation boots"),+0
[50%]: OBJECT: (')',"scimitar"),blessed,+2
[50%]: OBJECT: ('(',"sack")
}
#
CONTAINER:('`',"statue"),random { }
CONTAINER:('`',"statue"),random { }
CONTAINER:('`',"statue"),random { }
CONTAINER:('`',"statue"),random { }
CONTAINER:('`',"statue"),random { }
CONTAINER:('`',"statue"),random { }
CONTAINER:('`',"statue"),random { }
LOOP [8] {
OBJECT:random,random
}
#
LOOP [7] {
TRAP:random,random
}
#
MONSTER:('@',"Medusa"),$place[0]
MONSTER:(';',"kraken"),(07,07)
#
# the nesting dragon
MONSTER:('D',"yellow dragon"), (05,04), asleep
[50%]: MONSTER: ('D',"baby yellow dragon"), (04,04), asleep
[25%]: MONSTER: ('D',"baby yellow dragon"), (04,05), asleep
OBJECT:('%',"egg"), (05,04), montype:"yellow dragon"
[50%]: OBJECT: ('%',"egg"), (05,04), montype:"yellow dragon"
[25%]: OBJECT: ('%',"egg"), (05,04), montype:"yellow dragon"
#
MONSTER:(';',"giant eel"),random
MONSTER:(';',"giant eel"),random
MONSTER:(';',"jellyfish"),random
MONSTER:(';',"jellyfish"),random
LOOP [14] {
MONSTER:'S',random
}
LOOP [4] {
MONSTER:('N',"black naga hatchling"), random
MONSTER:('N',"black naga"), random
}
+18
View File
@@ -1952,6 +1952,8 @@ new players if it detects some anticipated mistakes (default on).
.lp "confirm " .lp "confirm "
Have user confirm attacks on pets, shopkeepers, and other Have user confirm attacks on pets, shopkeepers, and other
peaceable creatures (default on). peaceable creatures (default on).
.lp dark_room
Show out-of-sight areas of lit rooms (default off).
.lp disclose .lp disclose
Controls what information the program reveals when the game ends. Controls what information the program reveals when the game ends.
Value is a space separated list of prompting/category pairs Value is a space separated list of prompting/category pairs
@@ -2324,6 +2326,19 @@ the appearance of the display, not the way the game treats you.
Show your approximate accumulated score on bottom line (default off). Show your approximate accumulated score on bottom line (default off).
.lp "silent " .lp "silent "
Suppress terminal beeps (default on). Suppress terminal beeps (default on).
.lp sortloot
Controls the sorting behavior of the pickup lists for inventory
and #loot commands and some others.
The possible values are:
.PS full
.PL full
always sort the lists;
.PL loot
only sort the lists that don't use inventory letters, like with
the #loot and pickup commands;
.PL none
show lists the traditional way without sorting.
.PE
.lp sortpack .lp sortpack
Sort the pack contents by type when displaying inventory (default on). Sort the pack contents by type when displaying inventory (default on).
.lp sparkle .lp sparkle
@@ -2992,6 +3007,9 @@ A string explaining how to recover a game on this system (no default value).
SEDUCE SEDUCE
0 or 1 to disable or enable, respectively, the SEDUCE option (see the source 0 or 1 to disable or enable, respectively, the SEDUCE option (see the source
for details on this function). for details on this function).
.lp
CHECK_SAVE_UID
0 or 1 to disable or enable, respectively, the UID checking for savefiles.
.pg .pg
The following options affect the score file: The following options affect the score file:
.pg .pg
+20
View File
@@ -2363,6 +2363,9 @@ players if it detects some anticipated mistakes (default on).
Have user confirm attacks on pets, shopkeepers, and other Have user confirm attacks on pets, shopkeepers, and other
peaceable creatures (default on). peaceable creatures (default on).
%.lp %.lp
%.lp
\item[\ib{dark\_room}]
Show out-of-sight areas of lit rooms (default off).
\item[\ib{disclose}] \item[\ib{disclose}]
Controls what information the program reveals when the game ends. Controls what information the program reveals when the game ends.
Value is a space separated list of prompting/category pairs Value is a space separated list of prompting/category pairs
@@ -2789,6 +2792,20 @@ Show your approximate accumulated score on bottom line (default off).
\item[\ib{silent}] \item[\ib{silent}]
Suppress terminal beeps (default on). Suppress terminal beeps (default on).
%.lp %.lp
\item[\ib{sortloot}]
Controls the sorting behavior of pickup lists for inventory
and \#loot commands and some others.
The possible values are:
%.sd
%.si
{\tt full} --- always sort the lists;\\
{\tt loot} --- only sort the lists that don't use inventory
letters, like with the \#loot and pickup commands;\\
{\tt none} --- show lists the traditional way without sorting.
%.ei
%.ed
%.lp
\item[\ib{sortpack}] \item[\ib{sortpack}]
Sort the pack contents by type when displaying inventory (default on). Sort the pack contents by type when displaying inventory (default on).
%.lp %.lp
@@ -3580,6 +3597,9 @@ A string explaining how to recover a game on this system (no default value).
\item[\ib{SEDUCE}] \item[\ib{SEDUCE}]
0 or 1 to disable or enable, respectively, the SEDUCE option (see the source) 0 or 1 to disable or enable, respectively, the SEDUCE option (see the source)
for details on this function. for details on this function.
%.lp
\item[\ib{CHECK\_SAVE\_UID}]
0 or 1 to disable or enable, respectively, the UID checking for savefiles.
\elist \elist
%.pg %.pg
+5
View File
@@ -894,6 +894,8 @@ non-pet rust monsters would eat rust-proofed non-digestibles but ignore
kicking a grave may topple the gravestone kicking a grave may topple the gravestone
allow showing legal positions for stinking cloud, jumping and polearms allow showing legal positions for stinking cloud, jumping and polearms
when asked for a location when asked for a location
cloned creatures (of any type) don't deathdrop items
pudding corpses behave somewhat differently than before
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
@@ -1112,6 +1114,7 @@ show more explicit reason why player was helpless at death
added new hallucinatory-only gods added new hallucinatory-only gods
options to create the character blind or nudist options to create the character blind or nudist
moving clouds on the plane of air moving clouds on the plane of air
disclose extinct species alongside genocided ones
Platform- and/or Interface-Specific New Features Platform- and/or Interface-Specific New Features
@@ -1151,6 +1154,8 @@ adopt/adapt/improve the Paranoid_Quit patch; default is paranoid_confirm:pray
adopt/adapt/improve Dungeon Overview adopt/adapt/improve Dungeon Overview
Aardvark Joe's Extended Logfile Aardvark Joe's Extended Logfile
Michael Deutschmann's use_darkgray Michael Deutschmann's use_darkgray
Clive Crous' dark_room
sortloot by Jeroen Demeyer and Jukka Lahtinen
Code Cleanup and Reorganization Code Cleanup and Reorganization
+2 -1
View File
@@ -415,7 +415,6 @@ typedef unsigned char uchar;
/* display features */ /* display features */
/* dungeon features */ /* dungeon features */
/* dungeon levels */ /* dungeon levels */
#define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */
/* monsters & objects */ /* monsters & objects */
/* I/O */ /* I/O */
#if !defined(MAC) #if !defined(MAC)
@@ -437,6 +436,8 @@ typedef unsigned char uchar;
*/ */
/* Menucolors */ /* Menucolors */
/* HACK: this is being added to fix the builds temporarily.
* Remove it whenever we finally get a real regex for Win32 */
#ifdef UNIX #ifdef UNIX
# define MENU_COLOR_REGEX /* use GNU regex */ # define MENU_COLOR_REGEX /* use GNU regex */
/*# define MENU_COLOR_REGEX_POSIX*/ /* use POSIX regex */ /*# define MENU_COLOR_REGEX_POSIX*/ /* use POSIX regex */
+9 -2
View File
@@ -1,4 +1,4 @@
/* NetHack 3.5 extern.h $NHDT-Date: 1426966688 2015/03/21 19:38:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.411 $ */ /* NetHack 3.5 extern.h $NHDT-Date: 1428715841 2015/04/11 01:30:41 $ $NHDT-Branch: master $:$NHDT-Revision: 1.454 $ */
/* Copyright (c) Steve Creps, 1988. */ /* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -856,6 +856,8 @@ E int NDECL(midnight);
/* ### invent.c ### */ /* ### invent.c ### */
E struct obj **FDECL(objarr_init, (int));
E void FDECL(objarr_set, (struct obj *, int, struct obj **, BOOLEAN_P));
E void FDECL(assigninvlet, (struct obj *)); E void FDECL(assigninvlet, (struct obj *));
E struct obj *FDECL(merge_choice, (struct obj *,struct obj *)); E struct obj *FDECL(merge_choice, (struct obj *,struct obj *));
E int FDECL(merged, (struct obj **,struct obj **)); E int FDECL(merged, (struct obj **,struct obj **));
@@ -1224,6 +1226,10 @@ E void FDECL(obj_ice_effects, (int, int, BOOLEAN_P));
E long FDECL(peek_at_iced_corpse_age, (struct obj *)); E long FDECL(peek_at_iced_corpse_age, (struct obj *));
E int FDECL(hornoplenty, (struct obj *,BOOLEAN_P)); E int FDECL(hornoplenty, (struct obj *,BOOLEAN_P));
E void NDECL(obj_sanity_check); E void NDECL(obj_sanity_check);
E struct obj* FDECL(obj_nexto, (struct obj*));
E struct obj* FDECL(obj_nexto_xy, (int, int, int, unsigned));
E struct obj* FDECL(obj_absorb, (struct obj**, struct obj**));
E struct obj* FDECL(obj_meld, (struct obj**, struct obj**));
/* ### mkroom.c ### */ /* ### mkroom.c ### */
@@ -1522,6 +1528,7 @@ E char *FDECL(doname, (struct obj *));
E boolean FDECL(not_fully_identified, (struct obj *)); E boolean FDECL(not_fully_identified, (struct obj *));
E char *FDECL(corpse_xname, (struct obj *,const char *,unsigned)); E char *FDECL(corpse_xname, (struct obj *,const char *,unsigned));
E char *FDECL(cxname, (struct obj *)); E char *FDECL(cxname, (struct obj *));
E char *FDECL(cxname_singular, (struct obj *));
E char *FDECL(killer_xname, (struct obj *)); E char *FDECL(killer_xname, (struct obj *));
E char *FDECL(short_oname, (struct obj *,char *(*)(OBJ_P),char *(*)(OBJ_P), E char *FDECL(short_oname, (struct obj *,char *(*)(OBJ_P),char *(*)(OBJ_P),
unsigned)); unsigned));
@@ -2656,7 +2663,7 @@ E struct monst *FDECL(bhit, (int,int,int,int,int (*)(MONST_P,OBJ_P),
int (*)(OBJ_P,OBJ_P),struct obj **)); int (*)(OBJ_P,OBJ_P),struct obj **));
E struct monst *FDECL(boomhit, (struct obj *,int,int)); E struct monst *FDECL(boomhit, (struct obj *,int,int));
E int FDECL(zhitm, (struct monst *,int,int,struct obj **)); E int FDECL(zhitm, (struct monst *,int,int,struct obj **));
E int FDECL(burn_floor_paper, (int,int,BOOLEAN_P,BOOLEAN_P)); E int FDECL(burn_floor_objects, (int,int,BOOLEAN_P,BOOLEAN_P));
E void FDECL(buzz, (int,int,XCHAR_P,XCHAR_P,int,int)); E void FDECL(buzz, (int,int,XCHAR_P,XCHAR_P,int,int));
E void FDECL(melt_ice, (XCHAR_P,XCHAR_P,const char *)); E void FDECL(melt_ice, (XCHAR_P,XCHAR_P,const char *));
E void FDECL(start_melt_ice_timeout, (XCHAR_P,XCHAR_P,long)); E void FDECL(start_melt_ice_timeout, (XCHAR_P,XCHAR_P,long));
+2
View File
@@ -22,6 +22,7 @@ struct flag {
boolean biff; /* enable checking for mail */ boolean biff; /* enable checking for mail */
boolean bones; /* allow saving/loading bones */ boolean bones; /* allow saving/loading bones */
boolean confirm; /* confirm before hitting tame monsters */ boolean confirm; /* confirm before hitting tame monsters */
boolean dark_room; /* show shadows in lit rooms */
boolean debug; /* in debugging mode */ boolean debug; /* in debugging mode */
#define wizard flags.debug #define wizard flags.debug
boolean end_own; /* list all own scores */ boolean end_own; /* list all own scores */
@@ -46,6 +47,7 @@ struct flag {
boolean showexp; /* show experience points */ boolean showexp; /* show experience points */
boolean showscore; /* show score */ boolean showscore; /* show score */
boolean silent; /* whether the bell rings or not */ boolean silent; /* whether the bell rings or not */
boolean sortloot; /* sort items alphabetically when looting */
boolean sortpack; /* sorted inventory */ boolean sortpack; /* sorted inventory */
boolean sparkle; /* show "resisting" special FX (Scott Bigham) */ boolean sparkle; /* show "resisting" special FX (Scott Bigham) */
boolean standout; /* use standout for --More-- */ boolean standout; /* use standout for --More-- */
+6 -1
View File
@@ -94,7 +94,7 @@ struct obj {
Bitfield(recharged,3); /* number of times it's been recharged */ Bitfield(recharged,3); /* number of times it's been recharged */
#define on_ice recharged /* corpse on ice */ #define on_ice recharged /* corpse on ice */
Bitfield(lamplit,1); /* a light-source -- can be lit */ Bitfield(lamplit,1); /* a light-source -- can be lit */
Bitfield(oreserved1,1); /* was the placeholder for invisible objects, free for use */ Bitfield(globby,1); /* globby; will combine with like types on adjacent squares */
Bitfield(greased,1); /* covered with grease */ Bitfield(greased,1); /* covered with grease */
Bitfield(nomerge,1); /* set temporarily to prevent merging */ Bitfield(nomerge,1); /* set temporarily to prevent merging */
Bitfield(was_thrown,1); /* thrown by hero since last picked up */ Bitfield(was_thrown,1); /* thrown by hero since last picked up */
@@ -232,6 +232,11 @@ struct obj {
#define polyfodder(obj) (ofood(obj) && pm_to_cham((obj)->corpsenm) != NON_PM) #define polyfodder(obj) (ofood(obj) && pm_to_cham((obj)->corpsenm) != NON_PM)
#define mlevelgain(obj) (ofood(obj) && (obj)->corpsenm == PM_WRAITH) #define mlevelgain(obj) (ofood(obj) && (obj)->corpsenm == PM_WRAITH)
#define mhealup(obj) (ofood(obj) && (obj)->corpsenm == PM_NURSE) #define mhealup(obj) (ofood(obj) && (obj)->corpsenm == PM_NURSE)
#define Is_pudding(o) (o->otyp == GLOB_OF_GRAY_OOZE \
|| o->otyp == GLOB_OF_BROWN_PUDDING \
|| o->otyp == GLOB_OF_GREEN_SLIME \
|| o->otyp == GLOB_OF_BLACK_PUDDING)
/* Containers */ /* Containers */
#define carried(o) ((o)->where == OBJ_INVENT) #define carried(o) ((o)->where == OBJ_INVENT)
+82 -76
View File
@@ -128,98 +128,102 @@
#define S_bars 17 /* KMH -- iron bars */ #define S_bars 17 /* KMH -- iron bars */
#define S_tree 18 /* KMH */ #define S_tree 18 /* KMH */
#define S_room 19 #define S_room 19
#define S_corr 20 #define S_darkroom 20
#define S_litcorr 21 #define S_corr 21
#define S_upstair 22 #define S_litcorr 22
#define S_dnstair 23 #define S_upstair 23
#define S_upladder 24 #define S_dnstair 24
#define S_dnladder 25 #define S_upladder 25
#define S_altar 26 #define S_dnladder 26
#define S_grave 27 #define S_altar 27
#define S_throne 28 #define S_grave 28
#define S_sink 29 #define S_throne 29
#define S_fountain 30 #define S_sink 30
#define S_pool 31 #define S_fountain 31
#define S_ice 32 #define S_pool 32
#define S_lava 33 #define S_ice 33
#define S_vodbridge 34 #define S_lava 34
#define S_hodbridge 35 #define S_vodbridge 35
#define S_vcdbridge 36 /* closed drawbridge, vertical wall */ #define S_hodbridge 36
#define S_hcdbridge 37 /* closed drawbridge, horizontal wall */ #define S_vcdbridge 37 /* closed drawbridge, vertical wall */
#define S_air 38 #define S_hcdbridge 38 /* closed drawbridge, horizontal wall */
#define S_cloud 39 #define S_air 39
#define S_water 40 #define S_cloud 40
#define S_water 41
/* end dungeon characters, begin traps */ /* end dungeon characters, begin traps */
#define S_arrow_trap 41 #define S_arrow_trap 42
#define S_dart_trap 42 #define S_dart_trap 43
#define S_falling_rock_trap 43 #define S_falling_rock_trap 44
#define S_squeaky_board 44 #define S_squeaky_board 45
#define S_bear_trap 45 #define S_bear_trap 46
#define S_land_mine 46 #define S_land_mine 47
#define S_rolling_boulder_trap 47 #define S_rolling_boulder_trap 48
#define S_sleeping_gas_trap 48 #define S_sleeping_gas_trap 49
#define S_rust_trap 49 #define S_rust_trap 50
#define S_fire_trap 50 #define S_fire_trap 51
#define S_pit 51 #define S_pit 52
#define S_spiked_pit 52 #define S_spiked_pit 53
#define S_hole 53 #define S_hole 54
#define S_trap_door 54 #define S_trap_door 55
#define S_teleportation_trap 55 #define S_teleportation_trap 56
#define S_level_teleporter 56 #define S_level_teleporter 57
#define S_magic_portal 57 #define S_magic_portal 58
#define S_web 58 #define S_web 59
#define S_statue_trap 59 #define S_statue_trap 60
#define S_magic_trap 60 #define S_magic_trap 61
#define S_anti_magic_trap 61 #define S_anti_magic_trap 62
#define S_polymorph_trap 62 #define S_polymorph_trap 63
/* end traps, begin special effects */ /* end traps, begin special effects */
#define S_vbeam 63 /* The 4 zap beam symbols. Do NOT separate. */ #define S_vbeam 64 /* The 4 zap beam symbols. Do NOT separate. */
#define S_hbeam 64 /* To change order or add, see function */ #define S_hbeam 65 /* To change order or add, see function */
#define S_lslant 65 /* zapdir_to_glyph() in display.c. */ #define S_lslant 66 /* zapdir_to_glyph() in display.c. */
#define S_rslant 66 #define S_rslant 67
#define S_digbeam 67 /* dig beam symbol */ #define S_digbeam 68 /* dig beam symbol */
#define S_flashbeam 68 /* camera flash symbol */ #define S_flashbeam 69 /* camera flash symbol */
#define S_boomleft 69 /* thrown boomerang, open left, e.g ')' */ #define S_boomleft 70 /* thrown boomerang, open left, e.g ')' */
#define S_boomright 70 /* thrown boomerand, open right, e.g. '(' */ #define S_boomright 71 /* thrown boomerand, open right, e.g. '(' */
#define S_ss1 71 /* 4 magic shield glyphs */ #define S_ss1 72 /* 4 magic shield glyphs */
#define S_ss2 72 #define S_ss2 73
#define S_ss3 73 #define S_ss3 74
#define S_ss4 74 #define S_ss4 75
#define S_poisoncloud 75 #define S_poisoncloud 76
#define S_goodpos 77 /* valid position for targeting */
/* The 8 swallow symbols. Do NOT separate. To change order or add, see */ /* The 8 swallow symbols. Do NOT separate. To change order or add, see */
/* the function swallow_to_glyph() in display.c. */ /* the function swallow_to_glyph() in display.c. */
#define S_sw_tl 76 /* swallow top left [1] */ #define S_sw_tl 78 /* swallow top left [1] */
#define S_sw_tc 77 /* swallow top center [2] Order: */ #define S_sw_tc 79 /* swallow top center [2] Order: */
#define S_sw_tr 78 /* swallow top right [3] */ #define S_sw_tr 80 /* swallow top right [3] */
#define S_sw_ml 79 /* swallow middle left [4] 1 2 3 */ #define S_sw_ml 81 /* swallow middle left [4] 1 2 3 */
#define S_sw_mr 80 /* swallow middle right [6] 4 5 6 */ #define S_sw_mr 82 /* swallow middle right [6] 4 5 6 */
#define S_sw_bl 81 /* swallow bottom left [7] 7 8 9 */ #define S_sw_bl 83 /* swallow bottom left [7] 7 8 9 */
#define S_sw_bc 82 /* swallow bottom center [8] */ #define S_sw_bc 84 /* swallow bottom center [8] */
#define S_sw_br 83 /* swallow bottom right [9] */ #define S_sw_br 85 /* swallow bottom right [9] */
#define S_explode1 84 /* explosion top left */ #define S_explode1 86 /* explosion top left */
#define S_explode2 85 /* explosion top center */ #define S_explode2 87 /* explosion top center */
#define S_explode3 86 /* explosion top right Ex. */ #define S_explode3 88 /* explosion top right Ex. */
#define S_explode4 87 /* explosion middle left */ #define S_explode4 89 /* explosion middle left */
#define S_explode5 88 /* explosion middle center /-\ */ #define S_explode5 90 /* explosion middle center /-\ */
#define S_explode6 89 /* explosion middle right |@| */ #define S_explode6 91 /* explosion middle right |@| */
#define S_explode7 90 /* explosion bottom left \-/ */ #define S_explode7 92 /* explosion bottom left \-/ */
#define S_explode8 91 /* explosion bottom center */ #define S_explode8 93 /* explosion bottom center */
#define S_explode9 92 /* explosion bottom right */ #define S_explode9 94 /* explosion bottom right */
/* end effects */ /* end effects */
#define MAXPCHARS 93 /* maximum number of mapped characters */ #define MAXPCHARS 95 /* maximum number of mapped characters */
#define MAXDCHARS 41 /* maximum of mapped dungeon characters */ #define MAXDCHARS 42 /* maximum of mapped dungeon characters */
#define MAXTCHARS 22 /* maximum of mapped trap characters */ #define MAXTCHARS 22 /* maximum of mapped trap characters */
#define MAXECHARS 30 /* maximum of mapped effects characters */ #define MAXECHARS 31 /* maximum of mapped effects characters */
#define MAXEXPCHARS 9 /* number of explosion characters */ #define MAXEXPCHARS 9 /* number of explosion characters */
#define DARKROOMSYM (Is_rogue_level(&u.uz) ? S_stone : S_darkroom)
struct symdef { struct symdef {
uchar sym; uchar sym;
const char *explanation; const char *explanation;
@@ -550,6 +554,8 @@ struct levelflags {
Bitfield(wizard_bones,1); /* set if level came from a bones file Bitfield(wizard_bones,1); /* set if level came from a bones file
which was created in wizard mode (or which was created in wizard mode (or
normal mode descendant of such) */ normal mode descendant of such) */
Bitfield(corrmaze, 1); /* Whether corridors are used for the maze
rather than ROOM */
}; };
typedef struct typedef struct
+80 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.5 sp_lev.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ /* NetHack 3.5 sp_lev.h $NHDT-Date: 1428655166 2015/04/10 08:39:26 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */
/* NetHack 3.5 sp_lev.h $Date: 2009/05/06 10:45:06 $ $Revision: 1.5 $ */ /* NetHack 3.5 sp_lev.h $Date: 2009/05/06 10:45:06 $ $Revision: 1.5 $ */
/* SCCS Id: @(#)sp_lev.h 3.5 2007/08/01 */ /* SCCS Id: @(#)sp_lev.h 3.5 2007/08/01 */
/* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1989 by Jean-Christophe Collet */
@@ -30,6 +30,7 @@
#define GRAVEYARD 0x00000100L #define GRAVEYARD 0x00000100L
#define ICEDPOOLS 0x00000200L /* for ice locations: ICED_POOL vs ICED_MOAT */ #define ICEDPOOLS 0x00000200L /* for ice locations: ICED_POOL vs ICED_MOAT */
#define SOLIDIFY 0x00000400L /* outer areas are nondiggable & nonpasswall */ #define SOLIDIFY 0x00000400L /* outer areas are nondiggable & nonpasswall */
#define CORRMAZE 0x00000800L /* for maze levels only */
/* different level layout initializers */ /* different level layout initializers */
#define LVLINIT_NONE 0 #define LVLINIT_NONE 0
@@ -470,4 +471,82 @@ struct lc_breakdef {
int break_depth; int break_depth;
}; };
/*
* Quick! Avert your eyes while you still have a chance!
*/
#ifdef SPEC_LEV
/* compiling lev_comp rather than nethack */
# ifdef USE_OLDARGS
# undef VA_ARGS
# undef VA_DECL
# undef VA_DECL2
# undef VA_SHIFT
# define VA_ARGS arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,\
arg10,arg11,arg12,arg13,arg14
# define VA_DECL(typ1,var1) (var1,VA_ARGS) \
typ1 var1; \
char *arg1,*arg2,*arg3,*arg4,*arg5,*arg6,*arg7,*arg8,*arg9,\
*arg10,*arg11,*arg12,*arg13,*arg14; {
# define VA_DECL2(typ1,var1,typ2,var2) (var1,var2,VA_ARGS) \
typ1 var1; typ2 var2; \
char *arg1,*arg2,*arg3,*arg4,*arg5,*arg6,*arg7,*arg8,*arg9,\
*arg10,*arg11,*arg12,*arg13,*arg14; {
/* unlike in the core, lev_comp's VA_SHIFT is completely safe,
because callers always pass all these arguments */
# define VA_SHIFT() (arg1=arg2, arg2=arg3, arg3=arg4, arg4=arg5,\
arg5=arg6, arg6=arg7, arg7=arg8, arg8=arg9,\
arg9=arg10, arg10=arg11, arg11=arg12,\
arg12=arg13, arg13=arg14, arg14=0)
/* standard NULL may be either (void *)0 or plain 0, both of
which would need to be explicitly cast to (char *) here */
typedef char *Va;
# define VA_PASS1(a1) (Va)a1, (Va)0,(Va)0,(Va)0,(Va)0,\
(Va)0,(Va)0,(Va)0,(Va)0,(Va)0,\
(Va)0,(Va)0,(Va)0,(Va)0
# define VA_PASS2(a1,a2) (Va)a1, (Va)a2, (Va)0,(Va)0,(Va)0,\
(Va)0,(Va)0,(Va)0,(Va)0,(Va)0,\
(Va)0,(Va)0,(Va)0,(Va)0
# define VA_PASS3(a1,a2,a3) (Va)a1, (Va)a2, (Va)a3, (Va)0,(Va)0,\
(Va)0,(Va)0,(Va)0,(Va)0,(Va)0,\
(Va)0,(Va)0,(Va)0,(Va)0
# define VA_PASS4(a1,a2,a3,a4) (Va)a1, (Va)a2, (Va)a3, (Va)a4, (Va)0,\
(Va)0,(Va)0,(Va)0,(Va)0,(Va)0,\
(Va)0,(Va)0,(Va)0,(Va)0
# define VA_PASS5(a1,a2,a3,a4,a5) \
(Va)a1, (Va)a2, (Va)a3, (Va)a4, (Va)a5,\
(Va)0,(Va)0,(Va)0,(Va)0,(Va)0,\
(Va)0,(Va)0,(Va)0,(Va)0
# define VA_PASS7(a1,a2,a3,a4,a5,a6,a7) \
(Va)a1, (Va)a2, (Va)a3, (Va)a4, (Va)a5,\
(Va)a6, (Va)a7, (Va)0,(Va)0,(Va)0,\
(Va)0,(Va)0,(Va)0,(Va)0
# define VA_PASS8(a1,a2,a3,a4,a5,a6,a7,a8) \
(Va)a1, (Va)a2, (Va)a3, (Va)a4, (Va)a5,\
(Va)a6, (Va)a7, (Va)a8, (Va)0,(Va)0,\
(Va)0,(Va)0,(Va)0,(Va)0
# define VA_PASS9(a1,a2,a3,a4,a5,a6,a7,a8,a9) \
(Va)a1, (Va)a2, (Va)a3, (Va)a4, (Va)a5,\
(Va)a6, (Va)a7, (Va)a8, (Va)a9, (Va)0,\
(Va)0,(Va)0,(Va)0,(Va)0
# define VA_PASS14(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) \
(Va)a1, (Va)a2, (Va)a3, (Va)a4, (Va)a5,\
(Va)a6, (Va)a7, (Va)a8, (Va)a9, (Va)a10,\
(Va)a11, (Va)a12, (Va)a13, (Va)a14
# else /*!USE_OLDARGS*/
/* USE_STDARG and USE_VARARGS don't need to pass dummy arguments
or cast real ones */
# define VA_PASS1(a1) a1
# define VA_PASS2(a1,a2) a1,a2
# define VA_PASS3(a1,a2,a3) a1,a2,a3
# define VA_PASS4(a1,a2,a3,a4) a1,a2,a3,a4
# define VA_PASS5(a1,a2,a3,a4,a5) a1,a2,a3,a4,a5
# define VA_PASS7(a1,a2,a3,a4,a5,a6,a7) a1,a2,a3,a4,a5,a6,a7
# define VA_PASS8(a1,a2,a3,a4,a5,a6,a7,a8) a1,a2,a3,a4,a5,a6,a7,a8
# define VA_PASS9(a1,a2,a3,a4,a5,a6,a7,a8,a9) a1,a2,a3,a4,a5,a6,a7,a8,a9
# define VA_PASS14(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) \
a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14
# endif /*?USE_OLDARGS*/
/* You were warned to avert your eyes.... */
#endif /*SPEC_LEV*/
#endif /* SP_LEV_H */ #endif /* SP_LEV_H */
+1
View File
@@ -34,6 +34,7 @@ struct sysopt {
# endif # endif
#endif #endif
int seduce; int seduce;
int check_save_uid; /* restoring savefile checks UID? */
}; };
extern struct sysopt sysopt; extern struct sysopt sysopt;
+9 -2
View File
@@ -1,4 +1,4 @@
/* NetHack 3.5 tradstdc.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ /* NetHack 3.5 tradstdc.h $NHDT-Date: 1428655166 2015/04/10 08:39:26 $ $NHDT-Branch: master $:$NHDT-Revision: 1.19 $ */
/* NetHack 3.5 tradstdc.h $Date: 2012/01/11 18:23:26 $ $Revision: 1.15 $ */ /* NetHack 3.5 tradstdc.h $Date: 2012/01/11 18:23:26 $ $Revision: 1.15 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -95,10 +95,17 @@
# define VA_DECL(typ1,var1) (var1,VA_ARGS) typ1 var1; \ # define VA_DECL(typ1,var1) (var1,VA_ARGS) typ1 var1; \
char *arg1,*arg2,*arg3,*arg4,*arg5,*arg6,*arg7,*arg8,*arg9; { char *arg1,*arg2,*arg3,*arg4,*arg5,*arg6,*arg7,*arg8,*arg9; {
# define VA_DECL2(typ1,var1,typ2,var2) (var1,var2,VA_ARGS) \ # define VA_DECL2(typ1,var1,typ2,var2) (var1,var2,VA_ARGS) \
typ1 var1; typ2 var2;\ typ1 var1; typ2 var2; \
char *arg1,*arg2,*arg3,*arg4,*arg5,*arg6,*arg7,*arg8,*arg9; { char *arg1,*arg2,*arg3,*arg4,*arg5,*arg6,*arg7,*arg8,*arg9; {
# define VA_START(x) # define VA_START(x)
# define VA_INIT(var1,typ1) # define VA_INIT(var1,typ1)
/* this is inherently risky, and should only be attempted as a
very last resort; manipulating arguments which haven't actually
been passed may or may not cause severe trouble depending on
the function-calling/argument-passing mechanism being used */
# define VA_SHIFT() (arg1=arg2, arg2=arg3, arg3=arg4, arg4=arg5,\
arg5=arg6, arg6=arg7, arg7=arg8, arg8=arg9)
# define VA_NEXT(var1,typ1) ((var1 = (typ1)arg1), VA_SHIFT(), var1)
# define VA_END() # define VA_END()
# endif # endif
#endif #endif
+2 -2
View File
@@ -1396,7 +1396,7 @@ display_jump_positions(state)
int state; int state;
{ {
if (state == 0) { if (state == 0) {
tmp_at(DISP_BEAM, cmap_to_glyph(S_flashbeam)); tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
} else if (state == 1) { } else if (state == 1) {
int x,y, dx, dy; int x,y, dx, dy;
for (dx = -4; dx <= 4; dx++) for (dx = -4; dx <= 4; dx++)
@@ -2605,7 +2605,7 @@ display_polearm_positions(state)
int state; int state;
{ {
if (state == 0) { if (state == 0) {
tmp_at(DISP_BEAM, cmap_to_glyph(S_flashbeam)); tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
} else if (state == 1) { } else if (state == 1) {
int x,y, dx,dy; int x,y, dx,dy;
for (dx = -4; dx <= 4; dx++) for (dx = -4; dx <= 4; dx++)
+1 -1
View File
@@ -1244,7 +1244,7 @@ char resultbuf[]; /* should be at least [7] to hold "18/100\0" */
void void
enlightenment(mode, final) enlightenment(mode, final)
int mode; /* BASICENLIGHTENMENT | MAGICENLIGHTENMENT (| both) */ int mode; /* BASICENLIGHTENMENT | MAGICENLIGHTENMENT (| both) */
int final; /* ENL_GAMEINPROGRESS:0, ENL_GAVEOVERALIVE, ENL_GAMEOVERDEAD */ int final; /* ENL_GAMEINPROGRESS:0, ENL_GAMEOVERALIVE, ENL_GAMEOVERDEAD */
{ {
char buf[BUFSZ], tmpbuf[BUFSZ]; char buf[BUFSZ], tmpbuf[BUFSZ];
+3 -3
View File
@@ -160,7 +160,7 @@ magic_map_background(x, y, show)
if (!cansee(x,y) && !lev->waslit) { if (!cansee(x,y) && !lev->waslit) {
/* Floor spaces are dark if unlit. Corridors are dark if unlit. */ /* Floor spaces are dark if unlit. Corridors are dark if unlit. */
if (lev->typ == ROOM && glyph == cmap_to_glyph(S_room)) if (lev->typ == ROOM && glyph == cmap_to_glyph(S_room))
glyph = cmap_to_glyph(S_stone); glyph = cmap_to_glyph((flags.dark_room && iflags.use_color) ? (DARKROOMSYM) : S_stone);
else if (lev->typ == CORR && glyph == cmap_to_glyph(S_litcorr)) else if (lev->typ == CORR && glyph == cmap_to_glyph(S_litcorr))
glyph = cmap_to_glyph(S_corr); glyph = cmap_to_glyph(S_corr);
} }
@@ -764,11 +764,11 @@ newsym(x,y)
* These checks and changes must be here and not in back_to_glyph(). * These checks and changes must be here and not in back_to_glyph().
* They are dependent on the position being out of sight. * They are dependent on the position being out of sight.
*/ */
else if (!lev->waslit) { else if (!lev->waslit || (flags.dark_room && iflags.use_color)) {
if (lev->glyph == cmap_to_glyph(S_litcorr) && lev->typ == CORR) if (lev->glyph == cmap_to_glyph(S_litcorr) && lev->typ == CORR)
show_glyph(x, y, lev->glyph = cmap_to_glyph(S_corr)); show_glyph(x, y, lev->glyph = cmap_to_glyph(S_corr));
else if (lev->glyph == cmap_to_glyph(S_room) && lev->typ == ROOM) else if (lev->glyph == cmap_to_glyph(S_room) && lev->typ == ROOM)
show_glyph(x, y, lev->glyph = cmap_to_glyph(S_stone)); show_glyph(x, y, lev->glyph = cmap_to_glyph(DARKROOMSYM));
else else
goto show_mem; goto show_mem;
} else { } else {
+1304 -1296
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -237,6 +237,7 @@ const char *goal;
if (glyph_is_cmap(k) && if (glyph_is_cmap(k) &&
(IS_DOOR(levl[tx][ty].typ) || (IS_DOOR(levl[tx][ty].typ) ||
glyph_to_cmap(k) == S_room || glyph_to_cmap(k) == S_room ||
glyph_to_cmap(k) == S_darkroom ||
glyph_to_cmap(k) == S_corr || glyph_to_cmap(k) == S_corr ||
glyph_to_cmap(k) == S_litcorr)) { glyph_to_cmap(k) == S_litcorr)) {
/* what the hero remembers to be at tx,ty */ /* what the hero remembers to be at tx,ty */
+18 -15
View File
@@ -156,7 +156,8 @@ const struct symdef defsyms[MAXPCHARS] = {
{'#', "iron bars", C(HI_METAL)}, /* bars */ {'#', "iron bars", C(HI_METAL)}, /* bars */
{'#', "tree", C(CLR_GREEN)}, /* tree */ {'#', "tree", C(CLR_GREEN)}, /* tree */
{'.', "floor of a room",C(CLR_GRAY)}, /* room */ {'.', "floor of a room",C(CLR_GRAY)}, /* room */
/*20*/ {'#', "corridor", C(CLR_GRAY)}, /* dark corr */ /*20*/ {'.', "dark part of a room",C(CLR_BLACK)}, /* dark room */
{'#', "corridor", C(CLR_GRAY)}, /* dark corr */
{'#', "lit corridor", C(CLR_GRAY)}, /* lit corr (see mapglyph.c) */ {'#', "lit corridor", C(CLR_GRAY)}, /* lit corr (see mapglyph.c) */
{'<', "staircase up", C(CLR_GRAY)}, /* upstair */ {'<', "staircase up", C(CLR_GRAY)}, /* upstair */
{'>', "staircase down", C(CLR_GRAY)}, /* dnstair */ {'>', "staircase down", C(CLR_GRAY)}, /* dnstair */
@@ -165,8 +166,8 @@ const struct symdef defsyms[MAXPCHARS] = {
{'_', "altar", C(CLR_GRAY)}, /* altar */ {'_', "altar", C(CLR_GRAY)}, /* altar */
{'|', "grave", C(CLR_GRAY)}, /* grave */ {'|', "grave", C(CLR_GRAY)}, /* grave */
{'\\', "opulent throne",C(HI_GOLD)}, /* throne */ {'\\', "opulent throne",C(HI_GOLD)}, /* throne */
{'#', "sink", C(CLR_GRAY)}, /* sink */ /*30*/ {'#', "sink", C(CLR_GRAY)}, /* sink */
/*30*/ {'{', "fountain", C(CLR_BLUE)}, /* fountain */ {'{', "fountain", C(CLR_BLUE)}, /* fountain */
{'}', "water", C(CLR_BLUE)}, /* pool */ {'}', "water", C(CLR_BLUE)}, /* pool */
{'.', "ice", C(CLR_CYAN)}, /* ice */ {'.', "ice", C(CLR_CYAN)}, /* ice */
{'}', "molten lava", C(CLR_RED)}, /* lava */ {'}', "molten lava", C(CLR_RED)}, /* lava */
@@ -175,8 +176,8 @@ const struct symdef defsyms[MAXPCHARS] = {
{'#', "raised drawbridge",C(CLR_BROWN)}, /* vcdbridge */ {'#', "raised drawbridge",C(CLR_BROWN)}, /* vcdbridge */
{'#', "raised drawbridge",C(CLR_BROWN)}, /* hcdbridge */ {'#', "raised drawbridge",C(CLR_BROWN)}, /* hcdbridge */
{' ', "air", C(CLR_CYAN)}, /* open air */ {' ', "air", C(CLR_CYAN)}, /* open air */
{'#', "cloud", C(CLR_GRAY)}, /* [part of] a cloud */ /*40*/ {'#', "cloud", C(CLR_GRAY)}, /* [part of] a cloud */
/*40*/ {'}', "water", C(CLR_BLUE)}, /* under water */ {'}', "water", C(CLR_BLUE)}, /* under water */
{'^', "arrow trap", C(HI_METAL)}, /* trap */ {'^', "arrow trap", C(HI_METAL)}, /* trap */
{'^', "dart trap", C(HI_METAL)}, /* trap */ {'^', "dart trap", C(HI_METAL)}, /* trap */
{'^', "falling rock trap",C(CLR_GRAY)}, /* trap */ {'^', "falling rock trap",C(CLR_GRAY)}, /* trap */
@@ -185,8 +186,8 @@ const struct symdef defsyms[MAXPCHARS] = {
{'^', "land mine", C(CLR_RED)}, /* trap */ {'^', "land mine", C(CLR_RED)}, /* trap */
{'^', "rolling boulder trap", C(CLR_GRAY)}, /* trap */ {'^', "rolling boulder trap", C(CLR_GRAY)}, /* trap */
{'^', "sleeping gas trap",C(HI_ZAP)}, /* trap */ {'^', "sleeping gas trap",C(HI_ZAP)}, /* trap */
{'^', "rust trap", C(CLR_BLUE)}, /* trap */ /*50*/ {'^', "rust trap", C(CLR_BLUE)}, /* trap */
/*50*/ {'^', "fire trap", C(CLR_ORANGE)}, /* trap */ {'^', "fire trap", C(CLR_ORANGE)}, /* trap */
{'^', "pit", C(CLR_BLACK)}, /* trap */ {'^', "pit", C(CLR_BLACK)}, /* trap */
{'^', "spiked pit", C(CLR_BLACK)}, /* trap */ {'^', "spiked pit", C(CLR_BLACK)}, /* trap */
{'^', "hole", C(CLR_BROWN)}, /* trap */ {'^', "hole", C(CLR_BROWN)}, /* trap */
@@ -195,8 +196,8 @@ const struct symdef defsyms[MAXPCHARS] = {
{'^', "level teleporter", C(CLR_MAGENTA)}, /* trap */ {'^', "level teleporter", C(CLR_MAGENTA)}, /* trap */
{'^', "magic portal", C(CLR_BRIGHT_MAGENTA)}, /* trap */ {'^', "magic portal", C(CLR_BRIGHT_MAGENTA)}, /* trap */
{'"', "web", C(CLR_GRAY)}, /* web */ {'"', "web", C(CLR_GRAY)}, /* web */
{'^', "statue trap", C(CLR_GRAY)}, /* trap */ /*60*/ {'^', "statue trap", C(CLR_GRAY)}, /* trap */
/*60*/ {'^', "magic trap", C(HI_ZAP)}, /* trap */ {'^', "magic trap", C(HI_ZAP)}, /* trap */
{'^', "anti-magic field", C(HI_ZAP)}, /* trap */ {'^', "anti-magic field", C(HI_ZAP)}, /* trap */
{'^', "polymorph trap", C(CLR_BRIGHT_GREEN)}, /* trap */ {'^', "polymorph trap", C(CLR_BRIGHT_GREEN)}, /* trap */
{'|', "wall", C(CLR_GRAY)}, /* vbeam */ {'|', "wall", C(CLR_GRAY)}, /* vbeam */
@@ -205,29 +206,30 @@ const struct symdef defsyms[MAXPCHARS] = {
{'/', "wall", C(CLR_GRAY)}, /* rslant */ {'/', "wall", C(CLR_GRAY)}, /* rslant */
{'*', "", C(CLR_WHITE)}, /* dig beam */ {'*', "", C(CLR_WHITE)}, /* dig beam */
{'!', "", C(CLR_WHITE)}, /* camera flash beam */ {'!', "", C(CLR_WHITE)}, /* camera flash beam */
{')', "", C(HI_WOOD)}, /* boomerang open left */ /*70*/ {')', "", C(HI_WOOD)}, /* boomerang open left */
/*70*/ {'(', "", C(HI_WOOD)}, /* boomerang open right */ {'(', "", C(HI_WOOD)}, /* boomerang open right */
{'0', "", C(HI_ZAP)}, /* 4 magic shield symbols */ {'0', "", C(HI_ZAP)}, /* 4 magic shield symbols */
{'#', "", C(HI_ZAP)}, {'#', "", C(HI_ZAP)},
{'@', "", C(HI_ZAP)}, {'@', "", C(HI_ZAP)},
{'*', "", C(HI_ZAP)}, {'*', "", C(HI_ZAP)},
{'#', "poison cloud", C(CLR_BRIGHT_GREEN)}, /* [part of] a poison cloud */ {'#', "poison cloud", C(CLR_BRIGHT_GREEN)}, /* [part of] a poison cloud */
{'?', "valid position", C(CLR_BRIGHT_GREEN)}, /* valid position for targeting */
{'/', "", C(CLR_GREEN)}, /* swallow top left */ {'/', "", C(CLR_GREEN)}, /* swallow top left */
{'-', "", C(CLR_GREEN)}, /* swallow top center */ {'-', "", C(CLR_GREEN)}, /* swallow top center */
{'\\', "", C(CLR_GREEN)}, /* swallow top right */ /*80*/ {'\\', "", C(CLR_GREEN)}, /* swallow top right */
{'|', "", C(CLR_GREEN)}, /* swallow middle left */ {'|', "", C(CLR_GREEN)}, /* swallow middle left */
{'|', "", C(CLR_GREEN)}, /* swallow middle right */ {'|', "", C(CLR_GREEN)}, /* swallow middle right */
/*80*/ {'\\', "", C(CLR_GREEN)}, /* swallow bottom left */ {'\\', "", C(CLR_GREEN)}, /* swallow bottom left */
{'-', "", C(CLR_GREEN)}, /* swallow bottom center*/ {'-', "", C(CLR_GREEN)}, /* swallow bottom center*/
{'/', "", C(CLR_GREEN)}, /* swallow bottom right */ {'/', "", C(CLR_GREEN)}, /* swallow bottom right */
{'/', "", C(CLR_ORANGE)}, /* explosion top left */ {'/', "", C(CLR_ORANGE)}, /* explosion top left */
{'-', "", C(CLR_ORANGE)}, /* explosion top center */ {'-', "", C(CLR_ORANGE)}, /* explosion top center */
{'\\', "", C(CLR_ORANGE)}, /* explosion top right */ {'\\', "", C(CLR_ORANGE)}, /* explosion top right */
{'|', "", C(CLR_ORANGE)}, /* explosion middle left */ {'|', "", C(CLR_ORANGE)}, /* explosion middle left */
{' ', "", C(CLR_ORANGE)}, /* explosion middle center*/ /*90*/ {' ', "", C(CLR_ORANGE)}, /* explosion middle center*/
{'|', "", C(CLR_ORANGE)}, /* explosion middle right */ {'|', "", C(CLR_ORANGE)}, /* explosion middle right */
{'\\', "", C(CLR_ORANGE)}, /* explosion bottom left */ {'\\', "", C(CLR_ORANGE)}, /* explosion bottom left */
/*90*/ {'-', "", C(CLR_ORANGE)}, /* explosion bottom center*/ {'-', "", C(CLR_ORANGE)}, /* explosion bottom center*/
{'/', "", C(CLR_ORANGE)}, /* explosion bottom right */ {'/', "", C(CLR_ORANGE)}, /* explosion bottom right */
}; };
@@ -647,6 +649,7 @@ struct symparse loadsyms[] = {
{SYM_PCHAR, S_flashbeam, "S_flashbeam"}, {SYM_PCHAR, S_flashbeam, "S_flashbeam"},
{SYM_PCHAR, S_boomleft, "S_boomleft"}, {SYM_PCHAR, S_boomleft, "S_boomleft"},
{SYM_PCHAR, S_boomright, "S_boomright"}, {SYM_PCHAR, S_boomright, "S_boomright"},
{SYM_PCHAR, S_goodpos, "S_goodpos"},
{SYM_PCHAR, S_ss1, "S_ss1"}, {SYM_PCHAR, S_ss1, "S_ss1"},
{SYM_PCHAR, S_ss2, "S_ss2"}, {SYM_PCHAR, S_ss2, "S_ss2"},
{SYM_PCHAR, S_ss3, "S_ss3"}, {SYM_PCHAR, S_ss3, "S_ss3"},
+3 -3
View File
@@ -1611,7 +1611,7 @@ start_eating(otmp) /* called as you start to eat */
context.victual.fullwarn = context.victual.doreset = FALSE; context.victual.fullwarn = context.victual.doreset = FALSE;
context.victual.eating = TRUE; context.victual.eating = TRUE;
if (otmp->otyp == CORPSE) { if (otmp->otyp == CORPSE || otmp->globby) {
cprefx(context.victual.piece->corpsenm); cprefx(context.victual.piece->corpsenm);
if (!context.victual.piece || !context.victual.eating) { if (!context.victual.piece || !context.victual.eating) {
/* rider revived, or died and lifesaved */ /* rider revived, or died and lifesaved */
@@ -2126,7 +2126,7 @@ struct obj *otmp;
!Stone_resistance && !Stone_resistance &&
!poly_when_stoned(youmonst.data)); !poly_when_stoned(youmonst.data));
if (mnum == PM_GREEN_SLIME) if (mnum == PM_GREEN_SLIME || otmp->otyp == GLOB_OF_GREEN_SLIME)
stoneorslime = (!Unchanging && !slimeproof(youmonst.data)); stoneorslime = (!Unchanging && !slimeproof(youmonst.data));
if (cadaver && !nonrotting_corpse(mnum)) { if (cadaver && !nonrotting_corpse(mnum)) {
@@ -2396,7 +2396,7 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
* for normal vs. rotten food. The reqtime and nutrit values are * for normal vs. rotten food. The reqtime and nutrit values are
* then adjusted in accordance with the amount of food left. * then adjusted in accordance with the amount of food left.
*/ */
if(otmp->otyp == CORPSE) { if(otmp->otyp == CORPSE || otmp->globby) {
int tmp = eatcorpse(otmp); int tmp = eatcorpse(otmp);
if (tmp == 2) { if (tmp == 2) {
/* used up */ /* used up */
+63 -10
View File
@@ -1236,6 +1236,9 @@ struct obj *list;
boolean identified, all_containers, reportempty; boolean identified, all_containers, reportempty;
{ {
register struct obj *box, *obj; register struct obj *box, *obj;
struct obj **oarray;
int i,n;
char *invlet;
char buf[BUFSZ]; char buf[BUFSZ];
boolean cat, deadcat; boolean cat, deadcat;
@@ -1255,10 +1258,30 @@ boolean identified, all_containers, reportempty;
continue; /* wrong type of container */ continue; /* wrong type of container */
} else if (box->cobj) { } else if (box->cobj) {
winid tmpwin = create_nhwindow(NHW_MENU); winid tmpwin = create_nhwindow(NHW_MENU);
/* count the number of items */
for (n = 0, obj = box->cobj; obj; obj = obj->nobj) n++;
/* Make a temporary array to store the objects sorted */
oarray = objarr_init(n);
/* Add objects to the array */
i = 0;
invlet = flags.inv_order;
nextclass:
for (obj = box->cobj; obj; obj = obj->nobj) {
if (!flags.sortpack || obj->oclass == *invlet) {
objarr_set(obj, i++, oarray, (flags.sortloot == 'f' || flags.sortloot == 'l') );
}
} /* for loop */
if (flags.sortpack) {
if (*++invlet) goto nextclass;
}
Sprintf(buf, "Contents of %s:", the(xname(box))); Sprintf(buf, "Contents of %s:", the(xname(box)));
putstr(tmpwin, 0, buf); putstr(tmpwin, 0, buf);
putstr(tmpwin, 0, ""); putstr(tmpwin, 0, "");
for (obj = box->cobj; obj; obj = obj->nobj) { for (i = 0; i < n; i++) {
obj = oarray[i];
if (identified) { if (identified) {
makeknown(obj->otyp); makeknown(obj->otyp);
obj->known = obj->bknown = obj->known = obj->bknown =
@@ -1268,6 +1291,7 @@ boolean identified, all_containers, reportempty;
} }
putstr(tmpwin, 0, doname(obj)); putstr(tmpwin, 0, doname(obj));
} }
free(oarray);
if (cat) putstr(tmpwin, 0, "Schroedinger's cat"); if (cat) putstr(tmpwin, 0, "Schroedinger's cat");
else if (deadcat) putstr(tmpwin, 0, "Schroedinger's dead cat"); else if (deadcat) putstr(tmpwin, 0, "Schroedinger's dead cat");
display_nhwindow(tmpwin, TRUE); display_nhwindow(tmpwin, TRUE);
@@ -1412,43 +1436,72 @@ num_genocides()
return n; return n;
} }
int
num_extinct()
{
int i, n = 0;
for (i = LOW_PM; i < NUMMONS; ++i)
if (!(mvitals[i].mvflags & G_GENOD) &&
(mvitals[i].mvflags & G_GONE) &&
!(mons[i].geno & G_UNIQ)) ++n;
return n;
}
STATIC_OVL void STATIC_OVL void
list_genocided(defquery, ask) list_genocided(defquery, ask)
char defquery; char defquery;
boolean ask; boolean ask;
{ {
register int i; register int i;
int ngenocided; int ngenocided, nextinct;
char c; char c;
winid klwin; winid klwin;
char buf[BUFSZ]; char buf[BUFSZ];
ngenocided = num_genocides(); ngenocided = num_genocides();
nextinct = num_extinct();
/* genocided species list */ /* genocided or extinct species list */
if (ngenocided != 0) { if (ngenocided != 0 || nextinct != 0) {
c = ask ? yn_function("Do you want a list of species genocided?", Sprintf(buf, "Do you want a list of %sspecies%s%s?",
ynqchars, defquery) : defquery; (nextinct && !ngenocided) ? "extinct " : "",
(ngenocided) ? " genocided" : "",
(nextinct && ngenocided) ? " and extinct" : "");
c = ask ? yn_function(buf, ynqchars, defquery) : defquery;
if (c == 'q') done_stopprint++; if (c == 'q') done_stopprint++;
if (c == 'y') { if (c == 'y') {
klwin = create_nhwindow(NHW_MENU); klwin = create_nhwindow(NHW_MENU);
putstr(klwin, 0, "Genocided species:"); Sprintf(buf, "%s%s species:",
(ngenocided) ? "Genocided" : "Extinct",
(nextinct && ngenocided) ? " or extinct" : "");
putstr(klwin, 0, buf);
putstr(klwin, 0, ""); putstr(klwin, 0, "");
for (i = LOW_PM; i < NUMMONS; i++) for (i = LOW_PM; i < NUMMONS; i++)
if (mvitals[i].mvflags & G_GENOD) { if (mvitals[i].mvflags & G_GONE && !(mons[i].geno & G_UNIQ)) {
if ((mons[i].geno & G_UNIQ) && i != PM_HIGH_PRIEST) if ((mons[i].geno & G_UNIQ) && i != PM_HIGH_PRIEST)
Sprintf(buf, "%s%s", Sprintf(buf, "%s%s",
!type_is_pname(&mons[i]) ? "" : "the ", !type_is_pname(&mons[i]) ? "" : "the ",
mons[i].mname); mons[i].mname);
else else
Strcpy(buf, makeplural(mons[i].mname)); Strcpy(buf, makeplural(mons[i].mname));
if (!(mvitals[i].mvflags & G_GENOD))
Strcat(buf, " (extinct)");
putstr(klwin, 0, buf); putstr(klwin, 0, buf);
} }
putstr(klwin, 0, ""); putstr(klwin, 0, "");
Sprintf(buf, "%d species genocided.", ngenocided); if (ngenocided > 0) {
putstr(klwin, 0, buf); Sprintf(buf, "%d species genocided.", ngenocided);
putstr(klwin, 0, buf);
}
if (nextinct > 0) {
Sprintf(buf, "%d species extinct.", nextinct);
putstr(klwin, 0, buf);
}
display_nhwindow(klwin, TRUE); display_nhwindow(klwin, TRUE);
destroy_nhwindow(klwin); destroy_nhwindow(klwin);
+1872 -1870
View File
File diff suppressed because it is too large Load Diff
+1918 -1918
View File
File diff suppressed because it is too large Load Diff
+9 -5
View File
@@ -603,24 +603,28 @@ STATIC_DCL struct tm *NDECL(getlt);
void void
setrandom() setrandom()
{ {
time_t now = getnow(); /* time((TIME_type) 0) */ unsigned long seed = (unsigned long)getnow(); /* time((TIME_type) 0) */
#ifdef UNIX
/* Quick dirty band-aid to prevent PRNG prediction */
seed *= getpid();
#endif
/* the types are different enough here that sweeping the different /* the types are different enough here that sweeping the different
* routine names into one via #defines is even more confusing * routine names into one via #defines is even more confusing
*/ */
#ifdef RANDOM /* srandom() from sys/share/random.c */ #ifdef RANDOM /* srandom() from sys/share/random.c */
srandom((unsigned int) now); srandom((unsigned int) seed);
#else #else
# if defined(__APPLE__) || defined(BSD) || defined(LINUX) || defined(ULTRIX) || defined(CYGWIN32) /* system srandom() */ # if defined(__APPLE__) || defined(BSD) || defined(LINUX) || defined(ULTRIX) || defined(CYGWIN32) /* system srandom() */
# if defined(BSD) && !defined(POSIX_TYPES) && defined(SUNOS4) # if defined(BSD) && !defined(POSIX_TYPES) && defined(SUNOS4)
(void) (void)
# endif # endif
srandom((int) now); srandom((int) seed);
# else # else
# ifdef UNIX /* system srand48() */ # ifdef UNIX /* system srand48() */
srand48((long) now); srand48((long) seed);
# else /* poor quality system routine */ # else /* poor quality system routine */
srand((int) now); srand((int) seed);
# endif # endif
# endif # endif
#endif #endif
+2132 -2026
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -116,7 +116,7 @@ unsigned *ospecial;
color = CLR_MAGENTA; color = CLR_MAGENTA;
else if (offset == S_corr || offset == S_litcorr) else if (offset == S_corr || offset == S_litcorr)
color = CLR_GRAY; color = CLR_GRAY;
else if (offset >= S_room && offset <= S_water) else if (offset >= S_room && offset <= S_water && offset != S_darkroom)
color = CLR_GREEN; color = CLR_GREEN;
else else
color = NO_COLOR; color = NO_COLOR;
+1 -1
View File
@@ -519,7 +519,7 @@ int spellnum;
destroy_item(SCROLL_CLASS, AD_FIRE); destroy_item(SCROLL_CLASS, AD_FIRE);
destroy_item(POTION_CLASS, AD_FIRE); destroy_item(POTION_CLASS, AD_FIRE);
destroy_item(SPBOOK_CLASS, AD_FIRE); destroy_item(SPBOOK_CLASS, AD_FIRE);
(void) burn_floor_paper(u.ux, u.uy, TRUE, FALSE); (void) burn_floor_objects(u.ux, u.uy, TRUE, FALSE);
break; break;
case CLC_LIGHTNING: case CLC_LIGHTNING:
{ {
+1
View File
@@ -581,6 +581,7 @@ clear_level_structures()
level.flags.is_cavernous_lev = 0; level.flags.is_cavernous_lev = 0;
level.flags.arboreal = 0; level.flags.arboreal = 0;
level.flags.wizard_bones = 0; level.flags.wizard_bones = 0;
level.flags.corrmaze = 0;
nroom = 0; nroom = 0;
rooms[0].hx = -1; rooms[0].hx = -1;
+30 -39
View File
@@ -540,25 +540,25 @@ register const char *s;
} }
level.flags.is_maze_lev = TRUE; level.flags.is_maze_lev = TRUE;
level.flags.corrmaze = !rn2(3);
#ifndef WALLIFIED_MAZE if (level.flags.corrmaze)
for(x = 2; x < x_maze_max; x++) for(x = 2; x < x_maze_max; x++)
for(y = 2; y < y_maze_max; y++) for(y = 2; y < y_maze_max; y++)
levl[x][y].typ = STONE; levl[x][y].typ = STONE;
#else else
for(x = 2; x <= x_maze_max; x++) for(x = 2; x <= x_maze_max; x++)
for(y = 2; y <= y_maze_max; y++) for(y = 2; y <= y_maze_max; y++)
levl[x][y].typ = ((x % 2) && (y % 2)) ? STONE : HWALL; levl[x][y].typ = ((x % 2) && (y % 2)) ? STONE : HWALL;
#endif
maze0xy(&mm); maze0xy(&mm);
walkfrom((int) mm.x, (int) mm.y, 0); walkfrom((int) mm.x, (int) mm.y, 0);
/* put a boulder at the maze center */ /* put a boulder at the maze center */
(void) mksobj_at(BOULDER, (int) mm.x, (int) mm.y, TRUE, FALSE); (void) mksobj_at(BOULDER, (int) mm.x, (int) mm.y, TRUE, FALSE);
#ifdef WALLIFIED_MAZE if (!level.flags.corrmaze)
wallification(2, 2, x_maze_max, y_maze_max); wallification(2, 2, x_maze_max, y_maze_max);
#endif
mazexy(&mm); mazexy(&mm);
mkstairs(mm.x, mm.y, 1, (struct mkroom *)0); /* up */ mkstairs(mm.x, mm.y, 1, (struct mkroom *)0); /* up */
if (!Invocation_lev(&u.uz)) { if (!Invocation_lev(&u.uz)) {
@@ -649,11 +649,12 @@ schar typ;
int q, a, dir, pos; int q, a, dir, pos;
int dirs[4]; int dirs[4];
#ifndef WALLIFIED_MAZE if (!typ) {
if (!typ) typ = CORR; if (level.flags.corrmaze)
#else typ = CORR;
if (!typ) typ = ROOM; else
#endif typ = ROOM;
}
pos = 1; pos = 1;
mazex[pos] = (char) x; mazex[pos] = (char) x;
@@ -694,11 +695,12 @@ schar typ;
register int q,a,dir; register int q,a,dir;
int dirs[4]; int dirs[4];
#ifndef WALLIFIED_MAZE if (!typ) {
if (!typ) typ = CORR; if (level.flags.corrmaze)
#else typ = CORR;
if (!typ) typ = ROOM; else
#endif typ = ROOM;
}
if(!IS_DOOR(levl[x][y].typ)) { if(!IS_DOOR(levl[x][y].typ)) {
/* might still be on edge of MAP, so don't overwrite */ /* might still be on edge of MAP, so don't overwrite */
@@ -736,7 +738,7 @@ register int dir;
void void
mazexy(cc) /* find random point in generated corridors, mazexy(cc) /* find random point in generated corridors,
so we don't create items in moats, bunkers, or walls */ so we don't create items in moats, bunkers, or walls */
coord *cc; coord *cc;
{ {
int cpt=0; int cpt=0;
@@ -745,13 +747,8 @@ mazexy(cc) /* find random point in generated corridors,
cc->x = 3 + 2*rn2((x_maze_max>>1) - 1); cc->x = 3 + 2*rn2((x_maze_max>>1) - 1);
cc->y = 3 + 2*rn2((y_maze_max>>1) - 1); cc->y = 3 + 2*rn2((y_maze_max>>1) - 1);
cpt++; cpt++;
} while (cpt < 100 && levl[cc->x][cc->y].typ != } while (cpt < 100 &&
#ifdef WALLIFIED_MAZE levl[cc->x][cc->y].typ != (level.flags.corrmaze ? CORR : ROOM));
ROOM
#else
CORR
#endif
);
if (cpt >= 100) { if (cpt >= 100) {
register int x, y; register int x, y;
/* last try */ /* last try */
@@ -759,13 +756,8 @@ mazexy(cc) /* find random point in generated corridors,
for (y = 0; y < (y_maze_max>>1) - 1; y++) { for (y = 0; y < (y_maze_max>>1) - 1; y++) {
cc->x = 3 + 2 * x; cc->x = 3 + 2 * x;
cc->y = 3 + 2 * y; cc->y = 3 + 2 * y;
if (levl[cc->x][cc->y].typ == if (levl[cc->x][cc->y].typ == (level.flags.corrmaze ? CORR : ROOM))
#ifdef WALLIFIED_MAZE return;
ROOM
#else
CORR
#endif
) return;
} }
panic("mazexy: can't find a place!"); panic("mazexy: can't find a place!");
} }
@@ -782,7 +774,7 @@ bound_digging()
* so the boundary would be breached * so the boundary would be breached
* *
* we can't bound unconditionally on one beyond the last line, because * we can't bound unconditionally on one beyond the last line, because
* that provides a window of abuse for WALLIFIED_MAZE special levels * that provides a window of abuse for wallified special levels
*/ */
{ {
register int x,y; register int x,y;
@@ -886,7 +878,6 @@ fumaroles()
for (n = rn2(3)+2; n; n--) { for (n = rn2(3)+2; n; n--) {
xchar x = rn1(COLNO-4,3); xchar x = rn1(COLNO-4,3);
xchar y = rn1(ROWNO-4,3); xchar y = rn1(ROWNO-4,3);
struct trap *ttmp = t_at(x,y);
if (levl[x][y].typ == LAVAPOOL) { if (levl[x][y].typ == LAVAPOOL) {
NhRegion *r = create_gas_cloud(x,y, 4+rn2(5), rn1(10,5)); NhRegion *r = create_gas_cloud(x,y, 4+rn2(5), rn1(10,5));
clear_heros_fault(r); clear_heros_fault(r);
+1270 -1136
View File
File diff suppressed because it is too large Load Diff
+2338 -2320
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -1820,7 +1820,7 @@ struct permonst _mons2[] = {
* Puddings * Puddings
*/ */
MON("gray ooze", S_PUDDING, MON("gray ooze", S_PUDDING,
LVL(3, 1, 8, 0, 0), (G_GENO|2), LVL(3, 1, 8, 0, 0), (G_GENO|G_NOCORPSE|2),
A(ATTK(AT_BITE, AD_RUST, 2, 8), A(ATTK(AT_BITE, AD_RUST, 2, 8),
NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK),
SIZ(500, 250, MS_SILENT, MZ_MEDIUM), SIZ(500, 250, MS_SILENT, MZ_MEDIUM),
@@ -1829,7 +1829,7 @@ struct permonst _mons2[] = {
M1_MINDLESS|M1_OMNIVORE|M1_ACID, M1_MINDLESS|M1_OMNIVORE|M1_ACID,
M2_HOSTILE|M2_NEUTER, 0, CLR_GRAY), M2_HOSTILE|M2_NEUTER, 0, CLR_GRAY),
MON("brown pudding", S_PUDDING, MON("brown pudding", S_PUDDING,
LVL(5, 3, 8, 0, 0), (G_GENO|1), LVL(5, 3, 8, 0, 0), (G_GENO|G_NOCORPSE|1),
A(ATTK(AT_BITE, AD_DCAY, 0, 0), A(ATTK(AT_BITE, AD_DCAY, 0, 0),
NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK),
SIZ(500, 250, MS_SILENT, MZ_MEDIUM), SIZ(500, 250, MS_SILENT, MZ_MEDIUM),
@@ -1838,7 +1838,7 @@ struct permonst _mons2[] = {
M1_MINDLESS|M1_OMNIVORE|M1_ACID, M1_MINDLESS|M1_OMNIVORE|M1_ACID,
M2_HOSTILE|M2_NEUTER, 0, CLR_BROWN), M2_HOSTILE|M2_NEUTER, 0, CLR_BROWN),
MON("green slime", S_PUDDING, MON("green slime", S_PUDDING,
LVL(6, 6, 6, 0, 0), (G_HELL|G_GENO|1), LVL(6, 6, 6, 0, 0), (G_HELL|G_GENO|G_NOCORPSE|1),
A(ATTK(AT_TUCH, AD_SLIM, 1, 4), ATTK(AT_NONE, AD_SLIM, 0, 0), A(ATTK(AT_TUCH, AD_SLIM, 1, 4), ATTK(AT_NONE, AD_SLIM, 0, 0),
NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK),
SIZ(400, 150, MS_SILENT, MZ_LARGE), SIZ(400, 150, MS_SILENT, MZ_LARGE),
@@ -1847,7 +1847,7 @@ struct permonst _mons2[] = {
M1_MINDLESS|M1_OMNIVORE|M1_ACID|M1_POIS, M1_MINDLESS|M1_OMNIVORE|M1_ACID|M1_POIS,
M2_HOSTILE|M2_NEUTER, 0, CLR_GREEN), M2_HOSTILE|M2_NEUTER, 0, CLR_GREEN),
MON("black pudding", S_PUDDING, MON("black pudding", S_PUDDING,
LVL(10, 6, 6, 0, 0), (G_GENO|1), LVL(10, 6, 6, 0, 0), (G_GENO|G_NOCORPSE|1),
A(ATTK(AT_BITE, AD_CORR, 3, 8), ATTK(AT_NONE, AD_CORR, 0, 0), A(ATTK(AT_BITE, AD_CORR, 3, 8), ATTK(AT_NONE, AD_CORR, 0, 0),
NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK),
SIZ(900, 250, MS_SILENT, MZ_LARGE), SIZ(900, 250, MS_SILENT, MZ_LARGE),
+8 -2
View File
@@ -1,5 +1,4 @@
/* NetHack 3.5 objects.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ /* NetHack 3.5 objects.c $NHDT-Date: 1426470348 2015/03/16 01:45:48 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.27 $ */
/* NetHack 3.5 objects.c $Date: 2011/07/28 04:00:20 $ $Revision: 1.23 $ */
/* Copyright (c) Mike Threepoint, 1989. */ /* Copyright (c) Mike Threepoint, 1989. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -670,11 +669,18 @@ FOOD("egg", 85, 1, 1, 1, FLESH, 80, CLR_WHITE),
FOOD("meatball", 0, 1, 1, 0, FLESH, 5, CLR_BROWN), FOOD("meatball", 0, 1, 1, 0, FLESH, 5, CLR_BROWN),
FOOD("meat stick", 0, 1, 1, 0, FLESH, 5, CLR_BROWN), FOOD("meat stick", 0, 1, 1, 0, FLESH, 5, CLR_BROWN),
FOOD("huge chunk of meat", 0,20,400, 0, FLESH,2000, CLR_BROWN), FOOD("huge chunk of meat", 0,20,400, 0, FLESH,2000, CLR_BROWN),
/* special case because it's not mergable */ /* special case because it's not mergable */
OBJECT(OBJ("meat ring", (char *)0), OBJECT(OBJ("meat ring", (char *)0),
BITS(1,0,0,0,0,0,0,0,0,0,0,0,FLESH), BITS(1,0,0,0,0,0,0,0,0,0,0,0,FLESH),
0, FOOD_CLASS, 0, 1, 5, 1, 0, 0, 0, 0, 5, CLR_BROWN), 0, FOOD_CLASS, 0, 1, 5, 1, 0, 0, 0, 0, 5, CLR_BROWN),
/* pudding 'corpses' will turn into these and combine */
FOOD("glob of gray ooze", 0, 2, 20, 0, FLESH, 20, CLR_GRAY),
FOOD("glob of brown pudding", 0, 2, 20, 0, FLESH, 20, CLR_BROWN),
FOOD("glob of green slime", 0, 2, 20, 0, FLESH, 20, CLR_GREEN),
FOOD("glob of black pudding", 0, 2, 20, 0, FLESH, 20, CLR_BLACK),
/* fruits & veggies */ /* fruits & veggies */
FOOD("kelp frond", 0, 1, 1, 0, VEGGY, 30, CLR_GREEN), FOOD("kelp frond", 0, 1, 1, 0, VEGGY, 30, CLR_GREEN),
FOOD("eucalyptus leaf", 3, 1, 1, 0, VEGGY, 30, CLR_GREEN), FOOD("eucalyptus leaf", 3, 1, 1, 0, VEGGY, 30, CLR_GREEN),
+2487 -2438
View File
File diff suppressed because it is too large Load Diff
+88 -3
View File
@@ -104,6 +104,7 @@ static struct Bool_Opt
{"color", &iflags.wc_color, FALSE, SET_IN_GAME}, /*WC*/ {"color", &iflags.wc_color, FALSE, SET_IN_GAME}, /*WC*/
# endif # endif
{"confirm",&flags.confirm, TRUE, SET_IN_GAME}, {"confirm",&flags.confirm, TRUE, SET_IN_GAME},
{"dark_room", &flags.dark_room, TRUE, SET_IN_GAME},
{"eight_bit_tty", &iflags.wc_eight_bit_input, FALSE, SET_IN_GAME}, /*WC*/ {"eight_bit_tty", &iflags.wc_eight_bit_input, FALSE, SET_IN_GAME}, /*WC*/
#ifdef TTY_GRAPHICS #ifdef TTY_GRAPHICS
{"extmenu", &iflags.extmenu, FALSE, SET_IN_GAME}, {"extmenu", &iflags.extmenu, FALSE, SET_IN_GAME},
@@ -345,6 +346,7 @@ static struct Comp_Opt
{ "scroll_amount", "amount to scroll map when scroll_margin is reached", { "scroll_amount", "amount to scroll map when scroll_margin is reached",
20, DISP_IN_GAME }, /*WC*/ 20, DISP_IN_GAME }, /*WC*/
{ "scroll_margin", "scroll map when this far from the edge", 20, DISP_IN_GAME }, /*WC*/ { "scroll_margin", "scroll map when this far from the edge", 20, DISP_IN_GAME }, /*WC*/
{ "sortloot", "sort object selection lists by description", 4, SET_IN_GAME },
#ifdef MSDOS #ifdef MSDOS
{ "soundcard", "type of sound card to use", 20, SET_IN_FILE }, { "soundcard", "type of sound card to use", 20, SET_IN_FILE },
#endif #endif
@@ -495,6 +497,35 @@ STATIC_OVL boolean FDECL(wc2_supported, (const char *));
STATIC_DCL void FDECL(remove_autopickup_exception, (struct autopickup_exception *)); STATIC_DCL void FDECL(remove_autopickup_exception, (struct autopickup_exception *));
STATIC_OVL int FDECL(count_ape_maps, (int *, int *)); STATIC_OVL int FDECL(count_ape_maps, (int *, int *));
void
reglyph_darkroom()
{
xchar x,y;
for (x = 0; x < COLNO; x++)
for (y = 0; y < ROWNO; y++) {
struct rm *lev = &levl[x][y];
if (!flags.dark_room) {
if (lev->glyph == cmap_to_glyph(S_darkroom))
lev->glyph = lev->waslit ? cmap_to_glyph(S_room) : cmap_to_glyph(S_stone);
} else {
if (lev->glyph == cmap_to_glyph(S_room) &&
lev->seenv &&
lev->waslit && !cansee(x,y))
lev->glyph = cmap_to_glyph(S_darkroom);
else if (lev->glyph == cmap_to_glyph(S_stone) &&
lev->typ == ROOM &&
lev->seenv &&
!cansee(x,y))
lev->glyph = cmap_to_glyph(S_darkroom);
}
}
if (flags.dark_room && iflags.use_color)
showsyms[S_darkroom]=showsyms[S_room];
else
showsyms[S_darkroom]=showsyms[S_stone];
}
/* check whether a user-supplied option string is a proper leading /* check whether a user-supplied option string is a proper leading
substring of a particular option name; option string might have substring of a particular option name; option string might have
a colon or equals sign and arbitrary value appended to it */ a colon or equals sign and arbitrary value appended to it */
@@ -628,6 +659,7 @@ initoptions_init()
(genericptr_t)def_inv_order, sizeof flags.inv_order); (genericptr_t)def_inv_order, sizeof flags.inv_order);
flags.pickup_types[0] = '\0'; flags.pickup_types[0] = '\0';
flags.pickup_burden = MOD_ENCUMBER; flags.pickup_burden = MOD_ENCUMBER;
flags.sortloot = 'l'; /* sort only loot by default */
for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++) for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++)
flags.end_disclose[i] = DISCLOSE_PROMPT_DEFAULT_NO; flags.end_disclose[i] = DISCLOSE_PROMPT_DEFAULT_NO;
@@ -703,6 +735,8 @@ initoptions_finish()
/* result in the player's preferred fruit [better than "\033"]. */ /* result in the player's preferred fruit [better than "\033"]. */
obj_descr[SLIME_MOLD].oc_name = "fruit"; obj_descr[SLIME_MOLD].oc_name = "fruit";
reglyph_darkroom();
return; return;
} }
@@ -2327,6 +2361,22 @@ goodfruit:
return; return;
} }
fullname = "sortloot";
if (match_optname(opts, fullname, 4, TRUE)) {
op = string_for_env_opt(fullname, opts, FALSE);
if (op) {
switch (tolower(*op)) {
case 'n':
case 'l':
case 'f': flags.sortloot = tolower(*op);
break;
default: badoption(opts);
return;
}
}
return;
}
fullname = "suppress_alert"; fullname = "suppress_alert";
if (match_optname(opts, fullname, 4, TRUE)) { if (match_optname(opts, fullname, 4, TRUE)) {
if (duplicate) complain_about_duplicate(opts,1); if (duplicate) complain_about_duplicate(opts,1);
@@ -2809,7 +2859,8 @@ goodfruit:
else if ((boolopt[i].addr) == &flags.invlet_constant) { else if ((boolopt[i].addr) == &flags.invlet_constant) {
if (flags.invlet_constant) reassign(); if (flags.invlet_constant) reassign();
} }
else if ((boolopt[i].addr) == &flags.lit_corridor) { else if (((boolopt[i].addr) == &flags.lit_corridor) ||
((boolopt[i].addr) == &flags.dark_room)) {
/* /*
* All corridor squares seen via night vision or * All corridor squares seen via night vision or
* candles & lamps change. Update them by calling * candles & lamps change. Update them by calling
@@ -2819,6 +2870,7 @@ goodfruit:
*/ */
vision_recalc(2); /* shut down vision */ vision_recalc(2); /* shut down vision */
vision_full_recalc = 1; /* delayed recalc */ vision_full_recalc = 1; /* delayed recalc */
if (iflags.use_color) need_redraw = TRUE; /* darkroom refresh */
} }
else if ((boolopt[i].addr) == &iflags.use_inverse || else if ((boolopt[i].addr) == &iflags.use_inverse ||
(boolopt[i].addr) == &flags.showrace || (boolopt[i].addr) == &flags.showrace ||
@@ -2861,6 +2913,10 @@ static NEARDATA const char *runmodes[] = {
"teleport", "run", "walk", "crawl" "teleport", "run", "walk", "crawl"
}; };
static NEARDATA const char *sortltype[] = {
"none", "loot", "full"
};
/* /*
* Convert the given string of object classes to a string of default object * Convert the given string of object classes to a string of default object
* symbols. * symbols.
@@ -3148,8 +3204,10 @@ doset()
} }
destroy_nhwindow(tmpwin); destroy_nhwindow(tmpwin);
if (need_redraw) if (need_redraw) {
reglyph_darkroom();
(void) doredraw(); (void) doredraw();
}
return 0; return 0;
} }
@@ -3167,7 +3225,8 @@ boolean setinitial,setfromfile;
char buf[BUFSZ]; char buf[BUFSZ];
/* Special handling of menustyle, pickup_burden, pickup_types, /* Special handling of menustyle, pickup_burden, pickup_types,
* disclose, runmode, msg_window, menu_headings, and number_pad options. * disclose, runmode, msg_window, menu_headings, sortloot,
* and number_pad options.
* Also takes care of interactive autopickup_exception_handling changes. * Also takes care of interactive autopickup_exception_handling changes.
*/ */
if (!strcmp("menustyle", optname)) { if (!strcmp("menustyle", optname)) {
@@ -3348,6 +3407,23 @@ boolean setinitial,setfromfile;
} }
destroy_nhwindow(tmpwin); destroy_nhwindow(tmpwin);
#endif #endif
} else if (!strcmp("sortloot", optname)) {
const char *sortl_name;
menu_item *sortl_pick = (menu_item *)0;
tmpwin = create_nhwindow(NHW_MENU);
start_menu(tmpwin);
for (i = 0; i < SIZE(sortltype); i++) {
sortl_name = sortltype[i];
any.a_char = *sortl_name;
add_menu(tmpwin, NO_GLYPH, &any, *sortl_name, 0,
ATR_NONE, sortl_name, MENU_UNSELECTED);
}
end_menu(tmpwin, "Select loot sorting type:");
if (select_menu(tmpwin, PICK_ONE, &sortl_pick) > 0) {
flags.sortloot = sortl_pick->item.a_char;
free((genericptr_t)sortl_pick);
}
destroy_nhwindow(tmpwin);
} else if (!strcmp("align_message", optname) || } else if (!strcmp("align_message", optname) ||
!strcmp("align_status", optname)) { !strcmp("align_status", optname)) {
menu_item *window_pick = (menu_item *)0; menu_item *window_pick = (menu_item *)0;
@@ -3937,6 +4013,15 @@ char *buf;
if (iflags.wc_scroll_margin) Sprintf(buf, "%d",iflags.wc_scroll_margin); if (iflags.wc_scroll_margin) Sprintf(buf, "%d",iflags.wc_scroll_margin);
else Strcpy(buf, defopt); else Strcpy(buf, defopt);
} }
else if (!strcmp(optname, "sortloot")) {
char *sortname = (char *)NULL;
for (i=0; i < SIZE(sortltype) && sortname==(char *)NULL; i++) {
if (flags.sortloot == sortltype[i][0])
sortname = (char *)sortltype[i];
}
if (sortname != (char *)NULL)
Sprintf(buf, "%s", sortname);
}
else if (!strcmp(optname, "player_selection")) else if (!strcmp(optname, "player_selection"))
Sprintf(buf, "%s", iflags.wc_player_selection ? "prompts" : "dialog"); Sprintf(buf, "%s", iflags.wc_player_selection ? "prompts" : "dialog");
#ifdef MSDOS #ifdef MSDOS
+3 -3
View File
@@ -250,7 +250,7 @@ lookat(x, y, buf, monbuf)
int tnum = what_trap(glyph_to_trap(glyph)); int tnum = what_trap(glyph_to_trap(glyph));
Strcpy(buf, defsyms[trap_to_defsym(tnum)].explanation); Strcpy(buf, defsyms[trap_to_defsym(tnum)].explanation);
} else if(!glyph_is_cmap(glyph)) { } else if(!glyph_is_cmap(glyph)) {
Strcpy(buf,"dark part of a room"); Strcpy(buf,"unexplored area");
} else switch(glyph_to_cmap(glyph)) { } else switch(glyph_to_cmap(glyph)) {
case S_altar: case S_altar:
Sprintf(buf, "%s %saltar", Sprintf(buf, "%s %saltar",
@@ -557,8 +557,8 @@ const char **firstmatch;
x_str = defsyms[i].explanation; x_str = defsyms[i].explanation;
if (sym == ((looked) ? if (sym == ((looked) ?
showsyms[i] : defsyms[i].sym) && *x_str) { showsyms[i] : defsyms[i].sym) && *x_str) {
/* avoid "an air", "a water", or "a floor of a room" */ /* avoid "an air", "a water", "a floor of a room", "a dark part of a room" */
int article = (i == S_room) ? 2 : /* 2=>"the" */ int article = ((i == S_room)||(i == S_darkroom)) ? 2 : /* 2=>"the" */
!(strcmp(x_str, "air") == 0 || /* 1=>"an" */ !(strcmp(x_str, "air") == 0 || /* 1=>"an" */
strcmp(x_str, "water") == 0); /* 0=>(none)*/ strcmp(x_str, "water") == 0); /* 0=>(none)*/
+16 -3
View File
@@ -707,9 +707,10 @@ menu_item **pick_list; /* return list of items picked */
int how; /* type of query */ int how; /* type of query */
boolean FDECL((*allow), (OBJ_P));/* allow function */ boolean FDECL((*allow), (OBJ_P));/* allow function */
{ {
int n; int i, n;
winid win; winid win;
struct obj *curr, *last, fake_hero_object; struct obj *curr, *last, fake_hero_object;
struct obj **oarray;
char *pack; char *pack;
anything any; anything any;
boolean printed_type_name, boolean printed_type_name,
@@ -742,6 +743,16 @@ boolean FDECL((*allow), (OBJ_P));/* allow function */
return 1; return 1;
} }
oarray = objarr_init(n);
/* Add objects to the array */
i = 0;
for (curr = olist; curr; curr = FOLLOW(curr, qflags)) {
if ((*allow)(curr)) {
objarr_set(curr, i++, oarray, (flags.sortloot == 'f' ||
(flags.sortloot == 'l' && !(qflags & USE_INVLET))));
}
}
win = create_nhwindow(NHW_MENU); win = create_nhwindow(NHW_MENU);
start_menu(win); start_menu(win);
any = zeroany; any = zeroany;
@@ -755,7 +766,8 @@ boolean FDECL((*allow), (OBJ_P));/* allow function */
pack = flags.inv_order; pack = flags.inv_order;
do { do {
printed_type_name = FALSE; printed_type_name = FALSE;
for (curr = olist; curr; curr = FOLLOW(curr, qflags)) { for (i = 0; i < n; i++) {
curr = oarray[i];
if ((qflags & FEEL_COCKATRICE) && curr->otyp == CORPSE && if ((qflags & FEEL_COCKATRICE) && curr->otyp == CORPSE &&
will_feel_cockatrice(curr, FALSE)) { will_feel_cockatrice(curr, FALSE)) {
destroy_nhwindow(win); /* stop the menu and revert */ destroy_nhwindow(win); /* stop the menu and revert */
@@ -783,6 +795,7 @@ boolean FDECL((*allow), (OBJ_P));/* allow function */
} }
pack++; pack++;
} while (sorted && *pack); } while (sorted && *pack);
free(oarray);
if (engulfer) { if (engulfer) {
char buf[BUFSZ]; char buf[BUFSZ];
@@ -809,7 +822,7 @@ boolean FDECL((*allow), (OBJ_P));/* allow function */
if (n > 0) { if (n > 0) {
menu_item *mi; menu_item *mi;
int i, k; int k;
/* fix up counts: -1 means no count used => pick all; /* fix up counts: -1 means no count used => pick all;
if fake_hero_object was picked, discard that choice */ if fake_hero_object was picked, discard that choice */
+1 -1
View File
@@ -886,7 +886,7 @@ display_stinking_cloud_positions(state)
int state; int state;
{ {
if (state == 0) { if (state == 0) {
tmp_at(DISP_BEAM, cmap_to_glyph(S_flashbeam)); tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
} else if (state == 1) { } else if (state == 1) {
int x,y, dx, dy; int x,y, dx, dy;
int dist = 6; int dist = 6;
+8 -1
View File
@@ -501,6 +501,13 @@ register struct obj *otmp;
else otmp->spe = fruitadd(oldf->fname, (struct fruit *)0); else otmp->spe = fruitadd(oldf->fname, (struct fruit *)0);
} }
#ifdef SYSCF
#define SYSOPT_CHECK_SAVE_UID sysopt.check_save_uid
#else
#define SYSOPT_CHECK_SAVE_UID TRUE
#endif
STATIC_OVL STATIC_OVL
boolean boolean
restgamestate(fd, stuckid, steedid) restgamestate(fd, stuckid, steedid)
@@ -516,7 +523,7 @@ unsigned int *stuckid, *steedid;
unsigned long uid; unsigned long uid;
mread(fd, (genericptr_t) &uid, sizeof uid); mread(fd, (genericptr_t) &uid, sizeof uid);
if (uid != (unsigned long)getuid()) { /* strange ... */ if (SYSOPT_CHECK_SAVE_UID && uid != (unsigned long)getuid()) { /* strange ... */
/* for wizard mode, issue a reminder; for others, treat it /* for wizard mode, issue a reminder; for others, treat it
as an attempt to cheat and refuse to restore this file */ as an attempt to cheat and refuse to restore this file */
pline("Saved game was not yours."); pline("Saved game was not yours.");
+17 -14
View File
@@ -524,12 +524,11 @@ schar filling;
for (x = x1; x <= x2; x++) for (x = x1; x <= x2; x++)
for (y = y1; y <= y2; y++) { for (y = y1; y <= y2; y++) {
#ifndef WALLIFIED_MAZE if (level.flags.corrmaze)
levl[x][y].typ = STONE; levl[x][y].typ = STONE;
#else else
levl[x][y].typ = levl[x][y].typ =
(y < 2 || ((x % 2) && (y % 2))) ? STONE : filling; (y < 2 || ((x % 2) && (y % 2))) ? STONE : filling;
#endif
} }
} }
@@ -2952,6 +2951,7 @@ spo_level_flags(coder)
if (lflags & GRAVEYARD) level.flags.graveyard = 1; if (lflags & GRAVEYARD) level.flags.graveyard = 1;
if (lflags & ICEDPOOLS) icedpools = TRUE; if (lflags & ICEDPOOLS) icedpools = TRUE;
if (lflags & SOLIDIFY) coder->solidify = TRUE; if (lflags & SOLIDIFY) coder->solidify = TRUE;
if (lflags & CORRMAZE) level.flags.corrmaze = TRUE;
opvar_free(flagdata); opvar_free(flagdata);
} }
@@ -4118,11 +4118,7 @@ spo_mazewalk(coder)
if (!isok(x,y)) return; if (!isok(x,y)) return;
if (OV_i(ftyp) < 1) { if (OV_i(ftyp) < 1) {
#ifndef WALLIFIED_MAZE OV_i(ftyp) = level.flags.corrmaze ? CORR : ROOM;
OV_i(ftyp) = CORR;
#else
OV_i(ftyp) = ROOM;
#endif
} }
/* don't use move() - it doesn't use W_NORTH, etc. */ /* don't use move() - it doesn't use W_NORTH, etc. */
@@ -5040,7 +5036,7 @@ sp_lev *lvl;
break; break;
case SPO_SEL_LINE: case SPO_SEL_LINE:
{ {
struct opvar *tmp, *tmp2, *pt = selection_opvar(NULL); struct opvar *tmp = NULL, *tmp2 = NULL, *pt = selection_opvar(NULL);
schar x1,y1,x2,y2; schar x1,y1,x2,y2;
if (!OV_pop_c(tmp)) panic("no ter sel linecoord1"); if (!OV_pop_c(tmp)) panic("no ter sel linecoord1");
if (!OV_pop_c(tmp2)) panic("no ter sel linecoord2"); if (!OV_pop_c(tmp2)) panic("no ter sel linecoord2");
@@ -5058,7 +5054,7 @@ sp_lev *lvl;
break; break;
case SPO_SEL_RNDLINE: case SPO_SEL_RNDLINE:
{ {
struct opvar *tmp, *tmp2, *tmp3, *pt = selection_opvar(NULL); struct opvar *tmp = NULL, *tmp2 = NULL, *tmp3, *pt = selection_opvar(NULL);
schar x1,y1,x2,y2; schar x1,y1,x2,y2;
if (!OV_pop_i(tmp3)) panic("no ter sel randline1"); if (!OV_pop_i(tmp3)) panic("no ter sel randline1");
if (!OV_pop_c(tmp)) panic("no ter sel randline2"); if (!OV_pop_c(tmp)) panic("no ter sel randline2");
@@ -5171,7 +5167,14 @@ next_opcode:
link_doors_rooms(); link_doors_rooms();
fill_rooms(); fill_rooms();
remove_boundary_syms(); remove_boundary_syms();
wallification(1, 0, COLNO-1, ROWNO-1); /* FIXME: Ideally, we want this call to only cover areas of the map
* which were not inserted directly by the special level file (see
* the insect legs on Baalzebub's level, for instance). Since that
* is currently not possible, we overload the corrmaze flag for this
* purpose.
*/
if (!level.flags.corrmaze)
wallification(1, 0, COLNO-1, ROWNO-1);
count_features(); count_features();
+1
View File
@@ -67,6 +67,7 @@ sys_early_init()
# endif # endif
#endif #endif
sysopt.check_save_uid = 1;
sysopt.seduce = 1; /* if it's compiled in, default to on */ sysopt.seduce = 1; /* if it's compiled in, default to on */
sysopt_seduce_set(sysopt.seduce); sysopt_seduce_set(sysopt.seduce);
} }
+3 -3
View File
@@ -2214,7 +2214,7 @@ glovecheck: target = which_armor(mtmp, W_ARMG);
(void) destroy_mitem(mtmp, SPBOOK_CLASS, AD_FIRE); (void) destroy_mitem(mtmp, SPBOOK_CLASS, AD_FIRE);
(void) destroy_mitem(mtmp, POTION_CLASS, AD_FIRE); (void) destroy_mitem(mtmp, POTION_CLASS, AD_FIRE);
} }
if (burn_floor_paper(mtmp->mx, mtmp->my, see_it, FALSE) && if (burn_floor_objects(mtmp->mx, mtmp->my, see_it, FALSE) &&
!see_it && distu(mtmp->mx, mtmp->my) <= 3*3) !see_it && distu(mtmp->mx, mtmp->my) <= 3*3)
You("smell smoke."); You("smell smoke.");
if (is_ice(mtmp->mx,mtmp->my)) if (is_ice(mtmp->mx,mtmp->my))
@@ -2852,7 +2852,7 @@ struct obj *box; /* null for floor trap */
boolean see_it = !Blind; boolean see_it = !Blind;
int num, alt; int num, alt;
/* Bug: for box case, the equivalent of burn_floor_paper() ought /* Bug: for box case, the equivalent of burn_floor_objects() ought
* to be done upon its contents. * to be done upon its contents.
*/ */
@@ -2897,7 +2897,7 @@ struct obj *box; /* null for floor trap */
destroy_item(SPBOOK_CLASS, AD_FIRE); destroy_item(SPBOOK_CLASS, AD_FIRE);
destroy_item(POTION_CLASS, AD_FIRE); destroy_item(POTION_CLASS, AD_FIRE);
} }
if (!box && burn_floor_paper(u.ux, u.uy, see_it, TRUE) && !see_it) if (!box && burn_floor_objects(u.ux, u.uy, see_it, TRUE) && !see_it)
You("smell paper burning."); You("smell paper burning.");
if (is_ice(u.ux, u.uy)) if (is_ice(u.ux, u.uy))
melt_ice(u.ux, u.uy, (char *)0); melt_ice(u.ux, u.uy, (char *)0);
+21 -33
View File
@@ -1,4 +1,4 @@
/* NetHack 3.5 vision.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ /* NetHack 3.5 vision.c $NHDT-Date: 1426449474 2015/03/15 19:57:54 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.14 $ */
/* NetHack 3.5 vision.c $Date: 2009/05/06 10:48:10 $ $Revision: 1.12 $ */ /* NetHack 3.5 vision.c $Date: 2009/05/06 10:48:10 $ $Revision: 1.12 $ */
/* SCCS Id: @(#)vision.c 3.5 2007/11/05 */ /* SCCS Id: @(#)vision.c 3.5 2007/11/05 */
/* Copyright (c) Dean Luick, with acknowledgements to Dave Cohrs, 1990. */ /* Copyright (c) Dean Luick, with acknowledgements to Dave Cohrs, 1990. */
@@ -499,7 +499,7 @@ vision_recalc(control)
char *next_rmin; /* min pointer for the new array */ char *next_rmin; /* min pointer for the new array */
char *next_rmax; /* max pointer for the new array */ char *next_rmax; /* max pointer for the new array */
char *ranges; /* circle ranges -- used for xray & night vision */ char *ranges; /* circle ranges -- used for xray & night vision */
int row; /* row counter (outer loop) */ int row = 0; /* row counter (outer loop) */
int start, stop; /* inner loop starting/stopping index */ int start, stop; /* inner loop starting/stopping index */
int dx, dy; /* one step from a lit door or lit wall (see below) */ int dx, dy; /* one step from a lit door or lit wall (see below) */
register int col; /* inner loop counter */ register int col; /* inner loop counter */
@@ -513,10 +513,6 @@ vision_recalc(control)
vision_full_recalc = 0; /* reset flag */ vision_full_recalc = 0; /* reset flag */
if (in_mklev || !iflags.vision_inited) return; if (in_mklev || !iflags.vision_inited) return;
#if defined(GCC_WARN) || defined(_MSC_VER)
row = 0;
#endif
/* /*
* Either the light sources have been taken care of, or we must * Either the light sources have been taken care of, or we must
* recalculate them here. * recalculate them here.
@@ -1655,18 +1651,15 @@ right_side(row, cb_row, cb_col, fb_row, fb_col, left, right_mark, limits)
char *limits; /* points at range limit for current row, or NULL */ char *limits; /* points at range limit for current row, or NULL */
{ {
register int i; register int i;
register char *rowp; register char *rowp = NULL;
int hit_stone = 0; int hit_stone = 0;
int left_shadow, right_shadow, loc_right; int left_shadow, right_shadow, loc_right;
int lblock_col; /* local block column (current row) */ int lblock_col; /* local block column (current row) */
int nrow, deeper; int nrow, deeper;
char *row_min; /* left most */ char *row_min = NULL; /* left most */
char *row_max; /* right most */ char *row_max = NULL; /* right most */
int lim_max; /* right most limit of circle */ int lim_max; /* right most limit of circle */
#if defined(GCC_WARN) || defined(_MSC_VER)
rowp = 0;
#endif
nrow = row + step; nrow = row + step;
deeper = good_row(nrow) && (!limits || (*limits >= *(limits+1))); deeper = good_row(nrow) && (!limits || (*limits >= *(limits+1)));
if(!vis_func) { if(!vis_func) {
@@ -1910,18 +1903,15 @@ left_side(row, cb_row, cb_col, fb_row, fb_col, left_mark, right, limits)
char *limits; char *limits;
{ {
register int i; register int i;
register char *rowp; register char *rowp = NULL;
int hit_stone = 0; int hit_stone = 0;
int left_shadow, right_shadow, loc_left; int left_shadow, right_shadow, loc_left;
int lblock_col; /* local block column (current row) */ int lblock_col; /* local block column (current row) */
int nrow, deeper; int nrow, deeper;
char *row_min; /* left most */ char *row_min = NULL; /* left most */
char *row_max; /* right most */ char *row_max = NULL; /* right most */
int lim_min; int lim_min;
#if defined(GCC_WARN) || defined(_MSC_VER)
rowp = 0;
#endif
nrow = row + step; nrow = row + step;
deeper = good_row(nrow) && (!limits || (*limits >= *(limits+1))); deeper = good_row(nrow) && (!limits || (*limits >= *(limits+1)));
if(!vis_func) { if(!vis_func) {
@@ -2192,20 +2182,17 @@ right_side(row, left, right_mark, limits)
int right_mark; /* last (right side) visible spot on prev row */ int right_mark; /* last (right side) visible spot on prev row */
char *limits; /* points at range limit for current row, or NULL */ char *limits; /* points at range limit for current row, or NULL */
{ {
int right; /* right limit of "could see" */ int right; /* right limit of "could see" */
int right_edge; /* right edge of an opening */ int right_edge; /* right edge of an opening */
int nrow; /* new row (calculate once) */ int nrow; /* new row (calculate once) */
int deeper; /* if TRUE, call self as needed */ int deeper; /* if TRUE, call self as needed */
int result; /* set by q?_path() */ int result; /* set by q?_path() */
register int i; /* loop counter */ register int i; /* loop counter */
register char *rowp = NULL; /* row optimization */ register char *rowp = NULL; /* row optimization */
char *row_min = NULL; /* left most [used by macro set_min()] */ char *row_min = NULL; /* left most [used by macro set_min()] */
char *row_max = NULL; /* right most [used by macro set_max()] */ char *row_max = NULL; /* right most [used by macro set_max()] */
int lim_max; /* right most limit of circle */ int lim_max; /* right most limit of circle */
#if defined(GCC_WARN) || defined(_MSC_VER)
rowp = row_min = row_max = 0;
#endif
nrow = row + step; nrow = row + step;
/* /*
* Can go deeper if the row is in bounds and the next row is within * Can go deeper if the row is in bounds and the next row is within
@@ -2372,13 +2359,14 @@ left_side(row, left_mark, right, limits)
int row, left_mark, right; int row, left_mark, right;
char *limits; char *limits;
{ {
int left, left_edge, nrow, deeper, result; int left, left_edge, nrow, deeper, result;
register int i; register int i;
register char *rowp = NULL; register char *rowp = NULL;
char *row_min = NULL, *row_max = NULL; char *row_min = NULL;
int lim_min; char *row_max = NULL;
int lim_min;
#if defined(GCC_WARN) || defined(_MSC_VER) #ifdef GCC_WARN
rowp = row_min = row_max = 0; rowp = row_min = row_max = 0;
#endif #endif
nrow = row+step; nrow = row+step;
+175 -156
View File
@@ -2109,18 +2109,19 @@ boolean ordinary;
case FIRE_HORN: case FIRE_HORN:
learn_it = TRUE; learn_it = TRUE;
if (Fire_resistance) { if (Fire_resistance) {
shieldeff(u.ux, u.uy); shieldeff(u.ux, u.uy);
You_feel("rather warm."); You_feel("rather warm.");
ugolemeffects(AD_FIRE, d(12,6)); ugolemeffects(AD_FIRE, d(12,6));
} else { } else {
pline("You've set yourself afire!"); pline("You've set yourself afire!");
damage = d(12,6); damage = d(12,6);
} }
burn_away_slime(); burn_away_slime();
(void) burnarmor(&youmonst); (void) burnarmor(&youmonst);
destroy_item(SCROLL_CLASS, AD_FIRE); destroy_item(SCROLL_CLASS, AD_FIRE);
destroy_item(POTION_CLASS, AD_FIRE); destroy_item(POTION_CLASS, AD_FIRE);
destroy_item(SPBOOK_CLASS, AD_FIRE); destroy_item(SPBOOK_CLASS, AD_FIRE);
destroy_item(FOOD_CLASS, AD_FIRE); /* only slime for now */
break; break;
case WAN_COLD: case WAN_COLD:
@@ -3326,6 +3327,7 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */
if (!rn2(3)) (void)destroy_mitem(mon, POTION_CLASS, AD_FIRE); if (!rn2(3)) (void)destroy_mitem(mon, POTION_CLASS, AD_FIRE);
if (!rn2(3)) (void)destroy_mitem(mon, SCROLL_CLASS, AD_FIRE); if (!rn2(3)) (void)destroy_mitem(mon, SCROLL_CLASS, AD_FIRE);
if (!rn2(5)) (void)destroy_mitem(mon, SPBOOK_CLASS, AD_FIRE); if (!rn2(5)) (void)destroy_mitem(mon, SPBOOK_CLASS, AD_FIRE);
destroy_mitem(mon, FOOD_CLASS, AD_FIRE); /* carried slime */
} }
break; break;
case ZT_COLD: case ZT_COLD:
@@ -3470,6 +3472,7 @@ xchar sx, sy;
if (!rn2(3)) destroy_item(POTION_CLASS, AD_FIRE); if (!rn2(3)) destroy_item(POTION_CLASS, AD_FIRE);
if (!rn2(3)) destroy_item(SCROLL_CLASS, AD_FIRE); if (!rn2(3)) destroy_item(SCROLL_CLASS, AD_FIRE);
if (!rn2(5)) destroy_item(SPBOOK_CLASS, AD_FIRE); if (!rn2(5)) destroy_item(SPBOOK_CLASS, AD_FIRE);
destroy_item(FOOD_CLASS, AD_FIRE);
} }
break; break;
case ZT_COLD: case ZT_COLD:
@@ -3566,11 +3569,11 @@ xchar sx, sy;
} }
/* /*
* burn scrolls and spellbooks on floor at position x,y * burn objects (such as scrolls and spellbooks) on floor
* return the number of scrolls and spellbooks burned * at position x,y; return the number of objects burned
*/ */
int int
burn_floor_paper(x, y, give_feedback, u_caused) burn_floor_objects(x, y, give_feedback, u_caused)
int x, y; int x, y;
boolean give_feedback; /* caller needs to decide about visibility checks */ boolean give_feedback; /* caller needs to decide about visibility checks */
boolean u_caused; boolean u_caused;
@@ -3582,37 +3585,39 @@ boolean u_caused;
for (obj = level.objects[x][y]; obj; obj = obj2) { for (obj = level.objects[x][y]; obj; obj = obj2) {
obj2 = obj->nexthere; obj2 = obj->nexthere;
if (obj->oclass == SCROLL_CLASS || obj->oclass == SPBOOK_CLASS) { if (obj->oclass == SCROLL_CLASS || obj->oclass == SPBOOK_CLASS
if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL || || (obj->oclass == FOOD_CLASS
obj_resists(obj, 2, 100)) && obj->otyp == GLOB_OF_GREEN_SLIME)) {
continue; if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL ||
scrquan = obj->quan; /* number present */ obj_resists(obj, 2, 100))
delquan = 0L; /* number to destroy */ continue;
for (i = scrquan; i > 0L; i--) scrquan = obj->quan; /* number present */
if (!rn2(3)) delquan++; delquan = 0L; /* number to destroy */
if (delquan) { for (i = scrquan; i > 0L; i--)
/* save name before potential delobj() */ if (!rn2(3)) delquan++;
if (give_feedback) { if (delquan) {
obj->quan = 1L; /* save name before potential delobj() */
Strcpy(buf1, (x == u.ux && y == u.uy) ? if (give_feedback) {
xname(obj) : distant_name(obj, xname)); obj->quan = 1L;
obj->quan = 2L; Strcpy(buf1, (x == u.ux && y == u.uy) ?
Strcpy(buf2, (x == u.ux && y == u.uy) ? xname(obj) : distant_name(obj, xname));
xname(obj) : distant_name(obj, xname)); obj->quan = 2L;
obj->quan = scrquan; Strcpy(buf2, (x == u.ux && y == u.uy) ?
} xname(obj) : distant_name(obj, xname));
/* useupf(), which charges, only if hero caused damage */ obj->quan = scrquan;
if (u_caused) useupf(obj, delquan); }
else if (delquan < scrquan) obj->quan -= delquan; /* useupf(), which charges, only if hero caused damage */
else delobj(obj); if (u_caused) useupf(obj, delquan);
cnt += delquan; else if (delquan < scrquan) obj->quan -= delquan;
if (give_feedback) { else delobj(obj);
if (delquan > 1L) cnt += delquan;
pline("%ld %s burn.", delquan, buf2); if (give_feedback) {
else if (delquan > 1L)
pline("%s burns.", An(buf1)); pline("%ld %s burn.", delquan, buf2);
} else
} pline("%s burns.", An(buf1));
}
}
} }
} }
return cnt; return cnt;
@@ -4252,7 +4257,7 @@ short exploding_wand_typ;
} }
if(OBJ_AT(x, y) && abstype == ZT_FIRE) if(OBJ_AT(x, y) && abstype == ZT_FIRE)
if (burn_floor_paper(x, y, FALSE, type > 0) && couldsee(x, y)) { if (burn_floor_objects(x, y, FALSE, type > 0) && couldsee(x, y)) {
newsym(x,y); newsym(x,y);
You("%s of smoke.", You("%s of smoke.",
!Blind ? "see a puff" : "smell a whiff"); !Blind ? "see a puff" : "smell a whiff");
@@ -4362,129 +4367,137 @@ const char * const destroy_strings[][3] = { /* also used in trap.c */
void void
destroy_item(osym, dmgtyp) destroy_item(osym, dmgtyp)
register int osym, dmgtyp; register int osym, dmgtyp;
{ {
register struct obj *obj, *obj2; register struct obj *obj, *obj2;
register int dmg, xresist, skip; register int dmg, xresist, skip;
register long i, cnt, quan; register long i, cnt, quan;
register int dindx; register int dindx;
const char *mult; const char *mult;
boolean physical_damage; boolean physical_damage;
for(obj = invent; obj; obj = obj2) { for(obj = invent; obj; obj = obj2) {
obj2 = obj->nobj; obj2 = obj->nobj;
physical_damage = FALSE; physical_damage = FALSE;
if(obj->oclass != osym) continue; /* test only objs of type osym */ if(obj->oclass != osym) continue; /* test only objs of type osym */
if(obj->oartifact) continue; /* don't destroy artifacts */ if(obj->oartifact) continue; /* don't destroy artifacts */
if(obj->in_use && obj->quan == 1L) continue; /* not available */ if(obj->in_use && obj->quan == 1L) continue; /* not available */
xresist = skip = 0; xresist = skip = 0;
/* lint suppression */ /* lint suppression */
dmg = dindx = 0; dmg = dindx = 0;
quan = 0L; quan = 0L;
switch(dmgtyp) { switch(dmgtyp) {
case AD_COLD: case AD_COLD:
if(osym == POTION_CLASS && obj->otyp != POT_OIL) { if(osym == POTION_CLASS && obj->otyp != POT_OIL) {
quan = obj->quan; quan = obj->quan;
dindx = 0; dindx = 0;
dmg = rnd(4); dmg = rnd(4);
} else skip++; } else skip++;
break; break;
case AD_FIRE: case AD_FIRE:
xresist = (Fire_resistance && obj->oclass != POTION_CLASS); xresist = (Fire_resistance
&& obj->oclass != POTION_CLASS
&& obj->otyp != GLOB_OF_GREEN_SLIME);
if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL) if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL)
skip++; skip++;
if (obj->otyp == SPE_BOOK_OF_THE_DEAD) { if (obj->otyp == SPE_BOOK_OF_THE_DEAD) {
skip++; skip++;
if (!Blind) if (!Blind)
pline("%s glows a strange %s, but remains intact.", pline("%s glows a strange %s, but remains intact.",
The(xname(obj)), hcolor("dark red")); The(xname(obj)), hcolor("dark red"));
} }
quan = obj->quan; quan = obj->quan;
switch(osym) { switch(osym) {
case POTION_CLASS: case POTION_CLASS:
dindx = (obj->otyp != POT_OIL) ? 1 : 2; dindx = (obj->otyp != POT_OIL) ? 1 : 2;
dmg = rnd(6); dmg = rnd(6);
break; break;
case SCROLL_CLASS: case SCROLL_CLASS:
dindx = 3; dindx = 3;
dmg = 1; dmg = 1;
break; break;
case SPBOOK_CLASS: case SPBOOK_CLASS:
dindx = 4; dindx = 4;
dmg = 1; dmg = 1;
break; break;
default: case FOOD_CLASS:
skip++; if (obj->otyp == GLOB_OF_GREEN_SLIME) {
break; dindx = obj->owt / 20;
} dmg = 1;
break; } else { skip++; }
case AD_ELEC: break;
xresist = (Shock_resistance && obj->oclass != RING_CLASS); default:
quan = obj->quan; skip++;
switch(osym) { break;
case RING_CLASS: }
if(obj->otyp == RIN_SHOCK_RESISTANCE) break;
{ skip++; break; } case AD_ELEC:
dindx = 5; xresist = (Shock_resistance && obj->oclass != RING_CLASS);
dmg = 0; quan = obj->quan;
break; switch(osym) {
case WAND_CLASS: case RING_CLASS:
if(obj->otyp == WAN_LIGHTNING) { skip++; break; } if(obj->otyp == RIN_SHOCK_RESISTANCE)
{ skip++; break; }
dindx = 5;
dmg = 0;
break;
case WAND_CLASS:
if(obj->otyp == WAN_LIGHTNING) { skip++; break; }
#if 0 #if 0
if (obj == current_wand) { skip++; break; } if (obj == current_wand) { skip++; break; }
#endif #endif
dindx = 6; dindx = 6;
dmg = rnd(10); dmg = rnd(10);
break; break;
default: default:
skip++; skip++;
break; break;
} }
break; break;
default: default:
skip++; skip++;
break; break;
} }
if(!skip) { if(!skip) {
if (obj->in_use) --quan; /* one will be used up elsewhere */ if (obj->in_use) --quan; /* one will be used up elsewhere */
for(i = cnt = 0L; i < quan; i++) for(i = cnt = 0L; i < quan; i++)
if(!rn2(3)) cnt++; if(!rn2(3)) cnt++;
if(!cnt) continue; if(!cnt) continue;
mult = (cnt == quan) ? "Your" : mult = (cnt == quan) ? (quan > 1) ? "All of your " : "Your" :
(cnt == 1L) ? "One of your" : "Some of your"; (cnt == 1L) ? "One of your" : "Some of your";
pline("%s %s %s!", mult, xname(obj), pline("%s %s %s!", mult, xname(obj),
destroy_strings[dindx][(cnt > 1L)]); destroy_strings[dindx][(cnt > 1L)]);
if(osym == POTION_CLASS && dmgtyp != AD_COLD) { if(osym == POTION_CLASS && dmgtyp != AD_COLD) {
if (!breathless(youmonst.data) || haseyes(youmonst.data)) if (!breathless(youmonst.data) || haseyes(youmonst.data))
potionbreathe(obj); potionbreathe(obj);
} }
if (obj->owornmask) { if (obj->owornmask) {
if (obj->owornmask & W_RING) /* ring being worn */ if (obj->owornmask & W_RING) /* ring being worn */
Ring_gone(obj); Ring_gone(obj);
else else
setnotworn(obj); setnotworn(obj);
} }
if (obj == current_wand) current_wand = 0; /* destroyed */ if (obj == current_wand) current_wand = 0; /* destroyed */
for (i = 0; i < cnt; i++) for (i = 0; i < cnt; i++)
useup(obj); useup(obj);
if(dmg) { if(dmg) {
if(xresist) You("aren't hurt!"); if(xresist) You("aren't hurt!");
else { else {
const char *how = destroy_strings[dindx][2]; const char *how = destroy_strings[dindx][2];
boolean one = (cnt == 1L); boolean one = (cnt == 1L);
if (physical_damage) dmg = Maybe_Half_Phys(dmg); if (physical_damage) dmg = Maybe_Half_Phys(dmg);
losehp(dmg, one ? how : (const char *)makeplural(how), losehp(dmg, one ? how : (const char *)makeplural(how),
one ? KILLED_BY_AN : KILLED_BY); one ? KILLED_BY_AN : KILLED_BY);
exercise(A_STR, FALSE); exercise(A_STR, FALSE);
} }
} }
} }
} }
return; return;
} }
int int
@@ -4543,6 +4556,12 @@ int osym, dmgtyp;
dindx = 4; dindx = 4;
tmp++; tmp++;
break; break;
case FOOD_CLASS:
if (obj->otyp == GLOB_OF_GREEN_SLIME) {
dindx = obj->owt / 20;
tmp++;
} else { skip++; }
break;
default: default:
skip++; skip++;
break; break;
+806 -816
View File
File diff suppressed because it is too large Load Diff
+1228 -1126
View File
File diff suppressed because it is too large Load Diff
+441 -414
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -79,7 +79,7 @@ VARDAT = $(VARDATD) $(VARDATND)
DATHELP = help hh cmdhelp history opthelp wizhelp DATHELP = help hh cmdhelp history opthelp wizhelp
SPEC_LEVS = asmodeus.lev baalz.lev bigrm-?.lev castle.lev fakewiz?.lev \ SPEC_LEVS = asmodeus.lev baalz.lev bigrm-*.lev castle.lev fakewiz?.lev \
juiblex.lev knox.lev medusa-?.lev minend-?.lev minefill.lev \ juiblex.lev knox.lev medusa-?.lev minend-?.lev minefill.lev \
minetn-?.lev oracle.lev orcus.lev sanctum.lev soko?-?.lev \ minetn-?.lev oracle.lev orcus.lev sanctum.lev soko?-?.lev \
tower?.lev valley.lev wizard?.lev \ tower?.lev valley.lev wizard?.lev \
+3
View File
@@ -40,6 +40,9 @@ MAXPLAYERS=10
# Uncomment the next line to disable the SEDUCE option. # Uncomment the next line to disable the SEDUCE option.
#SEDUCE=0 #SEDUCE=0
# Uncomment to disable savefile UID checking.
#CHECK_SAVE_UID=0
# Record (high score) file options. # Record (high score) file options.
# CAUTION: changing these after people have started playing games can # CAUTION: changing these after people have started playing games can
# lead to lost high scores! # lead to lost high scores!
+2 -1
View File
@@ -111,7 +111,7 @@ FILE *orig_yyin = NULL;
map_cnt = 0; map_cnt = 0;
return MAP_ID; return MAP_ID;
} }
<MAPC>[-|}{+xABCISHKMPLWTtFYU\\#. 0123456789]*\r?\n { <MAPC>[-|}{+xABCISHKPLWTF\\#. 0123456789]*\r?\n {
int len = yyleng; int len = yyleng;
savetoken(yytext); savetoken(yytext);
/* convert \r\n to \n */ /* convert \r\n to \n */
@@ -295,6 +295,7 @@ shroud { savetoken(yytext); yylval.i=SHROUD; return FLAG_TYPE; }
graveyard { savetoken(yytext); yylval.i=GRAVEYARD; return FLAG_TYPE; } graveyard { savetoken(yytext); yylval.i=GRAVEYARD; return FLAG_TYPE; }
icedpools { savetoken(yytext); yylval.i=ICEDPOOLS; return FLAG_TYPE; } icedpools { savetoken(yytext); yylval.i=ICEDPOOLS; return FLAG_TYPE; }
solidify { savetoken(yytext); yylval.i=SOLIDIFY; return FLAG_TYPE; } solidify { savetoken(yytext); yylval.i=SOLIDIFY; return FLAG_TYPE; }
corrmaze { savetoken(yytext); yylval.i=CORRMAZE; return FLAG_TYPE; }
[0-9]+d[0-9]+ { char *p = strchr(yytext, 'd'); [0-9]+d[0-9]+ { char *p = strchr(yytext, 'd');
savetoken(yytext); savetoken(yytext);
if (p) { if (p) {
+376 -267
View File
File diff suppressed because it is too large Load Diff
+158 -83
View File
@@ -1,4 +1,4 @@
/* NetHack 3.5 lev_main.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ /* NetHack 3.5 lev_main.c $NHDT-Date: 1428655166 2015/04/10 08:39:26 $ $NHDT-Branch: master $:$NHDT-Revision: 1.34 $ */
/* NetHack 3.5 lev_main.c $Date: 2012/01/12 04:48:12 $ $Revision: 1.20 $ */ /* NetHack 3.5 lev_main.c $Date: 2012/01/12 04:48:12 $ $Revision: 1.20 $ */
/* SCCS Id: @(#)lev_main.c 3.5 2007/01/17 */ /* SCCS Id: @(#)lev_main.c 3.5 2007/01/17 */
/* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1989 by Jean-Christophe Collet */
@@ -8,11 +8,9 @@
* This file contains the main function for the parser * This file contains the main function for the parser
* and some useful functions needed by yacc * and some useful functions needed by yacc
*/ */
#define SPEC_LEV /* for MPW */ #define SPEC_LEV /* for USE_OLDARGS (sp_lev.h) and for MPW (macconf.h) */
/* although, why don't we move those special defines here.. and in dgn_main? */
#include <stdarg.h>
#define NEED_VARARGS
#include "hack.h" #include "hack.h"
#include "date.h" #include "date.h"
#include "sp_lev.h" #include "sp_lev.h"
@@ -77,14 +75,14 @@ extern unsigned _stklen = STKSIZ;
#endif #endif
#define MAX_ERRORS 25 #define MAX_ERRORS 25
extern int NDECL (yyparse); extern int NDECL(yyparse);
extern void FDECL (init_yyin, (FILE *)); extern void FDECL(init_yyin, (FILE *));
extern void FDECL (init_yyout, (FILE *)); extern void FDECL(init_yyout, (FILE *));
int FDECL (main, (int, char **)); int FDECL(main, (int, char **));
void FDECL (yyerror, (const char *)); void FDECL(yyerror, (const char *));
void FDECL (yywarning, (const char *)); void FDECL(yywarning, (const char *));
int NDECL (yywrap); int NDECL(yywrap);
int FDECL(get_floor_type, (CHAR_P)); int FDECL(get_floor_type, (CHAR_P));
int FDECL(get_room_type, (char *)); int FDECL(get_room_type, (char *));
int FDECL(get_trap_type, (char *)); int FDECL(get_trap_type, (char *));
@@ -113,11 +111,12 @@ extern void NDECL(decl_init);
void FDECL(add_opcode, (sp_lev *, int, genericptr_t)); void FDECL(add_opcode, (sp_lev *, int, genericptr_t));
static boolean FDECL(write_common_data, (int,sp_lev *)); static boolean FDECL(write_common_data, (int));
static boolean FDECL(write_maze, (int,sp_lev *)); static boolean FDECL(write_maze, (int,sp_lev *));
static void NDECL(init_obj_classes); static void NDECL(init_obj_classes);
static int FDECL(case_insensitive_comp, (const char *, const char *)); static int FDECL(case_insensitive_comp, (const char *, const char *));
void VDECL(lc_pline, (const char *, ...));
void VDECL(lc_error, (const char *, ...)); void VDECL(lc_error, (const char *, ...));
void VDECL(lc_warning, (const char *, ...)); void VDECL(lc_warning, (const char *, ...));
char * FDECL(decode_parm_chr, (CHAR_P)); char * FDECL(decode_parm_chr, (CHAR_P));
@@ -128,8 +127,8 @@ struct opvar * FDECL(set_opvar_region, (struct opvar *, long));
struct opvar * FDECL(set_opvar_mapchar, (struct opvar *, long)); struct opvar * FDECL(set_opvar_mapchar, (struct opvar *, long));
struct opvar * FDECL(set_opvar_monst, (struct opvar *, long)); struct opvar * FDECL(set_opvar_monst, (struct opvar *, long));
struct opvar * FDECL(set_opvar_obj, (struct opvar *, long)); struct opvar * FDECL(set_opvar_obj, (struct opvar *, long));
struct opvar * FDECL(set_opvar_str, (struct opvar *, char *)); struct opvar * FDECL(set_opvar_str, (struct opvar *, const char *));
struct opvar * FDECL(set_opvar_var, (struct opvar *, char *)); struct opvar * FDECL(set_opvar_var, (struct opvar *, const char *));
void VDECL(add_opvars, (sp_lev *, const char *, ...)); void VDECL(add_opvars, (sp_lev *, const char *, ...));
void NDECL(break_stmt_start); void NDECL(break_stmt_start);
void FDECL(break_stmt_end, (sp_lev *)); void FDECL(break_stmt_end, (sp_lev *));
@@ -295,8 +294,7 @@ char **argv;
} }
fin = freopen(fname, "r", stdin); fin = freopen(fname, "r", stdin);
if (!fin) { if (!fin) {
(void) fprintf(stderr,"Can't open \"%s\" for input.\n", lc_pline("Can't open \"%s\" for input.\n", fname);
fname);
perror(fname); perror(fname);
errors_encountered = TRUE; errors_encountered = TRUE;
} else { } else {
@@ -329,9 +327,10 @@ yyerror(s)
const char *s; const char *s;
{ {
char *e = ((char *)s + strlen(s) - 1); char *e = ((char *)s + strlen(s) - 1);
(void) fprintf(stderr, "%s: line %d, pos %d: %s", (void) fprintf(stderr, "%s: line %d, pos %d: %s",
fname, nh_line_number, fname, nh_line_number,
token_start_pos-strlen(curr_token), s); token_start_pos - (int)strlen(curr_token), s);
if (*e != '.' && *e != '!') if (*e != '.' && *e != '!')
(void) fprintf(stderr, " at \"%s\"", curr_token); (void) fprintf(stderr, " at \"%s\"", curr_token);
(void) fprintf(stderr, "\n"); (void) fprintf(stderr, "\n");
@@ -362,30 +361,84 @@ yywrap()
return 1; return 1;
} }
/*
* lc_pline(): lev_comp version of pline(), stripped down version of
* core's pline(), with convoluted handling for variadic arguments to
* support <stdarg.h>, <varargs.h>, and neither of the above.
*
* Using state for message/warning/error mode simplifies calling interface.
*/
#define LC_PLINE_MESSAGE 0
#define LC_PLINE_WARNING 1
#define LC_PLINE_ERROR 2
static int lc_pline_mode = LC_PLINE_MESSAGE;
#if defined(USE_STDARG) || defined(USE_VARARGS)
static void FDECL(lc_vpline, (const char *, va_list));
void void
lc_error(const char *fmt, ...) lc_pline VA_DECL(const char *, line)
{ VA_START(line);
char buf[512]; VA_INIT(line, char *);
va_list argp; lc_vpline(line, VA_ARGS);
VA_END();
va_start(argp, fmt);
(void) vsnprintf(buf, 511, fmt, argp);
va_end(argp);
yyerror(buf);
} }
# ifdef USE_STDARG
static void
lc_vpline(const char *line, va_list the_args) {
# else
static void
lc_vpline(line, the_args) const char *line; va_list the_args; {
# endif
#else /* USE_STDARG | USE_VARARG */
#define lc_vpline lc_pline
void void
lc_warning(const char *fmt, ...) lc_pline VA_DECL(const char *, line)
{ #endif /* USE_STDARG | USE_VARARG */
char buf[512];
va_list argp;
va_start(argp, fmt); char pbuf[3*BUFSZ];
(void) vsnprintf(buf, 511, fmt, argp); static char nomsg[] = "(no message)";
va_end(argp); /* Do NOT use VA_START and VA_END in here... see above */
yywarning(buf); if (!line || !*line) line = nomsg; /* shouldn't happen */
if (index(line, '%')) {
Vsprintf(pbuf, line, VA_ARGS);
pbuf[BUFSZ-1] = '\0'; /* truncate if long */
line = pbuf;
}
switch (lc_pline_mode) {
case LC_PLINE_ERROR: yyerror(line); break;
case LC_PLINE_WARNING: yywarning(line); break;
default: (void)fprintf(stderr, "%s\n", line); break;
}
lc_pline_mode = LC_PLINE_MESSAGE; /* reset to default */
return;
}
/*VARARGS1*/
void
lc_error VA_DECL(const char *, line)
VA_START(line);
VA_INIT(line, const char *);
lc_pline_mode = LC_PLINE_ERROR;
lc_vpline(line, VA_ARGS);
VA_END();
return;
}
/*VARARGS1*/
void
lc_warning VA_DECL(const char *, line)
VA_START(line);
VA_INIT(line, const char *);
lc_pline_mode = LC_PLINE_WARNING;
lc_vpline(line, VA_ARGS);
VA_END();
return;
} }
@@ -394,16 +447,17 @@ decode_parm_chr(chr)
char chr; char chr;
{ {
static char buf[32]; static char buf[32];
switch (chr) { switch (chr) {
default: sprintf(buf, "unknown"); break; default: Strcpy(buf, "unknown"); break;
case 'i': sprintf(buf, "int"); break; case 'i': Strcpy(buf, "int"); break;
case 'r': sprintf(buf, "region"); break; case 'r': Strcpy(buf, "region"); break;
case 's': sprintf(buf, "str"); break; case 's': Strcpy(buf, "str"); break;
case 'O': sprintf(buf, "obj"); break; case 'O': Strcpy(buf, "obj"); break;
case 'c': sprintf(buf, "coord"); break; case 'c': Strcpy(buf, "coord"); break;
case ' ': sprintf(buf, "nothing"); break; case ' ': Strcpy(buf, "nothing"); break;
case 'm': sprintf(buf, "mapchar"); break; case 'm': Strcpy(buf, "mapchar"); break;
case 'M': sprintf(buf, "monster"); break; case 'M': Strcpy(buf, "monster"); break;
} }
return buf; return buf;
} }
@@ -500,7 +554,7 @@ long val;
struct opvar * struct opvar *
set_opvar_str(ov, val) set_opvar_str(ov, val)
struct opvar *ov; struct opvar *ov;
char *val; const char *val;
{ {
if (ov) { if (ov) {
ov->spovartyp = SPOVAR_STRING; ov->spovartyp = SPOVAR_STRING;
@@ -512,7 +566,7 @@ char *val;
struct opvar * struct opvar *
set_opvar_var(ov, val) set_opvar_var(ov, val)
struct opvar *ov; struct opvar *ov;
char *val; const char *val;
{ {
if (ov) { if (ov) {
ov->spovartyp = SPOVAR_VARIABLE; ov->spovartyp = SPOVAR_VARIABLE;
@@ -524,13 +578,36 @@ char *val;
#define New(type) \ #define New(type) \
(type *) memset((genericptr_t)alloc(sizeof(type)), 0, sizeof(type)) (type *) memset((genericptr_t)alloc(sizeof(type)), 0, sizeof(type))
void #if defined(USE_STDARG) || defined(USE_VARARGS)
add_opvars(sp_lev *sp, const char *fmt, ...) static void FDECL(vadd_opvars, (sp_lev *, const char *, va_list));
{
const char *p;
va_list argp;
va_start(argp, fmt); void
add_opvars VA_DECL2(sp_lev *, sp, const char *, fmt)
VA_START(fmt);
VA_INIT(fmt, char *);
vadd_opvars(sp, fmt, VA_ARGS);
VA_END();
}
# ifdef USE_STDARG
static void
vadd_opvars(sp_lev *sp, const char *fmt, va_list the_args) {
# else
static void
vadd_opvars(sp, fmt, the_args) sp_lev *sp; const char *fmt; va_list the_args; {
# endif
#else /* USE_STDARG | USE_VARARG */
#define vadd_opvars add_opvars
void
add_opvars VA_DECL2(sp_lev *, sp, const char *, fmt)
#endif /* USE_STDARG | USE_VARARG */
const char *p, *lp;
long la;
/* Do NOT use VA_START and VA_END in here... see above */
for(p = fmt; *p != '\0'; p++) { for(p = fmt; *p != '\0'; p++) {
switch(*p) { switch(*p) {
@@ -538,74 +615,73 @@ add_opvars(sp_lev *sp, const char *fmt, ...)
case 'i': /* integer */ case 'i': /* integer */
{ {
struct opvar *ov = New(struct opvar); struct opvar *ov = New(struct opvar);
set_opvar_int(ov, va_arg(argp, long)); set_opvar_int(ov, VA_NEXT(la, long));
add_opcode(sp, SPO_PUSH, ov); add_opcode(sp, SPO_PUSH, ov);
break; break;
} }
case 'c': /* coordinate */ case 'c': /* coordinate */
{ {
struct opvar *ov = New(struct opvar); struct opvar *ov = New(struct opvar);
set_opvar_coord(ov, va_arg(argp, long)); set_opvar_coord(ov, VA_NEXT(la, long));
add_opcode(sp, SPO_PUSH, ov); add_opcode(sp, SPO_PUSH, ov);
break; break;
} }
case 'r': /* region */ case 'r': /* region */
{ {
struct opvar *ov = New(struct opvar); struct opvar *ov = New(struct opvar);
set_opvar_region(ov, va_arg(argp, long)); set_opvar_region(ov, VA_NEXT(la, long));
add_opcode(sp, SPO_PUSH, ov); add_opcode(sp, SPO_PUSH, ov);
break; break;
} }
case 'm': /* mapchar */ case 'm': /* mapchar */
{ {
struct opvar *ov = New(struct opvar); struct opvar *ov = New(struct opvar);
set_opvar_mapchar(ov, va_arg(argp, long)); set_opvar_mapchar(ov, VA_NEXT(la, long));
add_opcode(sp, SPO_PUSH, ov); add_opcode(sp, SPO_PUSH, ov);
break; break;
} }
case 'M': /* monster */ case 'M': /* monster */
{ {
struct opvar *ov = New(struct opvar); struct opvar *ov = New(struct opvar);
set_opvar_monst(ov, va_arg(argp, long)); set_opvar_monst(ov, VA_NEXT(la, long));
add_opcode(sp, SPO_PUSH, ov); add_opcode(sp, SPO_PUSH, ov);
break; break;
} }
case 'O': /* object */ case 'O': /* object */
{ {
struct opvar *ov = New(struct opvar); struct opvar *ov = New(struct opvar);
set_opvar_obj(ov, va_arg(argp, long)); set_opvar_obj(ov, VA_NEXT(la, long));
add_opcode(sp, SPO_PUSH, ov); add_opcode(sp, SPO_PUSH, ov);
break; break;
} }
case 's': /* string */ case 's': /* string */
{ {
struct opvar *ov = New(struct opvar); struct opvar *ov = New(struct opvar);
set_opvar_str(ov, va_arg(argp, char *)); set_opvar_str(ov, VA_NEXT(lp, const char *));
add_opcode(sp, SPO_PUSH, ov); add_opcode(sp, SPO_PUSH, ov);
break; break;
} }
case 'v': /* variable */ case 'v': /* variable */
{ {
struct opvar *ov = New(struct opvar); struct opvar *ov = New(struct opvar);
set_opvar_var(ov, va_arg(argp, char *)); set_opvar_var(ov, VA_NEXT(lp, const char *));
add_opcode(sp, SPO_PUSH, ov); add_opcode(sp, SPO_PUSH, ov);
break; break;
} }
case 'o': /* opcode */ case 'o': /* opcode */
{ {
long i = va_arg(argp, int); long i = VA_NEXT(la, int);
if (i < 0 || i >= MAX_SP_OPCODES) if (i < 0 || i >= MAX_SP_OPCODES)
fprintf(stderr, "add_opvars: unknown opcode '%li'.\n", i); lc_pline("add_opvars: unknown opcode '%ld'.", i);
add_opcode(sp, i, NULL); add_opcode(sp, i, NULL);
break; break;
} }
default: default:
fprintf(stderr, "add_opvars: illegal format character '%c'.\n", *p); lc_pline("add_opvars: illegal format character '%c'.", *p);
break; break;
} }
} }
return;
va_end(argp);
} }
void void
@@ -785,12 +861,12 @@ spovar2str(spovar)
{ {
static int togl = 0; static int togl = 0;
static char buf[2][128]; static char buf[2][128];
char *n = NULL; const char *n = NULL;
int is_array = (spovar & SPOVAR_ARRAY); int is_array = (spovar & SPOVAR_ARRAY);
spovar &= ~SPOVAR_ARRAY; spovar &= ~SPOVAR_ARRAY;
switch (spovar) { switch (spovar) {
default: lc_error("spovar2str(%li)", spovar); break; default: lc_error("spovar2str(%ld)", spovar); break;
case SPOVAR_INT: n = "integer"; break; case SPOVAR_INT: n = "integer"; break;
case SPOVAR_STRING: n = "string"; break; case SPOVAR_STRING: n = "string"; break;
case SPOVAR_VARIABLE: n = "variable"; break; case SPOVAR_VARIABLE: n = "variable"; break;
@@ -860,7 +936,7 @@ reverse_jmp_opcode(opcode)
case SPO_JG: return SPO_JLE; case SPO_JG: return SPO_JLE;
case SPO_JLE: return SPO_JG; case SPO_JLE: return SPO_JG;
case SPO_JGE: return SPO_JL; case SPO_JGE: return SPO_JL;
default: lc_error("Cannot reverse comparison jmp opcode %i.", opcode); return SPO_NULL; default: lc_error("Cannot reverse comparison jmp opcode %d.", opcode); return SPO_NULL;
} }
} }
@@ -897,7 +973,7 @@ opvar_clone(ov)
break; break;
default: default:
{ {
lc_error("Unknown opvar_clone value type (%i)!", ov->spovartyp); lc_error("Unknown opvar_clone value type (%d)!", ov->spovartyp);
} }
} }
return tmpov; return tmpov;
@@ -1110,15 +1186,15 @@ char c;
case 'H' : return(SCORR); case 'H' : return(SCORR);
case '{' : return(FOUNTAIN); case '{' : return(FOUNTAIN);
case '\\' : return(THRONE); case '\\' : return(THRONE);
case 'K' : case 'K' : return(SINK);
return(SINK);
case '}' : return(MOAT); case '}' : return(MOAT);
case 'P' : return(POOL); case 'P' : return(POOL);
case 'L' : return(LAVAPOOL); case 'L' : return(LAVAPOOL);
case 'I' : return(ICE); case 'I' : return(ICE);
case 'W' : return(WATER); case 'W' : return(WATER);
case 'T' : return (TREE); case 'T' : return (TREE);
case 'F' : return (IRONBARS); /* Fe = iron */ case 'F' : return (IRONBARS); /* Fe = iron */
case 'x' : return(MAX_TYPE); /* "see-through" */
} }
return(INVALID_TYPE); return(INVALID_TYPE);
} }
@@ -1133,7 +1209,7 @@ genericptr_t dat;
_opcode *tmp; _opcode *tmp;
if ((opc < 0) || (opc >= MAX_SP_OPCODES)) if ((opc < 0) || (opc >= MAX_SP_OPCODES))
lc_error("Unknown opcode '%i'", opc); lc_error("Unknown opcode '%d'", opc);
tmp = (_opcode *)alloc(sizeof(_opcode)*(nop+1)); tmp = (_opcode *)alloc(sizeof(_opcode)*(nop+1));
if (sp->opcodes && nop) { if (sp->opcodes && nop) {
@@ -1226,7 +1302,7 @@ sp_lev *sp;
mbuf[((max_hig-1) * max_len) + (max_len-1) + 1] = '\0'; mbuf[((max_hig-1) * max_len) + (max_len-1) + 1] = '\0';
add_opvars(sp, "siio", mbuf, max_hig, max_len, SPO_MAP); add_opvars(sp, "siio", VA_PASS4(mbuf, max_hig, max_len, SPO_MAP));
for (dy = 0; dy < max_hig; dy++) for (dy = 0; dy < max_hig; dy++)
Free(tmpmap[dy]); Free(tmpmap[dy]);
@@ -1240,9 +1316,8 @@ sp_lev *sp;
* Output some info common to all special levels. * Output some info common to all special levels.
*/ */
static boolean static boolean
write_common_data(fd, lvl) write_common_data(fd)
int fd; int fd;
sp_lev *lvl;
{ {
static struct version_info version_data = { static struct version_info version_data = {
VERSION_NUMBER, VERSION_FEATURES, VERSION_NUMBER, VERSION_FEATURES,
@@ -1264,7 +1339,7 @@ sp_lev *maze;
{ {
int i; int i;
if (!write_common_data(fd, maze)) if (!write_common_data(fd))
return FALSE; return FALSE;
Write(fd, &(maze->n_opcodes), sizeof(maze->n_opcodes)); Write(fd, &(maze->n_opcodes), sizeof(maze->n_opcodes));
@@ -1275,7 +1350,7 @@ sp_lev *maze;
Write(fd, &(tmpo.opcode), sizeof(tmpo.opcode)); Write(fd, &(tmpo.opcode), sizeof(tmpo.opcode));
if (tmpo.opcode < SPO_NULL || tmpo.opcode >= MAX_SP_OPCODES) if (tmpo.opcode < SPO_NULL || tmpo.opcode >= MAX_SP_OPCODES)
panic("write_maze: unknown opcode (%i).", tmpo.opcode); panic("write_maze: unknown opcode (%d).", tmpo.opcode);
if (tmpo.opcode == SPO_PUSH) { if (tmpo.opcode == SPO_PUSH) {
genericptr_t opdat = tmpo.opdat; genericptr_t opdat = tmpo.opdat;
@@ -1304,14 +1379,14 @@ sp_lev *maze;
Free(ov->vardata.str); Free(ov->vardata.str);
} }
break; break;
default: panic("write_maze: unknown data type (%i).", ov->spovartyp); default: panic("write_maze: unknown data type (%d).", ov->spovartyp);
} }
} else panic("write_maze: PUSH with no data."); } else panic("write_maze: PUSH with no data.");
} else { } else {
/* sanity check */ /* sanity check */
genericptr_t opdat = tmpo.opdat; genericptr_t opdat = tmpo.opdat;
if (opdat) if (opdat)
panic("write_maze: opcode (%i) has data.", tmpo.opcode); panic("write_maze: opcode (%d) has data.", tmpo.opcode);
} }
Free(tmpo.opdat); Free(tmpo.opdat);
@@ -1357,7 +1432,7 @@ sp_lev *lvl;
if (!lvl) panic("write_level_file"); if (!lvl) panic("write_level_file");
if (be_verbose) if (be_verbose)
fprintf(stdout, "File: '%s', opcodes: %li\n", lbuf, lvl->n_opcodes); fprintf(stdout, "File: '%s', opcodes: %ld\n", lbuf, lvl->n_opcodes);
if (!write_maze(fout, lvl)) if (!write_maze(fout, lvl))
return FALSE; return FALSE;
-3
View File
@@ -1366,9 +1366,6 @@ static const char *build_opts[] = {
#ifdef VISION_TABLES #ifdef VISION_TABLES
"vision tables", "vision tables",
#endif #endif
#ifdef WALLIFIED_MAZE
"walled mazes",
#endif
#ifdef ZEROCOMP #ifdef ZEROCOMP
"zero-compressed save files", "zero-compressed save files",
#endif #endif
+263 -187
View File
File diff suppressed because it is too large Load Diff
+264 -226
View File
File diff suppressed because it is too large Load Diff
+47 -48
View File
@@ -5,84 +5,83 @@
# #
sub bail($); sub bail($);
sub setfile($);
sub helpmessage();
use Getopt::Long qw(:config bundling auto_version permute); use Getopt::Std;
$main::VERSION = 1.1; # TODO: switch to Getopt::Long so we can parse normal arguments too
$Getopt::Std::STANDARD_HELP_VERSION = TRUE;
$main::VERSION = 1.0;
our %opts = (); my %commands = (
our %commands = ( 'd' => 'debug mode; parse objects.txt to stdout instead of updating',
'output|o:s' => "-o, --output\tspecify an alternate output file",
'debug|d!' => "-d, --debug\tforce output to STDOUT",
'help|h' => "-h, --help\tdisplay this message and exit",
); );
my $helpformat = "%20s %s\n"; getopts(join('', keys(%commands)));
my $debug = (defined($opt_d) && $opt_d == 1);
my $tilecount = 0; my $tilecount = 0;
my $outfile = $debug ? "-" : "objects.txt";
my $infile = $debug ? "objects.txt" : "objects.bak";
GetOptions(\%opts, '<>' => \&setfile, keys(%commands));
if ($opts{'help'}) { helpmessage(); exit; } unless ($debug) {
if (!defined($opts{'infile'})) { helpmessage(); die "no file specified for processing; stopping\n"; } if (-e "$infile") { die "something didn't clean up objects.bak from last time; stopping\n"; }
rename($outfile,$infile) or die "couldn't move objects.txt to objects.bak; stopping\n";
if ($opts{'debug'}) {
$opts{'output'} = '-';
} }
if (defined($opts{'output'})) { open(INFILE, "<$infile") or bail("couldn't open $infile; bailing");
if (-e $opts{'output'}) { die "can't write to $opts{'output'}, it already exists; stopping\n"; } open(OUTFILE, ">$outfile") or bail("couldn't open $outfile; bailing");
open(INFILE, "<$opts{'infile'}") or bail("couldn't open $opts{'infile'}; bailing");
} else {
$opts{'output'} = $opts{'infile'};
if (-e "$opts{'infile'}.bak") { die "something didn't clean up $opts{'infile'}.bak from last time; stopping\n"; }
rename($opts{'infile'},"$opts{'infile'}.bak") or die "couldn't move $opts{'infile'} to $opts{'infile'}.bak; stopping\n";
open(INFILE, "<$opts{'infile'}.bak") or bail("couldn't open $opts{'infile'}.bak; bailing");
}
open(OUTFILE, ">$opts{'output'}") or bail("couldn't open $opts{'output'}; bailing");
while (my $line = <INFILE>) while (my $line = <INFILE>)
{ {
$line =~ s/cmap \d+/cmap $tilecount/; if (my ($tiletext) = $line =~ /^# tile \d+ (.*)/)
if ($line =~ s/^# tile \d+/# tile $tilecount/) { $tilecount++; } {
$line = "# tile $tilecount $tiletext\n";
$tilecount++;
}
print OUTFILE $line; print OUTFILE $line;
} }
close(INFILE); close(INFILE);
close(OUTFILE); close(OUTFILE);
unless ($opts{'debug'}) { unlink "$opts{'infile'}.bak"; } unless ($debug) { unlink $infile; }
exit; exit;
sub helpmessage() sub main::HELP_MESSAGE()
{ {
print("Usage: renumtiles.pl [OPTIONS] <textfile>\n\n"); print <<"STARTHELP";
foreach $opt (keys(%commands)) { Usage: renumtiles.pl [OPTIONS] <textfile>
my ($vname, $desc) = split("\t", $commands{$opt});
$desc =~ s/\t//g; STARTHELP
printf($helpformat, $vname, $desc); foreach $cmd (keys(%commands)) {
printf("%10s %s\n", '-'.$cmd, $commands{$cmd});
} }
printf($helpformat, "--version", "display version and exit\n"); print <<"ENDHELP";
\t--help display this help message and exit
\t--version display version and exit
ENDHELP
exit;
}
sub main::VERSION_MESSAGE()
{
my ($objglob, $optpackage, $ver, $switches) = @_;
print <<"STARTHELP";
renumtiles $ver -- tile-renumbering utility for NetHack
STARTHELP
} }
sub bail($) sub bail($)
{ {
unless ($opts{'debug'}) { unless ($debug) {
unlink $opts{'outfile'}; unlink $outfile;
rename ("$opts{'infile'}.bak",$opts{'outfile'}); rename ($infile,$outfile);
} }
shift; shift;
die "$_\n"; die "$_\n";
} }
sub setfile($)
{
if (defined($opts{'infile'})) {
return;
}
$opts{'infile'} = shift;
}
+2 -2
View File
@@ -1,4 +1,4 @@
/* NetHack 3.5 wintty.c $NHDT-Date: 1427667623 2015/03/29 22:20:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.75 $ */ /* NetHack 3.5 wintty.c $NHDT-Date: 1428394244 2015/04/07 08:10:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.84 $ */
/* NetHack 3.5 wintty.c $Date: 2012/01/22 06:27:09 $ $Revision: 1.66 $ */ /* NetHack 3.5 wintty.c $Date: 2012/01/22 06:27:09 $ $Revision: 1.66 $ */
/* Copyright (c) David Cohrs, 1991 */ /* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1770,7 +1770,7 @@ struct WinDesc *cw;
if (i == cw->maxrow) { if (i == cw->maxrow) {
#ifdef H2344_BROKEN #ifdef H2344_BROKEN
if(cw->type == NHW_TEXT){ if(cw->type == NHW_TEXT){
tty_curs(BASE_WINDOW, 0, (int)ttyDisplay->cury+1); tty_curs(BASE_WINDOW, 1, (int)ttyDisplay->cury+1);
cl_eos(); cl_eos();
} }
#endif #endif