home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
games
/
volume16
/
nethack31
/
patch2k
/
patches02h
Wrap
Text File
|
1993-06-16
|
55KB
|
2,033 lines
*** /tmp/da11330 Tue Jun 1 16:15:37 1993
--- src/rip.c Tue Apr 27 17:00:24 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)rip.c 3.1 91/08/05
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)rip.c 3.1 93/04/26 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 8,13 ****
--- 8,15 ----
extern const char *killed_by_prefix[];
+ #if defined(TTY_GRAPHICS) || defined(X11_GRAPHICS) || defined(mac)
+
static const char *rip_txt[] = {
" ----------",
" / \\",
***************
*** 49,58 ****
while(*ip) *op++ = *ip++;
}
void
! outrip(how, tmpwin)
! int how;
winid tmpwin;
{
register char **dp;
register char *dpx;
--- 51,61 ----
while(*ip) *op++ = *ip++;
}
+
void
! genl_outrip(tmpwin, how)
winid tmpwin;
+ int how;
{
register char **dp;
register char *dpx;
***************
*** 126,130 ****
--- 129,135 ----
putstr(tmpwin, 0, "");
putstr(tmpwin, 0, "");
}
+
+ #endif
/*rip.c*/
*** /tmp/da11354 Tue Jun 1 16:15:42 1993
--- src/save.c Fri May 28 11:32:09 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)save.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: @(#)save.c 3.1 93/05/26 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 31,37 ****
#endif
#ifdef ZEROCOMP
! static void FDECL(bputc, (UCHAR_P));
#endif
static void FDECL(savelevchn, (int, int));
static void FDECL(savedamage, (int,struct damage *, int));
--- 31,37 ----
#endif
#ifdef ZEROCOMP
! static void FDECL(bputc, (int));
#endif
static void FDECL(savelevchn, (int, int));
static void FDECL(savedamage, (int,struct damage *, int));
***************
*** 138,149 ****
if(flags.window_inited)
clear_nhwindow(WIN_MESSAGE);
! #ifdef MFLOPPY
if(!hu) {
dotcnt = 0;
curs(WIN_MAP, 1, 1);
putstr(WIN_MAP, 0, "Saving:");
}
/* make sure there is enough disk space */
savelev(fd, ledger_no(&u.uz), COUNT_SAVE);
savegamestate(fd, COUNT_SAVE);
--- 138,151 ----
if(flags.window_inited)
clear_nhwindow(WIN_MESSAGE);
! #ifdef MICRO
if(!hu) {
dotcnt = 0;
curs(WIN_MAP, 1, 1);
putstr(WIN_MAP, 0, "Saving:");
}
+ #endif
+ #ifdef MFLOPPY
/* make sure there is enough disk space */
savelev(fd, ledger_no(&u.uz), COUNT_SAVE);
savegamestate(fd, COUNT_SAVE);
***************
*** 383,389 ****
struct rm *prm, *rgrm;
int x, y;
uchar match;
!
rgrm = &levl[0][0]; /* start matching at first rm */
match = 0;
--- 385,391 ----
struct rm *prm, *rgrm;
int x, y;
uchar match;
!
rgrm = &levl[0][0]; /* start matching at first rm */
match = 0;
***************
*** 412,418 ****
bwrite(fd, (genericptr_t)rgrm, sizeof(struct rm));
/* start encoding again. we have at least 1 rm
* in the next run, viz. this one. */
! match = 1;
rgrm = prm;
}
}
--- 414,420 ----
bwrite(fd, (genericptr_t)rgrm, sizeof(struct rm));
/* start encoding again. we have at least 1 rm
* in the next run, viz. this one. */
! match = 1;
rgrm = prm;
}
}
***************
*** 439,444 ****
--- 441,447 ----
save_worm(fd, mode); /* save worm information */
savetrapchn(fd, ftrap, mode);
saveobjchn(fd, fobj, mode);
+ saveobjchn(fd, level.buriedobjlist, mode);
saveobjchn(fd, billobjs, mode);
save_engravings(fd, mode);
***************
*** 481,487 ****
static void
bputc(c)
! unsigned char c;
{
#ifdef MFLOPPY
bytes_counted++;
--- 484,490 ----
static void
bputc(c)
! int c;
{
#ifdef MFLOPPY
bytes_counted++;
***************
*** 492,498 ****
(void) write(bwritefd, outbuf, sizeof outbuf);
outbufp = 0;
}
! outbuf[outbufp++] = c;
}
/*ARGSUSED*/
--- 495,501 ----
(void) write(bwritefd, outbuf, sizeof outbuf);
outbufp = 0;
}
! outbuf[outbufp++] = (unsigned char)c;
}
/*ARGSUSED*/
***************
*** 499,504 ****
--- 502,510 ----
void
bufon(fd)
int fd;
+ #if defined(applec)
+ # pragma unused(fd)
+ #endif
{
return;
}
***************
*** 523,545 ****
void
bwrite(fd, loc, num)
! register int fd;
genericptr_t loc;
register unsigned num;
{
! bwritefd = fd;
! for (; num; num--, (*(char **)&loc)++) {
! if (*((char *)loc) == RLESC) { /* One more char in run */
! if (++outrunlength == 0xFF) {
! flushoutrun(outrunlength);
! }
! } else { /* end of run */
! if (outrunlength >= 0) { /* flush run */
! flushoutrun(outrunlength);
! }
! bputc(*((char *)loc));
! }
! }
}
void
--- 529,553 ----
void
bwrite(fd, loc, num)
! int fd;
genericptr_t loc;
register unsigned num;
{
! register unsigned char *bp = (unsigned char *)loc;
!
! bwritefd = fd;
! for (; num; num--, bp++) {
! if (*bp == RLESC) { /* One more char in run */
! if (++outrunlength == 0xFF) {
! flushoutrun(outrunlength);
! }
! } else { /* end of run */
! if (outrunlength >= 0) { /* flush run */
! flushoutrun(outrunlength);
! }
! bputc(*bp);
! }
! }
}
void
***************
*** 686,692 ****
bwrite(fd, (genericptr_t) &xl, sizeof(int));
bwrite(fd, (genericptr_t) otmp, xl + sizeof(struct obj));
! if (Is_container(otmp) || otmp->otyp == STATUE)
saveobjchn(fd,otmp->cobj,mode);
if (mode & FREE_SAVE) {
if(otmp->oclass == FOOD_CLASS) food_disappears(otmp);
--- 694,700 ----
bwrite(fd, (genericptr_t) &xl, sizeof(int));
bwrite(fd, (genericptr_t) otmp, xl + sizeof(struct obj));
! if (Has_contents(otmp))
saveobjchn(fd,otmp->cobj,mode);
if (mode & FREE_SAVE) {
if(otmp->oclass == FOOD_CLASS) food_disappears(otmp);
***************
*** 711,719 ****
while(mtmp) {
mtmp2 = mtmp->nmon;
- #ifdef MUSE
- if (mtmp->mw && mtmp->mw != mtmp->minvent) sort_mwep(mtmp);
- #endif
xl = mtmp->mxlth + mtmp->mnamelth;
bwrite(fd, (genericptr_t) &xl, sizeof(int));
bwrite(fd, (genericptr_t) mtmp, xl + sizeof(struct monst));
--- 719,724 ----
*** /tmp/da11362 Tue Jun 1 16:15:45 1993
--- src/shk.c Tue Jun 1 10:42:27 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)shk.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: @(#)shk.c 3.1 93/05/19 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 59,64 ****
--- 59,65 ----
BOOLEAN_P));
static void FDECL(bill_box_content, (struct obj *, BOOLEAN_P, BOOLEAN_P,
struct monst *));
+ static void FDECL(shk_names_obj, (struct obj *));
/*
invariants: obj->unpaid iff onbill(obj) [unless bp->useup]
***************
*** 128,134 ****
replshk(mtmp,mtmp2)
register struct monst *mtmp, *mtmp2;
{
! if(inhishop(mtmp) && *u.ushops == ESHK(mtmp)->shoproom) {
ESHK(mtmp2)->bill_p = &(ESHK(mtmp2)->bill[0]);
}
}
--- 129,136 ----
replshk(mtmp,mtmp2)
register struct monst *mtmp, *mtmp2;
{
! rooms[ESHK(mtmp2)->shoproom - ROOMOFFSET].resident = mtmp2;
! if (inhishop(mtmp) && *u.ushops == ESHK(mtmp)->shoproom) {
ESHK(mtmp2)->bill_p = &(ESHK(mtmp2)->bill[0]);
}
}
***************
*** 155,161 ****
register struct obj *list;
{
while (list) {
! if (Is_container(list)) clear_unpaid(list->cobj);
list->unpaid = 0;
list = list->nobj;
}
--- 157,163 ----
register struct obj *list;
{
while (list) {
! if (Has_contents(list)) clear_unpaid(list->cobj);
list->unpaid = 0;
list = list->nobj;
}
***************
*** 170,175 ****
--- 172,178 ----
clear_unpaid(invent);
clear_unpaid(fobj);
+ clear_unpaid(level.buriedobjlist);
for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
clear_unpaid(mtmp->minvent);
for(mtmp = migrating_mons; mtmp; mtmp = mtmp->nmon)
***************
*** 303,314 ****
if(!eshkp->billct && !eshkp->debit) /* bill is settled */
return;
! if(!*leavestring) {
/*
* Player just stepped onto shop-boundary (known from above logic).
* Try to intimidate him into paying his bill
*/
-
verbalize(NOTANGRY(shkp) ?
"%s! Please pay before leaving." :
"%s! Don't you leave without paying!",
--- 306,316 ----
if(!eshkp->billct && !eshkp->debit) /* bill is settled */
return;
! if (!*leavestring && shkp->mcanmove && !shkp->msleep) {
/*
* Player just stepped onto shop-boundary (known from above logic).
* Try to intimidate him into paying his bill
*/
verbalize(NOTANGRY(shkp) ?
"%s! Please pay before leaving." :
"%s! Don't you leave without paying!",
***************
*** 315,327 ****
plname);
return;
}
- /* by this point, we know an actual robbery has taken place */
- You("escaped the shop without paying!");
total = (addupbill(shkp) + eshkp->debit);
! eshkp->robbed += total;
! eshkp->credit = 0L;
! eshkp->debit = 0L;
setpaid(shkp);
You("stole %ld zorkmid%s worth of merchandise.",
total, plur(total));
if (pl_character[0] != 'R') /* stealing is unlawful */
--- 317,336 ----
plname);
return;
}
total = (addupbill(shkp) + eshkp->debit);
! if (eshkp->credit >= total) {
! Your("credit of %ld zorkmid%s is used to cover your shopping bill.",
! eshkp->credit, plur(eshkp->credit));
! total = 0L; /* credit gets cleared by setpaid() */
! } else {
! You("escaped the shop without paying!");
! total -= eshkp->credit;
! }
setpaid(shkp);
+ if (!total) return;
+
+ /* by this point, we know an actual robbery has taken place */
+ eshkp->robbed += total;
You("stole %ld zorkmid%s worth of merchandise.",
total, plur(total));
if (pl_character[0] != 'R') /* stealing is unlawful */
***************
*** 381,387 ****
pacify_shk(shkp);
}
! if (eshkp->following)
return;
if (Invis) {
--- 390,396 ----
pacify_shk(shkp);
}
! if (shkp->msleep || !shkp->mcanmove || eshkp->following) /* no dialog */
return;
if (Invis) {
***************
*** 398,405 ****
s_suffix(shkname(shkp)),
shtypes[rt - SHOPBASE].name);
} else if (eshkp->robbed) {
! verbalize("Beware, %s! I am upset about missing stock!",
! plname);
} else {
verbalize("Hello, %s! Welcome%s to %s %s!",
plname,
--- 407,413 ----
s_suffix(shkname(shkp)),
shtypes[rt - SHOPBASE].name);
} else if (eshkp->robbed) {
! pline("%s mutters imprecations against shoplifters.", shkname(shkp));
} else {
verbalize("Hello, %s! Welcome%s to %s %s!",
plname,
***************
*** 418,423 ****
--- 426,461 ----
return;
}
+ /*
+ Decide whether two unpaid items are mergable; caller is responsible for
+ making sure they're unpaid and the same type of object; we check the price
+ quoted by the shopkeeper and also that they both belong to the same shk.
+ */
+ boolean same_price(obj1, obj2)
+ struct obj *obj1, *obj2;
+ {
+ register struct monst *shkp1, *shkp2;
+ register struct bill_x *bp1 = 0, *bp2 = 0;
+ register boolean are_mergable = FALSE;
+
+ /* look up the first object by finding shk whose bill it's on */
+ for (shkp1 = next_shkp(fmon, TRUE); shkp1;
+ shkp1 = next_shkp(shkp1, TRUE))
+ if ((bp1 = onbill(obj1, shkp1, TRUE)) != 0) break;
+ /* second object is probably owned by same shk; if not, look harder */
+ if (shkp1 && (bp2 = onbill(obj2, shkp1, TRUE)) != 0) {
+ shkp2 = shkp1;
+ } else {
+ for (shkp2 = next_shkp(fmon, TRUE); shkp2;
+ shkp2 = next_shkp(shkp2, TRUE))
+ if ((bp2 = onbill(obj2, shkp2, TRUE)) != 0) break;
+ }
+
+ if (!bp1 || !bp2) impossible("same_price: object wasn't on any bill!");
+ else are_mergable = (shkp1 == shkp2 && bp1->price == bp2->price);
+ return are_mergable;
+ }
+
#endif /* OVL1 */
#ifdef OVLB
***************
*** 830,835 ****
--- 868,879 ----
return(0);
}
proceed:
+
+ if (shkp->msleep || !shkp->mcanmove) {
+ pline("%s %s.", Monnam(shkp),
+ rn2(2) ? "seems to be napping" : "doesn't respond");
+ return 0;
+ }
eshkp = ESHK(shkp);
ltmp = eshkp->robbed;
***************
*** 1115,1120 ****
--- 1159,1165 ----
}
pay(ltmp, shkp);
+ shk_names_obj(obj); /* identify some non-magic objects */
You("bought %s for %ld gold piece%s.",
doname(obj), ltmp, plur(ltmp));
obj->quan = save_quan; /* restore original count */
***************
*** 1194,1200 ****
if(numsk > 1) {
if(cansee(shkp->mx, shkp->my) && croaked)
pline("%s %slooks at your corpse%s%s", Monnam(shkp),
! (shkp->msleep || shkp->mfrozen) ?
"wakes up, " : "",
!rn2(2) ? (shkp->female ? ", shakes her head," :
", shakes his head,") : "",
--- 1239,1245 ----
if(numsk > 1) {
if(cansee(shkp->mx, shkp->my) && croaked)
pline("%s %slooks at your corpse%s%s", Monnam(shkp),
! (shkp->msleep || !shkp->mcanmove) ?
"wakes up, " : "",
!rn2(2) ? (shkp->female ? ", shakes her head," :
", shakes his head,") : "",
***************
*** 1231,1237 ****
if((loss > u.ugold) || !loss) {
pline("%s %s%stakes all your possessions.",
shkname(shkp),
! (shkp->msleep || shkp->mfrozen) ?
"wakes up and " : "",
(distu(shkp->mx, shkp->my) > 2) ?
"comes and " : "");
--- 1276,1282 ----
if((loss > u.ugold) || !loss) {
pline("%s %s%stakes all your possessions.",
shkname(shkp),
! (shkp->msleep || !shkp->mcanmove) ?
"wakes up and " : "",
(distu(shkp->mx, shkp->my) > 2) ?
"comes and " : "");
***************
*** 1272,1278 ****
shkp->mgold += loss;
pline("%s %sand takes %ld zorkmid%s %sowed %s.",
Monnam(shkp),
! (shkp->msleep || shkp->mfrozen) ?
"wakes up " : "comes ",
loss, plur(loss),
strncmp(eshkp->customer,
--- 1317,1323 ----
shkp->mgold += loss;
pline("%s %sand takes %ld zorkmid%s %sowed %s.",
Monnam(shkp),
! (shkp->msleep || !shkp->mcanmove) ?
"wakes up " : "comes ",
loss, plur(loss),
strncmp(eshkp->customer,
***************
*** 1302,1307 ****
--- 1347,1353 ----
obj = o_on(id, billobjs);
else if(!(obj = o_on(id, invent)) &&
!(obj = o_on(id, fobj)) &&
+ !(obj = o_on(id, level.buriedobjlist)) &&
!(obj = o_on(id, migrating_objs))) {
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
if ((obj = o_on(id, mtmp->minvent)) != 0)
***************
*** 1385,1391 ****
price += get_cost(otmp, shkp);
}
! if(Is_container(otmp))
price += contained_cost(otmp, shkp, price, usell);
}
--- 1431,1437 ----
price += get_cost(otmp, shkp);
}
! if (Has_contents(otmp))
price += contained_cost(otmp, shkp, price, usell);
}
***************
*** 1403,1409 ****
for (otmp = obj->cobj; otmp; otmp = otmp->nobj)
if (otmp->oclass == GOLD_CLASS)
value += otmp->quan;
! else if (Is_container(otmp))
value += contained_gold(otmp);
return(value);
--- 1449,1455 ----
for (otmp = obj->cobj; otmp; otmp = otmp->nobj)
if (otmp->oclass == GOLD_CLASS)
value += otmp->quan;
! else if (Has_contents(otmp))
value += contained_gold(otmp);
return(value);
***************
*** 1429,1435 ****
if(!otmp->unpaid && !(sale && saleitem))
otmp->no_charge = 1;
! if(Is_container(otmp))
dropped_container(otmp, shkp, sale);
}
}
--- 1475,1481 ----
if(!otmp->unpaid && !(sale && saleitem))
otmp->no_charge = 1;
! if (Has_contents(otmp))
dropped_container(otmp, shkp, sale);
}
}
***************
*** 1448,1454 ****
if(otmp->no_charge)
otmp->no_charge = 0;
! if(Is_container(otmp))
picked_container(otmp);
}
}
--- 1494,1500 ----
if(otmp->no_charge)
otmp->no_charge = 0;
! if (Has_contents(otmp))
picked_container(otmp);
}
}
***************
*** 1563,1574 ****
/* the "top" box is added in addtobill() */
if(!otmp->no_charge)
add_one_tobill(otmp, dummy);
! if(Is_container(otmp))
bill_box_content(otmp, ininv, dummy, shkp);
}
}
void
addtobill(obj, ininv, dummy, silent)
register struct obj *obj;
--- 1609,1635 ----
/* the "top" box is added in addtobill() */
if(!otmp->no_charge)
add_one_tobill(otmp, dummy);
! if (Has_contents(otmp))
bill_box_content(otmp, ininv, dummy, shkp);
}
}
+ static void
+ shk_names_obj(obj)
+ register struct obj *obj;
+ /* shopkeeper tells you what an object is */
+ {
+ obj->dknown = TRUE;
+ /* use real name for ordinary weapons/armor, and spell-less
+ * scrolls/books (that is, blank and mail).
+ */
+ if (!objects[obj->otyp].oc_magic &&
+ (obj->oclass == WEAPON_CLASS || obj->oclass == ARMOR_CLASS ||
+ obj->oclass == SCROLL_CLASS || obj->oclass == SPBOOK_CLASS))
+ makeknown(obj->otyp);
+ }
+
void
addtobill(obj, ininv, dummy, silent)
register struct obj *obj;
***************
*** 1577,1583 ****
register struct monst *shkp;
register char roomno = *u.ushops;
long ltmp = 0L, cltmp = 0L, gltmp = 0L;
! register boolean container = Is_container(obj);
if(!*u.ushops) return;
--- 1638,1644 ----
register struct monst *shkp;
register char roomno = *u.ushops;
long ltmp = 0L, cltmp = 0L, gltmp = 0L;
! register boolean container = Has_contents(obj);
if(!*u.ushops) return;
***************
*** 1639,1645 ****
} else /* i.e., !container */
add_one_tobill(obj, dummy);
speak:
! if(!shkp->msleep && !shkp->mfrozen && !silent) {
char buf[BUFSZ];
if(!ltmp) {
--- 1700,1706 ----
} else /* i.e., !container */
add_one_tobill(obj, dummy);
speak:
! if (shkp->mcanmove && !shkp->msleep && !silent) {
char buf[BUFSZ];
if(!ltmp) {
***************
*** 1650,1667 ****
Strcpy(buf, "\"For you, ");
if (ANGRY(shkp)) Strcat(buf, "scum ");
else {
! switch(rnd(4) + u.uevent.udemigod) {
! case 1: Strcat(buf, "good");
! break;
! case 2: Strcat(buf, "honored");
! break;
! case 3: Strcat(buf, "most gracious");
! break;
! case 4: Strcat(buf, "esteemed");
! break;
! case 5: Strcat(buf, "most renowned and sacred");
! break;
! }
#ifdef POLYSELF
if(!is_human(uasmon)) Strcat(buf, " creature");
else
--- 1711,1721 ----
Strcpy(buf, "\"For you, ");
if (ANGRY(shkp)) Strcat(buf, "scum ");
else {
! static const char *honored[5] = {
! "good", "honored", "most gracious", "esteemed",
! "most renowned and sacred"
! };
! Strcat(buf, honored[rn2(4) + u.uevent.udemigod]);
#ifdef POLYSELF
if(!is_human(uasmon)) Strcat(buf, " creature");
else
***************
*** 1668,1676 ****
#endif
Strcat(buf, (flags.female) ? " lady" : " sir");
}
- /* after all, the shk is telling you what it is */
- obj->dknown = 1;
- exercise(A_WIS, TRUE);
if(ininv) {
long quan = obj->quan;
obj->quan = 1L; /* fool xname() into giving singular */
--- 1722,1727 ----
***************
*** 1777,1787 ****
sub_one_frombill(obj, shkp);
! if(Is_container(obj))
for(otmp = obj->cobj; otmp; otmp = otmp->nobj) {
if(otmp->oclass == GOLD_CLASS) continue;
! if(Is_container(otmp))
subfrombill(otmp, shkp);
else
sub_one_frombill(otmp, shkp);
--- 1828,1838 ----
sub_one_frombill(obj, shkp);
! if (Has_contents(obj))
for(otmp = obj->cobj; otmp; otmp = otmp->nobj) {
if(otmp->oclass == GOLD_CLASS) continue;
! if (Has_contents(otmp))
subfrombill(otmp, shkp);
else
sub_one_frombill(otmp, shkp);
***************
*** 1810,1816 ****
if(otmp->oclass == GOLD_CLASS) continue;
! if(!Is_container(otmp)) {
if(ininv) {
if(otmp->unpaid)
price += get_cost(otmp, shkp);
--- 1861,1867 ----
if(otmp->oclass == GOLD_CLASS) continue;
! if (!Has_contents(otmp)) {
if(ininv) {
if(otmp->unpaid)
price += get_cost(otmp, shkp);
***************
*** 1852,1858 ****
if(obj->oclass == GOLD_CLASS) {
gvalue += obj->quan;
! } else if(Is_container(obj)) {
register boolean ininv = !!count_unpaid(obj->cobj);
value += stolen_container(obj, shkp, value, ininv);
--- 1903,1909 ----
if(obj->oclass == GOLD_CLASS) {
gvalue += obj->quan;
! } else if (Has_contents(obj)) {
register boolean ininv = !!count_unpaid(obj->cobj);
value += stolen_container(obj, shkp, value, ininv);
***************
*** 1918,1924 ****
register struct monst *shkp;
register struct eshk *eshkp;
register long ltmp = 0L, cltmp = 0L, gltmp = 0L, offer;
! boolean saleitem, cgold = FALSE, container = Is_container(obj);
boolean isgold = (obj->oclass == GOLD_CLASS);
if(!(shkp = shop_keeper(*in_rooms(x, y, SHOPBASE))) ||
--- 1969,1975 ----
register struct monst *shkp;
register struct eshk *eshkp;
register long ltmp = 0L, cltmp = 0L, gltmp = 0L, offer;
! boolean saleitem, cgold = FALSE, container = Has_contents(obj);
boolean isgold = (obj->oclass == GOLD_CLASS);
if(!(shkp = shop_keeper(*in_rooms(x, y, SHOPBASE))) ||
***************
*** 1934,1951 ****
return;
}
if(container) {
- if(obj->cobj == (struct obj *)0) {
- if(obj->unpaid) {
- sub_one_frombill(obj, shkp);
- return;
- }
- } else {
/* find the price of content before subfrombill */
cltmp += contained_cost(obj, shkp, cltmp, TRUE);
/* find the value of contained gold */
gltmp += contained_gold(obj);
cgold = (gltmp > 0L);
- }
}
if(!isgold && !obj->unpaid && saleitem)
--- 1985,1995 ----
***************
*** 1959,1971 ****
(container && count_unpaid(obj->cobj)));
if(container) {
- if(obj->cobj != (struct obj *)0) {
dropped_container(obj, shkp, FALSE);
if(!obj->unpaid && !saleitem)
obj->no_charge = 1;
if(obj->unpaid || count_unpaid(obj->cobj))
subfrombill(obj, shkp);
- } else obj->no_charge = 1;
} else obj->no_charge = 1;
if(!unpaid)
--- 2003,2013 ----
***************
*** 1974,1986 ****
}
/* you dropped something of your own - probably want to sell it */
! if(shkp->msleep || !shkp->mcanmove) {
! if(container && obj->cobj != (struct obj *)0) {
dropped_container(obj, shkp, TRUE);
! }
! if(!obj->unpaid && !saleitem && !isgold)
obj->no_charge = 1;
! if(!shkp->mcanmove) {
if(ANGRY(shkp) && !rn2(4))
pline("%s utters a curse.", Monnam(shkp));
else pline("%s is indisposed.", Monnam(shkp));
--- 2016,2027 ----
}
/* you dropped something of your own - probably want to sell it */
! if (shkp->msleep || !shkp->mcanmove) {
! if (container)
dropped_container(obj, shkp, TRUE);
! if (!obj->unpaid)
obj->no_charge = 1;
! if (!shkp->mcanmove) {
if(ANGRY(shkp) && !rn2(4))
pline("%s utters a curse.", Monnam(shkp));
else pline("%s is indisposed.", Monnam(shkp));
***************
*** 2037,2048 ****
if(offer) goto move_on;
else {
if(!isgold) {
! if(container && obj->cobj != (struct obj *)0) {
dropped_container(obj, shkp, FALSE);
! }
! if(!obj->unpaid && !saleitem)
! obj->no_charge = 1;
! subfrombill(obj, shkp);
}
return;
}
--- 2078,2087 ----
if(offer) goto move_on;
else {
if(!isgold) {
! if (container)
dropped_container(obj, shkp, FALSE);
! if (!obj->unpaid && !saleitem) obj->no_charge = 1;
! subfrombill(obj, shkp);
}
return;
}
***************
*** 2056,2087 ****
|| (Is_candle(obj) &&
obj->age < 20L * (long)objects[obj->otyp].oc_cost)) {
pline("%s seems not interested%s.", Monnam(shkp),
! cgold ? " in the rest" : "");
! if(container && obj->cobj != (struct obj *)0) {
dropped_container(obj, shkp, FALSE);
- }
obj->no_charge = 1;
return;
}
if(!shkp->mgold) {
long tmpcr = (ltmp + cltmp) * 2L;
! pline("%s cannot pay you at present.", Monnam(shkp));
! pline("Will you accept %ld zorkmids in credit for %s? ",
! tmpcr, doname(obj));
! /* cannot use a yn function here */
! if (readchar() == 'y') {
You("have %ld zorkmids in %scredit.", tmpcr,
! ESHK(shkp)->credit > 0L ? "additional " : "");
ESHK(shkp)->credit += tmpcr;
subfrombill(obj, shkp);
} else {
! if(container && obj->cobj != (struct obj *)0) {
! dropped_container(obj, shkp, FALSE);
! }
! if(!obj->unpaid)
! obj->no_charge = 1;
subfrombill(obj, shkp);
}
} else {
--- 2095,2131 ----
|| (Is_candle(obj) &&
obj->age < 20L * (long)objects[obj->otyp].oc_cost)) {
pline("%s seems not interested%s.", Monnam(shkp),
! cgold ? " in the rest" : "");
! if (container)
dropped_container(obj, shkp, FALSE);
obj->no_charge = 1;
return;
}
if(!shkp->mgold) {
+ char c, qbuf[BUFSZ];
long tmpcr = (ltmp + cltmp) * 2L;
! if (sell_response != 'n') {
! pline("%s cannot pay you at present.", Monnam(shkp));
! Sprintf(qbuf,
! "Will you accept %ld zorkmids in credit for %s? ",
! tmpcr, doname(obj));
! /* won't accept 'a' response here */
! c = ynq(qbuf);
! } else /* previously specified "quit" */
! c = 'n';
!
! if (c == 'y') {
You("have %ld zorkmids in %scredit.", tmpcr,
! ESHK(shkp)->credit > 0L ? "additional " : "");
ESHK(shkp)->credit += tmpcr;
subfrombill(obj, shkp);
} else {
! if (c == 'q') sell_response = 'n';
! if (container)
! dropped_container(obj, shkp, FALSE);
! if (!obj->unpaid) obj->no_charge = 1;
subfrombill(obj, shkp);
}
} else {
***************
*** 2113,2130 ****
switch (sell_response ? sell_response : ynaq(qbuf)) {
case 'q': sell_response = 'n';
! case 'n': if(container && obj->cobj != (struct obj *)0) {
dropped_container(obj, shkp, FALSE);
! }
! if(!obj->unpaid) obj->no_charge = 1;
subfrombill(obj, shkp);
break;
case 'a': sell_response = 'y';
! case 'y': if(container && obj->cobj != (struct obj *)0)
! dropped_container(obj, shkp, TRUE);
! if(!obj->unpaid && !saleitem)
! obj->no_charge = 1;
! subfrombill(obj, shkp);
pay(-offer, shkp);
You("sold %s for %ld gold piece%s.", doname(obj),
offer, plur(offer));
--- 2157,2172 ----
switch (sell_response ? sell_response : ynaq(qbuf)) {
case 'q': sell_response = 'n';
! case 'n': if (container)
dropped_container(obj, shkp, FALSE);
! if (!obj->unpaid) obj->no_charge = 1;
subfrombill(obj, shkp);
break;
case 'a': sell_response = 'y';
! case 'y': if (container)
! dropped_container(obj, shkp, TRUE);
! if (!obj->unpaid && !saleitem) obj->no_charge = 1;
! subfrombill(obj, shkp);
pay(-offer, shkp);
You("sold %s for %ld gold piece%s.", doname(obj),
offer, plur(offer));
***************
*** 2179,2194 ****
goto quit;
}
if(bp->useup || bp->bquan > obj->quan) {
! register long oquan, uquan;
! long thisused;
oquan = obj->quan;
uquan = (bp->useup ? bp->bquan : bp->bquan - oquan);
thisused = bp->price * uquan;
totused += thisused;
obj->quan = uquan; /* cheat doname */
buf_p = xprname(obj, ' ', FALSE, thisused);
obj->quan = oquan; /* restore value */
putstr(datawin, 0, buf_p);
}
}
--- 2221,2244 ----
goto quit;
}
if(bp->useup || bp->bquan > obj->quan) {
! register long oquan, uquan, thisused;
! unsigned save_unpaid;
+ save_unpaid = obj->unpaid;
oquan = obj->quan;
uquan = (bp->useup ? bp->bquan : bp->bquan - oquan);
thisused = bp->price * uquan;
totused += thisused;
obj->quan = uquan; /* cheat doname */
+ obj->unpaid = 0; /* ditto */
buf_p = xprname(obj, ' ', FALSE, thisused);
obj->quan = oquan; /* restore value */
+ #ifdef __SASC
+ /* SAS/C 6.2 can't cope for some reason */
+ sasc_bug(obj,save_unpaid);
+ #else
+ obj->unpaid = save_unpaid;
+ #endif
putstr(datawin, 0, buf_p);
}
}
***************
*** 2236,2241 ****
--- 2286,2292 ----
return tmp;
}
+ /* shk catches thrown pick-axe */
int
shkcatch(obj, x, y)
register struct obj *obj;
***************
*** 2403,2409 ****
if ((monstermoves - tmp_dam->when) < REPAIR_DELAY)
return(0);
! if (ESHK(shkp)->following)
return(0);
x = tmp_dam->place.x;
y = tmp_dam->place.y;
--- 2454,2460 ----
if ((monstermoves - tmp_dam->when) < REPAIR_DELAY)
return(0);
! if (shkp->msleep || !shkp->mcanmove || ESHK(shkp)->following)
return(0);
x = tmp_dam->place.x;
y = tmp_dam->place.y;
***************
*** 2448,2455 ****
y+vert(i)) == ESHK(shkp)->shoproom)
litter[i] |= INSHOP;
}
! if (Punished && ((uchain->ox == x && uchain->oy == y) ||
! (uball->ox == x && uball->oy == y))) {
/*
* Either the ball or chain is in the repair location.
*
--- 2499,2507 ----
y+vert(i)) == ESHK(shkp)->shoproom)
litter[i] |= INSHOP;
}
! if (Punished && !u.uswallow &&
! ((uchain->ox == x && uchain->oy == y) ||
! (uball->ox == x && uball->oy == y))) {
/*
* Either the ball or chain is in the repair location.
*
***************
*** 2872,2878 ****
break;
/* note: otmp might have ->no_charge set, but that's ok */
return (otmp && costly_spot(x, y) && NOTANGRY(shkp)
! && !shkp->msleep && !shkp->mfrozen)
? otmp : (struct obj *)0;
}
--- 2924,2930 ----
break;
/* note: otmp might have ->no_charge set, but that's ok */
return (otmp && costly_spot(x, y) && NOTANGRY(shkp)
! && shkp->mcanmove && !shkp->msleep)
? otmp : (struct obj *)0;
}
***************
*** 2950,2955 ****
--- 3002,3048 ----
return ".";
}
+ #ifdef SOUNDS
+ void
+ shk_chat(shkp)
+ register struct monst *shkp;
+ {
+ register struct eshk *eshk = ESHK(shkp);
+
+ if (ANGRY(shkp))
+ pline("%s mentions how much %s dislikes %s customers.",
+ shkname(shkp), he[shkp->female],
+ eshk->robbed ? "non-paying" : "rude");
+ else if (eshk->following)
+ if (strncmp(eshk->customer, plname, PL_NSIZ)) {
+ verbalize("Hello %s! I was looking for %s.",
+ plname, eshk->customer);
+ eshk->following = 0;
+ } else {
+ verbalize("Hello %s! Didn't you forget to pay?", plname);
+ }
+ else if (eshk->billct) {
+ register long total = addupbill(shkp) + eshk->debit;
+ pline("%s says that your bill comes to %ld zorkmid%s.",
+ shkname(shkp), total, plur(total));
+ } else if (eshk->debit)
+ pline("%s reminds you that you owe %s %ld zorkmid%s.",
+ shkname(shkp), him[shkp->female],
+ eshk->debit, plur(eshk->debit));
+ else if (eshk->credit)
+ pline("%s encourages you to use your %ld zorkmid%s of credit.",
+ shkname(shkp), eshk->credit, plur(eshk->credit));
+ else if (eshk->robbed)
+ pline("%s complains about a recent robbery.", shkname(shkp));
+ else if (shkp->mgold < 50)
+ pline("%s complains that business is bad.", shkname(shkp));
+ else if (shkp->mgold > 4000)
+ pline("%s says that business is good.", shkname(shkp));
+ else
+ pline("%s talks about the problem of shoplifters.", shkname(shkp));
+ }
+ #endif /* SOUNDS */
+
#ifdef KOPS
static void
kops_gone(silent)
***************
*** 3008,3014 ****
} else if (otmp->oclass == SPBOOK_CLASS) {
tmp -= tmp / 5L;
} else if (otmp->otyp == CAN_OF_GREASE)
! tmp /= 10L;
return(tmp);
}
--- 3101,3107 ----
} else if (otmp->oclass == SPBOOK_CLASS) {
tmp -= tmp / 5L;
} else if (otmp->otyp == CAN_OF_GREASE)
! tmp /= 10L;
return(tmp);
}
***************
*** 3140,3144 ****
--- 3233,3243 ----
}
#endif /* OVLB */
+
+ #ifdef __SASC
+ sasc_bug(struct obj *op, unsigned x){
+ op->unpaid=x;
+ }
+ #endif
/*shk.c*/
*** /tmp/da11370 Tue Jun 1 16:15:50 1993
--- src/shknam.c Mon May 17 14:05:04 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)shknam.c 3.1 93/02/17 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)shknam.c 3.1 93/05/15 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 10,16 ****
#ifdef OVLB
static void FDECL(mkshobj_at, (const struct shclass *,int,int));
! static void FDECL(findname, (char *,const char **));
static int FDECL(shkinit, (const struct shclass *,struct mkroom *));
static const char *shkliquors[] = {
--- 10,16 ----
#ifdef OVLB
static void FDECL(mkshobj_at, (const struct shclass *,int,int));
! static void FDECL(nameshk, (struct monst *,const char **));
static int FDECL(shkinit, (const struct shclass *,struct mkroom *));
static const char *shkliquors[] = {
***************
*** 123,128 ****
--- 123,140 ----
""
};
+ static const char *shklight[] = {
+ /* Romania */
+ "Zarnesti", "Slanic", "Nehoiasu", "Ludus", "Sighisoara", "Nisipitu",
+ "Razboieni", "Bicaz", "Dorohoi", "Vaslui", "Fetesti", "Tirgu Neamt",
+ "Babadag", "Zimnicea", "Zlatna", "Jiu", "Eforie", "Mamaia",
+ /* Bulgaria */
+ "Silistra", "Tulovo", "Panagyuritshte", "Smolyan", "Kirklareli",
+ "Pernik", "Lom", "Haskovo", "Dobrinishte", "Varvara", "Oryahovo",
+ "Troyan", "Lovech", "Sliven",
+ ""
+ };
+
static const char *shkgeneral[] = {
/* Suriname */
"Hebiwerie", "Possogroenoe", "Asidonhopo", "Manlobbi",
***************
*** 191,197 ****
*/
{"lighting store", TOOL_CLASS, 0, D_SHOP,
{{32, -WAX_CANDLE}, {50, -TALLOW_CANDLE},
! {5, -BRASS_LANTERN}, {10, -OIL_LAMP}, {3, -MAGIC_LAMP}},shktools},
{NULL, 0, 0, 0, {{0, 0}, {0, 0}, {0, 0}}, 0}
};
--- 203,209 ----
*/
{"lighting store", TOOL_CLASS, 0, D_SHOP,
{{32, -WAX_CANDLE}, {50, -TALLOW_CANDLE},
! {5, -BRASS_LANTERN}, {10, -OIL_LAMP}, {3, -MAGIC_LAMP}}, shklight},
{NULL, 0, 0, 0, {{0, 0}, {0, 0}, {0, 0}}, 0}
};
***************
*** 247,273 ****
else (void) mkobj_at(atype, sx, sy, TRUE);
}
- static void
- findname(nampt, nlp)
/* extract a shopkeeper name for the given shop type */
! char *nampt;
! const char *nlp[];
{
! register int i;
! for(i = 0; i < ledger_no(&u.uz); i++) /* Note: _not_ depth */
! if (!*nlp[i]) {
! /* Not enough names, try random/general name */
! if((i = rn2(i)))
! break;
! else if (nlp != shkgeneral)
! findname(nampt, shkgeneral);
! else
! Strcpy(nampt, "Dirk");
! return;
}
! (void) strncpy(nampt, nlp[i-1], PL_NSIZ);
! nampt[PL_NSIZ-1] = 0;
}
static int
--- 259,313 ----
else (void) mkobj_at(atype, sx, sy, TRUE);
}
/* extract a shopkeeper name for the given shop type */
! static void
! nameshk(shk, nlp)
! struct monst *shk;
! const char *nlp[];
{
! int i, try, names_avail;
! const char *shname = 0;
! struct monst *mtmp;
! int name_wanted = ledger_no(&u.uz); /* Note: _not_ depth */
! for (names_avail = 0; *nlp[names_avail]; names_avail++)
! ;
!
! for (try = 0; try < 50; try++) {
! if (nlp == shktools) {
! shname = shktools[rn2(names_avail)];
! shk->female = (*shname == '_');
! if (shk->female) shname++;
! } else {
! shk->female = name_wanted % 2;
!
! if (name_wanted < names_avail) {
! shname = nlp[name_wanted];
! } else {
! if ((i = rn2(names_avail)) != 0)
! shname = nlp[i-1];
! else if (nlp != shkgeneral) {
! nlp = shkgeneral; /* try general names */
! for (names_avail = 0; *nlp[names_avail];
! names_avail++)
! ;
! continue;
! } else
! shname = "Dirk";
! }
! }
!
! /* is name already is use on this level? */
! for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
! if (mtmp == shk) continue;
! if (!mtmp->isshk) continue;
! if (strcmp(ESHK(mtmp)->shknam, shname)) continue;
! break;
! }
! if (!mtmp) break; /* new name */
}
! (void) strncpy(ESHK(shk)->shknam, shname, PL_NSIZ);
! ESHK(shk)->shknam[PL_NSIZ-1] = 0;
}
static int
***************
*** 328,336 ****
/* now initialize the shopkeeper monster structure */
if(!(shk = makemon(&mons[PM_SHOPKEEPER], sx, sy))) return(-1);
! shk->isshk = shk->mpeaceful = 1;
set_malign(shk);
! shk->msleep = 0;
shk->mtrapseen = ~0; /* we know all the traps already */
ESHK(shk)->shoproom = (sroom - rooms) + ROOMOFFSET;
sroom->resident = shk;
--- 368,376 ----
/* now initialize the shopkeeper monster structure */
if(!(shk = makemon(&mons[PM_SHOPKEEPER], sx, sy))) return(-1);
! shk->isshk = shk->mpeaceful = TRUE;
set_malign(shk);
! shk->msleep = FALSE;
shk->mtrapseen = ~0; /* we know all the traps already */
ESHK(shk)->shoproom = (sroom - rooms) + ROOMOFFSET;
sroom->resident = shk;
***************
*** 347,362 ****
ESHK(shk)->following = 0;
ESHK(shk)->billct = 0;
shk->mgold = 1000L + 30L*(long)rnd(100); /* initial capital */
! if (shp->shknms == shktools) {
! int who = rn2(SIZE(shktools) - 1);
! const char *shname = shp->shknms[who];
! if (shk->female = (*shname == '_')) shname++;
! (void) strncpy(ESHK(shk)->shknam, shname, PL_NSIZ);
! ESHK(shk)->shknam[PL_NSIZ-1] = 0;
! } else {
! shk->female = ledger_no(&u.uz)%2;
! findname(ESHK(shk)->shknam, shp->shknms);
! }
return(sh);
}
--- 387,393 ----
ESHK(shk)->following = 0;
ESHK(shk)->billct = 0;
shk->mgold = 1000L + 30L*(long)rnd(100); /* initial capital */
! nameshk(shk, shp->shknms);
return(sh);
}
***************
*** 427,433 ****
* monsters will sit on top of objects and not the other way around.
*/
! level.flags.has_shop = 1;
}
#endif /* OVLB */
--- 458,464 ----
* monsters will sit on top of objects and not the other way around.
*/
! level.flags.has_shop = TRUE;
}
#endif /* OVLB */
*** /tmp/da11378 Tue Jun 1 16:15:53 1993
--- src/sit.c Thu May 20 15:43:51 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)sit.c 3.1 92/10/24 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)sit.c 3.1 93/05/19 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 36,42 ****
You("sit on %s.", the(xname(obj)));
if(!Is_box(obj)) pline("It's not very comfortable...");
! } else if(trap = t_at(u.ux, u.uy)) {
if (u.utrap) {
exercise(A_WIS, FALSE); /* you're getting stuck longer */
--- 36,42 ----
You("sit on %s.", the(xname(obj)));
if(!Is_box(obj)) pline("It's not very comfortable...");
! } else if ((trap = t_at(u.ux, u.uy)) != 0) {
if (u.utrap) {
exercise(A_WIS, FALSE); /* you're getting stuck longer */
***************
*** 211,219 ****
You("are granted an insight!");
if (invent) {
int ret, cval = rn2(5); /* agrees w/seffects() */
do {
ret = ggetobj("identify", identify, cval);
! } while (cval && (cval -= ret));
}
break;
case 13:
--- 211,221 ----
You("are granted an insight!");
if (invent) {
int ret, cval = rn2(5); /* agrees w/seffects() */
+ /* use up `cval' "charges"; 0 is special case */
do {
ret = ggetobj("identify", identify, cval);
! if (ret < 0) break; /* quit */
! } while (ret == 0 || (cval -= ret) > 0);
}
break;
case 13:
***************
*** 261,267 ****
} else if (u.uswallow)
pline("There are no seats in here!");
else
! pline("Having fun sitting on the floor?");
return(1);
}
--- 263,269 ----
} else if (u.uswallow)
pline("There are no seats in here!");
else
! pline("Having fun sitting on the %s?", surface(u.ux,u.uy));
return(1);
}
***************
*** 271,280 ****
int nobj = 0;
int cnt, onum;
struct obj *otmp;
if(Antimagic) {
shieldeff(u.ux, u.uy);
! You("feel a malignant aura surround you.");
}
for (otmp = invent; otmp; otmp = otmp->nobj) nobj++;
--- 273,288 ----
int nobj = 0;
int cnt, onum;
struct obj *otmp;
+ static const char *mal_aura = "feel a malignant aura surround %s.";
+ if (uwep && (uwep->oartifact == ART_MAGICBANE) && rn2(20)) {
+ You(mal_aura, "the magic-absorbing blade");
+ return;
+ }
+
if(Antimagic) {
shieldeff(u.ux, u.uy);
! You(mal_aura, "you");
}
for (otmp = invent; otmp; otmp = otmp->nobj) nobj++;
*** /tmp/da11402 Tue Jun 1 16:16:01 1993
--- src/spell.c Mon May 17 14:05:10 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)spell.c 3.1 92/12/10
/* Copyright (c) M. Stephenson 1988 */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)spell.c 3.1 93/05/15 */
/* Copyright (c) M. Stephenson 1988 */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 105,111 ****
}
if(!u.uhave.bell || !u.uhave.menorah) {
! pline("A chill runs down your spine.");
if(!u.uhave.bell) You("hear a faint chime...");
if(!u.uhave.menorah) pline("Vlad's doppelganger is amused.");
return;
--- 105,111 ----
}
if(!u.uhave.bell || !u.uhave.menorah) {
! pline("A chill runs down your %s.", body_part(SPINE));
if(!u.uhave.bell) You("hear a faint chime...");
if(!u.uhave.menorah) pline("Vlad's doppelganger is amused.");
return;
***************
*** 149,155 ****
mm.y = u.uy;
mkundead(&mm);
if(!rn2(4))
! if(mtmp = makemon(&mons[PM_MASTER_LICH],u.ux,u.uy)) {
mtmp->mpeaceful = 0;
set_malign(mtmp);
}
--- 149,155 ----
mm.y = u.uy;
mkundead(&mm);
if(!rn2(4))
! if ((mtmp = makemon(&mons[PM_MASTER_LICH],u.ux,u.uy)) != 0) {
mtmp->mpeaceful = 0;
set_malign(mtmp);
}
***************
*** 494,499 ****
--- 494,501 ----
case SPE_FINGER_OF_DEATH:
case SPE_LIGHT:
case SPE_DETECT_UNSEEN:
+ case SPE_HEALING:
+ case SPE_EXTRA_HEALING:
if (!(objects[pseudo->otyp].oc_dir == NODIR)) {
if (atme) u.dx = u.dy = u.dz = 0;
else (void) getdir(NULL);
***************
*** 524,533 ****
case SPE_INVISIBILITY:
(void) peffects(pseudo);
break;
- case SPE_HEALING:
- You("feel a bit better.");
- healup(rnd(8), 0, FALSE, FALSE);
- break;
case SPE_CURE_BLINDNESS:
healup(0, 0, FALSE, TRUE);
break;
--- 526,531 ----
***************
*** 534,543 ****
case SPE_CURE_SICKNESS:
if (Sick) You("are no longer ill.");
healup(0, 0, TRUE, FALSE);
- break;
- case SPE_EXTRA_HEALING:
- You("feel a fair bit better.");
- healup(d(2,8)+2, 0, FALSE, FALSE);
break;
case SPE_CREATE_FAMILIAR:
make_familiar((struct obj *)0, u.ux, u.uy);
--- 532,537 ----
*** /tmp/da11410 Tue Jun 1 16:16:03 1993
--- src/steal.c Tue Jun 1 11:58:39 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)steal.c 3.1 92/10/14 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)steal.c 3.1 93/05/30 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 11,20 ****
static const char *
equipname(otmp)
!
! register struct obj *otmp;
{
-
return (
#ifdef TOURIST
(otmp == uarmu) ? "shirt" :
--- 11,18 ----
static const char *
equipname(otmp)
! register struct obj *otmp;
{
return (
#ifdef TOURIST
(otmp == uarmu) ? "shirt" :
***************
*** 27,33 ****
}
long /* actually returns something that fits in an int */
! somegold(){
#ifdef LINT /* long conv. ok */
return(0L);
#else
--- 25,32 ----
}
long /* actually returns something that fits in an int */
! somegold()
! {
#ifdef LINT /* long conv. ok */
return(0L);
#else
***************
*** 50,56 ****
pline("%s quickly snatches some gold from between your %s!",
Monnam(mtmp), makeplural(body_part(FOOT)));
if(!u.ugold || !rn2(5)) {
! rloc(mtmp);
mtmp->mflee = 1;
}
} else if(u.ugold) {
--- 49,55 ----
pline("%s quickly snatches some gold from between your %s!",
Monnam(mtmp), makeplural(body_part(FOOT)));
if(!u.ugold || !rn2(5)) {
! if (!tele_restrict(mtmp)) rloc(mtmp);
mtmp->mflee = 1;
}
} else if(u.ugold) {
***************
*** 57,63 ****
u.ugold -= (tmp = somegold());
Your("purse feels lighter.");
mtmp->mgold += tmp;
! rloc(mtmp);
mtmp->mflee = 1;
flags.botl = 1;
}
--- 56,62 ----
u.ugold -= (tmp = somegold());
Your("purse feels lighter.");
mtmp->mgold += tmp;
! if (!tele_restrict(mtmp)) rloc(mtmp);
mtmp->mflee = 1;
flags.botl = 1;
}
***************
*** 68,74 ****
unsigned int stealmid; /* monster doing the stealing */
STATIC_OVL int
! stealarm(){
register struct monst *mtmp;
register struct obj *otmp;
--- 67,74 ----
unsigned int stealmid; /* monster doing the stealing */
STATIC_OVL int
! stealarm()
! {
register struct monst *mtmp;
register struct obj *otmp;
***************
*** 82,88 ****
pline("%s steals %s!", Monnam(mtmp), doname(otmp));
mpickobj(mtmp,otmp);
mtmp->mflee = 1;
! rloc(mtmp);
break;
}
break;
--- 82,88 ----
pline("%s steals %s!", Monnam(mtmp), doname(otmp));
mpickobj(mtmp,otmp);
mtmp->mflee = 1;
! if (!tele_restrict(mtmp)) rloc(mtmp);
break;
}
break;
***************
*** 263,270 ****
--- 263,275 ----
register struct monst *mtmp;
register struct obj *otmp;
{
+ if (otmp->otyp == GOLD_PIECE) { /* from floor etc. -- not inventory */
+ mtmp->mgold += otmp->quan;
+ obfree(otmp, (struct obj *)0);
+ } else {
otmp->nobj = mtmp->minvent;
mtmp->minvent = otmp;
+ }
}
#endif /* OVL1 */
***************
*** 278,288 ****
register int real, fake;
/* select the artifact to steal */
! if(u.uhave.amulet) {
real = AMULET_OF_YENDOR ;
fake = FAKE_AMULET_OF_YENDOR ;
#ifdef MULDGN
} else if(u.uhave.questart) {
for(otmp = invent; otmp; otmp = otmp->nobj)
if(is_quest_artifact(otmp)) goto snatch_it;
#endif
--- 283,294 ----
register int real, fake;
/* select the artifact to steal */
! if(u.uhave.amulet) {
real = AMULET_OF_YENDOR ;
fake = FAKE_AMULET_OF_YENDOR ;
#ifdef MULDGN
} else if(u.uhave.questart) {
+ real = fake = 0; /* gcc -Wall lint */
for(otmp = invent; otmp; otmp = otmp->nobj)
if(is_quest_artifact(otmp)) goto snatch_it;
#endif
***************
*** 302,312 ****
if(otmp->otyp == real || (otmp->otyp == fake && !mtmp->iswiz)) {
/* might be an imitation one */
snatch_it:
setnotworn(otmp);
freeinv(otmp);
mpickobj(mtmp,otmp);
pline("%s stole %s!", Monnam(mtmp), doname(otmp));
! if (can_teleport(mtmp->data)) rloc(mtmp);
return;
}
}
--- 308,322 ----
if(otmp->otyp == real || (otmp->otyp == fake && !mtmp->iswiz)) {
/* might be an imitation one */
snatch_it:
+ #ifdef MULDGN
+ if (otmp->oclass == ARMOR_CLASS) adj_abon(otmp, -(otmp->spe));
+ #endif
setnotworn(otmp);
freeinv(otmp);
mpickobj(mtmp,otmp);
pline("%s stole %s!", Monnam(mtmp), doname(otmp));
! if (can_teleport(mtmp->data) && !tele_restrict(mtmp))
! rloc(mtmp);
return;
}
}
***************
*** 315,353 ****
#endif /* OVLB */
#ifdef OVL0
! /* release the objects the killed animal was carrying */
void
relobj(mtmp,show,is_pet)
register struct monst *mtmp;
register int show;
! boolean is_pet; /* If true, pet should keep wielded weapon */
{
register struct obj *otmp, *otmp2;
register int omx = mtmp->mx, omy = mtmp->my;
-
#ifdef MUSE
! otmp2 = otmp = 0;
! if (is_pet) {
! sort_mwep(mtmp);
! if ((otmp2 = MON_WEP(mtmp))) {
! otmp = otmp2->nobj;
! otmp2->nobj = 0;
! }
! }
! if (!otmp2)
#endif
- { otmp = mtmp->minvent;
- mtmp->minvent = 0;
- }
for (; otmp; otmp = otmp2) {
#ifdef MUSE
! if (otmp->owornmask) {
mtmp->misc_worn_check &= ~(otmp->owornmask);
otmp->owornmask = 0L;
}
#endif
- otmp2 = otmp->nobj;
if (is_pet && cansee(omx, omy) && flags.verbose)
pline("%s drops %s.", Monnam(mtmp),
distant_name(otmp, doname));
--- 325,364 ----
#endif /* OVLB */
#ifdef OVL0
! /* release the objects the creature is carrying */
void
relobj(mtmp,show,is_pet)
register struct monst *mtmp;
register int show;
! boolean is_pet; /* If true, pet should keep wielded/worn items */
{
register struct obj *otmp, *otmp2;
register int omx = mtmp->mx, omy = mtmp->my;
#ifdef MUSE
! struct obj *backobj = 0;
! struct obj *wep = MON_WEP(mtmp);
#endif
+ otmp = mtmp->minvent;
+ mtmp->minvent = 0;
for (; otmp; otmp = otmp2) {
+ otmp2 = otmp->nobj;
#ifdef MUSE
! if (otmp->owornmask || otmp == wep) {
! if (is_pet) { /* skip worn/wielded item */
! if (!backobj) {
! mtmp->minvent = backobj = otmp;
! } else {
! backobj->nobj = otmp;
! backobj = backobj->nobj;
! }
! continue;
! }
mtmp->misc_worn_check &= ~(otmp->owornmask);
otmp->owornmask = 0L;
}
+ if (backobj) backobj->nobj = otmp->nobj;
#endif
if (is_pet && cansee(omx, omy) && flags.verbose)
pline("%s drops %s.", Monnam(mtmp),
distant_name(otmp, doname));
*** /tmp/da11418 Tue Jun 1 16:16:06 1993
--- src/timeout.c Wed Mar 31 14:20:11 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)timeout.c 3.1 92/11/01 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)timeout.c 3.1 93/03/30 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 164,172 ****
break;
case INVIS:
newsym(u.ux,u.uy);
! if (!Invis && !See_invisible && !Blind)
You("are no longer invisible.");
! stop_occupation();
break;
case SEE_INVIS:
set_mimic_blocking(); /* do special mimic handling */
--- 164,173 ----
break;
case INVIS:
newsym(u.ux,u.uy);
! if (!Invis && !See_invisible && !Blind) {
You("are no longer invisible.");
! stop_occupation();
! }
break;
case SEE_INVIS:
set_mimic_blocking(); /* do special mimic handling */
***************
*** 213,219 ****
switch (rn2(4)) {
case 1:
if (ACCESSIBLE(levl[u.ux][u.uy].typ)) { /* not POOL or STONE */
! if (Hallucination) pline("A rock bites your foot.");
else You("trip over a rock.");
break;
}
--- 214,220 ----
switch (rn2(4)) {
case 1:
if (ACCESSIBLE(levl[u.ux][u.uy].typ)) { /* not POOL or STONE */
! if (Hallucination) pline("A rock bites your %s.", body_part(FOOT));
else You("trip over a rock.");
break;
}
***************
*** 271,277 ****
locomotion(mtmp->data, "drop"));
else
You("see %s %s out of your pack!",
! an(mtmp->data->mname),
locomotion(mtmp->data, "drop"));
#ifdef POLYSELF
--- 272,278 ----
locomotion(mtmp->data, "drop"));
else
You("see %s %s out of your pack!",
! a_monnam(mtmp),
locomotion(mtmp->data, "drop"));
#ifdef POLYSELF
***************
*** 280,289 ****
pline("Its cries sound like \"%s.\"",
flags.female ? "mommy" : "daddy");
! if (mtmp2 = tamedog(mtmp, (struct obj *)0))
mtmp = mtmp2;
mtmp->mtame = 20;
! while(otmp = (mtmp->minvent)) {
mtmp->minvent = otmp->nobj;
dealloc_obj(otmp);
}
--- 281,290 ----
pline("Its cries sound like \"%s.\"",
flags.female ? "mommy" : "daddy");
! if ((mtmp2 = tamedog(mtmp, (struct obj *)0)) != 0)
mtmp = mtmp2;
mtmp->mtame = 20;
! while ((otmp = (mtmp->minvent)) != 0) {
mtmp->minvent = otmp->nobj;
dealloc_obj(otmp);
}
***************
*** 294,302 ****
struct monst *mtmp2;
verbalize("Gleep!"); /* Mything eggs :-) */
! if (mtmp2 = tamedog(mtmp, (struct obj *)0))
mtmp = mtmp2;
! while(otmp = (mtmp->minvent)) {
mtmp->minvent = otmp->nobj;
dealloc_obj(otmp);
}
--- 295,303 ----
struct monst *mtmp2;
verbalize("Gleep!"); /* Mything eggs :-) */
! if ((mtmp2 = tamedog(mtmp, (struct obj *)0)) != 0)
mtmp = mtmp2;
! while ((otmp = (mtmp->minvent)) != 0) {
mtmp->minvent = otmp->nobj;
dealloc_obj(otmp);
}
***************
*** 316,322 ****
for(otmp = invent; otmp; otmp = otmp2) {
otmp2 = otmp->nobj; /* otmp may hatch */
if(otmp->otyp == EGG && otmp->corpsenm >= 0) hatch_it(otmp);
! /* else if (Is_container(otmp) && otmp->cobj) ... */
/* */
/* Check for container here and hatch with the container. */
/* One of these days... */
--- 317,323 ----
for(otmp = invent; otmp; otmp = otmp2) {
otmp2 = otmp->nobj; /* otmp may hatch */
if(otmp->otyp == EGG && otmp->corpsenm >= 0) hatch_it(otmp);
! /* else if (Has_contents(otmp)) ... */
/* */
/* Check for container here and hatch with the container. */
/* One of these days... */