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
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:
+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.
+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.
+19 -17
View File
@@ -6,7 +6,7 @@
.ds vr "NetHack 3.6
.ds f0 "\*(vr
.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
.\" make changes to that file)
.\" .PS word
@@ -3007,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
@@ -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
developed, maintained, and enjoyed by the community to this day.
.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
as 3.6.0, the development team consisted of \fBWarwick Allison\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.
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
joined the NetHack development team,
joined the NetHack development team.
.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
\fBThe development team, as well as \fBSteve VanDevender\fP and
\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
\fBKen Lorber\fP, \fBHaoyang Wang\fP, \fBPat Rankin\fP, and \fBDean Luick\fP
maintained the port of NetHack 3.6.0 for Mac.
.pg
\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.
.pg
\fBJeff Bailey\fP created and maintained a port of NetHack 3.6.0 for Chrome.
.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
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,
+24 -25
View File
@@ -33,7 +33,7 @@
\begin{document}
%
% 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 h1 %.ds h2 \%
@@ -46,7 +46,7 @@
%.au
\author{Eric S. Raymond\\
(Edited and expanded for 3.6)}
\date{March 27, 2015}
\date{April 12, 2015}
\maketitle
@@ -3597,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
@@ -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,
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
\medskip
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
\medskip
In January 2015, preparation began for the release of NetHack 3.6
%.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
\medskip
3.6.0 TODO insert apprpriate description of 3.6.0 here
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
\medskip
The development team, as well as {\it Steve VanDevender} and
{\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}
maintained the port of NetHack 3.6.0 for Mac.
%.pg
\medskip
{\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.
%.pg
\medskip
{\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
\medskip
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
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
mithril armor should have silver color
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
options to create the character blind or nudist
moving clouds on the plane of air
disclose extinct species alongside genocided ones
tribute to Terry Pratchett
@@ -1153,7 +1157,7 @@ adopt/adapt/improve Dungeon Overview
Aardvark Joe's Extended Logfile
Michael Deutschmann's use_darkgray
Clive Crous' dark_room
Jukka Lahtinen's sortloot
sortloot by Jeroen Demeyer and Jukka Lahtinen
Code Cleanup and Reorganization
+4
View File
@@ -437,8 +437,12 @@ 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 */
#endif
/* if neither is defined, uses pmatch()
* 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 $ */
/* Copyright (c) Steve Creps, 1988. */
/* 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 boolean FDECL(online2, (int,int,int,int));
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
E int FDECL(strncmpi, (const char *,const char *,int));
#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 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 ### */
@@ -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 **));
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));
+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 */
@@ -233,6 +233,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)
+1
View File
@@ -35,6 +35,7 @@ struct sysopt {
# endif
#endif
int seduce;
int check_save_uid; /* restoring savefile checks UID? */
};
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
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];
+1 -1
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);
}
+1303 -1295
View File
File diff suppressed because it is too large Load Diff
+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.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 */
@@ -2127,7 +2127,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)) {
@@ -2397,7 +2397,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 */
+39 -10
View File
@@ -1238,7 +1238,7 @@ boolean identified, all_containers, reportempty;
{
register struct obj *box, *obj;
struct obj **oarray;
int i,j,n;
int i,n;
char *invlet;
char buf[BUFSZ];
boolean cat, deadcat;
@@ -1437,43 +1437,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);
+1868 -1866
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
+58 -14
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 $ */
/* SCCS Id: @(#)hacklib.c 3.5 2007/04/30 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* Copyright (c) Robert Patrick Rankin, 1991 */
/* NetHack may be freely redistributed. See license for details. */
/* We could include only config.h, except for the overlay definitions... */
#include "hack.h"
#include "hack.h" /* for config.h+extern.h */
/*=
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)
boolean digit (char)
@@ -40,9 +40,12 @@ NetHack, except that rounddiv may call panic().
int dist2 (int, int, int, int)
boolean online2 (int, int)
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)
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)
time_t getnow (void)
int getyear (void)
@@ -62,6 +65,9 @@ NetHack, except that rounddiv may call panic().
# define Static static
#endif
static boolean FDECL(pmatch_internal, (const char *,const char *,
BOOLEAN_P,const char *));
boolean
digit(c) /* is 'c' a digit? */
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) */
}
boolean
pmatch(patrn, strng) /* match a string against a pattern */
/* guts of pmatch(), pmatchi(), and pmatchz() */
static boolean
pmatch_internal(patrn, strng, ci, sk) /* match a string against a pattern */
const char *patrn, *strng;
boolean ci; /* True => case-insensitive, False => case-sensitive */
const char *sk; /* set of characters to skip */
{
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'.
*/
pmatch_top:
s = *strng++; p = *patrn++; /* get next chars and pre-advance */
if (!sk) {
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 */
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 */
return((boolean)((!*patrn || pmatch(patrn, strng-1)) ? TRUE :
s ? pmatch(patrn-1, strng) : FALSE));
else if (p != s && (p != '?' || !s)) /* check single character */
return (boolean)
((!*patrn || pmatch_internal(patrn, strng-1, ci, sk)) ? TRUE :
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 */
else /* return pmatch(patrn, strng); */
else /* return pmatch_internal(patrn, strng, ci, sk); */
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
int
strncmpi(s1, s2, n) /* case insensitive counted string comparison */
@@ -603,7 +647,7 @@ STATIC_DCL struct tm *NDECL(getlt);
void
setrandom()
{
unsigned long seed = 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();
+2022 -2014
View File
File diff suppressed because it is too large Load Diff
+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
@@ -879,7 +879,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);
+1268 -1134
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),
+10 -4
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: 1428802519 2015/04/12 01:35:19 $ $NHDT-Branch: master $:$NHDT-Revision: 1.34 $ */
/* Copyright (c) Mike Threepoint, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -374,9 +373,9 @@ ARMOR("splint mail", (char *)0,
ARMOR("banded mail", (char *)0,
1, 0, 1, 0, 72, 5, 350, 90, 4, 1, ARM_SUIT, IRON, HI_METAL),
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,
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,
1, 0, 0, 0, 72, 5, 300, 75, 5, 1, ARM_SUIT, IRON, HI_METAL),
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("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),
+2498 -2471
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -708,7 +708,7 @@ menu_item **pick_list; /* return list of items picked */
int how; /* type of query */
boolean FDECL((*allow), (OBJ_P));/* allow function */
{
int i, j, n;
int i, n;
winid win;
struct obj *curr, *last, fake_hero_object;
struct obj **oarray;
@@ -823,7 +823,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 */
+8 -1
View File
@@ -502,6 +502,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)
@@ -517,7 +524,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.");
+11 -2
View File
@@ -15,6 +15,11 @@
#include "sp_lev.h"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4244)
#endif
typedef void (*select_iter_func)(int, int, genericptr_t);
extern void FDECL(mkmap, (lev_init *));
@@ -5032,7 +5037,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");
@@ -5050,7 +5055,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");
@@ -5222,4 +5227,8 @@ const char *name;
}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
/*sp_lev.c*/
+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
@@ -2215,7 +2215,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))
@@ -2853,7 +2853,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.
*/
@@ -2898,7 +2898,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);
+20 -32
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;
#ifdef GCC_WARN
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 */
#ifdef GCC_WARN
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;
#ifdef GCC_WARN
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 */
#ifdef GCC_WARN
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,11 +2359,12 @@ 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;
#ifdef GCC_WARN
rowp = row_min = row_max = 0;
+175 -156
View File
@@ -2112,18 +2112,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:
@@ -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, 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:
@@ -3473,6 +3475,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:
@@ -3569,11 +3572,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;
@@ -3585,37 +3588,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;
@@ -4255,7 +4260,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");
@@ -4365,129 +4370,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
@@ -4546,6 +4559,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
+3
View File
@@ -35,6 +35,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!
+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 $ */
/* SCCS Id: @(#)winmenu.c 3.5 1996/08/15 */
/* Copyright (c) Dean Luick, 1992 */
@@ -249,9 +249,13 @@ menu_key(w, event, params, num_params)
return;
} else if (ch == MENU_SEARCH) { /* search */
if (menu_info->how == PICK_ANY || menu_info->how == PICK_ONE) {
char buf[BUFSZ];
X11_getlin("Search for:", buf);
if (!*buf || *buf == '\033') return;
char buf[BUFSZ+2], tmpbuf[BUFSZ];
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) {
invert_match(wp, buf);
return;
@@ -395,10 +399,12 @@ menu_search(w, client_data, call_data)
{
struct xwindow *wp = (struct xwindow *) client_data;
struct menu_info_t *menu_info = wp->menu_information;
char buf[BUFSZ+2], tmpbuf[BUFSZ];
char buf[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)
invert_match(wp, buf);
@@ -479,7 +485,7 @@ invert_all(wp)
static void
invert_match(wp, match)
struct xwindow *wp;
char *match;
char *match; /* wildcard pattern for pmatch() */
{
x11_menu_item *curr;
int count;
@@ -488,7 +494,7 @@ invert_match(wp, match)
reset_menu_count(wp->menu_information);
for (count = 0, curr = wp->menu_information->curr_menu.base; curr;
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);
changed = TRUE;
}
@@ -503,7 +509,7 @@ invert_match(wp, match)
static void
select_match(wp, match)
struct xwindow *wp;
char *match;
char *match; /* wildcard pattern for pmatch() */
{
x11_menu_item *curr;
int count;
@@ -511,11 +517,12 @@ select_match(wp, match)
reset_menu_count(wp->menu_information);
for (count = 0, curr = wp->menu_information->curr_menu.base; curr;
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) {
invert_line(wp, curr, count, -1L);
#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);
#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 $ */
/* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */
@@ -1664,20 +1664,24 @@ struct WinDesc *cw;
tty_nhbell();
break;
} else {
char searchbuf[BUFSZ], tmpbuf[BUFSZ];
char searchbuf[BUFSZ+2], tmpbuf[BUFSZ];
boolean on_curr_page = FALSE;
int lineno = 0;
tty_getlin("Search for:", tmpbuf);
if (!tmpbuf[0] || tmpbuf[0] == '\033') break;
Sprintf(searchbuf, "*%s*", tmpbuf);
for (curr = cw->mlist; curr; curr = curr->next) {
if (on_curr_page) lineno++;
if (curr == page_start)
on_curr_page = TRUE;
else if (curr == page_end)
on_curr_page = FALSE;
if (curr->identifier.a_void && pmatch(searchbuf, curr->str)) {
toggle_menu_curr(window, curr, lineno, on_curr_page, counting, count);
if (curr->identifier.a_void
&& pmatchi(searchbuf, curr->str)) {
toggle_menu_curr(window, curr, lineno,
on_curr_page, counting, count);
if (cw->how == PICK_ONE) {
finished = TRUE;
break;