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
5. variable expansion
6. reserved names
7. nhadd/nhcommit
------------------------------------------------------------------------------
1. email
Email to devteam@nethack.org will usually get a response, but it may take a
@@ -52,7 +53,9 @@ XXX windows
XXX linux
B. Specify the prefix for variable substitution:
(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
tree you cloned from git. I use ~/nethack/GITADDDIR; for that base,
create the needed directories and edit the file:
@@ -82,8 +85,7 @@ D. aliases
nhadd
nhcommit
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
substitutions do not show up in the working directory.
commands but perform RCS/CVS-style variable substitution.
Note that nothing terrible will happen if you do not use the nh* versions
of the commands.
@@ -94,6 +96,12 @@ D. aliases
MINE-Revision CVS style revision number
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,
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
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
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.
Here's how to do it:
+108 -10
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
# 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.
@@ -27,7 +27,11 @@ my %codes = (
'd M'=>0, 'd 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,
'aA '=>1, 'aAM'=>1, 'aAD'=>1,
@@ -41,9 +45,17 @@ my %codes = (
'fD '=>1, 'fDM'=>1,
# 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,
'fM '=>1, 'fA '=>1, 'fR '=>1, 'fC '=>1,
@@ -87,13 +99,48 @@ if ($^O eq "MSWin32")
$PDS = '\\';
}
# pick up the prefix for substitutions in this repo
my $PREFIX = &git_config('nethack','substprefix');
print "PREFIX: '$PREFIX'\n" if($opt{v});
# various command line options to consider and what the code actually does:
#DONE nhcommit with no files should exit(0)
#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);
# 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){
my $raw = shift @rawlist;
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";
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";
rename $ofile, $file or die "Can't rename $ofile to $file";
}
@@ -230,8 +291,14 @@ sub cmdparse {
last;
}
if(m/^--/){
if($opt{cmd} eq 'add' && $_ eq '--dry-run'){
exit 0;
}
if($opt{cmd} eq 'commit' && $_ eq '--dry-run'){
$opt{'n'} = 1;
exit 0;
}
if($opt{cmd} eq 'add' && $_ eq '--refresh'){
exit 0;
}
shift @in;
next;
@@ -244,6 +311,10 @@ sub cmdparse {
} elsif($opt{cmd} eq 'date'){
$opt{$single}++;
}
if($opt{cmd} eq 'add' && $single eq 'n'){
exit 0;
}
}
}
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 '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
}
@@ -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;
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
necessary for which versions, so that you can tell which files may be deleted
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
medusa.des mines.des opthelp oracle.des oracles.txt
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:
(files for all versions)
@@ -265,8 +266,8 @@ petmark.uu resource.h rip.uu splash.uu tiles.mak
winMS.h winhack.c winhack.rc
(files for Visual Studio 2010 Express Edition builds)
dgncomp.vcxproj dgnstuff.vcxproj dgnstuff.mak dlb_main.vcxproj levcomp.vcxproj
levstuff.vcxproj levstuff.mak makedefs.vcxproj nethack.sln uudecode.vcxproj
nethackw.vcxproj tile2bmp.vcxproj recover.vcxproj tilemap.vcxproj tiles.vcxproj
levstuff.vcxproj levstuff.mak makedefs.vcxproj NetHack.sln uudecode.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
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
GEOMETRY:center,center
MAP
...PPP.........PPPP..............PPPP...
.PPPP...........PP................PPPP..
PP.................................PPP..
....................................PPP.
.....................................PP.
.......................................P
xxxxxxxxx......xxxx...........xxxxxxxxxx
xxxxxxx.........xxx.............xxxxxxxx
xxxx..............................xxxxxx
xx.................................xxxxx
....................................xxxx
.......................................x
........................................
PP...................................PPP
.PPP...............................PPP..
..PP.............................PPPP...
..PPP...........................PPPPPP..
....PPPP.........PPP.........PPPP..PP...
xx...................................xxx
xxxx..............................xxxxxx
xxxxxx..........................xxxxxxxx
xxxxxxxx.........xx..........xxxxxxxxxxx
xxxxxxxxx.......xxxxxx.....xxxxxxxxxxxxx
ENDMAP
# Dungeon Description
# 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
GEOMETRY:center,center
MAP
.L......L.LLL.......LL....
.LLL.......L......LL......
LL.LL.............L.LL....
..........................
......................LL..
......................LLL.
LL........................
.LL.......................
.LL................LL.L...
..LL.....L.LL.......LLL...
.........LLL.........L....
xxxxxx..xxxxxx...xxxxxxxxx
xxxx......xx......xxxxxxxx
xx.xx.............xxxxxxxx
x....................xxxxx
......................xxxx
......................xxxx
xx........................
xxx......................x
xxx................xxxxxxx
xxxx.....x.xx.......xxxxxx
xxxxx...xxxxxx....xxxxxxxx
ENDMAP
# Dungeon Description
$place = { (14,04),(13,07) }
+11 -11
View File
@@ -186,17 +186,17 @@ MAZE: "Pri-goal", ' '
INIT_MAP: mines, 'L' , '.' , false , false , unlit , false
GEOMETRY:center,center
MAP
.L......L.LLL.......LL....
.LLL.......L......LL......
LL.LL.............L.LL....
..........................
......................LL..
......................LLL.
LL........................
.LL.......................
.LL................LL.L...
..LL.....L.LL.......LLL...
.........LLL.........L....
xxxxxx..xxxxxx...xxxxxxxxx
xxxx......xx......xxxxxxxx
xx.xx.............xxxxxxxx
x....................xxxxx
......................xxxx
......................xxxx
xx........................
xxx......................x
xxx................xxxxxxx
xxxx.....x.xx.......xxxxxx
xxxxx...xxxxxx....xxxxxxxx
ENDMAP
# Dungeon Description
$place = { (14,04),(13,07) }
+24 -24
View File
@@ -94,19 +94,19 @@ FLAGS: hardfloor,icedpools
INIT_MAP: mines, '.', 'I', true, true, lit, false
GEOMETRY:center,center
MAP
PPPP.... ....PPPPP.
PLP... .PPLLLPP
PPPPxxxx xxxxPPPPPx
PLPxxx xPPLLLPP
PPP ....................... PPPLLP
.. ............................ PPPP
. ............................... ....
................................. ..
.................................... .
xx ............................ PPPP
x ............................... xxxx
................................. xx
.................................... x
...................................
. .................................. .
.. .............................. PP
.PPP .......................... PLP
.PLLP ..PLLP
.PPPP.. ....PPPP
x .................................. x
xx .............................. PP
xPPP .......................... PLP
xPLLP xxPLLP
xPPPPxx xxxxPPPP
ENDMAP
# Dungeon Description
REGION:(00,00,39,12),lit,"ordinary"
@@ -180,23 +180,23 @@ FLAGS: icedpools
INIT_MAP: mines, '.', 'L', true, true, lit, false
GEOMETRY:center,center
MAP
.L............................LLLLL
LLL.........LLLLL.LLLLL.........LLL
.LLL......LLLLLLLLLLLLLLL.......LL.
.LLL.....LLL|---------|LLL.....L...
..LL....LL|--.........--|LL.....LLL
.......LL|-...LLLLLLL...-|LL.....L.
.......LL|...LL.....LL...|LL.......
xxxxxx.....................xxxxxxxx
xxxxx.......LLLLL.LLLLL......xxxxxx
xxxx......LLLLLLLLLLLLLLL......xxxx
xxxx.....LLL|---------|LLL.....xxxx
xxxx....LL|--.........--|LL.....xxx
x......LL|-...LLLLLLL...-|LL.....xx
.......LL|...LL.....LL...|LL......x
......LL|-..LL.......LL..-|LL......
......LL|.................|LL......
......LL|-..LL.......LL..-|LL......
.......LL|...LL.....LL...|LL.......
.......LL|-...LLLLLLL...-|LL.......
..L.....LL|--.........--|LL.....LL.
..LL.....LLL|---------|LLL....LLLL.
..LLL.....LLLLLLLLLLLLLLL...LLLLL..
.LLLL.......LLLLL.LLLLL.....LLLL...
..LL...............................
xx.....LL|-...LLLLLLL...-|LL......x
xxx.....LL|--.........--|LL.....xxx
xxxx.....LLL|---------|LLL...xxxxxx
xxxxx.....LLLLLLLLLLLLLLL...xxxxxxx
xxxxxx......LLLLL.LLLLL.....xxxxxxx
xxxxxxxxx..................xxxxxxxx
ENDMAP
# Dungeon Description
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
# 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)
LEVALIGN: neutral
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
BRANCH: "Fort Ludios" @ (18, 4) portal
RNDLEVEL: "medusa" "none" @ (-5, 4) 2
RNDLEVEL: "medusa" "none" @ (-5, 4) 4
LEVALIGN: chaotic
LEVEL: "castle" "none" @ (-1, 0)
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
GEOMETRY:left,bottom
MAP
}}}}}}}}
}}...}}}
}}}...}}
}}}}.}}}
}}}}}}}}
xxxxxxxx
xx...xxx
xxx...xx
xxxx.xxx
xxxxxxxx
ENDMAP
OBJECT:('`',"boulder"),random
GEOMETRY:right,top
MAP
}}}}}}}}
}}}}.}}}
}}}...}}
}}...}}}
}}}}}}}}
xxxxxxxx
xxxx.xxx
xxx...xx
xx...xxx
xxxxxxxx
ENDMAP
OBJECT:('`',"boulder"),random
# lair
GEOMETRY:center,center
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..}}}.}}}.}}..}}...}}}}x
x}}}}.}}}}....}}}}}.}}}..P..}}}.}}}}.}}..}}...}}}.}
}}}}..}}.}}..}}}}...}}}}...}}}.}}}}}.}}}}.}}}}}}.}}
}}}...}}...}}}..}}}}}}}}}}}}.....}}}}.}}...}..}.}}}
.}}}..}}.}}}}....}}..}}}..}}.....}}}}.}}}.}....}}}.
..}}}.}}}}..}}..}}..}}..}}..}}.}}}..}.}..}}}..}}}..
.}}}.}}}}....}}}}..}}....}}}}}}}...}}}....}}}}.}}}.
x}}}..}}.}}}}....}}..}}}..}}.....}}}}.}}}.}....}}}x
xx}}}.}}}}..}}..}}..}}..}}..}}.}}}..}.}..}}}..}}}xx
x}}}.}}}}....}}}}..}}....}}}}}}}...}}}....}}}}.}}}x
}}}...}}}....}}}..}}}....}}}..}}...}}}....}}}...}}}
.}}}.}}}}}..}}}..}}}}}..}}}..}}}}}..}}}..}}}}}.}}}.
..}}}}}.}}}}}.}}}}}.}}}}}.}}}}}.}}}}}.}}}}}.}}}}}..
x}}}.}}}}}..}}}..}}}}}..}}}..}}}}}..}}}..}}}}}.}}}x
xx}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}x}}}}}xx
ENDMAP
# Random registers
$monster = monster: { 'j','b','P','F' }
@@ -502,8 +502,8 @@ TRAP:"magic", random
#
# The Baalzebub level
#
MAZE:"baalz",random
FLAGS: noteleport
MAZE:"baalz",' '
FLAGS: noteleport,corrmaze
GEOMETRY:right,center
MAP
-------------------------------------------------
@@ -561,6 +561,10 @@ MONSTER:'V',random
#
MAZE:"sanctum", ' '
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
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
of NetHack 3.6.0 for Mac.
Michael Allison, Derek S. Ray, Yitzhak Sapir, Alex Kompel, and David Cohrs
maintained the port of NetHack 3.6.0 for Microsoft Windows.
Michael Allison, Derek S. Ray, Yitzhak Sapir, Alex Kompel, Dion Nicolaas,
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.
+199
View File
@@ -217,3 +217,202 @@ 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 "
Have user confirm attacks on pets, shopkeepers, and other
peaceable creatures (default on).
.lp dark_room
Show out-of-sight areas of lit rooms (default off).
.lp disclose
Controls what information the program reveals when the game ends.
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).
.lp "silent "
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
Sort the pack contents by type when displaying inventory (default on).
.lp sparkle
@@ -2992,6 +3007,9 @@ A string explaining how to recover a game on this system (no default value).
SEDUCE
0 or 1 to disable or enable, respectively, the SEDUCE option (see the source
for details on this function).
.lp
CHECK_SAVE_UID
0 or 1 to disable or enable, respectively, the UID checking for savefiles.
.pg
The following options affect the score file:
.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
peaceable creatures (default on).
%.lp
%.lp
\item[\ib{dark\_room}]
Show out-of-sight areas of lit rooms (default off).
\item[\ib{disclose}]
Controls what information the program reveals when the game ends.
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}]
Suppress terminal beeps (default on).
%.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}]
Sort the pack contents by type when displaying inventory (default on).
%.lp
@@ -3580,6 +3597,9 @@ A string explaining how to recover a game on this system (no default value).
\item[\ib{SEDUCE}]
0 or 1 to disable or enable, respectively, the SEDUCE option (see the source)
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
%.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
allow showing legal positions for stinking cloud, jumping and polearms
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
@@ -1112,6 +1114,7 @@ show more explicit reason why player was helpless at death
added new hallucinatory-only gods
options to create the character blind or nudist
moving clouds on the plane of air
disclose extinct species alongside genocided ones
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
Aardvark Joe's Extended Logfile
Michael Deutschmann's use_darkgray
Clive Crous' dark_room
sortloot by Jeroen Demeyer and Jukka Lahtinen
Code Cleanup and Reorganization
+2 -1
View File
@@ -415,7 +415,6 @@ typedef unsigned char uchar;
/* display features */
/* dungeon features */
/* dungeon levels */
#define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */
/* monsters & objects */
/* I/O */
#if !defined(MAC)
@@ -437,6 +436,8 @@ typedef unsigned char uchar;
*/
/* Menucolors */
/* HACK: this is being added to fix the builds temporarily.
* Remove it whenever we finally get a real regex for Win32 */
#ifdef UNIX
# define MENU_COLOR_REGEX /* use GNU 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. */
/* NetHack may be freely redistributed. See license for details. */
@@ -856,6 +856,8 @@ E int NDECL(midnight);
/* ### 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 struct obj *FDECL(merge_choice, (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 int FDECL(hornoplenty, (struct obj *,BOOLEAN_P));
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 ### */
@@ -1522,6 +1528,7 @@ E char *FDECL(doname, (struct obj *));
E boolean FDECL(not_fully_identified, (struct obj *));
E char *FDECL(corpse_xname, (struct obj *,const char *,unsigned));
E char *FDECL(cxname, (struct obj *));
E char *FDECL(cxname_singular, (struct obj *));
E char *FDECL(killer_xname, (struct obj *));
E char *FDECL(short_oname, (struct obj *,char *(*)(OBJ_P),char *(*)(OBJ_P),
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 **));
E struct monst *FDECL(boomhit, (struct obj *,int,int));
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(melt_ice, (XCHAR_P,XCHAR_P,const char *));
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 bones; /* allow saving/loading bones */
boolean confirm; /* confirm before hitting tame monsters */
boolean dark_room; /* show shadows in lit rooms */
boolean debug; /* in debugging mode */
#define wizard flags.debug
boolean end_own; /* list all own scores */
@@ -46,6 +47,7 @@ struct flag {
boolean showexp; /* show experience points */
boolean showscore; /* show score */
boolean silent; /* whether the bell rings or not */
boolean sortloot; /* sort items alphabetically when looting */
boolean sortpack; /* sorted inventory */
boolean sparkle; /* show "resisting" special FX (Scott Bigham) */
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 */
#define on_ice recharged /* corpse on ice */
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(nomerge,1); /* set temporarily to prevent merging */
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 mlevelgain(obj) (ofood(obj) && (obj)->corpsenm == PM_WRAITH)
#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 */
#define carried(o) ((o)->where == OBJ_INVENT)
+82 -76
View File
@@ -128,98 +128,102 @@
#define S_bars 17 /* KMH -- iron bars */
#define S_tree 18 /* KMH */
#define S_room 19
#define S_corr 20
#define S_litcorr 21
#define S_upstair 22
#define S_dnstair 23
#define S_upladder 24
#define S_dnladder 25
#define S_altar 26
#define S_grave 27
#define S_throne 28
#define S_sink 29
#define S_fountain 30
#define S_pool 31
#define S_ice 32
#define S_lava 33
#define S_vodbridge 34
#define S_hodbridge 35
#define S_vcdbridge 36 /* closed drawbridge, vertical wall */
#define S_hcdbridge 37 /* closed drawbridge, horizontal wall */
#define S_air 38
#define S_cloud 39
#define S_water 40
#define S_darkroom 20
#define S_corr 21
#define S_litcorr 22
#define S_upstair 23
#define S_dnstair 24
#define S_upladder 25
#define S_dnladder 26
#define S_altar 27
#define S_grave 28
#define S_throne 29
#define S_sink 30
#define S_fountain 31
#define S_pool 32
#define S_ice 33
#define S_lava 34
#define S_vodbridge 35
#define S_hodbridge 36
#define S_vcdbridge 37 /* closed drawbridge, vertical wall */
#define S_hcdbridge 38 /* closed drawbridge, horizontal wall */
#define S_air 39
#define S_cloud 40
#define S_water 41
/* end dungeon characters, begin traps */
#define S_arrow_trap 41
#define S_dart_trap 42
#define S_falling_rock_trap 43
#define S_squeaky_board 44
#define S_bear_trap 45
#define S_land_mine 46
#define S_rolling_boulder_trap 47
#define S_sleeping_gas_trap 48
#define S_rust_trap 49
#define S_fire_trap 50
#define S_pit 51
#define S_spiked_pit 52
#define S_hole 53
#define S_trap_door 54
#define S_teleportation_trap 55
#define S_level_teleporter 56
#define S_magic_portal 57
#define S_web 58
#define S_statue_trap 59
#define S_magic_trap 60
#define S_anti_magic_trap 61
#define S_polymorph_trap 62
#define S_arrow_trap 42
#define S_dart_trap 43
#define S_falling_rock_trap 44
#define S_squeaky_board 45
#define S_bear_trap 46
#define S_land_mine 47
#define S_rolling_boulder_trap 48
#define S_sleeping_gas_trap 49
#define S_rust_trap 50
#define S_fire_trap 51
#define S_pit 52
#define S_spiked_pit 53
#define S_hole 54
#define S_trap_door 55
#define S_teleportation_trap 56
#define S_level_teleporter 57
#define S_magic_portal 58
#define S_web 59
#define S_statue_trap 60
#define S_magic_trap 61
#define S_anti_magic_trap 62
#define S_polymorph_trap 63
/* end traps, begin special effects */
#define S_vbeam 63 /* The 4 zap beam symbols. Do NOT separate. */
#define S_hbeam 64 /* To change order or add, see function */
#define S_lslant 65 /* zapdir_to_glyph() in display.c. */
#define S_rslant 66
#define S_digbeam 67 /* dig beam symbol */
#define S_flashbeam 68 /* camera flash symbol */
#define S_boomleft 69 /* thrown boomerang, open left, e.g ')' */
#define S_boomright 70 /* thrown boomerand, open right, e.g. '(' */
#define S_ss1 71 /* 4 magic shield glyphs */
#define S_ss2 72
#define S_ss3 73
#define S_ss4 74
#define S_poisoncloud 75
#define S_vbeam 64 /* The 4 zap beam symbols. Do NOT separate. */
#define S_hbeam 65 /* To change order or add, see function */
#define S_lslant 66 /* zapdir_to_glyph() in display.c. */
#define S_rslant 67
#define S_digbeam 68 /* dig beam symbol */
#define S_flashbeam 69 /* camera flash symbol */
#define S_boomleft 70 /* thrown boomerang, open left, e.g ')' */
#define S_boomright 71 /* thrown boomerand, open right, e.g. '(' */
#define S_ss1 72 /* 4 magic shield glyphs */
#define S_ss2 73
#define S_ss3 74
#define S_ss4 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 function swallow_to_glyph() in display.c. */
#define S_sw_tl 76 /* swallow top left [1] */
#define S_sw_tc 77 /* swallow top center [2] Order: */
#define S_sw_tr 78 /* swallow top right [3] */
#define S_sw_ml 79 /* swallow middle left [4] 1 2 3 */
#define S_sw_mr 80 /* swallow middle right [6] 4 5 6 */
#define S_sw_bl 81 /* swallow bottom left [7] 7 8 9 */
#define S_sw_bc 82 /* swallow bottom center [8] */
#define S_sw_br 83 /* swallow bottom right [9] */
#define S_sw_tl 78 /* swallow top left [1] */
#define S_sw_tc 79 /* swallow top center [2] Order: */
#define S_sw_tr 80 /* swallow top right [3] */
#define S_sw_ml 81 /* swallow middle left [4] 1 2 3 */
#define S_sw_mr 82 /* swallow middle right [6] 4 5 6 */
#define S_sw_bl 83 /* swallow bottom left [7] 7 8 9 */
#define S_sw_bc 84 /* swallow bottom center [8] */
#define S_sw_br 85 /* swallow bottom right [9] */
#define S_explode1 84 /* explosion top left */
#define S_explode2 85 /* explosion top center */
#define S_explode3 86 /* explosion top right Ex. */
#define S_explode4 87 /* explosion middle left */
#define S_explode5 88 /* explosion middle center /-\ */
#define S_explode6 89 /* explosion middle right |@| */
#define S_explode7 90 /* explosion bottom left \-/ */
#define S_explode8 91 /* explosion bottom center */
#define S_explode9 92 /* explosion bottom right */
#define S_explode1 86 /* explosion top left */
#define S_explode2 87 /* explosion top center */
#define S_explode3 88 /* explosion top right Ex. */
#define S_explode4 89 /* explosion middle left */
#define S_explode5 90 /* explosion middle center /-\ */
#define S_explode6 91 /* explosion middle right |@| */
#define S_explode7 92 /* explosion bottom left \-/ */
#define S_explode8 93 /* explosion bottom center */
#define S_explode9 94 /* explosion bottom right */
/* end effects */
#define MAXPCHARS 93 /* maximum number of mapped characters */
#define MAXDCHARS 41 /* maximum of mapped dungeon characters */
#define MAXPCHARS 95 /* maximum number of mapped characters */
#define MAXDCHARS 42 /* maximum of mapped dungeon 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 DARKROOMSYM (Is_rogue_level(&u.uz) ? S_stone : S_darkroom)
struct symdef {
uchar sym;
const char *explanation;
@@ -550,6 +554,8 @@ struct levelflags {
Bitfield(wizard_bones,1); /* set if level came from a bones file
which was created in wizard mode (or
normal mode descendant of such) */
Bitfield(corrmaze, 1); /* Whether corridors are used for the maze
rather than ROOM */
};
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 $ */
/* SCCS Id: @(#)sp_lev.h 3.5 2007/08/01 */
/* Copyright (c) 1989 by Jean-Christophe Collet */
@@ -30,6 +30,7 @@
#define GRAVEYARD 0x00000100L
#define ICEDPOOLS 0x00000200L /* for ice locations: ICED_POOL vs ICED_MOAT */
#define SOLIDIFY 0x00000400L /* outer areas are nondiggable & nonpasswall */
#define CORRMAZE 0x00000800L /* for maze levels only */
/* different level layout initializers */
#define LVLINIT_NONE 0
@@ -470,4 +471,82 @@ struct lc_breakdef {
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 */
+1
View File
@@ -34,6 +34,7 @@ struct sysopt {
# endif
#endif
int seduce;
int check_save_uid; /* restoring savefile checks UID? */
};
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 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -95,10 +95,17 @@
# define VA_DECL(typ1,var1) (var1,VA_ARGS) typ1 var1; \
char *arg1,*arg2,*arg3,*arg4,*arg5,*arg6,*arg7,*arg8,*arg9; {
# 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; {
# define VA_START(x)
# 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()
# endif
#endif
+2 -2
View File
@@ -1396,7 +1396,7 @@ display_jump_positions(state)
int state;
{
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) {
int x,y, dx, dy;
for (dx = -4; dx <= 4; dx++)
@@ -2605,7 +2605,7 @@ display_polearm_positions(state)
int state;
{
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) {
int x,y, dx,dy;
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
enlightenment(mode, final)
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];
+3 -3
View File
@@ -160,7 +160,7 @@ magic_map_background(x, y, show)
if (!cansee(x,y) && !lev->waslit) {
/* Floor spaces are dark if unlit. Corridors are dark if unlit. */
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))
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().
* 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)
show_glyph(x, y, lev->glyph = cmap_to_glyph(S_corr));
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
goto show_mem;
} 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) &&
(IS_DOOR(levl[tx][ty].typ) ||
glyph_to_cmap(k) == S_room ||
glyph_to_cmap(k) == S_darkroom ||
glyph_to_cmap(k) == S_corr ||
glyph_to_cmap(k) == S_litcorr)) {
/* 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 */
{'#', "tree", C(CLR_GREEN)}, /* tree */
{'.', "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) */
{'<', "staircase up", C(CLR_GRAY)}, /* upstair */
{'>', "staircase down", C(CLR_GRAY)}, /* dnstair */
@@ -165,8 +166,8 @@ const struct symdef defsyms[MAXPCHARS] = {
{'_', "altar", C(CLR_GRAY)}, /* altar */
{'|', "grave", C(CLR_GRAY)}, /* grave */
{'\\', "opulent throne",C(HI_GOLD)}, /* throne */
{'#', "sink", C(CLR_GRAY)}, /* sink */
/*30*/ {'{', "fountain", C(CLR_BLUE)}, /* fountain */
/*30*/ {'#', "sink", C(CLR_GRAY)}, /* sink */
{'{', "fountain", C(CLR_BLUE)}, /* fountain */
{'}', "water", C(CLR_BLUE)}, /* pool */
{'.', "ice", C(CLR_CYAN)}, /* ice */
{'}', "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)}, /* hcdbridge */
{' ', "air", C(CLR_CYAN)}, /* open air */
{'#', "cloud", C(CLR_GRAY)}, /* [part of] a cloud */
/*40*/ {'}', "water", C(CLR_BLUE)}, /* under water */
/*40*/ {'#', "cloud", C(CLR_GRAY)}, /* [part of] a cloud */
{'}', "water", C(CLR_BLUE)}, /* under water */
{'^', "arrow trap", C(HI_METAL)}, /* trap */
{'^', "dart trap", C(HI_METAL)}, /* trap */
{'^', "falling rock trap",C(CLR_GRAY)}, /* trap */
@@ -185,8 +186,8 @@ const struct symdef defsyms[MAXPCHARS] = {
{'^', "land mine", C(CLR_RED)}, /* trap */
{'^', "rolling boulder trap", C(CLR_GRAY)}, /* trap */
{'^', "sleeping gas trap",C(HI_ZAP)}, /* trap */
{'^', "rust trap", C(CLR_BLUE)}, /* trap */
/*50*/ {'^', "fire trap", C(CLR_ORANGE)}, /* trap */
/*50*/ {'^', "rust trap", C(CLR_BLUE)}, /* trap */
{'^', "fire trap", C(CLR_ORANGE)}, /* trap */
{'^', "pit", C(CLR_BLACK)}, /* trap */
{'^', "spiked pit", C(CLR_BLACK)}, /* trap */
{'^', "hole", C(CLR_BROWN)}, /* trap */
@@ -195,8 +196,8 @@ const struct symdef defsyms[MAXPCHARS] = {
{'^', "level teleporter", C(CLR_MAGENTA)}, /* trap */
{'^', "magic portal", C(CLR_BRIGHT_MAGENTA)}, /* trap */
{'"', "web", C(CLR_GRAY)}, /* web */
{'^', "statue trap", C(CLR_GRAY)}, /* trap */
/*60*/ {'^', "magic trap", C(HI_ZAP)}, /* trap */
/*60*/ {'^', "statue trap", C(CLR_GRAY)}, /* trap */
{'^', "magic trap", C(HI_ZAP)}, /* trap */
{'^', "anti-magic field", C(HI_ZAP)}, /* trap */
{'^', "polymorph trap", C(CLR_BRIGHT_GREEN)}, /* trap */
{'|', "wall", C(CLR_GRAY)}, /* vbeam */
@@ -205,29 +206,30 @@ const struct symdef defsyms[MAXPCHARS] = {
{'/', "wall", C(CLR_GRAY)}, /* rslant */
{'*', "", C(CLR_WHITE)}, /* dig beam */
{'!', "", C(CLR_WHITE)}, /* camera flash beam */
{')', "", C(HI_WOOD)}, /* boomerang open left */
/*70*/ {'(', "", C(HI_WOOD)}, /* boomerang open right */
/*70*/ {')', "", C(HI_WOOD)}, /* boomerang open left */
{'(', "", C(HI_WOOD)}, /* boomerang open right */
{'0', "", C(HI_ZAP)}, /* 4 magic shield symbols */
{'#', "", C(HI_ZAP)},
{'@', "", C(HI_ZAP)},
{'*', "", C(HI_ZAP)},
{'#', "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 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 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 right */
{'/', "", C(CLR_ORANGE)}, /* explosion top left */
{'-', "", C(CLR_ORANGE)}, /* explosion top center */
{'\\', "", C(CLR_ORANGE)}, /* explosion top right */
{'|', "", 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 bottom left */
/*90*/ {'-', "", C(CLR_ORANGE)}, /* explosion bottom center*/
{'-', "", C(CLR_ORANGE)}, /* explosion bottom center*/
{'/', "", C(CLR_ORANGE)}, /* explosion bottom right */
};
@@ -647,6 +649,7 @@ struct symparse loadsyms[] = {
{SYM_PCHAR, S_flashbeam, "S_flashbeam"},
{SYM_PCHAR, S_boomleft, "S_boomleft"},
{SYM_PCHAR, S_boomright, "S_boomright"},
{SYM_PCHAR, S_goodpos, "S_goodpos"},
{SYM_PCHAR, S_ss1, "S_ss1"},
{SYM_PCHAR, S_ss2, "S_ss2"},
{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.eating = TRUE;
if (otmp->otyp == CORPSE) {
if (otmp->otyp == CORPSE || otmp->globby) {
cprefx(context.victual.piece->corpsenm);
if (!context.victual.piece || !context.victual.eating) {
/* rider revived, or died and lifesaved */
@@ -2126,7 +2126,7 @@ struct obj *otmp;
!Stone_resistance &&
!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));
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
* then adjusted in accordance with the amount of food left.
*/
if(otmp->otyp == CORPSE) {
if(otmp->otyp == CORPSE || otmp->globby) {
int tmp = eatcorpse(otmp);
if (tmp == 2) {
/* used up */
+63 -10
View File
@@ -1236,6 +1236,9 @@ struct obj *list;
boolean identified, all_containers, reportempty;
{
register struct obj *box, *obj;
struct obj **oarray;
int i,n;
char *invlet;
char buf[BUFSZ];
boolean cat, deadcat;
@@ -1255,10 +1258,30 @@ boolean identified, all_containers, reportempty;
continue; /* wrong type of container */
} else if (box->cobj) {
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)));
putstr(tmpwin, 0, buf);
putstr(tmpwin, 0, "");
for (obj = box->cobj; obj; obj = obj->nobj) {
for (i = 0; i < n; i++) {
obj = oarray[i];
if (identified) {
makeknown(obj->otyp);
obj->known = obj->bknown =
@@ -1268,6 +1291,7 @@ boolean identified, all_containers, reportempty;
}
putstr(tmpwin, 0, doname(obj));
}
free(oarray);
if (cat) putstr(tmpwin, 0, "Schroedinger's cat");
else if (deadcat) putstr(tmpwin, 0, "Schroedinger's dead cat");
display_nhwindow(tmpwin, TRUE);
@@ -1412,43 +1436,72 @@ num_genocides()
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
list_genocided(defquery, ask)
char defquery;
boolean ask;
{
register int i;
int ngenocided;
int ngenocided, nextinct;
char c;
winid klwin;
char buf[BUFSZ];
ngenocided = num_genocides();
nextinct = num_extinct();
/* genocided species list */
if (ngenocided != 0) {
c = ask ? yn_function("Do you want a list of species genocided?",
ynqchars, defquery) : defquery;
/* genocided or extinct species list */
if (ngenocided != 0 || nextinct != 0) {
Sprintf(buf, "Do you want a list of %sspecies%s%s?",
(nextinct && !ngenocided) ? "extinct " : "",
(ngenocided) ? " genocided" : "",
(nextinct && ngenocided) ? " and extinct" : "");
c = ask ? yn_function(buf, ynqchars, defquery) : defquery;
if (c == 'q') done_stopprint++;
if (c == 'y') {
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, "");
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)
Sprintf(buf, "%s%s",
!type_is_pname(&mons[i]) ? "" : "the ",
mons[i].mname);
else
Strcpy(buf, makeplural(mons[i].mname));
if (!(mvitals[i].mvflags & G_GENOD))
Strcat(buf, " (extinct)");
putstr(klwin, 0, buf);
}
putstr(klwin, 0, "");
Sprintf(buf, "%d species genocided.", ngenocided);
putstr(klwin, 0, buf);
if (ngenocided > 0) {
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);
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
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
* routine names into one via #defines is even more confusing
*/
#ifdef RANDOM /* srandom() from sys/share/random.c */
srandom((unsigned int) now);
srandom((unsigned int) seed);
#else
# if defined(__APPLE__) || defined(BSD) || defined(LINUX) || defined(ULTRIX) || defined(CYGWIN32) /* system srandom() */
# if defined(BSD) && !defined(POSIX_TYPES) && defined(SUNOS4)
(void)
# endif
srandom((int) now);
srandom((int) seed);
# else
# ifdef UNIX /* system srand48() */
srand48((long) now);
srand48((long) seed);
# else /* poor quality system routine */
srand((int) now);
srand((int) seed);
# 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;
else if (offset == S_corr || offset == S_litcorr)
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;
else
color = NO_COLOR;
+1 -1
View File
@@ -519,7 +519,7 @@ int spellnum;
destroy_item(SCROLL_CLASS, AD_FIRE);
destroy_item(POTION_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;
case CLC_LIGHTNING:
{
+1
View File
@@ -581,6 +581,7 @@ clear_level_structures()
level.flags.is_cavernous_lev = 0;
level.flags.arboreal = 0;
level.flags.wizard_bones = 0;
level.flags.corrmaze = 0;
nroom = 0;
rooms[0].hx = -1;
+30 -39
View File
@@ -540,25 +540,25 @@ register const char *s;
}
level.flags.is_maze_lev = TRUE;
level.flags.corrmaze = !rn2(3);
#ifndef WALLIFIED_MAZE
for(x = 2; x < x_maze_max; x++)
for(y = 2; y < y_maze_max; y++)
levl[x][y].typ = STONE;
#else
for(x = 2; x <= x_maze_max; x++)
for(y = 2; y <= y_maze_max; y++)
levl[x][y].typ = ((x % 2) && (y % 2)) ? STONE : HWALL;
#endif
if (level.flags.corrmaze)
for(x = 2; x < x_maze_max; x++)
for(y = 2; y < y_maze_max; y++)
levl[x][y].typ = STONE;
else
for(x = 2; x <= x_maze_max; x++)
for(y = 2; y <= y_maze_max; y++)
levl[x][y].typ = ((x % 2) && (y % 2)) ? STONE : HWALL;
maze0xy(&mm);
walkfrom((int) mm.x, (int) mm.y, 0);
/* put a boulder at the maze center */
(void) mksobj_at(BOULDER, (int) mm.x, (int) mm.y, TRUE, FALSE);
#ifdef WALLIFIED_MAZE
wallification(2, 2, x_maze_max, y_maze_max);
#endif
if (!level.flags.corrmaze)
wallification(2, 2, x_maze_max, y_maze_max);
mazexy(&mm);
mkstairs(mm.x, mm.y, 1, (struct mkroom *)0); /* up */
if (!Invocation_lev(&u.uz)) {
@@ -649,11 +649,12 @@ schar typ;
int q, a, dir, pos;
int dirs[4];
#ifndef WALLIFIED_MAZE
if (!typ) typ = CORR;
#else
if (!typ) typ = ROOM;
#endif
if (!typ) {
if (level.flags.corrmaze)
typ = CORR;
else
typ = ROOM;
}
pos = 1;
mazex[pos] = (char) x;
@@ -694,11 +695,12 @@ schar typ;
register int q,a,dir;
int dirs[4];
#ifndef WALLIFIED_MAZE
if (!typ) typ = CORR;
#else
if (!typ) typ = ROOM;
#endif
if (!typ) {
if (level.flags.corrmaze)
typ = CORR;
else
typ = ROOM;
}
if(!IS_DOOR(levl[x][y].typ)) {
/* might still be on edge of MAP, so don't overwrite */
@@ -736,7 +738,7 @@ register int dir;
void
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;
{
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->y = 3 + 2*rn2((y_maze_max>>1) - 1);
cpt++;
} while (cpt < 100 && levl[cc->x][cc->y].typ !=
#ifdef WALLIFIED_MAZE
ROOM
#else
CORR
#endif
);
} while (cpt < 100 &&
levl[cc->x][cc->y].typ != (level.flags.corrmaze ? CORR : ROOM));
if (cpt >= 100) {
register int x, y;
/* last try */
@@ -759,13 +756,8 @@ mazexy(cc) /* find random point in generated corridors,
for (y = 0; y < (y_maze_max>>1) - 1; y++) {
cc->x = 3 + 2 * x;
cc->y = 3 + 2 * y;
if (levl[cc->x][cc->y].typ ==
#ifdef WALLIFIED_MAZE
ROOM
#else
CORR
#endif
) return;
if (levl[cc->x][cc->y].typ == (level.flags.corrmaze ? CORR : ROOM))
return;
}
panic("mazexy: can't find a place!");
}
@@ -782,7 +774,7 @@ bound_digging()
* so the boundary would be breached
*
* 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;
@@ -886,7 +878,6 @@ fumaroles()
for (n = rn2(3)+2; n; n--) {
xchar x = rn1(COLNO-4,3);
xchar y = rn1(ROWNO-4,3);
struct trap *ttmp = t_at(x,y);
if (levl[x][y].typ == LAVAPOOL) {
NhRegion *r = create_gas_cloud(x,y, 4+rn2(5), rn1(10,5));
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
*/
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),
NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK),
SIZ(500, 250, MS_SILENT, MZ_MEDIUM),
@@ -1829,7 +1829,7 @@ struct permonst _mons2[] = {
M1_MINDLESS|M1_OMNIVORE|M1_ACID,
M2_HOSTILE|M2_NEUTER, 0, CLR_GRAY),
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),
NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK),
SIZ(500, 250, MS_SILENT, MZ_MEDIUM),
@@ -1838,7 +1838,7 @@ struct permonst _mons2[] = {
M1_MINDLESS|M1_OMNIVORE|M1_ACID,
M2_HOSTILE|M2_NEUTER, 0, CLR_BROWN),
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),
NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK),
SIZ(400, 150, MS_SILENT, MZ_LARGE),
@@ -1847,7 +1847,7 @@ struct permonst _mons2[] = {
M1_MINDLESS|M1_OMNIVORE|M1_ACID|M1_POIS,
M2_HOSTILE|M2_NEUTER, 0, CLR_GREEN),
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),
NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK),
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 $Date: 2011/07/28 04:00:20 $ $Revision: 1.23 $ */
/* NetHack 3.5 objects.c $NHDT-Date: 1426470348 2015/03/16 01:45:48 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.27 $ */
/* Copyright (c) Mike Threepoint, 1989. */
/* 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("meat stick", 0, 1, 1, 0, FLESH, 5, CLR_BROWN),
FOOD("huge chunk of meat", 0,20,400, 0, FLESH,2000, CLR_BROWN),
/* special case because it's not mergable */
OBJECT(OBJ("meat ring", (char *)0),
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),
/* 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 */
FOOD("kelp frond", 0, 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*/
# endif
{"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*/
#ifdef TTY_GRAPHICS
{"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",
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
{ "soundcard", "type of sound card to use", 20, SET_IN_FILE },
#endif
@@ -495,6 +497,35 @@ STATIC_OVL boolean FDECL(wc2_supported, (const char *));
STATIC_DCL void FDECL(remove_autopickup_exception, (struct autopickup_exception *));
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
substring of a particular option name; option string might have
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);
flags.pickup_types[0] = '\0';
flags.pickup_burden = MOD_ENCUMBER;
flags.sortloot = 'l'; /* sort only loot by default */
for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++)
flags.end_disclose[i] = DISCLOSE_PROMPT_DEFAULT_NO;
@@ -703,6 +735,8 @@ initoptions_finish()
/* result in the player's preferred fruit [better than "\033"]. */
obj_descr[SLIME_MOLD].oc_name = "fruit";
reglyph_darkroom();
return;
}
@@ -2327,6 +2361,22 @@ goodfruit:
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";
if (match_optname(opts, fullname, 4, TRUE)) {
if (duplicate) complain_about_duplicate(opts,1);
@@ -2809,7 +2859,8 @@ goodfruit:
else if ((boolopt[i].addr) == &flags.invlet_constant) {
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
* candles & lamps change. Update them by calling
@@ -2819,6 +2870,7 @@ goodfruit:
*/
vision_recalc(2); /* shut down vision */
vision_full_recalc = 1; /* delayed recalc */
if (iflags.use_color) need_redraw = TRUE; /* darkroom refresh */
}
else if ((boolopt[i].addr) == &iflags.use_inverse ||
(boolopt[i].addr) == &flags.showrace ||
@@ -2861,6 +2913,10 @@ static NEARDATA const char *runmodes[] = {
"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
* symbols.
@@ -3148,8 +3204,10 @@ doset()
}
destroy_nhwindow(tmpwin);
if (need_redraw)
if (need_redraw) {
reglyph_darkroom();
(void) doredraw();
}
return 0;
}
@@ -3167,7 +3225,8 @@ boolean setinitial,setfromfile;
char buf[BUFSZ];
/* 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.
*/
if (!strcmp("menustyle", optname)) {
@@ -3348,6 +3407,23 @@ boolean setinitial,setfromfile;
}
destroy_nhwindow(tmpwin);
#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) ||
!strcmp("align_status", optname)) {
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);
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"))
Sprintf(buf, "%s", iflags.wc_player_selection ? "prompts" : "dialog");
#ifdef MSDOS
+3 -3
View File
@@ -250,7 +250,7 @@ lookat(x, y, buf, monbuf)
int tnum = what_trap(glyph_to_trap(glyph));
Strcpy(buf, defsyms[trap_to_defsym(tnum)].explanation);
} else if(!glyph_is_cmap(glyph)) {
Strcpy(buf,"dark part of a room");
Strcpy(buf,"unexplored area");
} else switch(glyph_to_cmap(glyph)) {
case S_altar:
Sprintf(buf, "%s %saltar",
@@ -557,8 +557,8 @@ const char **firstmatch;
x_str = defsyms[i].explanation;
if (sym == ((looked) ?
showsyms[i] : defsyms[i].sym) && *x_str) {
/* avoid "an air", "a water", or "a floor of a room" */
int article = (i == S_room) ? 2 : /* 2=>"the" */
/* avoid "an air", "a water", "a floor of a room", "a dark part of a room" */
int article = ((i == S_room)||(i == S_darkroom)) ? 2 : /* 2=>"the" */
!(strcmp(x_str, "air") == 0 || /* 1=>"an" */
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 */
boolean FDECL((*allow), (OBJ_P));/* allow function */
{
int n;
int i, n;
winid win;
struct obj *curr, *last, fake_hero_object;
struct obj **oarray;
char *pack;
anything any;
boolean printed_type_name,
@@ -742,6 +743,16 @@ boolean FDECL((*allow), (OBJ_P));/* allow function */
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);
start_menu(win);
any = zeroany;
@@ -755,7 +766,8 @@ boolean FDECL((*allow), (OBJ_P));/* allow function */
pack = flags.inv_order;
do {
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 &&
will_feel_cockatrice(curr, FALSE)) {
destroy_nhwindow(win); /* stop the menu and revert */
@@ -783,6 +795,7 @@ boolean FDECL((*allow), (OBJ_P));/* allow function */
}
pack++;
} while (sorted && *pack);
free(oarray);
if (engulfer) {
char buf[BUFSZ];
@@ -809,7 +822,7 @@ boolean FDECL((*allow), (OBJ_P));/* allow function */
if (n > 0) {
menu_item *mi;
int i, k;
int k;
/* fix up counts: -1 means no count used => pick all;
if fake_hero_object was picked, discard that choice */
+1 -1
View File
@@ -886,7 +886,7 @@ display_stinking_cloud_positions(state)
int state;
{
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) {
int x,y, dx, dy;
int dist = 6;
+8 -1
View File
@@ -501,6 +501,13 @@ register struct obj *otmp;
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
boolean
restgamestate(fd, stuckid, steedid)
@@ -516,7 +523,7 @@ unsigned int *stuckid, *steedid;
unsigned long 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
as an attempt to cheat and refuse to restore this file */
pline("Saved game was not yours.");
+17 -14
View File
@@ -524,12 +524,11 @@ schar filling;
for (x = x1; x <= x2; x++)
for (y = y1; y <= y2; y++) {
#ifndef WALLIFIED_MAZE
levl[x][y].typ = STONE;
#else
levl[x][y].typ =
(y < 2 || ((x % 2) && (y % 2))) ? STONE : filling;
#endif
if (level.flags.corrmaze)
levl[x][y].typ = STONE;
else
levl[x][y].typ =
(y < 2 || ((x % 2) && (y % 2))) ? STONE : filling;
}
}
@@ -2952,6 +2951,7 @@ spo_level_flags(coder)
if (lflags & GRAVEYARD) level.flags.graveyard = 1;
if (lflags & ICEDPOOLS) icedpools = TRUE;
if (lflags & SOLIDIFY) coder->solidify = TRUE;
if (lflags & CORRMAZE) level.flags.corrmaze = TRUE;
opvar_free(flagdata);
}
@@ -4118,11 +4118,7 @@ spo_mazewalk(coder)
if (!isok(x,y)) return;
if (OV_i(ftyp) < 1) {
#ifndef WALLIFIED_MAZE
OV_i(ftyp) = CORR;
#else
OV_i(ftyp) = ROOM;
#endif
OV_i(ftyp) = level.flags.corrmaze ? CORR : ROOM;
}
/* don't use move() - it doesn't use W_NORTH, etc. */
@@ -5040,7 +5036,7 @@ sp_lev *lvl;
break;
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;
if (!OV_pop_c(tmp)) panic("no ter sel linecoord1");
if (!OV_pop_c(tmp2)) panic("no ter sel linecoord2");
@@ -5058,7 +5054,7 @@ sp_lev *lvl;
break;
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;
if (!OV_pop_i(tmp3)) panic("no ter sel randline1");
if (!OV_pop_c(tmp)) panic("no ter sel randline2");
@@ -5171,7 +5167,14 @@ next_opcode:
link_doors_rooms();
fill_rooms();
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();
+1
View File
@@ -67,6 +67,7 @@ sys_early_init()
# endif
#endif
sysopt.check_save_uid = 1;
sysopt.seduce = 1; /* if it's compiled in, default to on */
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, 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)
You("smell smoke.");
if (is_ice(mtmp->mx,mtmp->my))
@@ -2852,7 +2852,7 @@ struct obj *box; /* null for floor trap */
boolean see_it = !Blind;
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.
*/
@@ -2897,7 +2897,7 @@ struct obj *box; /* null for floor trap */
destroy_item(SPBOOK_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.");
if (is_ice(u.ux, u.uy))
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 $ */
/* SCCS Id: @(#)vision.c 3.5 2007/11/05 */
/* 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_rmax; /* max pointer for the new array */
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 dx, dy; /* one step from a lit door or lit wall (see below) */
register int col; /* inner loop counter */
@@ -513,10 +513,6 @@ vision_recalc(control)
vision_full_recalc = 0; /* reset flag */
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
* 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 */
{
register int i;
register char *rowp;
register char *rowp = NULL;
int hit_stone = 0;
int left_shadow, right_shadow, loc_right;
int lblock_col; /* local block column (current row) */
int nrow, deeper;
char *row_min; /* left most */
char *row_max; /* right most */
char *row_min = NULL; /* left most */
char *row_max = NULL; /* right most */
int lim_max; /* right most limit of circle */
#if defined(GCC_WARN) || defined(_MSC_VER)
rowp = 0;
#endif
nrow = row + step;
deeper = good_row(nrow) && (!limits || (*limits >= *(limits+1)));
if(!vis_func) {
@@ -1910,18 +1903,15 @@ left_side(row, cb_row, cb_col, fb_row, fb_col, left_mark, right, limits)
char *limits;
{
register int i;
register char *rowp;
register char *rowp = NULL;
int hit_stone = 0;
int left_shadow, right_shadow, loc_left;
int lblock_col; /* local block column (current row) */
int nrow, deeper;
char *row_min; /* left most */
char *row_max; /* right most */
char *row_min = NULL; /* left most */
char *row_max = NULL; /* right most */
int lim_min;
#if defined(GCC_WARN) || defined(_MSC_VER)
rowp = 0;
#endif
nrow = row + step;
deeper = good_row(nrow) && (!limits || (*limits >= *(limits+1)));
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 */
char *limits; /* points at range limit for current row, or NULL */
{
int right; /* right limit of "could see" */
int right_edge; /* right edge of an opening */
int nrow; /* new row (calculate once) */
int deeper; /* if TRUE, call self as needed */
int result; /* set by q?_path() */
register int i; /* loop counter */
int right; /* right limit of "could see" */
int right_edge; /* right edge of an opening */
int nrow; /* new row (calculate once) */
int deeper; /* if TRUE, call self as needed */
int result; /* set by q?_path() */
register int i; /* loop counter */
register char *rowp = NULL; /* row optimization */
char *row_min = NULL; /* left most [used by macro set_min()] */
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;
/*
* 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;
char *limits;
{
int left, left_edge, nrow, deeper, result;
register int i;
int left, left_edge, nrow, deeper, result;
register int i;
register char *rowp = NULL;
char *row_min = NULL, *row_max = NULL;
int lim_min;
char *row_min = NULL;
char *row_max = NULL;
int lim_min;
#if defined(GCC_WARN) || defined(_MSC_VER)
#ifdef GCC_WARN
rowp = row_min = row_max = 0;
#endif
nrow = row+step;
+175 -156
View File
@@ -2109,18 +2109,19 @@ boolean ordinary;
case FIRE_HORN:
learn_it = TRUE;
if (Fire_resistance) {
shieldeff(u.ux, u.uy);
You_feel("rather warm.");
ugolemeffects(AD_FIRE, d(12,6));
} else {
pline("You've set yourself afire!");
damage = d(12,6);
shieldeff(u.ux, u.uy);
You_feel("rather warm.");
ugolemeffects(AD_FIRE, d(12,6));
} else {
pline("You've set yourself afire!");
damage = d(12,6);
}
burn_away_slime();
(void) burnarmor(&youmonst);
destroy_item(SCROLL_CLASS, AD_FIRE);
destroy_item(POTION_CLASS, AD_FIRE);
destroy_item(SPBOOK_CLASS, AD_FIRE);
destroy_item(FOOD_CLASS, AD_FIRE); /* only slime for now */
break;
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, SCROLL_CLASS, AD_FIRE);
if (!rn2(5)) (void)destroy_mitem(mon, SPBOOK_CLASS, AD_FIRE);
destroy_mitem(mon, FOOD_CLASS, AD_FIRE); /* carried slime */
}
break;
case ZT_COLD:
@@ -3470,6 +3472,7 @@ xchar sx, sy;
if (!rn2(3)) destroy_item(POTION_CLASS, AD_FIRE);
if (!rn2(3)) destroy_item(SCROLL_CLASS, AD_FIRE);
if (!rn2(5)) destroy_item(SPBOOK_CLASS, AD_FIRE);
destroy_item(FOOD_CLASS, AD_FIRE);
}
break;
case ZT_COLD:
@@ -3566,11 +3569,11 @@ xchar sx, sy;
}
/*
* burn scrolls and spellbooks on floor at position x,y
* return the number of scrolls and spellbooks burned
* burn objects (such as scrolls and spellbooks) on floor
* at position x,y; return the number of objects burned
*/
int
burn_floor_paper(x, y, give_feedback, u_caused)
burn_floor_objects(x, y, give_feedback, u_caused)
int x, y;
boolean give_feedback; /* caller needs to decide about visibility checks */
boolean u_caused;
@@ -3582,37 +3585,39 @@ boolean u_caused;
for (obj = level.objects[x][y]; obj; obj = obj2) {
obj2 = obj->nexthere;
if (obj->oclass == SCROLL_CLASS || obj->oclass == SPBOOK_CLASS) {
if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL ||
obj_resists(obj, 2, 100))
continue;
scrquan = obj->quan; /* number present */
delquan = 0L; /* number to destroy */
for (i = scrquan; i > 0L; i--)
if (!rn2(3)) delquan++;
if (delquan) {
/* save name before potential delobj() */
if (give_feedback) {
obj->quan = 1L;
Strcpy(buf1, (x == u.ux && y == u.uy) ?
xname(obj) : distant_name(obj, xname));
obj->quan = 2L;
Strcpy(buf2, (x == u.ux && y == u.uy) ?
xname(obj) : distant_name(obj, xname));
obj->quan = scrquan;
}
/* useupf(), which charges, only if hero caused damage */
if (u_caused) useupf(obj, delquan);
else if (delquan < scrquan) obj->quan -= delquan;
else delobj(obj);
cnt += delquan;
if (give_feedback) {
if (delquan > 1L)
pline("%ld %s burn.", delquan, buf2);
else
pline("%s burns.", An(buf1));
}
}
if (obj->oclass == SCROLL_CLASS || obj->oclass == SPBOOK_CLASS
|| (obj->oclass == FOOD_CLASS
&& obj->otyp == GLOB_OF_GREEN_SLIME)) {
if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL ||
obj_resists(obj, 2, 100))
continue;
scrquan = obj->quan; /* number present */
delquan = 0L; /* number to destroy */
for (i = scrquan; i > 0L; i--)
if (!rn2(3)) delquan++;
if (delquan) {
/* save name before potential delobj() */
if (give_feedback) {
obj->quan = 1L;
Strcpy(buf1, (x == u.ux && y == u.uy) ?
xname(obj) : distant_name(obj, xname));
obj->quan = 2L;
Strcpy(buf2, (x == u.ux && y == u.uy) ?
xname(obj) : distant_name(obj, xname));
obj->quan = scrquan;
}
/* useupf(), which charges, only if hero caused damage */
if (u_caused) useupf(obj, delquan);
else if (delquan < scrquan) obj->quan -= delquan;
else delobj(obj);
cnt += delquan;
if (give_feedback) {
if (delquan > 1L)
pline("%ld %s burn.", delquan, buf2);
else
pline("%s burns.", An(buf1));
}
}
}
}
return cnt;
@@ -4252,7 +4257,7 @@ short exploding_wand_typ;
}
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);
You("%s of smoke.",
!Blind ? "see a puff" : "smell a whiff");
@@ -4362,129 +4367,137 @@ const char * const destroy_strings[][3] = { /* also used in trap.c */
void
destroy_item(osym, dmgtyp)
register int osym, dmgtyp;
register int osym, dmgtyp;
{
register struct obj *obj, *obj2;
register int dmg, xresist, skip;
register long i, cnt, quan;
register int dindx;
const char *mult;
boolean physical_damage;
register struct obj *obj, *obj2;
register int dmg, xresist, skip;
register long i, cnt, quan;
register int dindx;
const char *mult;
boolean physical_damage;
for(obj = invent; obj; obj = obj2) {
obj2 = obj->nobj;
physical_damage = FALSE;
if(obj->oclass != osym) continue; /* test only objs of type osym */
if(obj->oartifact) continue; /* don't destroy artifacts */
if(obj->in_use && obj->quan == 1L) continue; /* not available */
xresist = skip = 0;
/* lint suppression */
dmg = dindx = 0;
quan = 0L;
for(obj = invent; obj; obj = obj2) {
obj2 = obj->nobj;
physical_damage = FALSE;
if(obj->oclass != osym) continue; /* test only objs of type osym */
if(obj->oartifact) continue; /* don't destroy artifacts */
if(obj->in_use && obj->quan == 1L) continue; /* not available */
xresist = skip = 0;
/* lint suppression */
dmg = dindx = 0;
quan = 0L;
switch(dmgtyp) {
case AD_COLD:
if(osym == POTION_CLASS && obj->otyp != POT_OIL) {
quan = obj->quan;
dindx = 0;
dmg = rnd(4);
} else skip++;
break;
case AD_FIRE:
xresist = (Fire_resistance && obj->oclass != POTION_CLASS);
switch(dmgtyp) {
case AD_COLD:
if(osym == POTION_CLASS && obj->otyp != POT_OIL) {
quan = obj->quan;
dindx = 0;
dmg = rnd(4);
} else skip++;
break;
case AD_FIRE:
xresist = (Fire_resistance
&& obj->oclass != POTION_CLASS
&& obj->otyp != GLOB_OF_GREEN_SLIME);
if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL)
skip++;
if (obj->otyp == SPE_BOOK_OF_THE_DEAD) {
skip++;
if (!Blind)
pline("%s glows a strange %s, but remains intact.",
The(xname(obj)), hcolor("dark red"));
}
quan = obj->quan;
switch(osym) {
case POTION_CLASS:
dindx = (obj->otyp != POT_OIL) ? 1 : 2;
dmg = rnd(6);
break;
case SCROLL_CLASS:
dindx = 3;
dmg = 1;
break;
case SPBOOK_CLASS:
dindx = 4;
dmg = 1;
break;
default:
skip++;
break;
}
break;
case AD_ELEC:
xresist = (Shock_resistance && obj->oclass != RING_CLASS);
quan = obj->quan;
switch(osym) {
case RING_CLASS:
if(obj->otyp == RIN_SHOCK_RESISTANCE)
{ skip++; break; }
dindx = 5;
dmg = 0;
break;
case WAND_CLASS:
if(obj->otyp == WAN_LIGHTNING) { skip++; break; }
if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL)
skip++;
if (obj->otyp == SPE_BOOK_OF_THE_DEAD) {
skip++;
if (!Blind)
pline("%s glows a strange %s, but remains intact.",
The(xname(obj)), hcolor("dark red"));
}
quan = obj->quan;
switch(osym) {
case POTION_CLASS:
dindx = (obj->otyp != POT_OIL) ? 1 : 2;
dmg = rnd(6);
break;
case SCROLL_CLASS:
dindx = 3;
dmg = 1;
break;
case SPBOOK_CLASS:
dindx = 4;
dmg = 1;
break;
case FOOD_CLASS:
if (obj->otyp == GLOB_OF_GREEN_SLIME) {
dindx = obj->owt / 20;
dmg = 1;
} else { skip++; }
break;
default:
skip++;
break;
}
break;
case AD_ELEC:
xresist = (Shock_resistance && obj->oclass != RING_CLASS);
quan = obj->quan;
switch(osym) {
case RING_CLASS:
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 (obj == current_wand) { skip++; break; }
if (obj == current_wand) { skip++; break; }
#endif
dindx = 6;
dmg = rnd(10);
break;
default:
skip++;
break;
}
break;
default:
skip++;
break;
}
if(!skip) {
if (obj->in_use) --quan; /* one will be used up elsewhere */
for(i = cnt = 0L; i < quan; i++)
if(!rn2(3)) cnt++;
dindx = 6;
dmg = rnd(10);
break;
default:
skip++;
break;
}
break;
default:
skip++;
break;
}
if(!skip) {
if (obj->in_use) --quan; /* one will be used up elsewhere */
for(i = cnt = 0L; i < quan; i++)
if(!rn2(3)) cnt++;
if(!cnt) continue;
mult = (cnt == quan) ? "Your" :
(cnt == 1L) ? "One of your" : "Some of your";
pline("%s %s %s!", mult, xname(obj),
destroy_strings[dindx][(cnt > 1L)]);
if(osym == POTION_CLASS && dmgtyp != AD_COLD) {
if (!breathless(youmonst.data) || haseyes(youmonst.data))
potionbreathe(obj);
}
if (obj->owornmask) {
if (obj->owornmask & W_RING) /* ring being worn */
Ring_gone(obj);
else
setnotworn(obj);
}
if (obj == current_wand) current_wand = 0; /* destroyed */
for (i = 0; i < cnt; i++)
useup(obj);
if(dmg) {
if(xresist) You("aren't hurt!");
else {
const char *how = destroy_strings[dindx][2];
boolean one = (cnt == 1L);
if(!cnt) continue;
mult = (cnt == quan) ? (quan > 1) ? "All of your " : "Your" :
(cnt == 1L) ? "One of your" : "Some of your";
pline("%s %s %s!", mult, xname(obj),
destroy_strings[dindx][(cnt > 1L)]);
if(osym == POTION_CLASS && dmgtyp != AD_COLD) {
if (!breathless(youmonst.data) || haseyes(youmonst.data))
potionbreathe(obj);
}
if (obj->owornmask) {
if (obj->owornmask & W_RING) /* ring being worn */
Ring_gone(obj);
else
setnotworn(obj);
}
if (obj == current_wand) current_wand = 0; /* destroyed */
for (i = 0; i < cnt; i++)
useup(obj);
if(dmg) {
if(xresist) You("aren't hurt!");
else {
const char *how = destroy_strings[dindx][2];
boolean one = (cnt == 1L);
if (physical_damage) dmg = Maybe_Half_Phys(dmg);
losehp(dmg, one ? how : (const char *)makeplural(how),
one ? KILLED_BY_AN : KILLED_BY);
exercise(A_STR, FALSE);
}
}
}
}
return;
if (physical_damage) dmg = Maybe_Half_Phys(dmg);
losehp(dmg, one ? how : (const char *)makeplural(how),
one ? KILLED_BY_AN : KILLED_BY);
exercise(A_STR, FALSE);
}
}
}
}
return;
}
int
@@ -4543,6 +4556,12 @@ int osym, dmgtyp;
dindx = 4;
tmp++;
break;
case FOOD_CLASS:
if (obj->otyp == GLOB_OF_GREEN_SLIME) {
dindx = obj->owt / 20;
tmp++;
} else { skip++; }
break;
default:
skip++;
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
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 \
minetn-?.lev oracle.lev orcus.lev sanctum.lev soko?-?.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.
#SEDUCE=0
# Uncomment to disable savefile UID checking.
#CHECK_SAVE_UID=0
# Record (high score) file options.
# CAUTION: changing these after people have started playing games can
# lead to lost high scores!
+2 -1
View File
@@ -111,7 +111,7 @@ FILE *orig_yyin = NULL;
map_cnt = 0;
return MAP_ID;
}
<MAPC>[-|}{+xABCISHKMPLWTtFYU\\#. 0123456789]*\r?\n {
<MAPC>[-|}{+xABCISHKPLWTF\\#. 0123456789]*\r?\n {
int len = yyleng;
savetoken(yytext);
/* 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; }
icedpools { savetoken(yytext); yylval.i=ICEDPOOLS; 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');
savetoken(yytext);
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 $ */
/* SCCS Id: @(#)lev_main.c 3.5 2007/01/17 */
/* Copyright (c) 1989 by Jean-Christophe Collet */
@@ -8,11 +8,9 @@
* This file contains the main function for the parser
* and some useful functions needed by yacc
*/
#define SPEC_LEV /* for MPW */
/* although, why don't we move those special defines here.. and in dgn_main? */
#include <stdarg.h>
#define SPEC_LEV /* for USE_OLDARGS (sp_lev.h) and for MPW (macconf.h) */
#define NEED_VARARGS
#include "hack.h"
#include "date.h"
#include "sp_lev.h"
@@ -77,14 +75,14 @@ extern unsigned _stklen = STKSIZ;
#endif
#define MAX_ERRORS 25
extern int NDECL (yyparse);
extern void FDECL (init_yyin, (FILE *));
extern void FDECL (init_yyout, (FILE *));
extern int NDECL(yyparse);
extern void FDECL(init_yyin, (FILE *));
extern void FDECL(init_yyout, (FILE *));
int FDECL (main, (int, char **));
void FDECL (yyerror, (const char *));
void FDECL (yywarning, (const char *));
int NDECL (yywrap);
int FDECL(main, (int, char **));
void FDECL(yyerror, (const char *));
void FDECL(yywarning, (const char *));
int NDECL(yywrap);
int FDECL(get_floor_type, (CHAR_P));
int FDECL(get_room_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));
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 void NDECL(init_obj_classes);
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_warning, (const char *, ...));
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_monst, (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_var, (struct opvar *, char *));
struct opvar * FDECL(set_opvar_str, (struct opvar *, const char *));
struct opvar * FDECL(set_opvar_var, (struct opvar *, const char *));
void VDECL(add_opvars, (sp_lev *, const char *, ...));
void NDECL(break_stmt_start);
void FDECL(break_stmt_end, (sp_lev *));
@@ -295,8 +294,7 @@ char **argv;
}
fin = freopen(fname, "r", stdin);
if (!fin) {
(void) fprintf(stderr,"Can't open \"%s\" for input.\n",
fname);
lc_pline("Can't open \"%s\" for input.\n", fname);
perror(fname);
errors_encountered = TRUE;
} else {
@@ -329,9 +327,10 @@ yyerror(s)
const char *s;
{
char *e = ((char *)s + strlen(s) - 1);
(void) fprintf(stderr, "%s: line %d, pos %d: %s",
fname, nh_line_number,
token_start_pos-strlen(curr_token), s);
token_start_pos - (int)strlen(curr_token), s);
if (*e != '.' && *e != '!')
(void) fprintf(stderr, " at \"%s\"", curr_token);
(void) fprintf(stderr, "\n");
@@ -362,30 +361,84 @@ yywrap()
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
lc_error(const char *fmt, ...)
{
char buf[512];
va_list argp;
va_start(argp, fmt);
(void) vsnprintf(buf, 511, fmt, argp);
va_end(argp);
yyerror(buf);
lc_pline VA_DECL(const char *, line)
VA_START(line);
VA_INIT(line, char *);
lc_vpline(line, VA_ARGS);
VA_END();
}
# 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
lc_warning(const char *fmt, ...)
{
char buf[512];
va_list argp;
lc_pline VA_DECL(const char *, line)
#endif /* USE_STDARG | USE_VARARG */
va_start(argp, fmt);
(void) vsnprintf(buf, 511, fmt, argp);
va_end(argp);
char pbuf[3*BUFSZ];
static char nomsg[] = "(no message)";
/* 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;
{
static char buf[32];
switch (chr) {
default: sprintf(buf, "unknown"); break;
case 'i': sprintf(buf, "int"); break;
case 'r': sprintf(buf, "region"); break;
case 's': sprintf(buf, "str"); break;
case 'O': sprintf(buf, "obj"); break;
case 'c': sprintf(buf, "coord"); break;
case ' ': sprintf(buf, "nothing"); break;
case 'm': sprintf(buf, "mapchar"); break;
case 'M': sprintf(buf, "monster"); break;
default: Strcpy(buf, "unknown"); break;
case 'i': Strcpy(buf, "int"); break;
case 'r': Strcpy(buf, "region"); break;
case 's': Strcpy(buf, "str"); break;
case 'O': Strcpy(buf, "obj"); break;
case 'c': Strcpy(buf, "coord"); break;
case ' ': Strcpy(buf, "nothing"); break;
case 'm': Strcpy(buf, "mapchar"); break;
case 'M': Strcpy(buf, "monster"); break;
}
return buf;
}
@@ -500,7 +554,7 @@ long val;
struct opvar *
set_opvar_str(ov, val)
struct opvar *ov;
char *val;
const char *val;
{
if (ov) {
ov->spovartyp = SPOVAR_STRING;
@@ -512,7 +566,7 @@ char *val;
struct opvar *
set_opvar_var(ov, val)
struct opvar *ov;
char *val;
const char *val;
{
if (ov) {
ov->spovartyp = SPOVAR_VARIABLE;
@@ -524,13 +578,36 @@ char *val;
#define New(type) \
(type *) memset((genericptr_t)alloc(sizeof(type)), 0, sizeof(type))
void
add_opvars(sp_lev *sp, const char *fmt, ...)
{
const char *p;
va_list argp;
#if defined(USE_STDARG) || defined(USE_VARARGS)
static void FDECL(vadd_opvars, (sp_lev *, const char *, va_list));
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++) {
switch(*p) {
@@ -538,74 +615,73 @@ add_opvars(sp_lev *sp, const char *fmt, ...)
case 'i': /* integer */
{
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);
break;
}
case 'c': /* coordinate */
{
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);
break;
}
case 'r': /* region */
{
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);
break;
}
case 'm': /* mapchar */
{
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);
break;
}
case 'M': /* monster */
{
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);
break;
}
case 'O': /* object */
{
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);
break;
}
case 's': /* string */
{
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);
break;
}
case 'v': /* variable */
{
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);
break;
}
case 'o': /* opcode */
{
long i = va_arg(argp, int);
long i = VA_NEXT(la, int);
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);
break;
}
default:
fprintf(stderr, "add_opvars: illegal format character '%c'.\n", *p);
lc_pline("add_opvars: illegal format character '%c'.", *p);
break;
}
}
va_end(argp);
return;
}
void
@@ -785,12 +861,12 @@ spovar2str(spovar)
{
static int togl = 0;
static char buf[2][128];
char *n = NULL;
const char *n = NULL;
int is_array = (spovar & SPOVAR_ARRAY);
spovar &= ~SPOVAR_ARRAY;
switch (spovar) {
default: lc_error("spovar2str(%li)", spovar); break;
default: lc_error("spovar2str(%ld)", spovar); break;
case SPOVAR_INT: n = "integer"; break;
case SPOVAR_STRING: n = "string"; break;
case SPOVAR_VARIABLE: n = "variable"; break;
@@ -860,7 +936,7 @@ reverse_jmp_opcode(opcode)
case SPO_JG: return SPO_JLE;
case SPO_JLE: return SPO_JG;
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;
default:
{
lc_error("Unknown opvar_clone value type (%i)!", ov->spovartyp);
lc_error("Unknown opvar_clone value type (%d)!", ov->spovartyp);
}
}
return tmpov;
@@ -1110,15 +1186,15 @@ char c;
case 'H' : return(SCORR);
case '{' : return(FOUNTAIN);
case '\\' : return(THRONE);
case 'K' :
return(SINK);
case 'K' : return(SINK);
case '}' : return(MOAT);
case 'P' : return(POOL);
case 'L' : return(LAVAPOOL);
case 'I' : return(ICE);
case 'W' : return(WATER);
case 'T' : return (TREE);
case 'F' : return (IRONBARS); /* Fe = iron */
case 'T' : return (TREE);
case 'F' : return (IRONBARS); /* Fe = iron */
case 'x' : return(MAX_TYPE); /* "see-through" */
}
return(INVALID_TYPE);
}
@@ -1133,7 +1209,7 @@ genericptr_t dat;
_opcode *tmp;
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));
if (sp->opcodes && nop) {
@@ -1226,7 +1302,7 @@ sp_lev *sp;
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++)
Free(tmpmap[dy]);
@@ -1240,9 +1316,8 @@ sp_lev *sp;
* Output some info common to all special levels.
*/
static boolean
write_common_data(fd, lvl)
write_common_data(fd)
int fd;
sp_lev *lvl;
{
static struct version_info version_data = {
VERSION_NUMBER, VERSION_FEATURES,
@@ -1264,7 +1339,7 @@ sp_lev *maze;
{
int i;
if (!write_common_data(fd, maze))
if (!write_common_data(fd))
return FALSE;
Write(fd, &(maze->n_opcodes), sizeof(maze->n_opcodes));
@@ -1275,7 +1350,7 @@ sp_lev *maze;
Write(fd, &(tmpo.opcode), sizeof(tmpo.opcode));
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) {
genericptr_t opdat = tmpo.opdat;
@@ -1304,14 +1379,14 @@ sp_lev *maze;
Free(ov->vardata.str);
}
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 {
/* sanity check */
genericptr_t opdat = tmpo.opdat;
if (opdat)
panic("write_maze: opcode (%i) has data.", tmpo.opcode);
panic("write_maze: opcode (%d) has data.", tmpo.opcode);
}
Free(tmpo.opdat);
@@ -1357,7 +1432,7 @@ sp_lev *lvl;
if (!lvl) panic("write_level_file");
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))
return FALSE;
-3
View File
@@ -1366,9 +1366,6 @@ static const char *build_opts[] = {
#ifdef VISION_TABLES
"vision tables",
#endif
#ifdef WALLIFIED_MAZE
"walled mazes",
#endif
#ifdef ZEROCOMP
"zero-compressed save files",
#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 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 = ();
our %commands = (
'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 %commands = (
'd' => 'debug mode; parse objects.txt to stdout instead of updating',
);
my $helpformat = "%20s %s\n";
getopts(join('', keys(%commands)));
my $debug = (defined($opt_d) && $opt_d == 1);
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; }
if (!defined($opts{'infile'})) { helpmessage(); die "no file specified for processing; stopping\n"; }
if ($opts{'debug'}) {
$opts{'output'} = '-';
unless ($debug) {
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 (defined($opts{'output'})) {
if (-e $opts{'output'}) { die "can't write to $opts{'output'}, it already exists; stopping\n"; }
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");
open(INFILE, "<$infile") or bail("couldn't open $infile; bailing");
open(OUTFILE, ">$outfile") or bail("couldn't open $outfile; bailing");
while (my $line = <INFILE>)
{
$line =~ s/cmap \d+/cmap $tilecount/;
if ($line =~ s/^# tile \d+/# tile $tilecount/) { $tilecount++; }
if (my ($tiletext) = $line =~ /^# tile \d+ (.*)/)
{
$line = "# tile $tilecount $tiletext\n";
$tilecount++;
}
print OUTFILE $line;
}
close(INFILE);
close(OUTFILE);
unless ($opts{'debug'}) { unlink "$opts{'infile'}.bak"; }
unless ($debug) { unlink $infile; }
exit;
sub helpmessage()
sub main::HELP_MESSAGE()
{
print("Usage: renumtiles.pl [OPTIONS] <textfile>\n\n");
foreach $opt (keys(%commands)) {
my ($vname, $desc) = split("\t", $commands{$opt});
$desc =~ s/\t//g;
printf($helpformat, $vname, $desc);
print <<"STARTHELP";
Usage: renumtiles.pl [OPTIONS] <textfile>
STARTHELP
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($)
{
unless ($opts{'debug'}) {
unlink $opts{'outfile'};
rename ("$opts{'infile'}.bak",$opts{'outfile'});
unless ($debug) {
unlink $outfile;
rename ($infile,$outfile);
}
shift;
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 $ */
/* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */
@@ -1770,7 +1770,7 @@ struct WinDesc *cw;
if (i == cw->maxrow) {
#ifdef H2344_BROKEN
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();
}
#endif