home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
games
/
volume16
/
nethack31
/
patch2d
/
patches02d
Wrap
Text File
|
1993-06-16
|
57KB
|
2,043 lines
*** /tmp/da10978 Tue Jun 1 16:13:38 1993
--- src/exper.c Wed Mar 3 14:21:59 1993
***************
*** 24,29 ****
--- 24,32 ----
experience(mtmp, nk) /* return # of exp points for mtmp after nk killed */
register struct monst *mtmp;
register int nk;
+ #if defined(applec)
+ # pragma unused(nk)
+ #endif
{
register struct permonst *ptr = mtmp->data;
int i, tmp, tmp2;
*** /tmp/da10986 Tue Jun 1 16:13:40 1993
--- src/explode.c Mon May 17 14:04:31 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)explode.c 3.1 93/02/17
/* Copyright (C) 1990 by Ken Arromdee */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)explode.c 3.1 93/05/15 */
/* Copyright (C) 1990 by Ken Arromdee */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 5,14 ****
#include "hack.h"
/* Note: Arrays are column first, while the screen is row first */
! static int expl[3][3] =
! { S_explode1, S_explode4, S_explode7,
! S_explode2, S_explode5, S_explode8,
! S_explode3, S_explode6, S_explode9 };
/* Note: I had to choose one of three possible kinds of "type" when writing
* this function: a wand type (like in zap.c), an adtyp, or an object type.
--- 5,15 ----
#include "hack.h"
/* Note: Arrays are column first, while the screen is row first */
! static int expl[3][3] = {
! { S_explode1, S_explode4, S_explode7 },
! { S_explode2, S_explode5, S_explode8 },
! { S_explode3, S_explode6, S_explode9 }
! };
/* Note: I had to choose one of three possible kinds of "type" when writing
* this function: a wand type (like in zap.c), an adtyp, or an object type.
***************
*** 68,74 ****
}
}
/* can be both you and mtmp if you're swallowed */
! if (mtmp = m_at(i+x-1, j+y-1)) {
switch(adtyp) {
case AD_FIRE:
explmask[i][j] = resists_fire(mtmp->data)
--- 69,75 ----
}
}
/* can be both you and mtmp if you're swallowed */
! if ((mtmp = m_at(i+x-1, j+y-1)) != 0) {
switch(adtyp) {
case AD_FIRE:
explmask[i][j] = resists_fire(mtmp->data)
***************
*** 83,89 ****
explmask[i][j] = 0;
break;
}
! } else if (i+x-1 != u.ux || j+j-1 != u.uy)
explmask[i][j] = 0;
if (cansee(i+x-1, j+y-1)) visible = TRUE;
--- 84,90 ----
explmask[i][j] = 0;
break;
}
! } else if (i+x-1 != u.ux || j+y-1 != u.uy)
explmask[i][j] = 0;
if (cansee(i+x-1, j+y-1)) visible = TRUE;
*** /tmp/da11002 Tue Jun 1 16:13:44 1993
--- src/files.c Mon May 24 12:32:37 1993
***************
*** 449,470 ****
/* ---------- BEGIN FILE COMPRESSION HANDLING ----------- */
/* compress file */
void
compress(filename)
const char *filename;
{
#ifdef COMPRESS
! char cmd[80];
!
! Strcpy(cmd, COMPRESS);
! Strcat(cmd, " ");
! # ifdef COMPRESS_OPTIONS
! Strcat(cmd, COMPRESS_OPTIONS);
! Strcat(cmd, " ");
! # endif
! Strcat(cmd,filename);
! (void) system(cmd);
#endif
}
--- 449,534 ----
/* ---------- BEGIN FILE COMPRESSION HANDLING ----------- */
+ #ifdef COMPRESS
+ /*
+ * using system() is simpler, but opens up security holes and causes
+ * problems on at least Interactive UNIX 3.0.1 (SVR3.2), where any
+ * setuid is renounced by /bin/sh, so the files cannot be accessed.
+ *
+ * cf. child() in unixunix.c.
+ */
+ void
+ docompress_file(filename, uncomp)
+ char *filename;
+ boolean uncomp;
+ {
+ char *args[10];
+ # ifdef COMPRESS_OPTIONS
+ char opts[80];
+ # endif
+ int i = 0;
+ int f;
+
+ args[0] = COMPRESS;
+ if (uncomp) args[++i] = "-d"; /* uncompress */
+ # ifdef COMPRESS_OPTIONS
+ {
+ /* we can't guarantee there's only one additional option, sigh */
+ char *opt;
+ boolean inword = FALSE;
+
+ Strcpy(opts, COMPRESS_OPTIONS);
+ opt = opts;
+ while (*opt) {
+ if ((*opt == ' ') || (*opt == '\t')) {
+ if (inword) {
+ *opt = '\0';
+ inword = FALSE;
+ }
+ } else if (!inword) {
+ args[++i] = opt;
+ inword = TRUE;
+ }
+ opt++;
+ }
+ }
+ # endif
+ args[++i] = filename;
+ args[++i] = NULL;
+
+ f = fork();
+ if (f == 0) { /* child */
+ (void) execv(args[0], args);
+ perror(NULL);
+ pline("Exec to %scompress %s failed.",
+ uncomp ? "un" : "", filename);
+ exit(1);
+ } else if (f == -1) {
+ perror(NULL);
+ pline("Fork to %scompress %s failed.",
+ uncomp ? "un" : "", filename);
+ return;
+ }
+ (void) signal(SIGINT, SIG_IGN);
+ (void) signal(SIGQUIT, SIG_IGN);
+ (void) wait((int *)0);
+ (void) signal(SIGINT, (SIG_RET_TYPE) done1);
+ # ifdef WIZARD
+ if (wizard) (void) signal(SIGQUIT, SIG_DFL);
+ # endif
+ }
+ #endif
+
/* compress file */
void
compress(filename)
const char *filename;
+ #ifdef applec
+ # pragma unused(filename)
+ #endif
{
#ifdef COMPRESS
! docompress_file(filename, FALSE);
#endif
}
***************
*** 473,497 ****
void
uncompress(filename)
const char *filename;
{
#ifdef COMPRESS
! char cmd[80], cfn[80];
int fd;
! Strcpy(cfn,filename);
# ifdef COMPRESS_EXTENSION
! Strcat(cfn,COMPRESS_EXTENSION);
# endif
! if((fd = open(cfn,O_RDONLY)) >= 0) {
! (void) close(fd);
! Strcpy(cmd, COMPRESS);
! Strcat(cmd, " -d "); /* uncompress */
! # ifdef COMPRESS_OPTIONS
! Strcat(cmd, COMPRESS_OPTIONS);
! Strcat(cmd, " ");
! # endif
! Strcat(cmd,cfn);
! (void) system(cmd);
}
#endif
}
--- 537,557 ----
void
uncompress(filename)
const char *filename;
+ #ifdef applec
+ # pragma unused(filename)
+ #endif
{
#ifdef COMPRESS
! char cfn[80];
int fd;
! Strcpy(cfn, filename);
# ifdef COMPRESS_EXTENSION
! Strcat(cfn, COMPRESS_EXTENSION);
# endif
! if ((fd = open(cfn, O_RDONLY)) >= 0) {
! (void) close(fd);
! docompress_file(cfn, TRUE);
}
#endif
}
***************
*** 540,545 ****
--- 600,608 ----
lock_file(filename, retryct)
const char *filename;
int retryct;
+ #ifdef applec
+ # pragma unused(filename, retryct)
+ #endif
{
#if defined(UNIX) || defined(VMS)
char *lockname;
***************
*** 609,614 ****
--- 672,680 ----
void
unlock_file(filename)
const char *filename;
+ #if defined(applec)
+ # pragma unused(filename)
+ #endif
{
#if defined(UNIX) || defined(VMS)
char *lockname;
***************
*** 658,666 ****
#endif
/* "filename" is an environment variable, so it should hang around */
! if (filename && ((fp = fopenp(filename, "r")) != (FILE *)0)) {
! configfile = filename;
! return(fp);
}
#if defined(MICRO) || defined(MAC)
--- 724,748 ----
#endif
/* "filename" is an environment variable, so it should hang around */
! if (filename) {
! #ifdef UNIX
! if (access(filename, 4) == -1) {
! /* 4 is R_OK on newer systems */
! /* nasty sneaky attempt to read file through
! * NetHack's setuid permissions -- this is the only
! * place a file name may be wholly under the player's
! * control
! */
! raw_printf("Access to %s denied (%d).",
! filename, errno);
! wait_synch();
! /* fall through to standard names */
! } else
! #endif
! if ((fp = fopenp(filename, "r")) != (FILE *)0) {
! configfile = filename;
! return(fp);
! }
}
#if defined(MICRO) || defined(MAC)
***************
*** 752,757 ****
--- 834,842 ----
char *buf;
char *tmp_ramdisk;
char *tmp_levels;
+ #if defined(applec)
+ # pragma unused(tmp_ramdisk,tmp_levels)
+ #endif
{
char *bufp, *altp;
***************
*** 798,813 ****
(void) strncpy(tmp_levels, bufp, PATHLEN);
} else if (!strncmpi(buf, "SAVE", 4)) {
char *ptr;
if (ptr = index(bufp, ';')) {
*ptr = '\0';
# ifdef MFLOPPY
if (*(ptr+1) == 'n' || *(ptr+1) == 'N') {
- extern int saveprompt;
saveprompt = FALSE;
}
# endif
! }
(void) strncpy(SAVEP, bufp, PATHLEN);
append_slash(SAVEP);
#endif /* MICRO */
--- 883,905 ----
(void) strncpy(tmp_levels, bufp, PATHLEN);
} else if (!strncmpi(buf, "SAVE", 4)) {
+ # ifdef MFLOPPY
+ extern int saveprompt;
+ #endif
char *ptr;
if (ptr = index(bufp, ';')) {
*ptr = '\0';
# ifdef MFLOPPY
if (*(ptr+1) == 'n' || *(ptr+1) == 'N') {
saveprompt = FALSE;
}
# endif
! }
! #ifdef MFLOPPY
! else
! saveprompt = flags.asksavedisk;
! #endif
!
(void) strncpy(SAVEP, bufp, PATHLEN);
append_slash(SAVEP);
#endif /* MICRO */
***************
*** 836,854 ****
(void) get_uchars(fp, buf, bufp, &(monsyms[1]),
MAXMCLASSES-1, "MONSTERS");
#ifdef AMIGA
} else if (!strncmpi(buf, "PATH", 4)) {
(void) strncpy(PATH, bufp, PATHLEN);
- #endif
- #ifdef AMII_GRAPHICS
} else if (!strncmpi(buf, "PENS", 3)) {
int i;
char *t;
! for (i = 0, t = strtok(bufp, ",");
! t && i < 8;
! t = strtok(NULL, ","), ++i) {
sscanf(t, "%hx", &flags.amii_curmap[i]);
}
amii_setpens();
#endif
} else
return 0;
--- 928,959 ----
(void) get_uchars(fp, buf, bufp, &(monsyms[1]),
MAXMCLASSES-1, "MONSTERS");
#ifdef AMIGA
+ } else if (!strncmpi(buf, "FONT", 4)) {
+ char *t;
+ int size;
+ extern void amii_set_text_font( char *, int );
+
+ if( t = strchr( buf+5, ':' ) )
+ {
+ *t = 0;
+ amii_set_text_font( buf+5, atoi( t + 1 ) );
+ *t = ':';
+ }
} else if (!strncmpi(buf, "PATH", 4)) {
(void) strncpy(PATH, bufp, PATHLEN);
} else if (!strncmpi(buf, "PENS", 3)) {
+ # ifdef AMII_GRAPHICS
int i;
char *t;
! extern void amii_setpens( void );
!
! for (i = 0, t = strtok(bufp, ",/"); t != NULL;
! t = strtok(NULL, ",/"), ++i)
! {
sscanf(t, "%hx", &flags.amii_curmap[i]);
}
amii_setpens();
+ # endif
#endif
} else
return 0;
***************
*** 942,947 ****
--- 1047,1055 ----
void
check_recordfile(dir)
const char *dir;
+ #if defined(applec)
+ # pragma unused(dir)
+ #endif
{
#if defined(UNIX) || defined(VMS)
int fd = open(RECORD, O_RDWR, 0);
*** /tmp/da11010 Tue Jun 1 16:13:47 1993
--- src/fountain.c Wed May 19 10:08:25 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)fountain.c 3.1 93/02/13 */
/* Copyright Scott R. Turner, srt@ucla, 10/27/86 */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)fountain.c 3.1 93/05/18 */
/* Copyright Scott R. Turner, srt@ucla, 10/27/86 */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 108,116 ****
pline("Water gushes forth from the overflowing fountain!");
/* Put a pool at x, y */
-
levl[x][y].typ = POOL;
!
water_damage(level.objects[x][y], FALSE, TRUE);
if ((mtmp = m_at(x, y)) != 0)
--- 108,115 ----
pline("Water gushes forth from the overflowing fountain!");
/* Put a pool at x, y */
levl[x][y].typ = POOL;
! del_engr_at(x, y);
water_damage(level.objects[x][y], FALSE, TRUE);
if ((mtmp = m_at(x, y)) != 0)
***************
*** 513,524 ****
morehungry(rn1(30-ACURR(A_CON), 11));
vomit();
break;
- #ifdef POLYSELF
case 10: pline("This water contains toxic wastes!");
You("undergo a freakish metamorphosis!");
polyself();
! break;
#endif
/* more odd messages --JJB */
case 11: You("hear clanking from the pipes....");
break;
--- 512,525 ----
morehungry(rn1(30-ACURR(A_CON), 11));
vomit();
break;
case 10: pline("This water contains toxic wastes!");
You("undergo a freakish metamorphosis!");
+ #ifdef POLYSELF
polyself();
! #else
! newman();
#endif
+ break;
/* more odd messages --JJB */
case 11: You("hear clanking from the pipes....");
break;
*** /tmp/da11018 Tue Jun 1 16:13:50 1993
--- src/hack.c Tue Jun 1 10:42:03 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)hack.c 3.1 93/02/18 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)hack.c 3.1 93/05/18 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 115,120 ****
--- 115,124 ----
case SPIKED_PIT:
case PIT:
freeobj(otmp);
+ /* vision kludge to get messages right;
+ the pit will temporarily be seen even
+ if this is one among multiple boulders */
+ if (!Blind) viz_array[ry][rx] |= IN_SIGHT;
if (!flooreffects(otmp, rx, ry, "fall")) {
place_object(otmp, rx, ry);
otmp->nobj = fobj;
***************
*** 126,132 ****
The(xname(otmp)));
deltrap(ttmp);
delobj(otmp);
! delallobj(rx, ry);
if (cansee(rx,ry)) newsym(rx,ry);
continue;
case LEVEL_TELEP:
--- 130,136 ----
The(xname(otmp)));
deltrap(ttmp);
delobj(otmp);
! bury_objs(rx, ry);
if (cansee(rx,ry)) newsym(rx,ry);
continue;
case LEVEL_TELEP:
***************
*** 286,292 ****
} else if (lev->typ == SDOOR) {
if (lev->doormask & D_TRAPPED) {
lev->doormask = D_NODOOR;
! b_trapped("secret door");
} else {
digtxt = "chew through the secret door.";
lev->doormask = D_BROKEN;
--- 290,296 ----
} else if (lev->typ == SDOOR) {
if (lev->doormask & D_TRAPPED) {
lev->doormask = D_NODOOR;
! b_trapped("secret door", 0);
} else {
digtxt = "chew through the secret door.";
lev->doormask = D_BROKEN;
***************
*** 300,306 ****
}
if (lev->doormask & D_TRAPPED) {
lev->doormask = D_NODOOR;
! b_trapped("door");
} else {
digtxt = "chew through the door.";
lev->doormask = D_BROKEN;
--- 304,310 ----
}
if (lev->doormask & D_TRAPPED) {
lev->doormask = D_NODOOR;
! b_trapped("door", 0);
} else {
digtxt = "chew through the door.";
lev->doormask = D_BROKEN;
***************
*** 513,518 ****
--- 517,532 ----
y = u.uy + u.dy;
} while(!isok(x, y) || bad_rock(x, y));
}
+ /* turbulence might alter your actual destination */
+ if (u.uinwater) {
+ water_friction();
+ if (!u.dx && !u.dy) {
+ nomul(0);
+ return;
+ }
+ x = u.ux + u.dx;
+ y = u.uy + u.dy;
+ }
if(!isok(x, y)) {
nomul(0);
return;
***************
*** 783,789 ****
/* now move the hero */
mtmp = m_at(x, y);
- if (u.uinwater) water_friction();
u.ux += u.dx;
u.uy += u.dy;
/* if safepet at destination then move the pet to the hero's
--- 797,802 ----
***************
*** 980,990 ****
if(IS_SINK(levl[u.ux][u.uy].typ) && Levitation)
dosinkfall();
#endif
! if(!flags.nopick && OBJ_AT(u.ux, u.uy) &&
! (!is_pool(u.ux,u.uy) || Underwater))
! pickup(1);
! else read_engr_at(u.ux,u.uy);
! if(trap = t_at(u.ux,u.uy))
dotrap(trap); /* fall into pit, arrow trap, etc. */
if((mtmp = m_at(u.ux, u.uy)) && !u.uswallow) {
mtmp->mundetected = 0;
--- 993,1000 ----
if(IS_SINK(levl[u.ux][u.uy].typ) && Levitation)
dosinkfall();
#endif
! pickup(1);
! if ((trap = t_at(u.ux,u.uy)) != 0)
dotrap(trap); /* fall into pit, arrow trap, etc. */
if((mtmp = m_at(u.ux, u.uy)) && !u.uswallow) {
mtmp->mundetected = 0;
***************
*** 1162,1172 ****
if (*u.ushops0)
u_left_shop(u.ushops_left, newlev);
! if (!*u.uentered && !*u.ushops_entered)
return; /* no entrance messages necessary */
/* Did we just enter a shop? */
! if (*u.ushops_entered && !newlev)
u_entered_shop(u.ushops_entered);
for (ptr = &u.uentered[0]; *ptr; ptr++) {
--- 1172,1182 ----
if (*u.ushops0)
u_left_shop(u.ushops_left, newlev);
! if (!*u.uentered && !*u.ushops_entered) /* implied by newlev */
return; /* no entrance messages necessary */
/* Did we just enter a shop? */
! if (*u.ushops_entered)
u_entered_shop(u.ushops_entered);
for (ptr = &u.uentered[0]; *ptr; ptr++) {
***************
*** 1176,1228 ****
/* vault.c insists that a vault remain a VAULT,
* and temples should remain TEMPLEs,
* but everything else gives a message only the first time */
! if(!newlev)
! switch (rt) {
! case ZOO:
! pline("Welcome to David's treasure zoo!");
! break;
! case SWAMP:
! pline("It %s rather %s down here.",
! Blind ? "feels" : "looks",
! Blind ? "humid" : "muddy");
! break;
! case COURT:
! You("enter an opulent throne room!");
! break;
! case MORGUE:
! if(midnight())
! pline("Run away! Run away!");
! else
! You("have an uncanny feeling...");
! break;
! case BEEHIVE:
! You("enter a giant beehive!");
! break;
#ifdef ARMY
! case BARRACKS:
! if(monstinroom(&mons[PM_SOLDIER], roomno) ||
! monstinroom(&mons[PM_SERGEANT], roomno) ||
! monstinroom(&mons[PM_LIEUTENANT], roomno) ||
! monstinroom(&mons[PM_CAPTAIN], roomno))
! You("enter a military barracks!");
! else
! You("enter an abandoned barracks.");
! break;
#endif
! case DELPHI:
! if(monstinroom(&mons[PM_ORACLE], roomno))
! verbalize("Hello, %s, welcome to Delphi!", plname);
! break;
! case TEMPLE:
! intemple(roomno + ROOMOFFSET);
! /* fall through */
! default:
! rt = 0;
! }
! else
! rt = 0;
! if(rt != 0) {
rooms[roomno].rtype = OROOM;
if (!search_special(rt)) {
/* No more room of that type */
--- 1186,1240 ----
/* vault.c insists that a vault remain a VAULT,
* and temples should remain TEMPLEs,
* but everything else gives a message only the first time */
! switch (rt) {
! case ZOO:
! pline("Welcome to David's treasure zoo!");
! break;
! case SWAMP:
! pline("It %s rather %s down here.",
! Blind ? "feels" : "looks",
! Blind ? "humid" : "muddy");
! break;
! case COURT:
! You("enter an opulent throne room!");
! break;
! case MORGUE:
! if(midnight()) {
! #ifdef POLYSELF
! const char *run = locomotion(uasmon, "Run");
! pline("%s away! %s away!", run, run);
! #else
! pline("Run away! Run away!");
! #endif
! } else
! You("have an uncanny feeling...");
! break;
! case BEEHIVE:
! You("enter a giant beehive!");
! break;
#ifdef ARMY
! case BARRACKS:
! if(monstinroom(&mons[PM_SOLDIER], roomno) ||
! monstinroom(&mons[PM_SERGEANT], roomno) ||
! monstinroom(&mons[PM_LIEUTENANT], roomno) ||
! monstinroom(&mons[PM_CAPTAIN], roomno))
! You("enter a military barracks!");
! else
! You("enter an abandoned barracks.");
! break;
#endif
! case DELPHI:
! if(monstinroom(&mons[PM_ORACLE], roomno))
! verbalize("Hello, %s, welcome to Delphi!", plname);
! break;
! case TEMPLE:
! intemple(roomno + ROOMOFFSET);
! /* fall through */
! default:
! rt = 0;
! }
! if (rt != 0) {
rooms[roomno].rtype = OROOM;
if (!search_special(rt)) {
/* No more room of that type */
***************
*** 1302,1308 ****
return(0);
}
if(Levitation && !Is_airlevel(&u.uz) && !Is_waterlevel(&u.uz)) {
! You("cannot reach the floor.");
return(1);
}
pickup(-count);
--- 1314,1320 ----
return(0);
}
if(Levitation && !Is_airlevel(&u.uz) && !Is_waterlevel(&u.uz)) {
! You("cannot reach the %s.", surface(u.ux,u.uy));
return(1);
}
pickup(-count);
*** /tmp/da11034 Tue Jun 1 16:13:55 1993
--- src/invent.c Wed May 19 10:30:00 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)invent.c 3.1 92/12/11 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)invent.c 3.1 93/05/17 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 21,26 ****
--- 21,27 ----
static struct obj *FDECL(find_unpaid,(struct obj *,struct obj **));
static boolean NDECL(wearing_armor);
static boolean FDECL(is_worn,(struct obj *));
+ static boolean FDECL(is_fully_identified,(struct obj *));
#endif /* OVLB */
STATIC_DCL char FDECL(obj_to_let,(struct obj *));
***************
*** 28,38 ****
static int lastinvnr = 51; /* 0 ... 51 (never saved&restored) */
- char inv_order[] = { /* manipulated in options.c, used below */
- AMULET_CLASS, WEAPON_CLASS, ARMOR_CLASS, FOOD_CLASS, SCROLL_CLASS,
- SPBOOK_CLASS, POTION_CLASS, RING_CLASS, WAND_CLASS, TOOL_CLASS,
- GEM_CLASS, ROCK_CLASS, BALL_CLASS, CHAIN_CLASS, 0 };
-
#ifdef WIZARD
/* wizards can wish for venom, which will become an invisible inventory
* item without this. putting it in inv_order would mean venom would
--- 29,34 ----
***************
*** 325,333 ****
struct obj *otmp, *otmp2;
for (otmp = level.objects[x][y]; otmp; otmp = otmp2) {
- otmp2 = otmp->nexthere;
if (otmp == uball)
unpunish();
if (otmp == uchain)
continue;
delobj(otmp);
--- 321,330 ----
struct obj *otmp, *otmp2;
for (otmp = level.objects[x][y]; otmp; otmp = otmp2) {
if (otmp == uball)
unpunish();
+ /* after unpunish(), or might get deallocated chain */
+ otmp2 = otmp->nexthere;
if (otmp == uchain)
continue;
delobj(otmp);
***************
*** 334,339 ****
--- 331,426 ----
}
}
+ /* move objects from fobj/nexthere lists to buriedobjlist, keeping position
+ * information */
+ void
+ bury_objs(x, y)
+ int x, y;
+ {
+ struct obj *otmp, *otmp2;
+
+ for (otmp = level.objects[x][y]; otmp; otmp = otmp2) {
+ if (otmp == uball)
+ unpunish();
+ /* after unpunish(), or might get deallocated chain */
+ otmp2 = otmp->nexthere;
+ if (otmp == uchain)
+ continue;
+ #ifdef WALKIES
+ if (otmp->otyp == LEASH && otmp->leashmon != 0)
+ o_unleash(otmp);
+ #endif
+ if (otmp->lamplit) {
+ otmp->lamplit = 0;
+ check_lamps();
+ }
+ freeobj(otmp);
+ if (otmp->otyp == ROCK) {
+ /* melts into burying material */
+ obfree(otmp, (struct obj *)0);
+ continue;
+ }
+ otmp->nexthere = (struct obj *)0;
+ otmp->nobj = level.buriedobjlist;
+ level.buriedobjlist = otmp;
+ }
+ /* don't expect any engravings here, but just in case */
+ del_engr_at(x, y);
+ newsym(x, y);
+ }
+
+ /* delete buried object */
+ void
+ delburiedobj(obj)
+ struct obj *obj;
+ {
+ struct obj *otmp;
+ if (obj == level.buriedobjlist)
+ level.buriedobjlist = obj->nobj;
+ else {
+ for (otmp = level.buriedobjlist; otmp; otmp = otmp->nobj)
+ if (otmp->nobj == obj) {
+ otmp->nobj = obj->nobj;
+ break;
+ }
+ if (!otmp) panic("error in delburiedobj");
+ }
+ obfree(obj, (struct obj *) 0); /* frees contents also */
+ }
+
+ /* move objects from buriedobjlist to fobj/nexthere lists */
+ void
+ unearth_objs(x, y)
+ int x, y;
+ {
+ struct obj *otmp, *otmp2, *prevobj;
+
+ remove_cadavers(&level.buriedobjlist);
+
+ prevobj = (struct obj *) 0;
+ for (otmp = level.buriedobjlist; otmp; otmp = otmp2) {
+ otmp2 = otmp->nobj;
+ if (otmp->ox == x && otmp->oy == y) {
+ if (prevobj)
+ prevobj->nobj = otmp2;
+ else
+ level.buriedobjlist = otmp2;
+ if (is_organic(otmp) && rn2(2)) {
+ /* rotted away */
+ obfree(otmp, (struct obj *) 0);
+ } else {
+ otmp->nobj = fobj;
+ fobj = otmp;
+ place_object(otmp, x, y);
+ stackobj(otmp);
+ }
+ } else
+ prevobj = otmp;
+ }
+ del_engr_at(x, y);
+ newsym(x, y);
+ }
+
#endif /* OVL3 */
#ifdef OVL2
***************
*** 345,350 ****
--- 432,448 ----
#ifdef WALKIES
if(obj->otyp == LEASH && obj->leashmon != 0) o_unleash(obj);
#endif
+ if (obj->otyp == AMULET_OF_YENDOR ||
+ obj->otyp == CANDELABRUM_OF_INVOCATION ||
+ obj->otyp == BELL_OF_OPENING ||
+ obj->otyp == SPE_BOOK_OF_THE_DEAD) {
+ /* player might be doing something stupid, but we
+ * can't guarantee that. assume special artifacts
+ * are indestructible via drawbridges, and exploding
+ * chests, and golem creation, and ...
+ */
+ return;
+ }
freeobj(obj);
newsym(obj->ox,obj->oy);
obfree(obj, (struct obj *) 0); /* frees contents also */
***************
*** 431,437 ****
while(objchn) {
if(objchn->o_id == id) return(objchn);
! if (Is_container(objchn) && (temp = o_on(id,objchn->cobj)))
return temp;
objchn = objchn->nobj;
}
--- 529,535 ----
while(objchn) {
if(objchn->o_id == id) return(objchn);
! if (Has_contents(objchn) && (temp = o_on(id,objchn->cobj)))
return temp;
objchn = objchn->nobj;
}
***************
*** 589,609 ****
else if ((!strcmp(word, "wear") &&
(otmp->oclass == TOOL_CLASS &&
otmp->otyp != BLINDFOLD && otmp->otyp != TOWEL))
#ifdef POLYSELF
|| (!strcmp(word, "eat") && !is_edible(otmp))
#endif
! || (!strcmp(word, "can") &&
! (otmp->otyp != CORPSE))
|| (!strcmp(word, "write with") &&
(otmp->oclass == TOOL_CLASS &&
otmp->otyp != MAGIC_MARKER && otmp->otyp != TOWEL))
|| (!strcmp(word, "rub") &&
(otmp->oclass == TOOL_CLASS &&
otmp->otyp != OIL_LAMP && otmp->otyp != MAGIC_LAMP &&
otmp->otyp != BRASS_LANTERN))
- || (!strcmp(word, "wield") &&
- (otmp->oclass == TOOL_CLASS &&
- otmp->otyp != PICK_AXE && otmp->otyp != UNICORN_HORN))
)
foo--;
} else {
--- 687,711 ----
else if ((!strcmp(word, "wear") &&
(otmp->oclass == TOOL_CLASS &&
otmp->otyp != BLINDFOLD && otmp->otyp != TOWEL))
+ || (!strcmp(word, "wield") &&
+ (otmp->oclass == TOOL_CLASS &&
+ otmp->otyp != PICK_AXE && otmp->otyp != UNICORN_HORN))
#ifdef POLYSELF
|| (!strcmp(word, "eat") && !is_edible(otmp))
#endif
! || (!strcmp(word, "sacrifice") &&
! (otmp->otyp != CORPSE &&
! otmp->otyp != AMULET_OF_YENDOR &&
! otmp->otyp != FAKE_AMULET_OF_YENDOR))
|| (!strcmp(word, "write with") &&
(otmp->oclass == TOOL_CLASS &&
otmp->otyp != MAGIC_MARKER && otmp->otyp != TOWEL))
+ || (!strcmp(word, "tin") &&
+ (otmp->otyp != CORPSE))
|| (!strcmp(word, "rub") &&
(otmp->oclass == TOOL_CLASS &&
otmp->otyp != OIL_LAMP && otmp->otyp != MAGIC_LAMP &&
otmp->otyp != BRASS_LANTERN))
)
foo--;
} else {
***************
*** 782,787 ****
--- 884,897 ----
return(!!(otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL | W_WEP)));
}
+ static boolean
+ is_fully_identified(otmp)
+ register struct obj *otmp;
+ {
+ return(otmp->known && otmp->dknown && otmp->bknown && otmp->rknown
+ && objects[otmp->otyp].oc_name_known);
+ }
+
static NEARDATA const char removeables[] =
{ ARMOR_CLASS, WEAPON_CLASS, RING_CLASS, AMULET_CLASS, TOOL_CLASS, 0 };
***************
*** 801,806 ****
--- 911,917 ----
int FDECL((*ckfn),(OBJ_P)) = (int (*)()) 0;
xchar allowgold = (u.ugold && !strcmp(word, "drop")) ? 1 : 0; /* BAH */
register boolean takeoff = !strcmp(word, "take off");
+ register boolean ident = !strcmp(word, "identify");
struct obj *obj;
int unpaid, oc_of_sym;
***************
*** 819,825 ****
unpaid = 0;
for (obj = invent; obj; obj = obj->nobj) {
sym = (char) def_oc_syms[(int) obj->oclass];
! if (!index(ilets, sym) && (!takeoff || is_worn(obj))) {
ilets[iletct++] = sym;
/* necessary because of index() being used above */
ilets[iletct] = '\0';
--- 930,937 ----
unpaid = 0;
for (obj = invent; obj; obj = obj->nobj) {
sym = (char) def_oc_syms[(int) obj->oclass];
! if (!index(ilets, sym) && (!takeoff || is_worn(obj))
! && (!ident || !is_fully_identified(obj))) {
ilets[iletct++] = sym;
/* necessary because of index() being used above */
ilets[iletct] = '\0';
***************
*** 828,834 ****
if (obj->unpaid) unpaid = 1;
}
! if (!takeoff && (unpaid || invent)) {
ilets[iletct++] = ' ';
if (unpaid) ilets[iletct++] = 'u';
if (invent) ilets[iletct++] = 'a';
--- 940,949 ----
if (obj->unpaid) unpaid = 1;
}
! if (ident && !iletct) {
! You("have already identified all your possessions.");
! return -1; /* special case for seffects(read.c) */
! } else if (!takeoff && (unpaid || invent)) {
ilets[iletct++] = ' ';
if (unpaid) ilets[iletct++] = 'u';
if (invent) ilets[iletct++] = 'a';
***************
*** 938,946 ****
if(ilet == 'z') ilet = 'A'; else ilet++;
otmp2 = otmp->nobj;
if (olets && *olets && otmp->oclass != *olets) continue;
! if(takeoff && !is_worn(otmp)) continue;
! if(ckfn && !(*ckfn)(otmp)) continue;
! if(!allflag) {
Strcpy(qbuf, ininv ?
xprname(otmp, ilet, !nodot, 0L) : doname(otmp));
Strcat(qbuf, "?");
--- 1053,1062 ----
if(ilet == 'z') ilet = 'A'; else ilet++;
otmp2 = otmp->nobj;
if (olets && *olets && otmp->oclass != *olets) continue;
! if (takeoff && !is_worn(otmp)) continue;
! if (ident && is_fully_identified(otmp)) continue;
! if (ckfn && !(*ckfn)(otmp)) continue;
! if (!allflag) {
Strcpy(qbuf, ininv ?
xprname(otmp, ilet, !nodot, 0L) : doname(otmp));
Strcat(qbuf, "?");
***************
*** 981,986 ****
--- 1097,1104 ----
default:
break;
case 'q':
+ /* special case for seffects() */
+ if (ident) cnt = -1;
goto ret;
}
}
***************
*** 1111,1117 ****
} else
return (*last_found = list);
}
! if (Is_container(list) && list->cobj) {
if ((obj = find_unpaid(list->cobj, last_found)) != 0)
return obj;
}
--- 1229,1235 ----
} else
return (*last_found = list);
}
! if (Has_contents(list)) {
if ((obj = find_unpaid(list->cobj, last_found)) != 0)
return obj;
}
***************
*** 1136,1142 ****
register struct obj *otmp;
struct obj *z_obj;
register char ilet;
! char *invlet = inv_order;
int classcount;
#if defined(LINT) || defined(GCC_WARN)
int save_unpaid = 0;
--- 1254,1260 ----
register struct obj *otmp;
struct obj *z_obj;
register char ilet;
! char *invlet = flags.inv_order;
int classcount;
#if defined(LINT) || defined(GCC_WARN)
int save_unpaid = 0;
***************
*** 1161,1167 ****
if (do_containers) { /* single non-inventory object */
z_obj = (struct obj *) 0;
if ((otmp = find_unpaid(invent, &z_obj)) != 0)
! pline(xprname(otmp, CONTAINED_SYM, TRUE,
(show_cost ? unpaid_cost(otmp) : 0L)));
else
impossible(
--- 1279,1286 ----
if (do_containers) { /* single non-inventory object */
z_obj = (struct obj *) 0;
if ((otmp = find_unpaid(invent, &z_obj)) != 0)
! pline("%s",
! xprname(otmp, CONTAINED_SYM, TRUE,
(show_cost ? unpaid_cost(otmp) : 0L)));
else
impossible(
***************
*** 1169,1175 ****
} else {
for(otmp = invent; otmp; otmp = otmp->nobj) {
if (otmp->invlet == lets[0]) {
! pline(xprname(otmp, lets[0], TRUE,
(show_cost ? unpaid_cost(otmp) : 0L)));
break;
}
--- 1288,1295 ----
} else {
for(otmp = invent; otmp; otmp = otmp->nobj) {
if (otmp->invlet == lets[0]) {
! pline("%s",
! xprname(otmp, lets[0], TRUE,
(show_cost ? unpaid_cost(otmp) : 0L)));
break;
}
***************
*** 1227,1233 ****
* have unpaid items that have been already listed.
*/
for (otmp = invent; otmp; otmp = otmp->nobj) {
! if (Is_container(otmp) && otmp->cobj) {
z_obj = (struct obj *) 0; /* haven't found any */
while (find_unpaid(otmp->cobj, (struct obj **)&z_obj)) {
totcost += cost = unpaid_cost(z_obj);
--- 1347,1353 ----
* have unpaid items that have been already listed.
*/
for (otmp = invent; otmp; otmp = otmp->nobj) {
! if (Has_contents(otmp)) {
z_obj = (struct obj *) 0; /* haven't found any */
while (find_unpaid(otmp->cobj, (struct obj **)&z_obj)) {
totcost += cost = unpaid_cost(z_obj);
***************
*** 1263,1269 ****
while (list) {
if (list->unpaid) count++;
! if (Is_container(list) && list->cobj)
count += count_unpaid(list->cobj);
list = list->nobj;
}
--- 1383,1389 ----
while (list) {
if (list->unpaid) count++;
! if (Has_contents(list))
count += count_unpaid(list->cobj);
list = list->nobj;
}
***************
*** 1361,1367 ****
const char *verb = Blind ? "feel" : "see";
const char *dfeature = (char*) 0;
char fbuf[BUFSZ], fbuf2[BUFSZ];
- int ct;
boolean no_article = FALSE;
winid tmpwin;
--- 1481,1486 ----
***************
*** 1449,1463 ****
}
/* we know there is something here */
! /* find out if there is more than one object there */
! for (ct = 0, otmp = otmp0; otmp; otmp = otmp->nexthere)
! if (++ct > 1) break;
!
! if (ct == 1) {
if (dfeature) pline(fbuf);
You("%s here %s.", verb, doname(otmp0));
} else {
! display_nhwindow(NHW_MESSAGE, FALSE);
tmpwin = create_nhwindow(NHW_MENU);
if(dfeature) {
putstr(tmpwin, 0, fbuf);
--- 1568,1579 ----
}
/* we know there is something here */
! if (!otmp0->nexthere) {
! /* only one object */
if (dfeature) pline(fbuf);
You("%s here %s.", verb, doname(otmp0));
} else {
! display_nhwindow(WIN_MESSAGE, FALSE);
tmpwin = create_nhwindow(NHW_MENU);
if(dfeature) {
putstr(tmpwin, 0, fbuf);
***************
*** 1542,1547 ****
--- 1658,1667 ----
/* see burn_lamps() for a reference for the magic "25" */
if (Is_candle(obj) && obj->age/25 != otmp->age/25)
return(FALSE);
+
+ /* don't merge surcharged item with base-cost item */
+ if (obj->unpaid && !same_price(obj, otmp))
+ return FALSE;
/* if they have names, make sure they're the same */
if ( (obj->onamelth != otmp->onamelth &&
*** /tmp/da11042 Tue Jun 1 16:13:58 1993
--- src/lock.c Tue Jun 1 12:07:19 1993
***************
*** 1,8 ****
! /* SCCS Id: @(#)lock.c 3.1 92/09/02
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
! #include "hack.h"
#define CONTAINER_BITS 0 /* box options not [yet?] implemented */
--- 1,8 ----
! /* SCCS Id: @(#)lock.c 3.1 93/05/28 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
! #include "hack.h"
#define CONTAINER_BITS 0 /* box options not [yet?] implemented */
***************
*** 18,23 ****
--- 18,24 ----
#ifdef OVLB
+ static const char *NDECL(lock_action);
static boolean FDECL(obstructed,(int,int));
static void FDECL(chest_shatter_msg, (struct obj *));
***************
*** 41,46 ****
--- 42,77 ----
xlock.door_or_box && (xlock.door == &levl[x][y]));
}
+ /* produce an occupation string appropriate for the current activity */
+ static const char *
+ lock_action()
+ {
+ /* "unlocking"+2 == "locking" */
+ static const char *actions[] = {
+ /* [0] */ "unlocking the door",
+ /* [1] */ "unlocking the chest",
+ /* [2] */ "unlocking the box",
+ /* [3] */ "picking the lock"
+ };
+
+ /* if the target is currently unlocked, we're trying to lock it now */
+ if (xlock.door_or_box && !(xlock.door->doormask & D_LOCKED))
+ return actions[0]+2; /* "locking the door" */
+ else if (!xlock.door_or_box && !xlock.box->olocked)
+ return xlock.box->otyp == CHEST ? actions[1]+2 : actions[2]+2;
+ /* otherwise we're trying to unlock it */
+ else if (xlock.picktyp == LOCK_PICK)
+ return actions[3]; /* "picking the lock" */
+ #ifdef TOURIST
+ else if (xlock.picktyp == CREDIT_CARD)
+ return actions[3]; /* same as lock_pick */
+ #endif
+ else if (xlock.door_or_box)
+ return actions[0]; /* "unlocking the door" */
+ else
+ return xlock.box->otyp == CHEST ? actions[1] : actions[2];
+ }
+
STATIC_PTR
int
picklock() /* try to open/close a lock */
***************
*** 73,83 ****
|| nohands(uasmon)
#endif
) {
! You("give up your attempt to %s the lock.",
! (xlock.door_or_box ? !(xlock.door->doormask & D_LOCKED) :
! !xlock.box->olocked) ? "lock" :
! ((xlock.picktyp == LOCK_PICK) ? "pick" : "open" ));
!
exercise(A_DEX, TRUE); /* even if you don't succeed */
return((xlock.usedtime = 0));
}
--- 104,110 ----
|| nohands(uasmon)
#endif
) {
! You("give up your attempt at %s.", lock_action());
exercise(A_DEX, TRUE); /* even if you don't succeed */
return((xlock.usedtime = 0));
}
***************
*** 84,95 ****
if(rn2(100) > xlock.chance) return(1); /* still busy */
if(xlock.door_or_box) {
- You("succeed in %sing the lock.",
- !(xlock.door->doormask & D_LOCKED) ? "lock" :
- ((xlock.picktyp == LOCK_PICK) ? "pick" : "open" ));
if(xlock.door->doormask & D_TRAPPED) {
! b_trapped("door");
xlock.door->doormask = D_NODOOR;
unblock_point(u.ux+u.dx, u.uy+u.dy);
newsym(u.ux+u.dx, u.uy+u.dy);
--- 111,120 ----
if(rn2(100) > xlock.chance) return(1); /* still busy */
+ You("succeed in %s.", lock_action());
if(xlock.door_or_box) {
if(xlock.door->doormask & D_TRAPPED) {
! b_trapped("door", FINGER);
xlock.door->doormask = D_NODOOR;
unblock_point(u.ux+u.dx, u.uy+u.dy);
newsym(u.ux+u.dx, u.uy+u.dy);
***************
*** 97,105 ****
xlock.door->doormask = D_CLOSED;
else xlock.door->doormask = D_LOCKED;
} else {
- You("succeed in %sing the lock.",
- (!xlock.box->olocked) ? "lock" :
- (xlock.picktyp == LOCK_PICK) ? "pick" : "open" );
xlock.box->olocked = !xlock.box->olocked;
if(xlock.box->otrapped)
(void) chest_trap(xlock.box, FINGER, FALSE);
--- 122,127 ----
***************
*** 152,166 ****
xlock.box->olocked = 0;
xlock.box->obroken = 1;
if(!xlock.picktyp && !rn2(3)) {
! register struct monst *shkp;
long loss = 0L;
! #ifdef GCC_WARN
! shkp = (struct monst *) 0;
! #endif
- if(*u.ushops) shkp = shop_keeper(*u.ushops);
-
pline("In fact, you've totally destroyed %s.",
the(xname(xlock.box)));
--- 174,186 ----
xlock.box->olocked = 0;
xlock.box->obroken = 1;
if(!xlock.picktyp && !rn2(3)) {
! struct monst *shkp;
! boolean costly;
long loss = 0L;
! costly = (*u.ushops && costly_spot(u.ux, u.uy));
! shkp = costly ? shop_keeper(*u.ushops) : 0;
pline("In fact, you've totally destroyed %s.",
the(xname(xlock.box)));
***************
*** 169,175 ****
otmp2 = otmp->nobj;
if(!rn2(3) || otmp->oclass == POTION_CLASS) {
chest_shatter_msg(otmp);
! if(*u.ushops && costly_spot(u.ux, u.uy))
loss += stolen_value(otmp, u.ux, u.uy,
(boolean)shkp->mpeaceful, TRUE);
if (otmp->quan == 1L) {
--- 189,195 ----
otmp2 = otmp->nobj;
if(!rn2(3) || otmp->oclass == POTION_CLASS) {
chest_shatter_msg(otmp);
! if (costly)
loss += stolen_value(otmp, u.ux, u.uy,
(boolean)shkp->mpeaceful, TRUE);
if (otmp->quan == 1L) {
***************
*** 184,191 ****
stackobj(otmp);
}
xlock.box->cobj = (struct obj *) 0; /* no contents */
! if(*u.ushops && costly_spot(u.ux, u.uy))
! loss += stolen_value(otmp, u.ux, u.uy,
(boolean)shkp->mpeaceful, TRUE);
if(loss) You("owe %ld zorkmids for objects destroyed.", loss);
delobj(xlock.box);
--- 204,211 ----
stackobj(otmp);
}
xlock.box->cobj = (struct obj *) 0; /* no contents */
! if (costly)
! loss += stolen_value(xlock.box, u.ux, u.uy,
(boolean)shkp->mpeaceful, TRUE);
if(loss) You("owe %ld zorkmids for objects destroyed.", loss);
delobj(xlock.box);
***************
*** 216,232 ****
ch = 0; /* GCC myopia */
#endif
picktyp = pick->otyp;
! if(xlock.usedtime && picktyp == xlock.picktyp) {
! You("resume your attempt to %s the lock.",
! (xlock.door_or_box ? !(xlock.door->doormask & D_LOCKED) :
! !xlock.box->olocked) ? "lock" :
! ((xlock.picktyp == LOCK_PICK) ? "pick" : "open" ));
!
! set_occupation(picklock,
! (picktyp == LOCK_PICK) ? "picking the lock" :
! "opening the lock", 0);
! return(1);
}
#ifdef POLYSELF
--- 236,247 ----
ch = 0; /* GCC myopia */
#endif
picktyp = pick->otyp;
! if (xlock.usedtime && picktyp == xlock.picktyp) {
! const char *action = lock_action();
! You("resume your attempt at %s.", action);
! set_occupation(picklock, action, 0);
! return(1);
}
#ifdef POLYSELF
***************
*** 381,389 ****
xlock.chance = ch;
xlock.picktyp = picktyp;
xlock.usedtime = 0;
! set_occupation(picklock,
! (picktyp == LOCK_PICK) ? "picking the lock" :
! "opening the lock", 0);
return(1);
}
--- 396,402 ----
xlock.chance = ch;
xlock.picktyp = picktyp;
xlock.usedtime = 0;
! set_occupation(picklock, lock_action(), 0);
return(1);
}
***************
*** 522,528 ****
if (rnl(20) < (ACURRSTR+ACURR(A_DEX)+ACURR(A_CON))/3) {
pline("The door opens.");
if(door->doormask & D_TRAPPED) {
! b_trapped("door");
door->doormask = D_NODOOR;
} else
door->doormask = D_ISOPEN;
--- 535,541 ----
if (rnl(20) < (ACURRSTR+ACURR(A_DEX)+ACURR(A_CON))/3) {
pline("The door opens.");
if(door->doormask & D_TRAPPED) {
! b_trapped("door", FINGER);
door->doormask = D_NODOOR;
} else
door->doormask = D_ISOPEN;
***************
*** 706,711 ****
--- 719,733 ----
case WAN_LOCKING:
case SPE_WIZARD_LOCK:
if (obstructed(x,y)) return 0;
+ /* Don't allow doors to close over traps. This is for pits */
+ /* & trap doors, but is it ever OK for anything else? */
+ if (t_at(x,y)) {
+ /* maketrap() clears doormask, so it should be NODOOR */
+ pline(
+ "A cloud of dust springs up in the doorway, but quickly dissipates.");
+ return 0;
+ }
+
switch (door->doormask & ~D_TRAPPED) {
case D_CLOSED:
msg = "The door locks!";
*** /tmp/da11050 Tue Jun 1 16:14:01 1993
--- src/mail.c Mon May 17 14:04:38 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)mail.c 3.1 92/11/14 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)mail.c 3.1 93/05/15 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 48,54 ****
# include <sys/stat.h>
# include <pwd.h>
/* DON'T trust all Unices to declare getpwuid() in <pwd.h> */
! # if !defined(_BULL_SOURCE) && !defined(sgi)
/* DO trust all SVR4 to typedef uid_t in <sys/types.h> (probably to a long) */
# if defined(POSIX_TYPES) || defined(SVR4) || defined(HPUX)
extern struct passwd *FDECL(getpwuid,(uid_t));
--- 48,54 ----
# include <sys/stat.h>
# include <pwd.h>
/* DON'T trust all Unices to declare getpwuid() in <pwd.h> */
! # if !defined(_BULL_SOURCE) && !defined(sgi) && !defined(_M_UNIX)
/* DO trust all SVR4 to typedef uid_t in <sys/types.h> (probably to a long) */
# if defined(POSIX_TYPES) || defined(SVR4) || defined(HPUX)
extern struct passwd *FDECL(getpwuid,(uid_t));
***************
*** 368,377 ****
message_seen = TRUE;
# ifdef NO_MAILREADER
! verbalize("Hello, %s! You have some mail in the outside world.", plname);
! # else
verbalize("Hello, %s! %s.", plname, info->display_txt);
if (info->message_typ) {
struct obj *obj = mksobj(SCR_MAIL, FALSE, FALSE);
if (distu(md->mx,md->my) > 2)
--- 368,382 ----
message_seen = TRUE;
# ifdef NO_MAILREADER
! if (info->message_typ) {
! verbalize("Hello, %s! You have some mail in the outside world.", plname);
! goto go_back;
! }
! # endif /* NO_MAILREADER */
!
verbalize("Hello, %s! %s.", plname, info->display_txt);
+ # ifndef NO_MAILREADER
if (info->message_typ) {
struct obj *obj = mksobj(SCR_MAIL, FALSE, FALSE);
if (distu(md->mx,md->my) > 2)
***************
*** 435,453 ****
readmail(otmp)
struct obj *otmp;
{
- #ifdef AMIGA
char *junk[]={
! "It reads: \"Please disregard previous letter.\"",
! "It reads: \"Welcome to NetHack 3.1!\"",
! "It reads: \"Only Amiga makes it possible.\"",
! "It reads: \"CATS have all the answers.\"",
! "It reads: \"Report bugs to nethack-bugs@linc.cis.upenn.edu\""
};
! pline(junk[rn2(SIZE(junk))]);
! #else
! pline("It reads: \"Please disregard previous letter.\"");
! #endif
}
#endif /* OVLB */
--- 440,456 ----
readmail(otmp)
struct obj *otmp;
{
char *junk[]={
! "Please disregard previous letter.",
! "Welcome to NetHack 3.1!",
! #ifdef AMIGA
! "Only Amiga makes it possible.",
! "CATS have all the answers.",
! #endif
! "Report bugs to nethack-bugs@linc.cis.upenn.edu"
};
! pline("It reads: \"%s\"", junk[rn2(SIZE(junk))]);
}
#endif /* OVLB */
***************
*** 552,562 ****
struct obj *otmp;
{
# ifdef SHELL /* can't access mail reader without spawning subprocess */
! char *p, *cmd, buf[BUFSZ], qbuf[BUFSZ];
/* there should be a command hidden beyond the object name */
! p = otmp->onamelth ? ONAME(otmp) : "";
! cmd = (strlen(p) + 1 < otmp->onamelth) ? eos(p) + 1 : (char *) 0;
if (!cmd || !*cmd) cmd = "SPAWN";
Sprintf(qbuf, "System command (%s)", cmd);
--- 555,568 ----
struct obj *otmp;
{
# ifdef SHELL /* can't access mail reader without spawning subprocess */
! const char *txt, *cmd;
! char *p, buf[BUFSZ], qbuf[BUFSZ];
! int len;
/* there should be a command hidden beyond the object name */
! txt = otmp->onamelth ? ONAME(otmp) : "";
! len = strlen(txt);
! cmd = (len + 1 < otmp->onamelth) ? txt + len + 1 : (char *) 0;
if (!cmd || !*cmd) cmd = "SPAWN";
Sprintf(qbuf, "System command (%s)", cmd);
*** /tmp/da11058 Tue Jun 1 16:14:03 1993
--- src/makemon.c Mon May 24 16:40:28 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)makemon.c 3.1 93/02/20 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)makemon.c 3.1 93/05/10 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 333,338 ****
--- 333,343 ----
(void)mongets(mtmp, KNIFE);
(void)mongets(mtmp, LONG_SWORD);
break;
+ case S_ZOMBIE:
+ if (!rn2(4)) (void)mongets(mtmp, LEATHER_ARMOR);
+ if (!rn2(4))
+ (void)mongets(mtmp, (rn2(3) ? KNIFE : SHORT_SWORD));
+ break;
case S_DEMON:
switch (mm) {
case PM_BALROG:
***************
*** 364,380 ****
if (!is_demon(ptr)) break;
/* fall thru */
/*
! * Now the general case, ~40% chance of getting some type
! * of weapon. TODO: Add more weapons types (use bigmonst());
*/
default:
! switch(rnd(12)) {
case 1:
! m_initthrow(mtmp, DART, 12);
break;
case 2:
! (void) mongets(mtmp, CROSSBOW);
! m_initthrow(mtmp, CROSSBOW_BOLT, 12);
break;
case 3:
(void) mongets(mtmp, BOW);
--- 369,395 ----
if (!is_demon(ptr)) break;
/* fall thru */
/*
! * Now the general case, Some chance of getting some type
! * of weapon for "normal" monsters. Certain special types
! * of monsters will get a bonus chance or different selections.
*/
default:
! {
! int bias;
!
! bias = is_lord(ptr) + is_prince(ptr) * 2 + extra_nasty(ptr);
! switch(rnd(14 - (2 * bias))) {
case 1:
! if(strongmonst(ptr)) (void) mongets(mtmp, BATTLE_AXE);
! else m_initthrow(mtmp, DART, 12);
break;
case 2:
! if(strongmonst(ptr))
! (void) mongets(mtmp, TWO_HANDED_SWORD);
! else {
! (void) mongets(mtmp, CROSSBOW);
! m_initthrow(mtmp, CROSSBOW_BOLT, 12);
! }
break;
case 3:
(void) mongets(mtmp, BOW);
***************
*** 381,398 ****
m_initthrow(mtmp, ARROW, 12);
break;
case 4:
! m_initthrow(mtmp, DAGGER, 3);
break;
case 5:
! (void) mongets(mtmp, AKLYS);
break;
default:
break;
}
! break;
}
#ifdef MUSE
! if ((int) mtmp->m_lev > rn2(70))
(void) mongets(mtmp, rnd_offensive_item(mtmp));
#endif
}
--- 396,417 ----
m_initthrow(mtmp, ARROW, 12);
break;
case 4:
! if(strongmonst(ptr)) (void) mongets(mtmp, LONG_SWORD);
! else m_initthrow(mtmp, DAGGER, 3);
break;
case 5:
! if(strongmonst(ptr))
! (void) mongets(mtmp, LUCERN_HAMMER);
! else (void) mongets(mtmp, AKLYS);
break;
default:
break;
}
! }
! break;
}
#ifdef MUSE
! if ((int) mtmp->m_lev > rn2(75))
(void) mongets(mtmp, rnd_offensive_item(mtmp));
#endif
}
***************
*** 546,552 ****
if (ptr == &mons[PM_SOLDIER] && rn2(13)) return;
#endif
#ifdef MUSE
! if ((int) mtmp->m_lev > rn2(30))
(void) mongets(mtmp, rnd_defensive_item(mtmp));
if ((int) mtmp->m_lev > rn2(100))
(void) mongets(mtmp, rnd_misc_item(mtmp));
--- 565,571 ----
if (ptr == &mons[PM_SOLDIER] && rn2(13)) return;
#endif
#ifdef MUSE
! if ((int) mtmp->m_lev > rn2(50))
(void) mongets(mtmp, rnd_defensive_item(mtmp));
if ((int) mtmp->m_lev > rn2(100))
(void) mongets(mtmp, rnd_misc_item(mtmp));
***************
*** 851,857 ****
if (mdat) {
if (IS_POOL(levl[x][y].typ))
if (mdat == &playermon &&
! (HLevitation || Wwalking || Magical_breathing))
return 1;
else return (is_flyer(mdat) || is_swimmer(mdat));
if (levl[x][y].typ == LAVAPOOL)
--- 870,876 ----
if (mdat) {
if (IS_POOL(levl[x][y].typ))
if (mdat == &playermon &&
! (HLevitation || Wwalking || Amphibious))
return 1;
else return (is_flyer(mdat) || is_swimmer(mdat));
if (levl[x][y].typ == LAVAPOOL)
***************
*** 1210,1222 ****
register int newtype;
register struct permonst *ptr = mtmp->data;
- if (ptr->mlevel >= 50 || is_golem(ptr) || is_home_elemental(ptr)
- || is_mplayer(ptr))
- /* doesn't grow up, has strange hp calculation so might be
- * weakened by tests below */
- return ptr;
-
if (victim) {
mtmp->mhpmax = mtmp->mhpmax + (1 + rn2((int)victim->m_lev+1));
if (mtmp->mhpmax <= (8 * (int)mtmp->m_lev)
|| (mtmp->m_lev == 0 && mtmp->mhpmax <= 4))
--- 1229,1241 ----
register int newtype;
register struct permonst *ptr = mtmp->data;
if (victim) {
+ if (ptr->mlevel >= 50 || is_golem(ptr) || is_home_elemental(ptr)
+ || is_mplayer(ptr))
+ /* doesn't grow up, has strange hp calculation so might be
+ * weakened by tests below */
+ return ptr;
+
mtmp->mhpmax = mtmp->mhpmax + (1 + rn2((int)victim->m_lev+1));
if (mtmp->mhpmax <= (8 * (int)mtmp->m_lev)
|| (mtmp->m_lev == 0 && mtmp->mhpmax <= 4))
***************
*** 1245,1250 ****
--- 1264,1270 ----
return (struct permonst *)0;
}
mtmp->data = &mons[newtype];
+ newsym(mtmp->mx, mtmp->my); /* color may change */
mtmp->m_lev = mons[newtype].mlevel;
}
if (newtype == monsndx(ptr) && victim &&
*** /tmp/da11066 Tue Jun 1 16:14:06 1993
--- src/mcastu.c Thu May 6 11:25:36 1993
***************
*** 1,25 ****
! /* SCCS Id: @(#)mcastu.c 3.1 90/09/21
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
! #include "hack.h"
#ifdef OVL0
-
static void FDECL(cursetxt,(struct monst *));
- const char *spelltyp[] = {
- "shower of missiles",
- "fireball",
- "sleep ray",
- "cone of cold",
- "finger of death",
- "bolt of lightning",
- "",
- "",
- "",
- ""
- };
static
void
cursetxt(mtmp)
--- 1,14 ----
! /* SCCS Id: @(#)mcastu.c 3.1 93/05/04 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
! #include "hack.h"
#ifdef OVL0
static void FDECL(cursetxt,(struct monst *));
+ extern const char *flash_types[]; /* from zap.c */
+
static
void
cursetxt(mtmp)
***************
*** 337,342 ****
--- 326,334 ----
#endif /* OVLB */
#ifdef OVL0
+ /* convert 1..10 to 0..9; add 10 for second group (spell casting) */
+ #define ad_to_typ(k) (10 + (int)k - 1)
+
int
buzzmu(mtmp, mattk) /* monster uses spell (ranged) */
register struct monst *mtmp;
***************
*** 351,358 ****
if(mattk->adtyp && (mattk->adtyp < 11)) { /* no cf unsigned >0 */
if(canseemon(mtmp))
pline("%s zaps you with a %s!", Monnam(mtmp),
! spelltyp[mattk->adtyp-1]);
! buzz((int) (-10 - (mattk->adtyp-1)), (int)mattk->damn,
mtmp->mx, mtmp->my, sgn(tbx), sgn(tby));
} else impossible("Monster spell %d cast", mattk->adtyp-1);
}
--- 343,350 ----
if(mattk->adtyp && (mattk->adtyp < 11)) { /* no cf unsigned >0 */
if(canseemon(mtmp))
pline("%s zaps you with a %s!", Monnam(mtmp),
! flash_types[ad_to_typ(mattk->adtyp)]);
! buzz(-ad_to_typ(mattk->adtyp), (int)mattk->damn,
mtmp->mx, mtmp->my, sgn(tbx), sgn(tby));
} else impossible("Monster spell %d cast", mattk->adtyp-1);
}
*** /tmp/da11074 Tue Jun 1 16:14:08 1993
--- src/mhitm.c Fri May 28 11:31:59 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)mhitm.c 3.1 93/02/09 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)mhitm.c 3.1 93/05/26 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 360,366 ****
if(vis) {
Sprintf(buf,"%s gazes at", Monnam(magr));
! pline("%s %s.", buf, mon_nam(mdef));
}
if (!mdef->mcansee || mdef->msleep) {
--- 360,366 ----
if(vis) {
Sprintf(buf,"%s gazes at", Monnam(magr));
! pline("%s %s...", buf, mon_nam(mdef));
}
if (!mdef->mcansee || mdef->msleep) {
***************
*** 655,661 ****
break;
case AD_TLPT:
if(!magr->mcan && tmp < mdef->mhp) {
! rloc(mdef);
if(vis && !cansee(mdef->mx, mdef->my))
pline("%s suddenly disappears!", Monnam(mdef));
}
--- 655,661 ----
break;
case AD_TLPT:
if(!magr->mcan && tmp < mdef->mhp) {
! if (!tele_restrict(mdef)) rloc(mdef);
if(vis && !cansee(mdef->mx, mdef->my))
pline("%s suddenly disappears!", Monnam(mdef));
}
***************
*** 856,862 ****
remove_monster(mdef->mx, mdef->my);
place_monster(mdef, mdef->mx, mdef->my);
}
! monkilled(mdef, "", mattk->adtyp);
if (mdef->mhp > 0) return 0; /* mdef lifesaved */
return (MM_DEF_DIED | (grow_up(magr,mdef) ? 0 : MM_AGR_DIED));
}
--- 856,862 ----
remove_monster(mdef->mx, mdef->my);
place_monster(mdef, mdef->mx, mdef->my);
}
! monkilled(mdef, "", (int)mattk->adtyp);
if (mdef->mhp > 0) return 0; /* mdef lifesaved */
return (MM_DEF_DIED | (grow_up(magr,mdef) ? 0 : MM_AGR_DIED));
}
***************
*** 972,980 ****
--- 972,988 ----
/* These affect the enemy only if defender is still alive */
if (rn2(3)) switch(mddat->mattk[i].adtyp) {
case AD_PLYS: /* Floating eye */
+ if (tmp > 127) tmp = 127;
if (mddat == &mons[PM_FLOATING_EYE]) {
+ if (!rn2(4)) tmp = 127;
if (magr->mcansee && haseyes(madat) && mdef->mcansee &&
(perceives(madat) || !mdef->minvis)) {
+ #ifdef MUSE
+ Sprintf(buf, "%s gaze is reflected by %%s %%s.",
+ s_suffix(mon_nam(mdef)));
+ if (mon_reflects(magr, buf))
+ return(mdead|mhit);
+ #endif
Strcpy(buf, Monnam(magr));
if(canseemon(magr))
pline("%s is frozen by %s gaze!",
***************
*** 1057,1063 ****
assess_dmg:
if((magr->mhp -= tmp) <= 0) {
! monkilled(magr,"",mddat->mattk[i].adtyp);
return (mdead | mhit | MM_AGR_DIED);
}
return (mdead | mhit);
--- 1065,1071 ----
assess_dmg:
if((magr->mhp -= tmp) <= 0) {
! monkilled(magr, "", (int)mddat->mattk[i].adtyp);
return (mdead | mhit | MM_AGR_DIED);
}
return (mdead | mhit);