Merge branch 'master' into nhmall-booktribute

Conflicts:
	doc/fixes35.0
	include/extern.h
	src/mkobj.c
	src/mon.c
	src/objnam.c
	win/share/objects.txt
This commit is contained in:
nhmall
2015-04-12 10:02:17 -04:00
41 changed files with 16487 additions and 15871 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ rationale, etc.
============================================== ==============================================
FEATURE_NOTICE Alerts for a Release FEATURE_NOTICE Alerts for a Release
There is a code mechanism for alterting players to a change in behavior There is a code mechanism for alerting players to a change in behavior
over prior versions of the game. over prior versions of the game.
Here's how to do it: Here's how to do it:
+5 -4
View File
@@ -1,4 +1,4 @@
This is a listing of all files in a full NetHack 3.5 distribution, organized This is a listing of all files in a full NetHack 3.6 distribution, organized
in their standard manner on a UNIX system. It indicates which files are in their standard manner on a UNIX system. It indicates which files are
necessary for which versions, so that you can tell which files may be deleted necessary for which versions, so that you can tell which files may be deleted
from or not transferred to your system if you wish. from or not transferred to your system if you wish.
@@ -17,7 +17,8 @@ cmdhelp data.base dungeon.def endgame.des gehennom.des
help hh history knox.des license help hh history knox.des license
medusa.des mines.des opthelp oracle.des oracles.txt medusa.des mines.des opthelp oracle.des oracles.txt
quest.txt rumors.fal rumors.tru sokoban.des symbols quest.txt rumors.fal rumors.tru sokoban.des symbols
tower.des wizhelp yendor.des tower.des wizhelp yendor.des tribute bogusmon.txt
engrave.txt epitaph.txt
doc: doc:
(files for all versions) (files for all versions)
@@ -265,8 +266,8 @@ petmark.uu resource.h rip.uu splash.uu tiles.mak
winMS.h winhack.c winhack.rc winMS.h winhack.c winhack.rc
(files for Visual Studio 2010 Express Edition builds) (files for Visual Studio 2010 Express Edition builds)
dgncomp.vcxproj dgnstuff.vcxproj dgnstuff.mak dlb_main.vcxproj levcomp.vcxproj dgncomp.vcxproj dgnstuff.vcxproj dgnstuff.mak dlb_main.vcxproj levcomp.vcxproj
levstuff.vcxproj levstuff.mak makedefs.vcxproj nethack.sln uudecode.vcxproj levstuff.vcxproj levstuff.mak makedefs.vcxproj NetHack.sln uudecode.vcxproj
nethackw.vcxproj tile2bmp.vcxproj recover.vcxproj tilemap.vcxproj tiles.vcxproj NetHackW.vcxproj tile2bmp.vcxproj recover.vcxproj tilemap.vcxproj tiles.vcxproj
This is a list of files produced by auxiliary programs. They can all be This is a list of files produced by auxiliary programs. They can all be
regenerated from the files in the distribution. regenerated from the files in the distribution.
+2 -2
View File
@@ -186,8 +186,8 @@ as well as maintaining the X11 interface.
Ken Lorber, Haoyang Wang, Pat Rankin, and Dean Luick maintained the port Ken Lorber, Haoyang Wang, Pat Rankin, and Dean Luick maintained the port
of NetHack 3.6.0 for Mac. of NetHack 3.6.0 for Mac.
Michael Allison, Derek S. Ray, Yitzhak Sapir, Alex Kompel, and David Cohrs Michael Allison, Derek S. Ray, Yitzhak Sapir, Alex Kompel, Dion Nicolaas,
maintained the port of NetHack 3.6.0 for Microsoft Windows. and David Cohrs maintained the port of NetHack 3.6.0 for Microsoft Windows.
Jeff Bailey created and maintained a port of NetHack 3.6.0 for Chrome. Jeff Bailey created and maintained a port of NetHack 3.6.0 for Chrome.
+19 -17
View File
@@ -6,7 +6,7 @@
.ds vr "NetHack 3.6 .ds vr "NetHack 3.6
.ds f0 "\*(vr .ds f0 "\*(vr
.ds f1 .ds f1
.ds f2 "March 27, 2015 .ds f2 "April 12, 2015
.\" labeled paragraph start (should be part of tmac.n, but I don't want to .\" labeled paragraph start (should be part of tmac.n, but I don't want to
.\" make changes to that file) .\" make changes to that file)
.\" .PS word .\" .PS word
@@ -3007,6 +3007,9 @@ A string explaining how to recover a game on this system (no default value).
SEDUCE SEDUCE
0 or 1 to disable or enable, respectively, the SEDUCE option (see the source 0 or 1 to disable or enable, respectively, the SEDUCE option (see the source
for details on this function). for details on this function).
.lp
CHECK_SAVE_UID
0 or 1 to disable or enable, respectively, the UID checking for savefiles.
.pg .pg
The following options affect the score file: The following options affect the score file:
.pg .pg
@@ -3281,16 +3284,6 @@ successors originally by \fBDaniel Thaler\fP and then by \fBAlex Smith\fP,
and Dynahack by \fBTung Nguyen\fP. Some of those variants continue to be and Dynahack by \fBTung Nguyen\fP. Some of those variants continue to be
developed, maintained, and enjoyed by the community to this day. developed, maintained, and enjoyed by the community to this day.
.pg .pg
In September 2014, an interim snapshot of the code under development was
released publicly by other parties. Since that code was a work-in-progress
and had not gone through a period of debugging, it was decided that the
version numbers present on that code snapshot would be retired and never
used in an official NetHack release. An announcement was posted on the
devteam's official nethack.org website to that effect, stating that there
would never be a 3.4.4, 3.5, or 3.5.0 official release version.
.pg
In January 2015, preparation began for the release of NetHack 3.6
.pg
At the beginning of development for what would eventually get released At the beginning of development for what would eventually get released
as 3.6.0, the development team consisted of \fBWarwick Allison\fP, as 3.6.0, the development team consisted of \fBWarwick Allison\fP,
\fBMichael Allison\fP, \fBKen Arromdee\fP, \fBMichael Allison\fP, \fBKen Arromdee\fP,
@@ -3299,25 +3292,34 @@ as 3.6.0, the development team consisted of \fBWarwick Allison\fP,
\fBMike Stephenson\fP, \fBJanet Walz\fP, and \fBPaul Winner\fP. \fBMike Stephenson\fP, \fBJanet Walz\fP, and \fBPaul Winner\fP.
Leading up to the release of 3.6.0 in early 2015, new members Leading up to the release of 3.6.0 in early 2015, new members
\fBSean Hunt\fP, \fBPasi Kallinen\fP, and \fBDerek S. Ray\fP \fBSean Hunt\fP, \fBPasi Kallinen\fP, and \fBDerek S. Ray\fP
joined the NetHack development team, joined the NetHack development team.
.pg .pg
\fB3.6.0 TODO insert apprpriate description of 3.6.0 here In September 2014, an interim snapshot of the code under development was
released publicly by other parties. Since that code was a work-in-progress
and had not gone through a period of debugging, it was decided that the
version numbers present on that code snapshot would be retired and never
used in an official NetHack release. An announcement was posted on the
devteam's official nethack.org website to that effect, stating that there
would never be a 3.4.4, 3.5, or 3.5.0 official release version.
.pg
In January 2015, preparation began for the release of NetHack 3.6. The 3.6
version merges work done by the development team since the previous release with
some of the beloved community patches. Many bugs were fixed and some code was
restructured.
.pg .pg
\fBThe development team, as well as \fBSteve VanDevender\fP and \fBThe development team, as well as \fBSteve VanDevender\fP and
\fBKevin Smolkowski\fP ensured that NetHack 3.6.0 continued to operate on \fBKevin Smolkowski\fP ensured that NetHack 3.6.0 continued to operate on
various Unix flavors as well as maintaining the X11 interface. various Unix flavors and maintained the X11 interface.
.pg .pg
\fBKen Lorber\fP, \fBHaoyang Wang\fP, \fBPat Rankin\fP, and \fBDean Luick\fP \fBKen Lorber\fP, \fBHaoyang Wang\fP, \fBPat Rankin\fP, and \fBDean Luick\fP
maintained the port of NetHack 3.6.0 for Mac. maintained the port of NetHack 3.6.0 for Mac.
.pg .pg
\fBMichael Allison\fP, \fBDerek S. Ray\fP, \fBYitzhak Sapir\fP, \fBMichael Allison\fP, \fBDerek S. Ray\fP, \fBYitzhak Sapir\fP,
\fBAlex Kompel\fP, and \fBDavid Cohrs\fP maintained the port of \fBAlex Kompel\fP, and \fBDion Nicolaas\fP maintained the port of
NetHack 3.6.0 for Microsoft Windows. NetHack 3.6.0 for Microsoft Windows.
.pg .pg
\fBJeff Bailey\fP created and maintained a port of NetHack 3.6.0 for Chrome. \fBJeff Bailey\fP created and maintained a port of NetHack 3.6.0 for Chrome.
.pg .pg
TODO \fBAlex Kompel\fP maintained a port of NetHack 3.6.0 to Windows Phone.
.pg
\fBThis version of the game is special in a particular way. Near the end of \fBThis version of the game is special in a particular way. Near the end of
the development of 3.6, one of the significant inspirations for many of the the development of 3.6, one of the significant inspirations for many of the
humorous and fun features found in the game, author \fBTerry Pratchett\fP, humorous and fun features found in the game, author \fBTerry Pratchett\fP,
+24 -25
View File
@@ -33,7 +33,7 @@
\begin{document} \begin{document}
% %
% input file: guidebook.mn % input file: guidebook.mn
% $Revision: 1.122 $ $Date: 2015/03/27 06:00:00 $ % $Revision: 1.122 $ $Date: 2015/04/12 06:00:00 $
% %
%.ds h0 " %.ds h0 "
%.ds h1 %.ds h2 \% %.ds h1 %.ds h2 \%
@@ -46,7 +46,7 @@
%.au %.au
\author{Eric S. Raymond\\ \author{Eric S. Raymond\\
(Edited and expanded for 3.6)} (Edited and expanded for 3.6)}
\date{March 27, 2015} \date{April 12, 2015}
\maketitle \maketitle
@@ -3597,6 +3597,9 @@ A string explaining how to recover a game on this system (no default value).
\item[\ib{SEDUCE}] \item[\ib{SEDUCE}]
0 or 1 to disable or enable, respectively, the SEDUCE option (see the source) 0 or 1 to disable or enable, respectively, the SEDUCE option (see the source)
for details on this function. for details on this function.
%.lp
\item[\ib{CHECK\_SAVE\_UID}]
0 or 1 to disable or enable, respectively, the UID checking for savefiles.
\elist \elist
%.pg %.pg
@@ -3952,6 +3955,18 @@ originally by Daniel Thaler and then by Alex Smith, and
Dynahack by Tung Nguyen. Some of those variants continue to be developed, Dynahack by Tung Nguyen. Some of those variants continue to be developed,
maintained, and enjoyed by the community to this day. maintained, and enjoyed by the community to this day.
%.pg
\medskip
At the beginning of development for what would eventually get released
as 3.6.0, the development team consisted of {\it Warwick Allison},
{\it Michael Allison}, {\it Ken Arromdee},
{\it David Cohrs}, {\it Jessie Collet},
{\it Ken Lorber}, {\it Dean Luick}, {\it Pat Rankin},
{\it Mike Stephenson}, {\it Janet Walz}, and {\it Paul Winner}.
Leading up to the release of 3.6.0 in early 2015, new members
{\it Sean Hunt}, {\it Pasi Kallinen}, and {\it Derek S. Ray}
joined the NetHack development team.
%.pg %.pg
\medskip \medskip
In September 2014, an interim snapshot of the code under development was In September 2014, an interim snapshot of the code under development was
@@ -3964,47 +3979,31 @@ would never be a 3.4.4, 3.5, or 3.5.0 official release version.
%.pg %.pg
\medskip \medskip
In January 2015, preparation began for the release of NetHack 3.6 In January 2015, preparation began for the release of NetHack 3.6.
The 3.6 version merges work done by the development team since the previous
%.pg release with some of the beloved community patches. Many bugs were fixed
\medskip and some code was restructured.
At the beginning of development for what would eventually get released
as 3.6.0, the development team consisted of {\it Warwick Allison},
{\it Michael Allison}, {\it Ken Arromdee},
{\it David Cohrs}, {\it Jessie Collet},
{\it Ken Lorber}, {\it Dean Luick}, {\it Pat Rankin},
{\it Mike Stephenson}, {\it Janet Walz}, and {\it Paul Winner}.
Leading up to the release of 3.6.0 in early 2015, new members
{\it Sean Hunt}, {\it Pasi Kallinen}, and {\it Derek S. Ray}
joined the NetHack development team,
%.pg
\medskip
3.6.0 TODO insert apprpriate description of 3.6.0 here
%.pg %.pg
\medskip \medskip
The development team, as well as {\it Steve VanDevender} and The development team, as well as {\it Steve VanDevender} and
{\it Kevin Smolkowski} ensured that NetHack 3.6.0 continued to operate on {\it Kevin Smolkowski} ensured that NetHack 3.6.0 continued to operate on
various Unix flavors as well as maintaining the X11 interface. various Unix flavors and maintained the X11 interface.
%.pg
{\it Ken Lorber}, {\it Haoyang Wang}, {\it Pat Rankin}, and {\it Dean Luick} {\it Ken Lorber}, {\it Haoyang Wang}, {\it Pat Rankin}, and {\it Dean Luick}
maintained the port of NetHack 3.6.0 for Mac. maintained the port of NetHack 3.6.0 for Mac.
%.pg %.pg
\medskip \medskip
{\it Michael Allison}, {\it Derek S. Ray}, {\it Yitzhak Sapir}, {\it Michael Allison}, {\it Derek S. Ray}, {\it Yitzhak Sapir},
{\it Alex Kompel}, and {\it David Cohrs} maintained the port of {\it Alex Kompel}, and {\it Dion Nicolaas} maintained the port of
NetHack 3.6.0 for Microsoft Windows. NetHack 3.6.0 for Microsoft Windows.
%.pg %.pg
\medskip \medskip
{\it Jeff Bailey} created and maintained a port of NetHack 3.6.0 for Chrome. {\it Jeff Bailey} created and maintained a port of NetHack 3.6.0 for Chrome.
%.pg
\medskip
{\it Alex Kompel} maintained a port of NetHack 3.6.0 to Windows Phone. <FIXME>?
%.pg %.pg
\medskip \medskip
This version of the game is special in a particular way. Near the end of This version of the game is special in a particular way. Near the end of
+5 -1
View File
@@ -894,6 +894,9 @@ non-pet rust monsters would eat rust-proofed non-digestibles but ignore
kicking a grave may topple the gravestone kicking a grave may topple the gravestone
allow showing legal positions for stinking cloud, jumping and polearms allow showing legal positions for stinking cloud, jumping and polearms
when asked for a location when asked for a location
cloned creatures (of any type) don't deathdrop items
pudding corpses behave somewhat differently than before
mithril armor should have silver color
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
@@ -1112,6 +1115,7 @@ show more explicit reason why player was helpless at death
added new hallucinatory-only gods added new hallucinatory-only gods
options to create the character blind or nudist options to create the character blind or nudist
moving clouds on the plane of air moving clouds on the plane of air
disclose extinct species alongside genocided ones
tribute to Terry Pratchett tribute to Terry Pratchett
@@ -1153,7 +1157,7 @@ adopt/adapt/improve Dungeon Overview
Aardvark Joe's Extended Logfile Aardvark Joe's Extended Logfile
Michael Deutschmann's use_darkgray Michael Deutschmann's use_darkgray
Clive Crous' dark_room Clive Crous' dark_room
Jukka Lahtinen's sortloot sortloot by Jeroen Demeyer and Jukka Lahtinen
Code Cleanup and Reorganization Code Cleanup and Reorganization
+4
View File
@@ -437,8 +437,12 @@ typedef unsigned char uchar;
*/ */
/* Menucolors */ /* Menucolors */
/* HACK: this is being added to fix the builds temporarily.
* Remove it whenever we finally get a real regex for Win32 */
#ifdef UNIX
# define MENU_COLOR_REGEX /* use GNU regex */ # define MENU_COLOR_REGEX /* use GNU regex */
/*# define MENU_COLOR_REGEX_POSIX*/ /* use POSIX regex */ /*# define MENU_COLOR_REGEX_POSIX*/ /* use POSIX regex */
#endif
/* if neither is defined, uses pmatch() /* if neither is defined, uses pmatch()
* pmatch() provides basic globbing: '*' and '?' wildcards. * pmatch() provides basic globbing: '*' and '?' wildcards.
*/ */
+8 -2
View File
@@ -1,4 +1,4 @@
/* NetHack 3.5 extern.h $NHDT-Date: 1428196810 2015/04/05 01:20:10 $ $NHDT-Branch: nhmall-booktribute $:$NHDT-Revision: 1.451 $ */ /* NetHack 3.5 extern.h $NHDT-Date: 1428806395 2015/04/12 02:39:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.455 $ */
/* NetHack 3.5 extern.h $Date: 2013/11/05 00:57:53 $ $Revision: 1.380 $ */ /* NetHack 3.5 extern.h $Date: 2013/11/05 00:57:53 $ $Revision: 1.380 $ */
/* Copyright (c) Steve Creps, 1988. */ /* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -836,6 +836,8 @@ E int FDECL(isqrt, (int));
E int FDECL(distmin, (int,int,int,int)); E int FDECL(distmin, (int,int,int,int));
E boolean FDECL(online2, (int,int,int,int)); E boolean FDECL(online2, (int,int,int,int));
E boolean FDECL(pmatch, (const char *,const char *)); E boolean FDECL(pmatch, (const char *,const char *));
E boolean FDECL(pmatchi, (const char *,const char *));
E boolean FDECL(pmatchz, (const char *,const char *));
#ifndef STRNCMPI #ifndef STRNCMPI
E int FDECL(strncmpi, (const char *,const char *,int)); E int FDECL(strncmpi, (const char *,const char *,int));
#endif #endif
@@ -1230,6 +1232,10 @@ E void FDECL(obj_ice_effects, (int, int, BOOLEAN_P));
E long FDECL(peek_at_iced_corpse_age, (struct obj *)); E long FDECL(peek_at_iced_corpse_age, (struct obj *));
E int FDECL(hornoplenty, (struct obj *,BOOLEAN_P)); E int FDECL(hornoplenty, (struct obj *,BOOLEAN_P));
E void NDECL(obj_sanity_check); E void NDECL(obj_sanity_check);
E struct obj* FDECL(obj_nexto, (struct obj*));
E struct obj* FDECL(obj_nexto_xy, (int, int, int, unsigned));
E struct obj* FDECL(obj_absorb, (struct obj**, struct obj**));
E struct obj* FDECL(obj_meld, (struct obj**, struct obj**));
/* ### mkroom.c ### */ /* ### mkroom.c ### */
@@ -2663,7 +2669,7 @@ E struct monst *FDECL(bhit, (int,int,int,int,int (*)(MONST_P,OBJ_P),
int (*)(OBJ_P,OBJ_P),struct obj **)); int (*)(OBJ_P,OBJ_P),struct obj **));
E struct monst *FDECL(boomhit, (struct obj *,int,int)); E struct monst *FDECL(boomhit, (struct obj *,int,int));
E int FDECL(zhitm, (struct monst *,int,int,struct obj **)); E int FDECL(zhitm, (struct monst *,int,int,struct obj **));
E int FDECL(burn_floor_paper, (int,int,BOOLEAN_P,BOOLEAN_P)); E int FDECL(burn_floor_objects, (int,int,BOOLEAN_P,BOOLEAN_P));
E void FDECL(buzz, (int,int,XCHAR_P,XCHAR_P,int,int)); E void FDECL(buzz, (int,int,XCHAR_P,XCHAR_P,int,int));
E void FDECL(melt_ice, (XCHAR_P,XCHAR_P,const char *)); E void FDECL(melt_ice, (XCHAR_P,XCHAR_P,const char *));
E void FDECL(start_melt_ice_timeout, (XCHAR_P,XCHAR_P,long)); E void FDECL(start_melt_ice_timeout, (XCHAR_P,XCHAR_P,long));
+6 -1
View File
@@ -94,7 +94,7 @@ struct obj {
Bitfield(recharged,3); /* number of times it's been recharged */ Bitfield(recharged,3); /* number of times it's been recharged */
#define on_ice recharged /* corpse on ice */ #define on_ice recharged /* corpse on ice */
Bitfield(lamplit,1); /* a light-source -- can be lit */ Bitfield(lamplit,1); /* a light-source -- can be lit */
Bitfield(oreserved1,1); /* was the placeholder for invisible objects, free for use */ Bitfield(globby,1); /* globby; will combine with like types on adjacent squares */
Bitfield(greased,1); /* covered with grease */ Bitfield(greased,1); /* covered with grease */
Bitfield(nomerge,1); /* set temporarily to prevent merging */ Bitfield(nomerge,1); /* set temporarily to prevent merging */
Bitfield(was_thrown,1); /* thrown by hero since last picked up */ Bitfield(was_thrown,1); /* thrown by hero since last picked up */
@@ -233,6 +233,11 @@ struct obj {
#define polyfodder(obj) (ofood(obj) && pm_to_cham((obj)->corpsenm) != NON_PM) #define polyfodder(obj) (ofood(obj) && pm_to_cham((obj)->corpsenm) != NON_PM)
#define mlevelgain(obj) (ofood(obj) && (obj)->corpsenm == PM_WRAITH) #define mlevelgain(obj) (ofood(obj) && (obj)->corpsenm == PM_WRAITH)
#define mhealup(obj) (ofood(obj) && (obj)->corpsenm == PM_NURSE) #define mhealup(obj) (ofood(obj) && (obj)->corpsenm == PM_NURSE)
#define Is_pudding(o) (o->otyp == GLOB_OF_GRAY_OOZE \
|| o->otyp == GLOB_OF_BROWN_PUDDING \
|| o->otyp == GLOB_OF_GREEN_SLIME \
|| o->otyp == GLOB_OF_BLACK_PUDDING)
/* Containers */ /* Containers */
#define carried(o) ((o)->where == OBJ_INVENT) #define carried(o) ((o)->where == OBJ_INVENT)
+1
View File
@@ -35,6 +35,7 @@ struct sysopt {
# endif # endif
#endif #endif
int seduce; int seduce;
int check_save_uid; /* restoring savefile checks UID? */
}; };
extern struct sysopt sysopt; extern struct sysopt sysopt;
+1 -1
View File
@@ -1244,7 +1244,7 @@ char resultbuf[]; /* should be at least [7] to hold "18/100\0" */
void void
enlightenment(mode, final) enlightenment(mode, final)
int mode; /* BASICENLIGHTENMENT | MAGICENLIGHTENMENT (| both) */ int mode; /* BASICENLIGHTENMENT | MAGICENLIGHTENMENT (| both) */
int final; /* ENL_GAMEINPROGRESS:0, ENL_GAVEOVERALIVE, ENL_GAMEOVERDEAD */ int final; /* ENL_GAMEINPROGRESS:0, ENL_GAMEOVERALIVE, ENL_GAMEOVERDEAD */
{ {
char buf[BUFSZ], tmpbuf[BUFSZ]; char buf[BUFSZ], tmpbuf[BUFSZ];
+1 -1
View File
@@ -160,7 +160,7 @@ magic_map_background(x, y, show)
if (!cansee(x,y) && !lev->waslit) { if (!cansee(x,y) && !lev->waslit) {
/* Floor spaces are dark if unlit. Corridors are dark if unlit. */ /* Floor spaces are dark if unlit. Corridors are dark if unlit. */
if (lev->typ == ROOM && glyph == cmap_to_glyph(S_room)) if (lev->typ == ROOM && glyph == cmap_to_glyph(S_room))
glyph = cmap_to_glyph(S_stone); glyph = cmap_to_glyph((flags.dark_room && iflags.use_color) ? (DARKROOMSYM) : S_stone);
else if (lev->typ == CORR && glyph == cmap_to_glyph(S_litcorr)) else if (lev->typ == CORR && glyph == cmap_to_glyph(S_litcorr))
glyph = cmap_to_glyph(S_corr); glyph = cmap_to_glyph(S_corr);
} }
+8
View File
@@ -131,6 +131,7 @@ const char *verb;
{ {
struct trap *t; struct trap *t;
struct monst *mtmp; struct monst *mtmp;
struct obj* otmp;
if (obj->where != OBJ_FREE) if (obj->where != OBJ_FREE)
panic("flooreffects: obj not free"); panic("flooreffects: obj not free");
@@ -211,6 +212,13 @@ const char *verb;
pline("%s %s into %s pit.", pline("%s %s into %s pit.",
The(xname(obj)), otense(obj, "tumble"), The(xname(obj)), otense(obj, "tumble"),
the_your[t->madeby_u]); the_your[t->madeby_u]);
} else if (obj->globby) {
/* Globby things like puddings might stick together */
while (obj && (otmp = obj_nexto_xy(obj->otyp, x, y, obj->o_id)) != (struct obj*)0) {
pline("The %s coalesce.", makeplural(obj_typename(obj->otyp)));
obj_meld(&obj, &otmp);
}
return (obj == NULL);
} }
return FALSE; return FALSE;
} }
+3 -3
View File
@@ -1612,7 +1612,7 @@ start_eating(otmp) /* called as you start to eat */
context.victual.fullwarn = context.victual.doreset = FALSE; context.victual.fullwarn = context.victual.doreset = FALSE;
context.victual.eating = TRUE; context.victual.eating = TRUE;
if (otmp->otyp == CORPSE) { if (otmp->otyp == CORPSE || otmp->globby) {
cprefx(context.victual.piece->corpsenm); cprefx(context.victual.piece->corpsenm);
if (!context.victual.piece || !context.victual.eating) { if (!context.victual.piece || !context.victual.eating) {
/* rider revived, or died and lifesaved */ /* rider revived, or died and lifesaved */
@@ -2127,7 +2127,7 @@ struct obj *otmp;
!Stone_resistance && !Stone_resistance &&
!poly_when_stoned(youmonst.data)); !poly_when_stoned(youmonst.data));
if (mnum == PM_GREEN_SLIME) if (mnum == PM_GREEN_SLIME || otmp->otyp == GLOB_OF_GREEN_SLIME)
stoneorslime = (!Unchanging && !slimeproof(youmonst.data)); stoneorslime = (!Unchanging && !slimeproof(youmonst.data));
if (cadaver && !nonrotting_corpse(mnum)) { if (cadaver && !nonrotting_corpse(mnum)) {
@@ -2397,7 +2397,7 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
* for normal vs. rotten food. The reqtime and nutrit values are * for normal vs. rotten food. The reqtime and nutrit values are
* then adjusted in accordance with the amount of food left. * then adjusted in accordance with the amount of food left.
*/ */
if(otmp->otyp == CORPSE) { if(otmp->otyp == CORPSE || otmp->globby) {
int tmp = eatcorpse(otmp); int tmp = eatcorpse(otmp);
if (tmp == 2) { if (tmp == 2) {
/* used up */ /* used up */
+37 -8
View File
@@ -1238,7 +1238,7 @@ boolean identified, all_containers, reportempty;
{ {
register struct obj *box, *obj; register struct obj *box, *obj;
struct obj **oarray; struct obj **oarray;
int i,j,n; int i,n;
char *invlet; char *invlet;
char buf[BUFSZ]; char buf[BUFSZ];
boolean cat, deadcat; boolean cat, deadcat;
@@ -1437,43 +1437,72 @@ num_genocides()
return n; return n;
} }
int
num_extinct()
{
int i, n = 0;
for (i = LOW_PM; i < NUMMONS; ++i)
if (!(mvitals[i].mvflags & G_GENOD) &&
(mvitals[i].mvflags & G_GONE) &&
!(mons[i].geno & G_UNIQ)) ++n;
return n;
}
STATIC_OVL void STATIC_OVL void
list_genocided(defquery, ask) list_genocided(defquery, ask)
char defquery; char defquery;
boolean ask; boolean ask;
{ {
register int i; register int i;
int ngenocided; int ngenocided, nextinct;
char c; char c;
winid klwin; winid klwin;
char buf[BUFSZ]; char buf[BUFSZ];
ngenocided = num_genocides(); ngenocided = num_genocides();
nextinct = num_extinct();
/* genocided species list */ /* genocided or extinct species list */
if (ngenocided != 0) { if (ngenocided != 0 || nextinct != 0) {
c = ask ? yn_function("Do you want a list of species genocided?", Sprintf(buf, "Do you want a list of %sspecies%s%s?",
ynqchars, defquery) : defquery; (nextinct && !ngenocided) ? "extinct " : "",
(ngenocided) ? " genocided" : "",
(nextinct && ngenocided) ? " and extinct" : "");
c = ask ? yn_function(buf, ynqchars, defquery) : defquery;
if (c == 'q') done_stopprint++; if (c == 'q') done_stopprint++;
if (c == 'y') { if (c == 'y') {
klwin = create_nhwindow(NHW_MENU); klwin = create_nhwindow(NHW_MENU);
putstr(klwin, 0, "Genocided species:"); Sprintf(buf, "%s%s species:",
(ngenocided) ? "Genocided" : "Extinct",
(nextinct && ngenocided) ? " or extinct" : "");
putstr(klwin, 0, buf);
putstr(klwin, 0, ""); putstr(klwin, 0, "");
for (i = LOW_PM; i < NUMMONS; i++) for (i = LOW_PM; i < NUMMONS; i++)
if (mvitals[i].mvflags & G_GENOD) { if (mvitals[i].mvflags & G_GONE && !(mons[i].geno & G_UNIQ)) {
if ((mons[i].geno & G_UNIQ) && i != PM_HIGH_PRIEST) if ((mons[i].geno & G_UNIQ) && i != PM_HIGH_PRIEST)
Sprintf(buf, "%s%s", Sprintf(buf, "%s%s",
!type_is_pname(&mons[i]) ? "" : "the ", !type_is_pname(&mons[i]) ? "" : "the ",
mons[i].mname); mons[i].mname);
else else
Strcpy(buf, makeplural(mons[i].mname)); Strcpy(buf, makeplural(mons[i].mname));
if (!(mvitals[i].mvflags & G_GENOD))
Strcat(buf, " (extinct)");
putstr(klwin, 0, buf); putstr(klwin, 0, buf);
} }
putstr(klwin, 0, ""); putstr(klwin, 0, "");
if (ngenocided > 0) {
Sprintf(buf, "%d species genocided.", ngenocided); Sprintf(buf, "%d species genocided.", ngenocided);
putstr(klwin, 0, buf); putstr(klwin, 0, buf);
}
if (nextinct > 0) {
Sprintf(buf, "%d species extinct.", nextinct);
putstr(klwin, 0, buf);
}
display_nhwindow(klwin, TRUE); display_nhwindow(klwin, TRUE);
destroy_nhwindow(klwin); destroy_nhwindow(klwin);
+14 -12
View File
@@ -1,4 +1,4 @@
/* NetHack 3.5 files.c $NHDT-Date: 1426969026 2015/03/21 20:17:06 $ $NHDT-Branch: master $:$NHDT-Revision: 1.137 $ */ /* NetHack 3.5 files.c $NHDT-Date: 1427337311 2015/03/26 02:35:11 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.141 $ */
/* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */ /* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1874,9 +1874,12 @@ int src;
fqname(filename, SYSCONFPREFIX, 0), BUFSZ-1); fqname(filename, SYSCONFPREFIX, 0), BUFSZ-1);
} else } else
#endif #endif
/* always honor sysconf first before anything else */
(void) strncpy(lastconfigfile, filename, BUFSZ-1); (void) strncpy(lastconfigfile, filename, BUFSZ-1);
lastconfigfile[BUFSZ-1] = '\0'; lastconfigfile[BUFSZ-1] = '\0';
if ((fp = fopenp(lastconfigfile, "r")) != (FILE *)0) { if ((fp = fopenp(lastconfigfile, "r")) != (FILE *)0)
return(fp);
if ((fp = fopenp(filename, "r")) != (FILE *)0) {
return(fp); return(fp);
#if defined(UNIX) || defined(VMS) #if defined(UNIX) || defined(VMS)
} else { } else {
@@ -1890,18 +1893,14 @@ int src;
} }
#if defined(MICRO) || defined(MAC) || defined(__BEOS__) || defined(WIN32) #if defined(MICRO) || defined(MAC) || defined(__BEOS__) || defined(WIN32)
(void) strncpy(lastconfigfile, if ((fp = fopenp(fqname(configfile, CONFIGPREFIX, 0), "r")) != (FILE *)0)
fqname(configfile, CONFIGPREFIX, 0), BUFSZ-1); return(fp);
lastconfigfile[BUFSZ-1] = '\0'; if ((fp = fopenp(configfile, "r")) != (FILE *)0)
if ((fp = fopenp(lastconfigfile, "r")) != (FILE *)0) {
return(fp); return(fp);
}
# ifdef MSDOS # ifdef MSDOS
(void) strncpy(lastconfigfile, if ((fp = fopenp(fqname(backward_compat_configfile, CONFIGPREFIX, 0), "r")) != (FILE *)0)
fqname(backward_compat_configfile, CONFIGPREFIX, 0), return(fp);
BUFSZ-1); if ((fp = fopenp(backward_compat_configfile, "r")) != (FILE *)0)
lastconfigfile[BUFSZ-1] = '\0';
else if ((fp = fopenp(lastconfigfile, "r")) != (FILE *)0)
return(fp); return(fp);
# endif # endif
#else #else
@@ -2207,6 +2206,9 @@ int src;
} else if (src == SET_IN_SYS && match_varname(buf, "RECOVER", 7)) { } else if (src == SET_IN_SYS && match_varname(buf, "RECOVER", 7)) {
if (sysopt.recover) free(sysopt.recover); if (sysopt.recover) free(sysopt.recover);
sysopt.recover = dupstr(bufp); sysopt.recover = dupstr(bufp);
} else if (src == SET_IN_SYS && match_varname(buf, "CHECK_SAVE_UID", 14)) {
n = atoi(bufp);
sysopt.check_save_uid = n;
} else if (match_varname(buf, "SEDUCE", 6)) { } else if (match_varname(buf, "SEDUCE", 6)) {
n = !!atoi(bufp); /* XXX this could be tighter */ n = !!atoi(bufp); /* XXX this could be tighter */
/* allow anyone to turn it off, but only sysconf to turn it on*/ /* allow anyone to turn it off, but only sysconf to turn it on*/
+57 -13
View File
@@ -1,15 +1,15 @@
/* NetHack 3.5 hacklib.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ /* NetHack 3.5 hacklib.c $NHDT-Date: 1428806394 2015/04/12 02:39:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.34 $ */
/* NetHack 3.5 hacklib.c $Date: 2009/05/06 10:46:32 $ $Revision: 1.23 $ */ /* NetHack 3.5 hacklib.c $Date: 2009/05/06 10:46:32 $ $Revision: 1.23 $ */
/* SCCS Id: @(#)hacklib.c 3.5 2007/04/30 */ /* SCCS Id: @(#)hacklib.c 3.5 2007/04/30 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* Copyright (c) Robert Patrick Rankin, 1991 */ /* Copyright (c) Robert Patrick Rankin, 1991 */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
/* We could include only config.h, except for the overlay definitions... */ #include "hack.h" /* for config.h+extern.h */
#include "hack.h"
/*= /*=
Assorted 'small' utility routines. They're virtually independent of Assorted 'small' utility routines. They're virtually independent of
NetHack, except that rounddiv may call panic(). NetHack, except that rounddiv may call panic(). setrandom calls one of
srandom(), srand48(), or srand() depending upon configuration.
return type routine name argument type(s) return type routine name argument type(s)
boolean digit (char) boolean digit (char)
@@ -40,9 +40,12 @@ NetHack, except that rounddiv may call panic().
int dist2 (int, int, int, int) int dist2 (int, int, int, int)
boolean online2 (int, int) boolean online2 (int, int)
boolean pmatch (const char *, const char *) boolean pmatch (const char *, const char *)
boolean pmatchi (const char *, const char *)
boolean pmatchz (const char *, const char *)
int strncmpi (const char *, const char *, int) int strncmpi (const char *, const char *, int)
char * strstri (const char *, const char *) char * strstri (const char *, const char *)
boolean fuzzymatch (const char *,const char *,const char *,boolean) boolean fuzzymatch (const char *,const char *,
const char *,boolean)
void setrandom (void) void setrandom (void)
time_t getnow (void) time_t getnow (void)
int getyear (void) int getyear (void)
@@ -62,6 +65,9 @@ NetHack, except that rounddiv may call panic().
# define Static static # define Static static
#endif #endif
static boolean FDECL(pmatch_internal, (const char *,const char *,
BOOLEAN_P,const char *));
boolean boolean
digit(c) /* is 'c' a digit? */ digit(c) /* is 'c' a digit? */
char c; char c;
@@ -465,9 +471,12 @@ online2(x0, y0, x1, y1) /* are two points lined up (on a straight line)? */
return((boolean)(!dy || !dx || (dy == dx) || (dy + dx == 0))); /* (dy == -dx) */ return((boolean)(!dy || !dx || (dy == dx) || (dy + dx == 0))); /* (dy == -dx) */
} }
boolean /* guts of pmatch(), pmatchi(), and pmatchz() */
pmatch(patrn, strng) /* match a string against a pattern */ static boolean
pmatch_internal(patrn, strng, ci, sk) /* match a string against a pattern */
const char *patrn, *strng; const char *patrn, *strng;
boolean ci; /* True => case-insensitive, False => case-sensitive */
const char *sk; /* set of characters to skip */
{ {
char s, p; char s, p;
/* /*
@@ -475,18 +484,53 @@ pmatch(patrn, strng) /* match a string against a pattern */
: any single character. Returns TRUE if 'strng' matches 'patrn'. : any single character. Returns TRUE if 'strng' matches 'patrn'.
*/ */
pmatch_top: pmatch_top:
if (!sk) {
s = *strng++; p = *patrn++; /* get next chars and pre-advance */ s = *strng++; p = *patrn++; /* get next chars and pre-advance */
} else {
/* fuzzy match variant of pmatch; particular characters are ignored */
do { s = *strng++; } while (index(sk, s));
do { p = *patrn++; } while (index(sk, p));
}
if (!p) /* end of pattern */ if (!p) /* end of pattern */
return((boolean)(s == '\0')); /* matches iff end of string too */ return (boolean)(s == '\0'); /* matches iff end of string too */
else if (p == '*') /* wildcard reached */ else if (p == '*') /* wildcard reached */
return((boolean)((!*patrn || pmatch(patrn, strng-1)) ? TRUE : return (boolean)
s ? pmatch(patrn-1, strng) : FALSE)); ((!*patrn || pmatch_internal(patrn, strng-1, ci, sk)) ? TRUE :
else if (p != s && (p != '?' || !s)) /* check single character */ s ? pmatch_internal(patrn-1, strng, ci, sk) : FALSE);
else if ((ci ? lowc(p) != lowc(s) : p != s) /* check single character */
&& (p != '?' || !s)) /* & single-char wildcard */
return FALSE; /* doesn't match */ return FALSE; /* doesn't match */
else /* return pmatch(patrn, strng); */ else /* return pmatch_internal(patrn, strng, ci, sk); */
goto pmatch_top; /* optimize tail recursion */ goto pmatch_top; /* optimize tail recursion */
} }
/* case-sensitive wildcard match */
boolean
pmatch(patrn, strng)
const char *patrn, *strng;
{
return pmatch_internal(patrn, strng, FALSE, (const char *)0);
}
/* case-insensitive wildcard match */
boolean
pmatchi(patrn, strng)
const char *patrn, *strng;
{
return pmatch_internal(patrn, strng, TRUE, (const char *)0);
}
/* case-insensitive wildcard fuzzymatch */
boolean
pmatchz(patrn, strng)
const char *patrn, *strng;
{
/* ignore spaces, tabs (just in case), dashes, and underscores */
static const char fuzzychars[] = " \t-_";
return pmatch_internal(patrn, strng, TRUE, fuzzychars);
}
#ifndef STRNCMPI #ifndef STRNCMPI
int int
strncmpi(s1, s2, n) /* case insensitive counted string comparison */ strncmpi(s1, s2, n) /* case insensitive counted string comparison */
@@ -603,7 +647,7 @@ STATIC_DCL struct tm *NDECL(getlt);
void void
setrandom() setrandom()
{ {
unsigned long seed = getnow(); /* time((TIME_type) 0) */ unsigned long seed = (unsigned long)getnow(); /* time((TIME_type) 0) */
#ifdef UNIX #ifdef UNIX
/* Quick dirty band-aid to prevent PRNG prediction */ /* Quick dirty band-aid to prevent PRNG prediction */
seed *= getpid(); seed *= getpid();
+13 -5
View File
@@ -1,4 +1,3 @@
/* NetHack 3.5 invent.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 invent.c $Date: 2013/11/05 00:57:55 $ $Revision: 1.125 $ */ /* NetHack 3.5 invent.c $Date: 2013/11/05 00:57:55 $ $Revision: 1.125 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -253,7 +252,8 @@ struct obj **potmp, **pobj;
otmp->quan += obj->quan; otmp->quan += obj->quan;
/* temporary special case for gold objects!!!! */ /* temporary special case for gold objects!!!! */
if (otmp->oclass == COIN_CLASS) otmp->owt = weight(otmp); if (otmp->oclass == COIN_CLASS) otmp->owt = weight(otmp);
else otmp->owt += obj->owt; /* and puddings!!!1!!one! */
else if (!Is_pudding(otmp)) otmp->owt += obj->owt;
if(!has_oname(otmp) && has_oname(obj)) if(!has_oname(otmp) && has_oname(obj))
otmp = *potmp = oname(otmp, ONAME(obj)); otmp = *potmp = oname(otmp, ONAME(obj));
obj_extract_self(obj); obj_extract_self(obj);
@@ -297,6 +297,15 @@ struct obj **potmp, **pobj;
} }
#endif /*0*/ #endif /*0*/
/* handle puddings a bit differently; absorption will
* free the other object automatically so we can just
* return out from here. */
if (Is_pudding(obj)) {
pline("The %s coalesce.", makeplural(obj_typename(obj->otyp)));
obj_absorb(potmp, pobj);
return(1);
}
obfree(obj,otmp); /* free(obj), bill->otmp */ obfree(obj,otmp); /* free(obj), bill->otmp */
return(1); return(1);
} }
@@ -1800,13 +1809,12 @@ long* out_cnt;
struct obj *otmp; struct obj *otmp;
char ilet, ret; char ilet, ret;
char *invlet = flags.inv_order; char *invlet = flags.inv_order;
int n, classcount; int i, n, classcount;
winid win; /* windows being used */ winid win; /* windows being used */
static winid local_win = WIN_ERR; /* window for partial menus */ static winid local_win = WIN_ERR; /* window for partial menus */
anything any; anything any;
menu_item *selected; menu_item *selected;
struct obj **oarray; struct obj **oarray;
int i, j;
/* overriden by global flag */ /* overriden by global flag */
if (flags.perm_invent) { if (flags.perm_invent) {
@@ -2759,7 +2767,7 @@ long numused;
register struct obj *otmp; register struct obj *otmp;
boolean at_u = (obj->ox == u.ux && obj->oy == u.uy); boolean at_u = (obj->ox == u.ux && obj->oy == u.uy);
/* burn_floor_paper() keeps an object pointer that it tries to /* burn_floor_objects() keeps an object pointer that it tries to
* useupf() multiple times, so obj must survive if plural */ * useupf() multiple times, so obj must survive if plural */
if (obj->quan > numused) if (obj->quan > numused)
otmp = splitobj(obj, numused); otmp = splitobj(obj, numused);
+1 -1
View File
@@ -519,7 +519,7 @@ int spellnum;
destroy_item(SCROLL_CLASS, AD_FIRE); destroy_item(SCROLL_CLASS, AD_FIRE);
destroy_item(POTION_CLASS, AD_FIRE); destroy_item(POTION_CLASS, AD_FIRE);
destroy_item(SPBOOK_CLASS, AD_FIRE); destroy_item(SPBOOK_CLASS, AD_FIRE);
(void) burn_floor_paper(u.ux, u.uy, TRUE, FALSE); (void) burn_floor_objects(u.ux, u.uy, TRUE, FALSE);
break; break;
case CLC_LIGHTNING: case CLC_LIGHTNING:
{ {
-1
View File
@@ -879,7 +879,6 @@ fumaroles()
for (n = rn2(3)+2; n; n--) { for (n = rn2(3)+2; n; n--) {
xchar x = rn1(COLNO-4,3); xchar x = rn1(COLNO-4,3);
xchar y = rn1(ROWNO-4,3); xchar y = rn1(ROWNO-4,3);
struct trap *ttmp = t_at(x,y);
if (levl[x][y].typ == LAVAPOOL) { if (levl[x][y].typ == LAVAPOOL) {
NhRegion *r = create_gas_cloud(x,y, 4+rn2(5), rn1(10,5)); NhRegion *r = create_gas_cloud(x,y, 4+rn2(5), rn1(10,5));
clear_heros_fault(r); clear_heros_fault(r);
+137 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.5 mkobj.c $NHDT-Date: 1426465437 2015/03/16 00:23:57 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.77 $ */ /* NetHack 3.5 mkobj.c $NHDT-Date: 1428715841 2015/04/11 01:30:41 $ $NHDT-Branch: master $:$NHDT-Revision: 1.91 $ */
/* NetHack 3.5 mkobj.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.70 $ */ /* NetHack 3.5 mkobj.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.70 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -673,9 +673,18 @@ boolean artif;
otmp->quan = (long) rnd(2); otmp->quan = (long) rnd(2);
break; break;
} }
if (otmp->otyp != CORPSE && otmp->otyp != MEAT_RING && if (Is_pudding(otmp)) {
otmp->otyp != KELP_FROND && !rn2(6)) otmp->globby = 1;
otmp->known = otmp->bknown = otmp->rknown = otmp->dknown = 1;
otmp->corpsenm = PM_GRAY_OOZE + (otmp->otyp - GLOB_OF_GRAY_OOZE);
/* this ensures that they don't fail merging because of
* BUC status or other irrelevancies */
} else {
if (otmp->otyp != CORPSE && otmp->otyp != MEAT_RING
&& otmp->otyp != KELP_FROND && !rn2(6)) {
otmp->quan = 2L; otmp->quan = 2L;
}
}
break; break;
case GEM_CLASS: case GEM_CLASS:
otmp->corpsenm = 0; /* LOADSTONE hack */ otmp->corpsenm = 0; /* LOADSTONE hack */
@@ -2131,4 +2140,129 @@ check_contained(container, mesg)
} }
} }
/*
* wrapper to make "near this object" convenient
*/
struct obj*
obj_nexto(otmp)
struct obj* otmp;
{
struct obj* otmp2 = NULL;
if (otmp) {
otmp2 = obj_nexto_xy(otmp->otyp, otmp->ox, otmp->oy, otmp->o_id);
} else {
impossible("obj_nexto: wasn't given an object to check");
}
return otmp2;
}
/*
* looks for objects of a particular type next to x, y
* skips over oid if found (lets us avoid ourselves if
* we're looking for a second type of an existing object)
*
* TODO: return a list of all objects near us so we can more
* reliably predict which one we want to 'find' first
*/
struct obj*
obj_nexto_xy(otyp, x, y, oid)
int otyp, x, y;
unsigned oid;
{
struct obj* otmp;
int fx, fy, ex, ey;
short dx, dy;
/* check under our "feet" first */
otmp = sobj_at(otyp, x, y);
while (otmp) {
/* don't be clever and find ourselves */
if (otmp->o_id != oid) { return otmp; }
otmp = nxtobj(otmp, otyp, TRUE);
}
/* search in a random order */
dx = (rn2(2) ? -1 : 1);
dy = (rn2(2) ? -1 : 1);
ex = x - dx;
ey = y - dy;
for (fx = ex; abs(fx - ex) < 3; fx += dx) {
for (fy = ey; abs(fy - ey) < 3; fy += dy) {
/* 0, 0 was checked above */
if (fx != x || fy != y) {
if ((otmp = sobj_at(otyp, fx, fy)) != 0) {
return otmp;
}
}
}
}
return NULL;
}
/*
* Causes one object to absorb another, increasing
* weight accordingly. Frees obj2; obj1 remains and
* is returned.
*/
struct obj*
obj_absorb(obj1, obj2)
struct obj **obj1, **obj2;
{
struct obj *otmp1 = NULL, *otmp2 = NULL;
int extrawt = 0;
/* don't let people dumb it up */
if (obj1 && obj2) {
otmp1 = *obj1;
otmp2 = *obj2;
if (otmp1 && otmp2) {
extrawt = otmp2->oeaten ? otmp2->oeaten : otmp2->owt;
otmp1->owt += extrawt;
otmp1->oeaten += otmp1->oeaten ? extrawt : 0;
otmp1->quan = 1;
obj_extract_self(otmp2);
newsym(otmp2->ox, otmp2->oy); /* in case of floor */
dealloc_obj(otmp2);
*obj2 = NULL;
return otmp1;
}
}
impossible("obj_absorb: not called with two actual objects");
return NULL;
}
/*
* Causes the heavier object to absorb the lighter object;
* wrapper for obj_absorb so that floor_effects works more
* cleanly (since we don't know which we want to stay around)
*/
struct obj*
obj_meld(obj1, obj2)
struct obj **obj1, **obj2;
{
struct obj *otmp1 = NULL, *otmp2 = NULL;
if (obj1 && obj2) {
otmp1 = *obj1;
otmp2 = *obj2;
if (otmp1 && otmp2) {
if (otmp1->owt > otmp2->owt || rn2(2)) {
return obj_absorb(obj1, obj2);
}
return obj_absorb(obj2, obj1);
}
}
impossible("obj_meld: not called with two actual objects");
return NULL;
}
/*mkobj.c*/ /*mkobj.c*/
+25 -7
View File
@@ -1,4 +1,4 @@
/* NetHack 3.5 mon.c $NHDT-Date: 1427580482 2015/03/28 22:08:02 $ $NHDT-Branch: master $:$NHDT-Revision: 1.142 $ */ /* NetHack 3.5 mon.c $NHDT-Date: 1426470347 2015/03/16 01:45:47 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.140 $ */
/* NetHack 3.5 mon.c $Date: 2012/05/16 02:15:10 $ $Revision: 1.126 $ */ /* NetHack 3.5 mon.c $Date: 2012/05/16 02:15:10 $ $Revision: 1.126 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -149,6 +149,7 @@ unsigned corpseflags;
register struct permonst *mdat = mtmp->data; register struct permonst *mdat = mtmp->data;
int num; int num;
struct obj *obj = (struct obj *)0; struct obj *obj = (struct obj *)0;
struct obj* otmp = (struct obj*)0;
int x = mtmp->mx, y = mtmp->my; int x = mtmp->mx, y = mtmp->my;
int mndx = monsndx(mdat); int mndx = monsndx(mdat);
unsigned corpstatflags = corpseflags; unsigned corpstatflags = corpseflags;
@@ -268,6 +269,24 @@ unsigned corpseflags;
obj = mksobj_at(SCR_BLANK_PAPER, x, y, TRUE, FALSE); obj = mksobj_at(SCR_BLANK_PAPER, x, y, TRUE, FALSE);
free_mname(mtmp); free_mname(mtmp);
break; break;
/* expired puddings will congeal into a large blob
like dragons, relies on the order remaining consistent */
case PM_GRAY_OOZE:
case PM_BROWN_PUDDING:
case PM_GREEN_SLIME:
case PM_BLACK_PUDDING:
/* we have to do this here because most other places
* expect there to be an object coming back; not this one */
obj = mksobj_at(GLOB_OF_BLACK_PUDDING - (PM_BLACK_PUDDING - mndx),
x, y, TRUE, FALSE);
while ((obj && (otmp = obj_nexto(obj)) != (struct obj*)0)) {
pline("The %s coalesce.", makeplural(obj_typename(obj->otyp)));
obj = obj_meld(&obj, &otmp);
}
free_mname(mtmp);
return obj;
break;
default_1: default_1:
default: default:
if (mvitals[mndx].mvflags & G_NOCORPSE) if (mvitals[mndx].mvflags & G_NOCORPSE)
@@ -1677,7 +1696,6 @@ boolean was_swallowed; /* digestion */
is_golem(mdat) || is_mplayer(mdat) || is_rider(mdat)) is_golem(mdat) || is_mplayer(mdat) || is_rider(mdat))
return TRUE; return TRUE;
tmp = 2 + ((mdat->geno & G_FREQ) < 2) + verysmall(mdat); tmp = 2 + ((mdat->geno & G_FREQ) < 2) + verysmall(mdat);
if (mon->mcloned) tmp += mvitals[monsndx(mdat)].died / 25;
return (boolean) !rn2(tmp); return (boolean) !rn2(tmp);
} }
@@ -1941,13 +1959,13 @@ int dest;
int otyp; int otyp;
/* illogical but traditional "treasure drop" */ /* illogical but traditional "treasure drop" */
if (!rn2(6) && !(mvitals[mndx].mvflags & G_NOCORPSE) && if (!rn2(6) && !(mvitals[mndx].mvflags & G_NOCORPSE)
/* no extra item from swallower or steed */ /* no extra item from swallower or steed */
(x != u.ux || y != u.uy) && && (x != u.ux || y != u.uy)
/* no extra item from kops--too easy to abuse */ /* no extra item from kops--too easy to abuse */
mdat->mlet != S_KOP && && mdat->mlet != S_KOP
/* reduced chance of item from cloned monster */ /* no items from cloned monsters */
(!mtmp->mcloned || !rn2(mvitals[mndx].died / 5 + 1))) { && !mtmp->mcloned) {
otmp = mkobj(RANDOM_CLASS, TRUE); otmp = mkobj(RANDOM_CLASS, TRUE);
/* don't create large objects from small monsters */ /* don't create large objects from small monsters */
otyp = otmp->otyp; otyp = otmp->otyp;
+4 -4
View File
@@ -1820,7 +1820,7 @@ struct permonst _mons2[] = {
* Puddings * Puddings
*/ */
MON("gray ooze", S_PUDDING, MON("gray ooze", S_PUDDING,
LVL(3, 1, 8, 0, 0), (G_GENO|2), LVL(3, 1, 8, 0, 0), (G_GENO|G_NOCORPSE|2),
A(ATTK(AT_BITE, AD_RUST, 2, 8), A(ATTK(AT_BITE, AD_RUST, 2, 8),
NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK),
SIZ(500, 250, MS_SILENT, MZ_MEDIUM), SIZ(500, 250, MS_SILENT, MZ_MEDIUM),
@@ -1829,7 +1829,7 @@ struct permonst _mons2[] = {
M1_MINDLESS|M1_OMNIVORE|M1_ACID, M1_MINDLESS|M1_OMNIVORE|M1_ACID,
M2_HOSTILE|M2_NEUTER, 0, CLR_GRAY), M2_HOSTILE|M2_NEUTER, 0, CLR_GRAY),
MON("brown pudding", S_PUDDING, MON("brown pudding", S_PUDDING,
LVL(5, 3, 8, 0, 0), (G_GENO|1), LVL(5, 3, 8, 0, 0), (G_GENO|G_NOCORPSE|1),
A(ATTK(AT_BITE, AD_DCAY, 0, 0), A(ATTK(AT_BITE, AD_DCAY, 0, 0),
NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK),
SIZ(500, 250, MS_SILENT, MZ_MEDIUM), SIZ(500, 250, MS_SILENT, MZ_MEDIUM),
@@ -1838,7 +1838,7 @@ struct permonst _mons2[] = {
M1_MINDLESS|M1_OMNIVORE|M1_ACID, M1_MINDLESS|M1_OMNIVORE|M1_ACID,
M2_HOSTILE|M2_NEUTER, 0, CLR_BROWN), M2_HOSTILE|M2_NEUTER, 0, CLR_BROWN),
MON("green slime", S_PUDDING, MON("green slime", S_PUDDING,
LVL(6, 6, 6, 0, 0), (G_HELL|G_GENO|1), LVL(6, 6, 6, 0, 0), (G_HELL|G_GENO|G_NOCORPSE|1),
A(ATTK(AT_TUCH, AD_SLIM, 1, 4), ATTK(AT_NONE, AD_SLIM, 0, 0), A(ATTK(AT_TUCH, AD_SLIM, 1, 4), ATTK(AT_NONE, AD_SLIM, 0, 0),
NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK),
SIZ(400, 150, MS_SILENT, MZ_LARGE), SIZ(400, 150, MS_SILENT, MZ_LARGE),
@@ -1847,7 +1847,7 @@ struct permonst _mons2[] = {
M1_MINDLESS|M1_OMNIVORE|M1_ACID|M1_POIS, M1_MINDLESS|M1_OMNIVORE|M1_ACID|M1_POIS,
M2_HOSTILE|M2_NEUTER, 0, CLR_GREEN), M2_HOSTILE|M2_NEUTER, 0, CLR_GREEN),
MON("black pudding", S_PUDDING, MON("black pudding", S_PUDDING,
LVL(10, 6, 6, 0, 0), (G_GENO|1), LVL(10, 6, 6, 0, 0), (G_GENO|G_NOCORPSE|1),
A(ATTK(AT_BITE, AD_CORR, 3, 8), ATTK(AT_NONE, AD_CORR, 0, 0), A(ATTK(AT_BITE, AD_CORR, 3, 8), ATTK(AT_NONE, AD_CORR, 0, 0),
NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK),
SIZ(900, 250, MS_SILENT, MZ_LARGE), SIZ(900, 250, MS_SILENT, MZ_LARGE),
+10 -4
View File
@@ -1,5 +1,4 @@
/* NetHack 3.5 objects.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ /* NetHack 3.5 objects.c $NHDT-Date: 1428802519 2015/04/12 01:35:19 $ $NHDT-Branch: master $:$NHDT-Revision: 1.34 $ */
/* NetHack 3.5 objects.c $Date: 2011/07/28 04:00:20 $ $Revision: 1.23 $ */
/* Copyright (c) Mike Threepoint, 1989. */ /* Copyright (c) Mike Threepoint, 1989. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -374,9 +373,9 @@ ARMOR("splint mail", (char *)0,
ARMOR("banded mail", (char *)0, ARMOR("banded mail", (char *)0,
1, 0, 1, 0, 72, 5, 350, 90, 4, 1, ARM_SUIT, IRON, HI_METAL), 1, 0, 1, 0, 72, 5, 350, 90, 4, 1, ARM_SUIT, IRON, HI_METAL),
ARMOR("dwarvish mithril-coat", (char *)0, ARMOR("dwarvish mithril-coat", (char *)0,
1, 0, 0, 0, 10, 1, 150, 240, 4, 2, ARM_SUIT, MITHRIL, HI_METAL), 1, 0, 0, 0, 10, 1, 150, 240, 4, 2, ARM_SUIT, MITHRIL, HI_SILVER),
ARMOR("elven mithril-coat", (char *)0, ARMOR("elven mithril-coat", (char *)0,
1, 0, 0, 0, 15, 1, 150, 240, 5, 2, ARM_SUIT, MITHRIL, HI_METAL), 1, 0, 0, 0, 15, 1, 150, 240, 5, 2, ARM_SUIT, MITHRIL, HI_SILVER),
ARMOR("chain mail", (char *)0, ARMOR("chain mail", (char *)0,
1, 0, 0, 0, 72, 5, 300, 75, 5, 1, ARM_SUIT, IRON, HI_METAL), 1, 0, 0, 0, 72, 5, 300, 75, 5, 1, ARM_SUIT, IRON, HI_METAL),
ARMOR("orcish chain mail", "crude chain mail", ARMOR("orcish chain mail", "crude chain mail",
@@ -670,11 +669,18 @@ FOOD("egg", 85, 1, 1, 1, FLESH, 80, CLR_WHITE),
FOOD("meatball", 0, 1, 1, 0, FLESH, 5, CLR_BROWN), FOOD("meatball", 0, 1, 1, 0, FLESH, 5, CLR_BROWN),
FOOD("meat stick", 0, 1, 1, 0, FLESH, 5, CLR_BROWN), FOOD("meat stick", 0, 1, 1, 0, FLESH, 5, CLR_BROWN),
FOOD("huge chunk of meat", 0,20,400, 0, FLESH,2000, CLR_BROWN), FOOD("huge chunk of meat", 0,20,400, 0, FLESH,2000, CLR_BROWN),
/* special case because it's not mergable */ /* special case because it's not mergable */
OBJECT(OBJ("meat ring", (char *)0), OBJECT(OBJ("meat ring", (char *)0),
BITS(1,0,0,0,0,0,0,0,0,0,0,0,FLESH), BITS(1,0,0,0,0,0,0,0,0,0,0,0,FLESH),
0, FOOD_CLASS, 0, 1, 5, 1, 0, 0, 0, 0, 5, CLR_BROWN), 0, FOOD_CLASS, 0, 1, 5, 1, 0, 0, 0, 0, 5, CLR_BROWN),
/* pudding 'corpses' will turn into these and combine */
FOOD("glob of gray ooze", 0, 2, 20, 0, FLESH, 20, CLR_GRAY),
FOOD("glob of brown pudding", 0, 2, 20, 0, FLESH, 20, CLR_BROWN),
FOOD("glob of green slime", 0, 2, 20, 0, FLESH, 20, CLR_GREEN),
FOOD("glob of black pudding", 0, 2, 20, 0, FLESH, 20, CLR_BLACK),
/* fruits & veggies */ /* fruits & veggies */
FOOD("kelp frond", 0, 1, 1, 0, VEGGY, 30, CLR_GREEN), FOOD("kelp frond", 0, 1, 1, 0, VEGGY, 30, CLR_GREEN),
FOOD("eucalyptus leaf", 3, 1, 1, 0, VEGGY, 30, CLR_GREEN), FOOD("eucalyptus leaf", 3, 1, 1, 0, VEGGY, 30, CLR_GREEN),
+36 -9
View File
@@ -1,5 +1,4 @@
/* NetHack 3.5 objnam.c $NHDT-Date: 1428196817 2015/04/05 01:20:17 $ $NHDT-Branch: nhmall-booktribute $:$NHDT-Revision: 1.120 $ */ /* NetHack 3.5 objnam.c $NHDT-Date: 1426470349 2015/03/16 01:45:49 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.108 $ */
/* NetHack 3.5 objnam.c $Date: 2011/10/27 02:24:54 $ $Revision: 1.101 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -383,6 +382,14 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */
} }
break; break;
} }
if (Is_pudding(obj)) {
Sprintf(buf, "%s%s",
obj->owt < 100 ? "small "
: obj->owt > 500 ? "very large "
: obj->owt > 300 ? "large "
: "", actualn);
break;
}
Strcpy(buf, actualn); Strcpy(buf, actualn);
if (typ == TIN && known) if (typ == TIN && known)
@@ -459,18 +466,17 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */
break; break;
case SPBOOK_CLASS: case SPBOOK_CLASS:
if (typ == SPE_NOVEL) { /* 3.6 tribute */ if (typ == SPE_NOVEL) { /* 3.6 tribute */
if (!dknown) { if (!dknown)
Strcpy(buf, "book"); Strcpy(buf, "book");
} else if (nn) { else if (nn)
Strcpy(buf, actualn); Strcpy(buf, actualn);
} else if (un) { else if (un)
Sprintf(buf, "novel called %s", un); Sprintf(buf, "novel called %s", un);
} else else
Sprintf(buf, "%s book", dn); Sprintf(buf, "%s book", dn);
break; break;
} else
/* end of tribute */ /* end of tribute */
if (!dknown) { } else if (!dknown) {
Strcpy(buf, "spellbook"); Strcpy(buf, "spellbook");
} else if (nn) { } else if (nn) {
if (typ != SPE_BOOK_OF_THE_DEAD) if (typ != SPE_BOOK_OF_THE_DEAD)
@@ -953,6 +959,12 @@ ring:
Strcpy(prefix, "an "); Strcpy(prefix, "an ");
Strcpy(prefix+3, tmpbuf+2); Strcpy(prefix+3, tmpbuf+2);
} }
/* show weight for items (debug tourist info)
* aum is stolen from Crawl's "Arbitrary Unit of Measure" */
if (wizard) {
Sprintf(eos(bp), " (%d aum)", obj->owt);
}
bp = strprepend(bp, prefix); bp = strprepend(bp, prefix);
return(bp); return(bp);
} }
@@ -2517,6 +2529,20 @@ struct obj *no_wish;
bp += 8; bp += 8;
} }
/* intercept pudding globs here; they're a valid wish target,
* but we need them to not get treated like a corpse.
*
* also don't let player wish for multiple globs.
*/
if ((p = strstri(bp, "glob of ")) != 0
|| (p = strstri(bp, "globs of ")) != 0) {
int globoffset = (*(p+4) == 's') ? 9 : 8;
if ((mntmp = name_to_mon(p + globoffset)) >= PM_GRAY_OOZE
&& mntmp <= PM_BLACK_PUDDING) {
mntmp = NON_PM; /* lie to ourselves */
cnt = 0; /* force only one */
}
} else {
/* /*
* Find corpse type using "of" (figurine of an orc, tin of orc meat) * Find corpse type using "of" (figurine of an orc, tin of orc meat)
* Don't check if it's a wand or spellbook. * Don't check if it's a wand or spellbook.
@@ -2534,6 +2560,7 @@ struct obj *no_wish;
&& (mntmp = name_to_mon(p + 4)) >= LOW_PM) && (mntmp = name_to_mon(p + 4)) >= LOW_PM)
*p = 0; *p = 0;
} }
}
/* Find corpse type w/o "of" (red dragon scale mail, yeti corpse) */ /* Find corpse type w/o "of" (red dragon scale mail, yeti corpse) */
if (strncmpi(bp, "samurai sword", 13)) /* not the "samurai" monster! */ if (strncmpi(bp, "samurai sword", 13)) /* not the "samurai" monster! */
if (strncmpi(bp, "wizard lock", 11)) /* not the "wizard" monster! */ if (strncmpi(bp, "wizard lock", 11)) /* not the "wizard" monster! */
@@ -3244,7 +3271,7 @@ typfnd:
otmp = oname(otmp, name); otmp = oname(otmp, name);
if (otmp->oartifact) { if (otmp->oartifact) {
otmp->quan = 1L; otmp->quan = 1L;
u.uconduct.wisharti++; u.uconduct.wisharti++; /* KMH, conduct */
} }
} }
+2 -2
View File
@@ -708,7 +708,7 @@ menu_item **pick_list; /* return list of items picked */
int how; /* type of query */ int how; /* type of query */
boolean FDECL((*allow), (OBJ_P));/* allow function */ boolean FDECL((*allow), (OBJ_P));/* allow function */
{ {
int i, j, n; int i, n;
winid win; winid win;
struct obj *curr, *last, fake_hero_object; struct obj *curr, *last, fake_hero_object;
struct obj **oarray; struct obj **oarray;
@@ -823,7 +823,7 @@ boolean FDECL((*allow), (OBJ_P));/* allow function */
if (n > 0) { if (n > 0) {
menu_item *mi; menu_item *mi;
int i, k; int k;
/* fix up counts: -1 means no count used => pick all; /* fix up counts: -1 means no count used => pick all;
if fake_hero_object was picked, discard that choice */ if fake_hero_object was picked, discard that choice */
+8 -1
View File
@@ -502,6 +502,13 @@ register struct obj *otmp;
else otmp->spe = fruitadd(oldf->fname, (struct fruit *)0); else otmp->spe = fruitadd(oldf->fname, (struct fruit *)0);
} }
#ifdef SYSCF
#define SYSOPT_CHECK_SAVE_UID sysopt.check_save_uid
#else
#define SYSOPT_CHECK_SAVE_UID TRUE
#endif
STATIC_OVL STATIC_OVL
boolean boolean
restgamestate(fd, stuckid, steedid) restgamestate(fd, stuckid, steedid)
@@ -517,7 +524,7 @@ unsigned int *stuckid, *steedid;
unsigned long uid; unsigned long uid;
mread(fd, (genericptr_t) &uid, sizeof uid); mread(fd, (genericptr_t) &uid, sizeof uid);
if (uid != (unsigned long)getuid()) { /* strange ... */ if (SYSOPT_CHECK_SAVE_UID && uid != (unsigned long)getuid()) { /* strange ... */
/* for wizard mode, issue a reminder; for others, treat it /* for wizard mode, issue a reminder; for others, treat it
as an attempt to cheat and refuse to restore this file */ as an attempt to cheat and refuse to restore this file */
pline("Saved game was not yours."); pline("Saved game was not yours.");
+11 -2
View File
@@ -15,6 +15,11 @@
#include "sp_lev.h" #include "sp_lev.h"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4244)
#endif
typedef void (*select_iter_func)(int, int, genericptr_t); typedef void (*select_iter_func)(int, int, genericptr_t);
extern void FDECL(mkmap, (lev_init *)); extern void FDECL(mkmap, (lev_init *));
@@ -5032,7 +5037,7 @@ sp_lev *lvl;
break; break;
case SPO_SEL_LINE: case SPO_SEL_LINE:
{ {
struct opvar *tmp, *tmp2, *pt = selection_opvar(NULL); struct opvar *tmp = NULL, *tmp2 = NULL, *pt = selection_opvar(NULL);
schar x1,y1,x2,y2; schar x1,y1,x2,y2;
if (!OV_pop_c(tmp)) panic("no ter sel linecoord1"); if (!OV_pop_c(tmp)) panic("no ter sel linecoord1");
if (!OV_pop_c(tmp2)) panic("no ter sel linecoord2"); if (!OV_pop_c(tmp2)) panic("no ter sel linecoord2");
@@ -5050,7 +5055,7 @@ sp_lev *lvl;
break; break;
case SPO_SEL_RNDLINE: case SPO_SEL_RNDLINE:
{ {
struct opvar *tmp, *tmp2, *tmp3, *pt = selection_opvar(NULL); struct opvar *tmp = NULL, *tmp2 = NULL, *tmp3, *pt = selection_opvar(NULL);
schar x1,y1,x2,y2; schar x1,y1,x2,y2;
if (!OV_pop_i(tmp3)) panic("no ter sel randline1"); if (!OV_pop_i(tmp3)) panic("no ter sel randline1");
if (!OV_pop_c(tmp)) panic("no ter sel randline2"); if (!OV_pop_c(tmp)) panic("no ter sel randline2");
@@ -5222,4 +5227,8 @@ const char *name;
} }
#ifdef _MSC_VER
#pragma warning(pop)
#endif
/*sp_lev.c*/ /*sp_lev.c*/
+1
View File
@@ -67,6 +67,7 @@ sys_early_init()
# endif # endif
#endif #endif
sysopt.check_save_uid = 1;
sysopt.seduce = 1; /* if it's compiled in, default to on */ sysopt.seduce = 1; /* if it's compiled in, default to on */
sysopt_seduce_set(sysopt.seduce); sysopt_seduce_set(sysopt.seduce);
} }
+3 -3
View File
@@ -2215,7 +2215,7 @@ glovecheck: target = which_armor(mtmp, W_ARMG);
(void) destroy_mitem(mtmp, SPBOOK_CLASS, AD_FIRE); (void) destroy_mitem(mtmp, SPBOOK_CLASS, AD_FIRE);
(void) destroy_mitem(mtmp, POTION_CLASS, AD_FIRE); (void) destroy_mitem(mtmp, POTION_CLASS, AD_FIRE);
} }
if (burn_floor_paper(mtmp->mx, mtmp->my, see_it, FALSE) && if (burn_floor_objects(mtmp->mx, mtmp->my, see_it, FALSE) &&
!see_it && distu(mtmp->mx, mtmp->my) <= 3*3) !see_it && distu(mtmp->mx, mtmp->my) <= 3*3)
You("smell smoke."); You("smell smoke.");
if (is_ice(mtmp->mx,mtmp->my)) if (is_ice(mtmp->mx,mtmp->my))
@@ -2853,7 +2853,7 @@ struct obj *box; /* null for floor trap */
boolean see_it = !Blind; boolean see_it = !Blind;
int num, alt; int num, alt;
/* Bug: for box case, the equivalent of burn_floor_paper() ought /* Bug: for box case, the equivalent of burn_floor_objects() ought
* to be done upon its contents. * to be done upon its contents.
*/ */
@@ -2898,7 +2898,7 @@ struct obj *box; /* null for floor trap */
destroy_item(SPBOOK_CLASS, AD_FIRE); destroy_item(SPBOOK_CLASS, AD_FIRE);
destroy_item(POTION_CLASS, AD_FIRE); destroy_item(POTION_CLASS, AD_FIRE);
} }
if (!box && burn_floor_paper(u.ux, u.uy, see_it, TRUE) && !see_it) if (!box && burn_floor_objects(u.ux, u.uy, see_it, TRUE) && !see_it)
You("smell paper burning."); You("smell paper burning.");
if (is_ice(u.ux, u.uy)) if (is_ice(u.ux, u.uy))
melt_ice(u.ux, u.uy, (char *)0); melt_ice(u.ux, u.uy, (char *)0);
+10 -22
View File
@@ -1,4 +1,4 @@
/* NetHack 3.5 vision.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ /* NetHack 3.5 vision.c $NHDT-Date: 1426449474 2015/03/15 19:57:54 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.14 $ */
/* NetHack 3.5 vision.c $Date: 2009/05/06 10:48:10 $ $Revision: 1.12 $ */ /* NetHack 3.5 vision.c $Date: 2009/05/06 10:48:10 $ $Revision: 1.12 $ */
/* SCCS Id: @(#)vision.c 3.5 2007/11/05 */ /* SCCS Id: @(#)vision.c 3.5 2007/11/05 */
/* Copyright (c) Dean Luick, with acknowledgements to Dave Cohrs, 1990. */ /* Copyright (c) Dean Luick, with acknowledgements to Dave Cohrs, 1990. */
@@ -499,7 +499,7 @@ vision_recalc(control)
char *next_rmin; /* min pointer for the new array */ char *next_rmin; /* min pointer for the new array */
char *next_rmax; /* max pointer for the new array */ char *next_rmax; /* max pointer for the new array */
char *ranges; /* circle ranges -- used for xray & night vision */ char *ranges; /* circle ranges -- used for xray & night vision */
int row; /* row counter (outer loop) */ int row = 0; /* row counter (outer loop) */
int start, stop; /* inner loop starting/stopping index */ int start, stop; /* inner loop starting/stopping index */
int dx, dy; /* one step from a lit door or lit wall (see below) */ int dx, dy; /* one step from a lit door or lit wall (see below) */
register int col; /* inner loop counter */ register int col; /* inner loop counter */
@@ -513,10 +513,6 @@ vision_recalc(control)
vision_full_recalc = 0; /* reset flag */ vision_full_recalc = 0; /* reset flag */
if (in_mklev || !iflags.vision_inited) return; if (in_mklev || !iflags.vision_inited) return;
#ifdef GCC_WARN
row = 0;
#endif
/* /*
* Either the light sources have been taken care of, or we must * Either the light sources have been taken care of, or we must
* recalculate them here. * recalculate them here.
@@ -1655,18 +1651,15 @@ right_side(row, cb_row, cb_col, fb_row, fb_col, left, right_mark, limits)
char *limits; /* points at range limit for current row, or NULL */ char *limits; /* points at range limit for current row, or NULL */
{ {
register int i; register int i;
register char *rowp; register char *rowp = NULL;
int hit_stone = 0; int hit_stone = 0;
int left_shadow, right_shadow, loc_right; int left_shadow, right_shadow, loc_right;
int lblock_col; /* local block column (current row) */ int lblock_col; /* local block column (current row) */
int nrow, deeper; int nrow, deeper;
char *row_min; /* left most */ char *row_min = NULL; /* left most */
char *row_max; /* right most */ char *row_max = NULL; /* right most */
int lim_max; /* right most limit of circle */ int lim_max; /* right most limit of circle */
#ifdef GCC_WARN
rowp = 0;
#endif
nrow = row + step; nrow = row + step;
deeper = good_row(nrow) && (!limits || (*limits >= *(limits+1))); deeper = good_row(nrow) && (!limits || (*limits >= *(limits+1)));
if(!vis_func) { if(!vis_func) {
@@ -1910,18 +1903,15 @@ left_side(row, cb_row, cb_col, fb_row, fb_col, left_mark, right, limits)
char *limits; char *limits;
{ {
register int i; register int i;
register char *rowp; register char *rowp = NULL;
int hit_stone = 0; int hit_stone = 0;
int left_shadow, right_shadow, loc_left; int left_shadow, right_shadow, loc_left;
int lblock_col; /* local block column (current row) */ int lblock_col; /* local block column (current row) */
int nrow, deeper; int nrow, deeper;
char *row_min; /* left most */ char *row_min = NULL; /* left most */
char *row_max; /* right most */ char *row_max = NULL; /* right most */
int lim_min; int lim_min;
#ifdef GCC_WARN
rowp = 0;
#endif
nrow = row + step; nrow = row + step;
deeper = good_row(nrow) && (!limits || (*limits >= *(limits+1))); deeper = good_row(nrow) && (!limits || (*limits >= *(limits+1)));
if(!vis_func) { if(!vis_func) {
@@ -2203,9 +2193,6 @@ right_side(row, left, right_mark, limits)
char *row_max = NULL; /* right most [used by macro set_max()] */ char *row_max = NULL; /* right most [used by macro set_max()] */
int lim_max; /* right most limit of circle */ int lim_max; /* right most limit of circle */
#ifdef GCC_WARN
rowp = row_min = row_max = 0;
#endif
nrow = row + step; nrow = row + step;
/* /*
* Can go deeper if the row is in bounds and the next row is within * Can go deeper if the row is in bounds and the next row is within
@@ -2375,7 +2362,8 @@ left_side(row, left_mark, right, limits)
int left, left_edge, nrow, deeper, result; int left, left_edge, nrow, deeper, result;
register int i; register int i;
register char *rowp = NULL; register char *rowp = NULL;
char *row_min = NULL, *row_max = NULL; char *row_min = NULL;
char *row_max = NULL;
int lim_min; int lim_min;
#ifdef GCC_WARN #ifdef GCC_WARN
+26 -7
View File
@@ -2124,6 +2124,7 @@ boolean ordinary;
destroy_item(SCROLL_CLASS, AD_FIRE); destroy_item(SCROLL_CLASS, AD_FIRE);
destroy_item(POTION_CLASS, AD_FIRE); destroy_item(POTION_CLASS, AD_FIRE);
destroy_item(SPBOOK_CLASS, AD_FIRE); destroy_item(SPBOOK_CLASS, AD_FIRE);
destroy_item(FOOD_CLASS, AD_FIRE); /* only slime for now */
break; break;
case WAN_COLD: case WAN_COLD:
@@ -3329,6 +3330,7 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */
if (!rn2(3)) (void)destroy_mitem(mon, POTION_CLASS, AD_FIRE); if (!rn2(3)) (void)destroy_mitem(mon, POTION_CLASS, AD_FIRE);
if (!rn2(3)) (void)destroy_mitem(mon, SCROLL_CLASS, AD_FIRE); if (!rn2(3)) (void)destroy_mitem(mon, SCROLL_CLASS, AD_FIRE);
if (!rn2(5)) (void)destroy_mitem(mon, SPBOOK_CLASS, AD_FIRE); if (!rn2(5)) (void)destroy_mitem(mon, SPBOOK_CLASS, AD_FIRE);
destroy_mitem(mon, FOOD_CLASS, AD_FIRE); /* carried slime */
} }
break; break;
case ZT_COLD: case ZT_COLD:
@@ -3473,6 +3475,7 @@ xchar sx, sy;
if (!rn2(3)) destroy_item(POTION_CLASS, AD_FIRE); if (!rn2(3)) destroy_item(POTION_CLASS, AD_FIRE);
if (!rn2(3)) destroy_item(SCROLL_CLASS, AD_FIRE); if (!rn2(3)) destroy_item(SCROLL_CLASS, AD_FIRE);
if (!rn2(5)) destroy_item(SPBOOK_CLASS, AD_FIRE); if (!rn2(5)) destroy_item(SPBOOK_CLASS, AD_FIRE);
destroy_item(FOOD_CLASS, AD_FIRE);
} }
break; break;
case ZT_COLD: case ZT_COLD:
@@ -3569,11 +3572,11 @@ xchar sx, sy;
} }
/* /*
* burn scrolls and spellbooks on floor at position x,y * burn objects (such as scrolls and spellbooks) on floor
* return the number of scrolls and spellbooks burned * at position x,y; return the number of objects burned
*/ */
int int
burn_floor_paper(x, y, give_feedback, u_caused) burn_floor_objects(x, y, give_feedback, u_caused)
int x, y; int x, y;
boolean give_feedback; /* caller needs to decide about visibility checks */ boolean give_feedback; /* caller needs to decide about visibility checks */
boolean u_caused; boolean u_caused;
@@ -3585,7 +3588,9 @@ boolean u_caused;
for (obj = level.objects[x][y]; obj; obj = obj2) { for (obj = level.objects[x][y]; obj; obj = obj2) {
obj2 = obj->nexthere; obj2 = obj->nexthere;
if (obj->oclass == SCROLL_CLASS || obj->oclass == SPBOOK_CLASS) { if (obj->oclass == SCROLL_CLASS || obj->oclass == SPBOOK_CLASS
|| (obj->oclass == FOOD_CLASS
&& obj->otyp == GLOB_OF_GREEN_SLIME)) {
if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL || if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL ||
obj_resists(obj, 2, 100)) obj_resists(obj, 2, 100))
continue; continue;
@@ -4255,7 +4260,7 @@ short exploding_wand_typ;
} }
if(OBJ_AT(x, y) && abstype == ZT_FIRE) if(OBJ_AT(x, y) && abstype == ZT_FIRE)
if (burn_floor_paper(x, y, FALSE, type > 0) && couldsee(x, y)) { if (burn_floor_objects(x, y, FALSE, type > 0) && couldsee(x, y)) {
newsym(x,y); newsym(x,y);
You("%s of smoke.", You("%s of smoke.",
!Blind ? "see a puff" : "smell a whiff"); !Blind ? "see a puff" : "smell a whiff");
@@ -4394,7 +4399,9 @@ register int osym, dmgtyp;
} else skip++; } else skip++;
break; break;
case AD_FIRE: case AD_FIRE:
xresist = (Fire_resistance && obj->oclass != POTION_CLASS); xresist = (Fire_resistance
&& obj->oclass != POTION_CLASS
&& obj->otyp != GLOB_OF_GREEN_SLIME);
if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL) if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL)
skip++; skip++;
@@ -4418,6 +4425,12 @@ register int osym, dmgtyp;
dindx = 4; dindx = 4;
dmg = 1; dmg = 1;
break; break;
case FOOD_CLASS:
if (obj->otyp == GLOB_OF_GREEN_SLIME) {
dindx = obj->owt / 20;
dmg = 1;
} else { skip++; }
break;
default: default:
skip++; skip++;
break; break;
@@ -4456,7 +4469,7 @@ register int osym, dmgtyp;
if(!rn2(3)) cnt++; if(!rn2(3)) cnt++;
if(!cnt) continue; if(!cnt) continue;
mult = (cnt == quan) ? "Your" : mult = (cnt == quan) ? (quan > 1) ? "All of your " : "Your" :
(cnt == 1L) ? "One of your" : "Some of your"; (cnt == 1L) ? "One of your" : "Some of your";
pline("%s %s %s!", mult, xname(obj), pline("%s %s %s!", mult, xname(obj),
destroy_strings[dindx][(cnt > 1L)]); destroy_strings[dindx][(cnt > 1L)]);
@@ -4546,6 +4559,12 @@ int osym, dmgtyp;
dindx = 4; dindx = 4;
tmp++; tmp++;
break; break;
case FOOD_CLASS:
if (obj->otyp == GLOB_OF_GREEN_SLIME) {
dindx = obj->owt / 20;
tmp++;
} else { skip++; }
break;
default: default:
skip++; skip++;
break; break;
+806 -816
View File
File diff suppressed because it is too large Load Diff
+1199 -1097
View File
File diff suppressed because it is too large Load Diff
+28 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.5 pcmain.c $NHDT-Date: 1426966701 2015/03/21 19:38:21 $ $NHDT-Branch: master $:$NHDT-Revision: 1.51 $ */ /* NetHack 3.5 pcmain.c $NHDT-Date: 1427337317 2015/03/26 02:35:17 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.52 $ */
/* NetHack 3.5 pcmain.c $Date: 2012/01/20 03:41:31 $ $Revision: 1.48 $ */ /* NetHack 3.5 pcmain.c $Date: 2012/01/20 03:41:31 $ $Revision: 1.48 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -109,6 +109,8 @@ char *argv[];
register int fd; register int fd;
register char *dir; register char *dir;
#if defined(WIN32) #if defined(WIN32)
char* envp = NULL;
char* sptr = NULL;
char fnamebuf[BUFSZ], encodedfnamebuf[BUFSZ]; char fnamebuf[BUFSZ], encodedfnamebuf[BUFSZ];
boolean save_getreturn_status = getreturn_enabled; boolean save_getreturn_status = getreturn_enabled;
#endif #endif
@@ -162,6 +164,31 @@ char *argv[];
append_slash(fqn_prefix[0]); append_slash(fqn_prefix[0]);
for (prefcnt = 1; prefcnt < PREFIX_COUNT; prefcnt++) for (prefcnt = 1; prefcnt < PREFIX_COUNT; prefcnt++)
fqn_prefix[prefcnt] = fqn_prefix[0]; fqn_prefix[prefcnt] = fqn_prefix[0];
# if defined(WIN32) || defined(MSDOS)
/* sysconf should be searched for in this location */
envp = nh_getenv("COMMONPROGRAMFILES");
if (envp) {
if ((sptr = index(envp, ';')) != 0) *sptr = '\0';
if (strlen(envp) > 0) {
fqn_prefix[SYSCONFPREFIX] = (char *)alloc(strlen(envp) + 10);
Strcpy(fqn_prefix[SYSCONFPREFIX], envp);
append_slash(fqn_prefix[SYSCONFPREFIX]);
Strcat(fqn_prefix[SYSCONFPREFIX], "NetHack\\");
}
}
/* user's home directory should default to this - unless overridden */
envp = nh_getenv("USERPROFILE");
if (envp) {
if ((sptr = index(envp, ';')) != 0) *sptr = '\0';
if (strlen(envp) > 0) {
fqn_prefix[CONFIGPREFIX] = (char *)alloc(strlen(envp)+2);
Strcpy(fqn_prefix[CONFIGPREFIX], envp);
append_slash(fqn_prefix[CONFIGPREFIX]);
}
}
# endif
} }
#endif #endif
#if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS) #if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS)
+3
View File
@@ -35,6 +35,9 @@ MAXPLAYERS=10
# Uncomment the next line to disable the SEDUCE option. # Uncomment the next line to disable the SEDUCE option.
#SEDUCE=0 #SEDUCE=0
# Uncomment to disable savefile UID checking.
#CHECK_SAVE_UID=0
# Record (high score) file options. # Record (high score) file options.
# CAUTION: changing these after people have started playing games can # CAUTION: changing these after people have started playing games can
# lead to lost high scores! # lead to lost high scores!
+19 -12
View File
@@ -1,4 +1,4 @@
/* NetHack 3.5 winmenu.c $NHDT-Date: 1427881480 2015/04/01 09:44:40 $ $NHDT-Branch: master $:$NHDT-Revision: 1.5 $ */ /* NetHack 3.5 winmenu.c $NHDT-Date: 1428828477 2015/04/12 08:47:57 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */
/* NetHack 3.5 winmenu.c $Date: 2009/05/06 10:55:53 $ $Revision: 1.5 $ */ /* NetHack 3.5 winmenu.c $Date: 2009/05/06 10:55:53 $ $Revision: 1.5 $ */
/* SCCS Id: @(#)winmenu.c 3.5 1996/08/15 */ /* SCCS Id: @(#)winmenu.c 3.5 1996/08/15 */
/* Copyright (c) Dean Luick, 1992 */ /* Copyright (c) Dean Luick, 1992 */
@@ -249,9 +249,13 @@ menu_key(w, event, params, num_params)
return; return;
} else if (ch == MENU_SEARCH) { /* search */ } else if (ch == MENU_SEARCH) { /* search */
if (menu_info->how == PICK_ANY || menu_info->how == PICK_ONE) { if (menu_info->how == PICK_ANY || menu_info->how == PICK_ONE) {
char buf[BUFSZ]; char buf[BUFSZ+2], tmpbuf[BUFSZ];
X11_getlin("Search for:", buf);
if (!*buf || *buf == '\033') return; X11_getlin("Search for:", tmpbuf);
if (!*tmpbuf || *tmpbuf == '\033') return;
/* convert "string" into "*string*" for use with pmatch() */
Sprintf(buf, "*%s*", tmpbuf);
if (menu_info->how == PICK_ANY) { if (menu_info->how == PICK_ANY) {
invert_match(wp, buf); invert_match(wp, buf);
return; return;
@@ -395,10 +399,12 @@ menu_search(w, client_data, call_data)
{ {
struct xwindow *wp = (struct xwindow *) client_data; struct xwindow *wp = (struct xwindow *) client_data;
struct menu_info_t *menu_info = wp->menu_information; struct menu_info_t *menu_info = wp->menu_information;
char buf[BUFSZ+2], tmpbuf[BUFSZ];
char buf[BUFSZ]; X11_getlin("Search for:", tmpbuf);
X11_getlin("Search for:", buf); if (!*tmpbuf || *tmpbuf == '\033') return;
if (!*buf || *buf == '\033') return; /* convert "string" into "*string*" for use with pmatch() */
Sprintf(buf, "*%s*", tmpbuf);
if (menu_info->how == PICK_ANY) if (menu_info->how == PICK_ANY)
invert_match(wp, buf); invert_match(wp, buf);
@@ -479,7 +485,7 @@ invert_all(wp)
static void static void
invert_match(wp, match) invert_match(wp, match)
struct xwindow *wp; struct xwindow *wp;
char *match; char *match; /* wildcard pattern for pmatch() */
{ {
x11_menu_item *curr; x11_menu_item *curr;
int count; int count;
@@ -488,7 +494,7 @@ invert_match(wp, match)
reset_menu_count(wp->menu_information); reset_menu_count(wp->menu_information);
for (count = 0, curr = wp->menu_information->curr_menu.base; curr; for (count = 0, curr = wp->menu_information->curr_menu.base; curr;
curr = curr->next, count++) curr = curr->next, count++)
if (curr->identifier.a_void != 0 && strstri(curr->str, match)) { if (curr->identifier.a_void != 0 && pmatchi(match, curr->str)) {
invert_line(wp, curr, count, -1L); invert_line(wp, curr, count, -1L);
changed = TRUE; changed = TRUE;
} }
@@ -503,7 +509,7 @@ invert_match(wp, match)
static void static void
select_match(wp, match) select_match(wp, match)
struct xwindow *wp; struct xwindow *wp;
char *match; char *match; /* wildcard pattern for pmatch() */
{ {
x11_menu_item *curr; x11_menu_item *curr;
int count; int count;
@@ -511,11 +517,12 @@ select_match(wp, match)
reset_menu_count(wp->menu_information); reset_menu_count(wp->menu_information);
for (count = 0, curr = wp->menu_information->curr_menu.base; curr; for (count = 0, curr = wp->menu_information->curr_menu.base; curr;
curr = curr->next, count++) curr = curr->next, count++)
if (curr->identifier.a_void != 0 && strstri(curr->str, match)) { if (curr->identifier.a_void != 0 && pmatchi(match, curr->str)) {
if (!curr->selected) { if (!curr->selected) {
invert_line(wp, curr, count, -1L); invert_line(wp, curr, count, -1L);
#ifndef USE_FWF #ifndef USE_FWF
XawListChange(wp->w, wp->menu_information->curr_menu.list_pointer, XawListChange(wp->w,
wp->menu_information->curr_menu.list_pointer,
0, 0, True); 0, 0, True);
#endif #endif
} }
+262 -187
View File
File diff suppressed because it is too large Load Diff
+87
View File
@@ -0,0 +1,87 @@
#!/bin/perl
#
# $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$
# $Date: 2002/01/05 21:06:02 $ $Revision: 1.1 $
#
sub bail($);
use Getopt::Std;
# TODO: switch to Getopt::Long so we can parse normal arguments too
$Getopt::Std::STANDARD_HELP_VERSION = TRUE;
$main::VERSION = 1.0;
my %commands = (
'd' => 'debug mode; parse objects.txt to stdout instead of updating',
);
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";
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";
}
open(INFILE, "<$infile") or bail("couldn't open $infile; bailing");
open(OUTFILE, ">$outfile") or bail("couldn't open $outfile; bailing");
while (my $line = <INFILE>)
{
if (my ($tiletext) = $line =~ /^# tile \d+ (.*)/)
{
$line = "# tile $tilecount $tiletext\n";
$tilecount++;
}
print OUTFILE $line;
}
close(INFILE);
close(OUTFILE);
unless ($debug) { unlink $infile; }
exit;
sub main::HELP_MESSAGE()
{
print <<"STARTHELP";
Usage: renumtiles.pl [OPTIONS] <textfile>
STARTHELP
foreach $cmd (keys(%commands)) {
printf("%10s %s\n", '-'.$cmd, $commands{$cmd});
}
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 ($debug) {
unlink $outfile;
rename ($infile,$outfile);
}
shift;
die "$_\n";
}
+8 -4
View File
@@ -1,4 +1,4 @@
/* 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 $NHDT-Date: 1428828474 2015/04/12 08:47:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.85 $ */
/* NetHack 3.5 wintty.c $Date: 2012/01/22 06:27:09 $ $Revision: 1.66 $ */ /* NetHack 3.5 wintty.c $Date: 2012/01/22 06:27:09 $ $Revision: 1.66 $ */
/* Copyright (c) David Cohrs, 1991 */ /* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1664,20 +1664,24 @@ struct WinDesc *cw;
tty_nhbell(); tty_nhbell();
break; break;
} else { } else {
char searchbuf[BUFSZ], tmpbuf[BUFSZ]; char searchbuf[BUFSZ+2], tmpbuf[BUFSZ];
boolean on_curr_page = FALSE; boolean on_curr_page = FALSE;
int lineno = 0; int lineno = 0;
tty_getlin("Search for:", tmpbuf); tty_getlin("Search for:", tmpbuf);
if (!tmpbuf[0] || tmpbuf[0] == '\033') break; if (!tmpbuf[0] || tmpbuf[0] == '\033') break;
Sprintf(searchbuf, "*%s*", tmpbuf); Sprintf(searchbuf, "*%s*", tmpbuf);
for (curr = cw->mlist; curr; curr = curr->next) { for (curr = cw->mlist; curr; curr = curr->next) {
if (on_curr_page) lineno++; if (on_curr_page) lineno++;
if (curr == page_start) if (curr == page_start)
on_curr_page = TRUE; on_curr_page = TRUE;
else if (curr == page_end) else if (curr == page_end)
on_curr_page = FALSE; on_curr_page = FALSE;
if (curr->identifier.a_void && pmatch(searchbuf, curr->str)) { if (curr->identifier.a_void
toggle_menu_curr(window, curr, lineno, on_curr_page, counting, count); && pmatchi(searchbuf, curr->str)) {
toggle_menu_curr(window, curr, lineno,
on_curr_page, counting, count);
if (cw->how == PICK_ONE) { if (cw->how == PICK_ONE) {
finished = TRUE; finished = TRUE;
break; break;