formatting - last of the trailing continuations

Last few && or || followed by end-of-line comments, plus tab replacement
and 'return' parentheses.  Not as many of those; some of these files had
already had that done.

Also, tweaked non-cursed scroll of charging read while confused to be a
tiny bit more effective.

To do:  find and fix block comments that immediately follow a line with
an end-of-line comment and got misindented to line up with that comment.
This commit is contained in:
PatR
2015-11-05 00:54:13 -08:00
parent 2ee06dda5a
commit ea8afe7e24
9 changed files with 299 additions and 276 deletions
+23 -23
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 read.c $NHDT-Date: 1444352700 2015/10/09 01:05:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.116 $ */ /* NetHack 3.6 read.c $NHDT-Date: 1446713638 2015/11/05 08:53:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.119 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -149,10 +149,10 @@ doread()
known = FALSE; known = FALSE;
if (check_capacity((char *) 0)) if (check_capacity((char *) 0))
return (0); return 0;
scroll = getobj(readable, "read"); scroll = getobj(readable, "read");
if (!scroll) if (!scroll)
return (0); return 0;
/* outrumor has its own blindness check */ /* outrumor has its own blindness check */
if (scroll->otyp == FORTUNE_COOKIE) { if (scroll->otyp == FORTUNE_COOKIE) {
@@ -162,7 +162,7 @@ doread()
if (!Blind) if (!Blind)
u.uconduct.literate++; u.uconduct.literate++;
useup(scroll); useup(scroll);
return (1); return 1;
} else if (scroll->otyp == T_SHIRT || scroll->otyp == ALCHEMY_SMOCK) { } else if (scroll->otyp == T_SHIRT || scroll->otyp == ALCHEMY_SMOCK) {
char buf[BUFSZ]; char buf[BUFSZ];
if (Blind) { if (Blind) {
@@ -267,7 +267,7 @@ doread()
} else if (scroll->oclass != SCROLL_CLASS } else if (scroll->oclass != SCROLL_CLASS
&& scroll->oclass != SPBOOK_CLASS) { && scroll->oclass != SPBOOK_CLASS) {
pline(silly_thing_to, "read"); pline(silly_thing_to, "read");
return (0); return 0;
} else if (Blind && (scroll->otyp != SPE_BOOK_OF_THE_DEAD)) { } else if (Blind && (scroll->otyp != SPE_BOOK_OF_THE_DEAD)) {
const char *what = 0; const char *what = 0;
if (scroll->oclass == SPBOOK_CLASS) if (scroll->oclass == SPBOOK_CLASS)
@@ -276,7 +276,7 @@ doread()
what = "formula on the scroll"; what = "formula on the scroll";
if (what) { if (what) {
pline("Being blind, you cannot read the %s.", what); pline("Being blind, you cannot read the %s.", what);
return (0); return 0;
} }
} }
@@ -307,7 +307,7 @@ doread()
u.uconduct.literate++; u.uconduct.literate++;
if (scroll->oclass == SPBOOK_CLASS) { if (scroll->oclass == SPBOOK_CLASS) {
return (study_book(scroll)); return study_book(scroll);
} }
scroll->in_use = TRUE; /* scroll, not spellbook, now being read */ scroll->in_use = TRUE; /* scroll, not spellbook, now being read */
if (scroll->otyp != SCR_BLANK_PAPER) { if (scroll->otyp != SCR_BLANK_PAPER) {
@@ -815,13 +815,13 @@ int percent;
/* /*
* Forget some things (e.g. after reading a scroll of amnesia). When called, * Forget some things (e.g. after reading a scroll of amnesia). When called,
* the following are always forgotten: * the following are always forgotten:
* - felt ball & chain * - felt ball & chain
* - traps * - traps
* - part (6 out of 7) of the map * - part (6 out of 7) of the map
* *
* Other things are subject to flags: * Other things are subject to flags:
* howmuch & ALL_MAP = forget whole map * howmuch & ALL_MAP = forget whole map
* howmuch & ALL_SPELLS = forget all spells * howmuch & ALL_SPELLS = forget all spells
*/ */
STATIC_OVL void STATIC_OVL void
forget(howmuch) forget(howmuch)
@@ -929,8 +929,8 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
if (objects[otyp].oc_magic) if (objects[otyp].oc_magic)
exercise(A_WIS, TRUE); /* just for trying */ exercise(A_WIS, TRUE); /* just for trying */
already_known = (sobj->oclass == SPBOOK_CLASS || /* spell */ already_known = (sobj->oclass == SPBOOK_CLASS /* spell */
objects[otyp].oc_name_known); || objects[otyp].oc_name_known);
switch (otyp) { switch (otyp) {
#ifdef MAIL #ifdef MAIL
@@ -1402,7 +1402,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
pline("This is an identify scroll."); pline("This is an identify scroll.");
if (!already_known) if (!already_known)
(void) learnscrolltyp(SCR_IDENTIFY); (void) learnscrolltyp(SCR_IDENTIFY);
/*FALLTHRU*/ /*FALLTHRU*/
case SPE_IDENTIFY: case SPE_IDENTIFY:
cval = 1; cval = 1;
if (sblessed || (!scursed && !rn2(5))) { if (sblessed || (!scursed && !rn2(5))) {
@@ -1427,10 +1427,9 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
u.uen = 0; u.uen = 0;
} else { } else {
You_feel("charged up!"); You_feel("charged up!");
if (u.uen < u.uenmax) u.uen += d(sblessed ? 6 : 4, 4);
u.uen = u.uenmax; if (u.uen > u.uenmax)
else u.uenmax = u.uen;
u.uen = (u.uenmax += d(5, 4));
} }
context.botl = 1; context.botl = 1;
break; break;
@@ -2024,8 +2023,8 @@ do_class_genocide()
|| quest_info(MS_GUARDIAN) == i) || quest_info(MS_GUARDIAN) == i)
/* non-leader/nemesis/guardian role-specific monster /* non-leader/nemesis/guardian role-specific monster
*/ */
&& (i != PM_NINJA || /* nuisance */ && (i != PM_NINJA /* nuisance */
Role_if(PM_SAMURAI))) { || Role_if(PM_SAMURAI))) {
boolean named, uniq; boolean named, uniq;
named = type_is_pname(&mons[i]) ? TRUE : FALSE; named = type_is_pname(&mons[i]) ? TRUE : FALSE;
@@ -2215,7 +2214,7 @@ int how;
void void
punish(sobj) punish(sobj)
register struct obj *sobj; struct obj *sobj;
{ {
struct obj *reuse_ball = (sobj && sobj->otyp == HEAVY_IRON_BALL) struct obj *reuse_ball = (sobj && sobj->otyp == HEAVY_IRON_BALL)
? sobj : (struct obj *) 0; ? sobj : (struct obj *) 0;
@@ -2257,9 +2256,10 @@ register struct obj *sobj;
} }
} }
/* remove the ball and chain */
void void
unpunish() unpunish()
{ /* remove the ball and chain */ {
struct obj *savechain = uchain; struct obj *savechain = uchain;
obj_extract_self(uchain); obj_extract_self(uchain);
+20 -19
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 rumors.c $NHDT-Date: 1432512762 2015/05/25 00:12:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.26 $ */ /* NetHack 3.6 rumors.c $NHDT-Date: 1446713640 2015/11/05 08:54:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.27 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -6,7 +6,7 @@
#include "lev.h" #include "lev.h"
#include "dlb.h" #include "dlb.h"
/* [note: this comment is fairly old, but still accurate for 3.1] /* [note: this comment is fairly old, but still accurate for 3.1]
* Rumors have been entirely rewritten to speed up the access. This is * Rumors have been entirely rewritten to speed up the access. This is
* essential when working from floppies. Using fseek() the way that's done * essential when working from floppies. Using fseek() the way that's done
* here means rumors following longer rumors are output more often than those * here means rumors following longer rumors are output more often than those
@@ -15,7 +15,7 @@
* this also happens with real fortune cookies. -dgk * this also happens with real fortune cookies. -dgk
*/ */
/* 3.5 /* 3.5
* The rumors file consists of a "do not edit" line, then a line containing * The rumors file consists of a "do not edit" line, then a line containing
* three sets of three counts (first two in decimal, third in hexadecimal). * three sets of three counts (first two in decimal, third in hexadecimal).
* The first set has the number of true rumors, the count in bytes for all * The first set has the number of true rumors, the count in bytes for all
@@ -27,7 +27,7 @@
* plus the size of the false rumors matches the offset for end-of-file. * plus the size of the false rumors matches the offset for end-of-file.
*/ */
/* 3.1 [now obsolete for rumors but still accurate for oracles] /* 3.1 [now obsolete for rumors but still accurate for oracles]
* The rumors file consists of a "do not edit" line, a hexadecimal number * The rumors file consists of a "do not edit" line, a hexadecimal number
* giving the number of bytes of useful/true rumors, followed by those * giving the number of bytes of useful/true rumors, followed by those
* true rumors (one per line), followed by the useless/false/misleading/cute * true rumors (one per line), followed by the useless/false/misleading/cute
@@ -115,9 +115,9 @@ boolean exclude_cookie;
} }
} }
/* /*
* input: 1 0 -1 * input: 1 0 -1
* rn2 \ +1 2=T 1=T 0=F * rn2 \ +1 2=T 1=T 0=F
* adj./ +0 1=T 0=F -1=F * adj./ +0 1=T 0=F -1=F
*/ */
switch (adjtruth = truth + rn2(2)) { switch (adjtruth = truth + rn2(2)) {
case 2: /*(might let a bogus input arg sneak thru)*/ case 2: /*(might let a bogus input arg sneak thru)*/
@@ -425,8 +425,9 @@ boolean delphi;
int oracle_idx; int oracle_idx;
char xbuf[BUFSZ]; char xbuf[BUFSZ];
if (oracle_flg < 0 || /* couldn't open ORACLEFILE */ /* early return if we couldn't open ORACLEFILE on previous attempt,
(oracle_flg > 0 && oracle_cnt == 0)) /* oracles already exhausted */ or if all the oracularities are already exhausted */
if (oracle_flg < 0 || (oracle_flg > 0 && oracle_cnt == 0))
return; return;
oracles = dlb_fopen(ORACLEFILE, "r"); oracles = dlb_fopen(ORACLEFILE, "r");
@@ -439,8 +440,8 @@ boolean delphi;
if (oracle_cnt == 0) if (oracle_cnt == 0)
return; return;
} }
/* oracle_loc[0] is the special oracle; */ /* oracle_loc[0] is the special oracle;
/* oracle_loc[1..oracle_cnt-1] are normal ones */ oracle_loc[1..oracle_cnt-1] are normal ones */
if (oracle_cnt <= 1 && !special) if (oracle_cnt <= 1 && !special)
return; /*(shouldn't happen)*/ return; /*(shouldn't happen)*/
oracle_idx = special ? 0 : rnd((int) oracle_cnt - 1); oracle_idx = special ? 0 : rnd((int) oracle_cnt - 1);
@@ -450,11 +451,10 @@ boolean delphi;
tmpwin = create_nhwindow(NHW_TEXT); tmpwin = create_nhwindow(NHW_TEXT);
if (delphi) if (delphi)
putstr( putstr(tmpwin, 0,
tmpwin, 0, special
special ? "The Oracle scornfully takes all your money and says:"
? "The Oracle scornfully takes all your money and says:" : "The Oracle meditates for a moment and then intones:");
: "The Oracle meditates for a moment and then intones:");
else else
putstr(tmpwin, 0, "The message reads:"); putstr(tmpwin, 0, "The message reads:");
putstr(tmpwin, 0, ""); putstr(tmpwin, 0, "");
@@ -475,7 +475,7 @@ boolean delphi;
int int
doconsult(oracl) doconsult(oracl)
register struct monst *oracl; struct monst *oracl;
{ {
long umoney; long umoney;
int u_pay, minor_cost = 50, major_cost = 500 + 50 * u.ulevel; int u_pay, minor_cost = 50, major_cost = 500 + 50 * u.ulevel;
@@ -510,8 +510,8 @@ register struct monst *oracl;
u_pay = minor_cost; u_pay = minor_cost;
break; break;
case 'n': case 'n':
if (umoney <= (long) minor_cost || /* don't even ask */ if (umoney <= (long) minor_cost /* don't even ask */
(oracle_cnt == 1 || oracle_flg < 0)) || (oracle_cnt == 1 || oracle_flg < 0))
return 0; return 0;
Sprintf(qbuf, "\"Then dost thou desire a major one?\" (%d %s)", Sprintf(qbuf, "\"Then dost thou desire a major one?\" (%d %s)",
major_cost, currency((long) major_cost)); major_cost, currency((long) major_cost));
@@ -531,6 +531,7 @@ register struct monst *oracl;
u.uevent.minor_oracle = TRUE; u.uevent.minor_oracle = TRUE;
} else { } else {
boolean cheapskate = u_pay < major_cost; boolean cheapskate = u_pay < major_cost;
outoracle(cheapskate, TRUE); outoracle(cheapskate, TRUE);
if (!cheapskate && !u.uevent.major_oracle) if (!cheapskate && !u.uevent.major_oracle)
add_xpts = u_pay / (u.uevent.minor_oracle ? 25 : 10); add_xpts = u_pay / (u.uevent.minor_oracle ? 25 : 10);
+122 -111
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 shk.c $NHDT-Date: 1445906862 2015/10/27 00:47:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.114 $ */ /* NetHack 3.6 shk.c $NHDT-Date: 1446713640 2015/11/05 08:54:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.115 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -32,8 +32,8 @@ STATIC_DCL void FDECL(append_honorific, (char *));
STATIC_DCL void FDECL(setpaid, (struct monst *)); STATIC_DCL void FDECL(setpaid, (struct monst *));
STATIC_DCL long FDECL(addupbill, (struct monst *)); STATIC_DCL long FDECL(addupbill, (struct monst *));
STATIC_DCL void FDECL(pacify_shk, (struct monst *)); STATIC_DCL void FDECL(pacify_shk, (struct monst *));
STATIC_DCL struct bill_x *FDECL(onbill, STATIC_DCL struct bill_x *FDECL(onbill, (struct obj *, struct monst *,
(struct obj *, struct monst *, BOOLEAN_P)); BOOLEAN_P));
STATIC_DCL struct monst *FDECL(next_shkp, (struct monst *, BOOLEAN_P)); STATIC_DCL struct monst *FDECL(next_shkp, (struct monst *, BOOLEAN_P));
STATIC_DCL long FDECL(shop_debt, (struct eshk *)); STATIC_DCL long FDECL(shop_debt, (struct eshk *));
STATIC_DCL char *FDECL(shk_owns, (char *, struct obj *)); STATIC_DCL char *FDECL(shk_owns, (char *, struct obj *));
@@ -44,13 +44,13 @@ STATIC_DCL void FDECL(pay, (long, struct monst *));
STATIC_DCL long FDECL(get_cost, (struct obj *, struct monst *)); STATIC_DCL long FDECL(get_cost, (struct obj *, struct monst *));
STATIC_DCL long FDECL(set_cost, (struct obj *, struct monst *)); STATIC_DCL long FDECL(set_cost, (struct obj *, struct monst *));
STATIC_DCL const char *FDECL(shk_embellish, (struct obj *, long)); STATIC_DCL const char *FDECL(shk_embellish, (struct obj *, long));
STATIC_DCL long FDECL(cost_per_charge, STATIC_DCL long FDECL(cost_per_charge, (struct monst *, struct obj *,
(struct monst *, struct obj *, BOOLEAN_P)); BOOLEAN_P));
STATIC_DCL long FDECL(cheapest_item, (struct monst *)); STATIC_DCL long FDECL(cheapest_item, (struct monst *));
STATIC_DCL int FDECL(dopayobj, (struct monst *, struct bill_x *, STATIC_DCL int FDECL(dopayobj, (struct monst *, struct bill_x *,
struct obj **, int, BOOLEAN_P)); struct obj **, int, BOOLEAN_P));
STATIC_DCL long FDECL(stolen_container, STATIC_DCL long FDECL(stolen_container, (struct obj *, struct monst *,
(struct obj *, struct monst *, long, BOOLEAN_P)); long, BOOLEAN_P));
STATIC_DCL long FDECL(getprice, (struct obj *, BOOLEAN_P)); STATIC_DCL long FDECL(getprice, (struct obj *, BOOLEAN_P));
STATIC_DCL void FDECL(shk_names_obj, (struct monst *, struct obj *, STATIC_DCL void FDECL(shk_names_obj, (struct monst *, struct obj *,
const char *, long, const char *)); const char *, long, const char *));
@@ -62,36 +62,36 @@ STATIC_DCL void FDECL(rile_shk, (struct monst *));
STATIC_DCL void FDECL(rouse_shk, (struct monst *, BOOLEAN_P)); STATIC_DCL void FDECL(rouse_shk, (struct monst *, BOOLEAN_P));
STATIC_DCL void FDECL(remove_damage, (struct monst *, BOOLEAN_P)); STATIC_DCL void FDECL(remove_damage, (struct monst *, BOOLEAN_P));
STATIC_DCL void FDECL(sub_one_frombill, (struct obj *, struct monst *)); STATIC_DCL void FDECL(sub_one_frombill, (struct obj *, struct monst *));
STATIC_DCL void FDECL(add_one_tobill, STATIC_DCL void FDECL(add_one_tobill, (struct obj *, BOOLEAN_P,
(struct obj *, BOOLEAN_P, struct monst *)); struct monst *));
STATIC_DCL void FDECL(dropped_container, STATIC_DCL void FDECL(dropped_container, (struct obj *, struct monst *,
(struct obj *, struct monst *, BOOLEAN_P)); BOOLEAN_P));
STATIC_DCL void FDECL(add_to_billobjs, (struct obj *)); STATIC_DCL void FDECL(add_to_billobjs, (struct obj *));
STATIC_DCL void FDECL(bill_box_content, STATIC_DCL void FDECL(bill_box_content, (struct obj *, BOOLEAN_P, BOOLEAN_P,
(struct obj *, BOOLEAN_P, BOOLEAN_P, struct monst *)); struct monst *));
STATIC_DCL boolean FDECL(rob_shop, (struct monst *)); STATIC_DCL boolean FDECL(rob_shop, (struct monst *));
STATIC_DCL void FDECL(deserted_shop, (char *)); STATIC_DCL void FDECL(deserted_shop, (char *));
STATIC_DCL boolean STATIC_DCL boolean FDECL(special_stock, (struct obj *, struct monst *,
FDECL(special_stock, (struct obj *, struct monst *, BOOLEAN_P)); BOOLEAN_P));
STATIC_DCL const char *FDECL(cad, (BOOLEAN_P)); STATIC_DCL const char *FDECL(cad, (BOOLEAN_P));
/* /*
invariants: obj->unpaid iff onbill(obj) [unless bp->useup] invariants: obj->unpaid iff onbill(obj) [unless bp->useup]
obj->quan <= bp->bquan obj->quan <= bp->bquan
*/ */
/* /*
Transfer money from inventory to monster when paying * Transfer money from inventory to monster when paying
shopkeepers, priests, oracle, succubus, & other demons. * shopkeepers, priests, oracle, succubus, and other demons.
Simple with only gold coins. * Simple with only gold coins.
This routine will handle money changing when multiple * This routine will handle money changing when multiple
coin types is implemented, only appropriate * coin types is implemented, only appropriate
monsters will pay change. (Peaceful shopkeepers, priests * monsters will pay change. (Peaceful shopkeepers, priests
& the oracle try to maintain goodwill while selling * and the oracle try to maintain goodwill while selling
their wares or services. Angry monsters and all demons * their wares or services. Angry monsters and all demons
will keep anything they get their hands on. * will keep anything they get their hands on.
Returns the amount actually paid, so we can know * Returns the amount actually paid, so we can know
if the monster kept the change. * if the monster kept the change.
*/ */
long long
money2mon(mon, amount) money2mon(mon, amount)
@@ -120,9 +120,9 @@ long amount;
} }
/* /*
Transfer money from monster to inventory. * Transfer money from monster to inventory.
Used when the shopkeeper pay for items, and when * Used when the shopkeeper pay for items, and when
the priest gives you money for an ale. * the priest gives you money for an ale.
*/ */
void void
money2u(mon, amount) money2u(mon, amount)
@@ -178,7 +178,9 @@ register boolean withbill;
return shkp; return shkp;
} }
void shkgone(mtmp) /* called in mon.c */ /* called in mon.c */
void
shkgone(mtmp)
struct monst *mtmp; struct monst *mtmp;
{ {
struct eshk *eshk = ESHK(mtmp); struct eshk *eshk = ESHK(mtmp);
@@ -660,8 +662,8 @@ same_price(obj1, obj2)
struct obj *obj1, *obj2; struct obj *obj1, *obj2;
{ {
register struct monst *shkp1, *shkp2; register struct monst *shkp1, *shkp2;
register struct bill_x *bp1 = 0, *bp2 = 0; struct bill_x *bp1 = 0, *bp2 = 0;
register boolean are_mergable = FALSE; boolean are_mergable = FALSE;
/* look up the first object by finding shk whose bill it's on */ /* look up the first object by finding shk whose bill it's on */
for (shkp1 = next_shkp(fmon, TRUE); shkp1; for (shkp1 = next_shkp(fmon, TRUE); shkp1;
@@ -857,9 +859,9 @@ register struct obj *obj, *merge;
shkp = shop_keeper(*u.ushops); shkp = shop_keeper(*u.ushops);
/* /*
* Note: `shkp = shop_keeper(*u.ushops)' used to be * Note: `shkp = shop_keeper(*u.ushops)' used to be
* unconditional. But obfree() is used all over * unconditional. But obfree() is used all over
* the place, so making its behavior be dependent * the place, so making its behavior be dependent
* upon player location doesn't make much sense. * upon player location doesn't make much sense.
*/ */
if ((bp = onbill(obj, shkp, FALSE)) != 0) { if ((bp = onbill(obj, shkp, FALSE)) != 0) {
@@ -882,6 +884,7 @@ register struct obj *obj, *merge;
{ {
/* DRS/NS 2.2.6 messes up -- Peter Kendell */ /* DRS/NS 2.2.6 messes up -- Peter Kendell */
int indx = ESHK(shkp)->billct; int indx = ESHK(shkp)->billct;
*bp = ESHK(shkp)->bill_p[indx]; *bp = ESHK(shkp)->bill_p[indx];
} }
#else #else
@@ -1161,8 +1164,9 @@ dopay()
multi = 0; multi = 0;
/* find how many shk's there are, how many are in */ /* Find how many shk's there are, how many are in
/* sight, and are you in a shop room with one. */ * sight, and are you in a shop room with one.
*/
nxtm = resident = 0; nxtm = resident = 0;
for (shkp = next_shkp(fmon, FALSE); shkp; for (shkp = next_shkp(fmon, FALSE); shkp;
shkp = next_shkp(shkp->nmon, FALSE)) { shkp = next_shkp(shkp->nmon, FALSE)) {
@@ -1190,8 +1194,9 @@ dopay()
return 0; return 0;
} }
/* the usual case. allow paying at a distance when */ /* The usual case. Allow paying at a distance when
/* inside a tended shop. should we change that? */ * inside a tended shop. Should we change that?
*/
if (sk == 1 && resident) { if (sk == 1 && resident) {
shkp = resident; shkp = resident;
goto proceed; goto proceed;
@@ -1469,11 +1474,12 @@ proceed:
return 1; return 1;
} }
/* return 2 if used-up portion paid */ /* return 2 if used-up portion paid
/* 1 if paid successfully */ * 1 if paid successfully
/* 0 if not enough money */ * 0 if not enough money
/* -1 if skip this object */ * -1 if skip this object
/* -2 if no money/credit left */ * -2 if no money/credit left
*/
STATIC_OVL int STATIC_OVL int
dopayobj(shkp, bp, obj_p, which, itemize) dopayobj(shkp, bp, obj_p, which, itemize)
register struct monst *shkp; register struct monst *shkp;
@@ -1642,8 +1648,10 @@ int croaked; /* -1: escaped dungeon; 0: quit; 1: died */
} }
/* give highest priority shopkeeper first crack */ /* give highest priority shopkeeper first crack */
firstshk = resident ? resident : creditor ? creditor : hostile ? hostile firstshk = resident ? resident
: localshk; : creditor ? creditor
: hostile ? hostile
: localshk;
if (firstshk) { if (firstshk) {
numsk++; numsk++;
taken = inherits(firstshk, numsk, croaked); taken = inherits(firstshk, numsk, croaked);
@@ -1681,8 +1689,8 @@ int croaked;
char takes[BUFSZ]; char takes[BUFSZ];
shkp->minvis = 0; shkp->minvis = 0;
/* the simplifying principle is that first-come */ /* The simplifying principle is that first-come
/* already took everything you had. */ already took everything you had. */
if (numsk > 1) { if (numsk > 1) {
if (cansee(shkp->mx, shkp->my) && croaked) { if (cansee(shkp->mx, shkp->my) && croaked) {
takes[0] = '\0'; takes[0] = '\0';
@@ -1801,7 +1809,8 @@ finish_paybill()
int ox = repo.location.x, oy = repo.location.y; int ox = repo.location.x, oy = repo.location.y;
#if 0 /* don't bother */ #if 0 /* don't bother */
if (ox == 0 && oy == 0) impossible("finish_paybill: no location"); if (ox == 0 && oy == 0)
impossible("finish_paybill: no location");
#endif #endif
/* normally done by savebones(), but that's too late in this case */ /* normally done by savebones(), but that's too late in this case */
unleash_all(); unleash_all();
@@ -1868,7 +1877,7 @@ unsigned id;
} }
/* Returns the price of an arbitrary item in the shop. /* Returns the price of an arbitrary item in the shop.
* Returns 0 if the item doesn't belong to a shopkeeper. */ Returns 0 if the item doesn't belong to a shopkeeper. */
long long
get_cost_of_shop_item(obj) get_cost_of_shop_item(obj)
register struct obj *obj; register struct obj *obj;
@@ -2035,7 +2044,7 @@ boolean unpaid_only;
price = contained_cost(otmp, shkp, price, usell, unpaid_only); price = contained_cost(otmp, shkp, price, usell, unpaid_only);
} }
return (price); return price;
} }
long long
@@ -2109,9 +2118,9 @@ boolean quietly;
verbalize("No thanks, I'd hang onto that if I were you."); verbalize("No thanks, I'd hang onto that if I were you.");
if (obj->spe < 7) if (obj->spe < 7)
verbalize( verbalize(
"You'll need %d%s candle%s to go along with it.", "You'll need %d%s candle%s to go along with it.",
(7 - obj->spe), (obj->spe > 0) ? " more" : "", (7 - obj->spe), (obj->spe > 0) ? " more" : "",
plur(7 - obj->spe)); plur(7 - obj->spe));
/* [what if hero is already carrying enough candles? /* [what if hero is already carrying enough candles?
should Izchak explain how to attach them instead] */ should Izchak explain how to attach them instead] */
} else { } else {
@@ -2561,6 +2570,7 @@ register struct monst *shkp;
{ {
/* DRS/NS 2.2.6 messes up -- Peter Kendell */ /* DRS/NS 2.2.6 messes up -- Peter Kendell */
int indx = ESHK(shkp)->billct; int indx = ESHK(shkp)->billct;
*bp = ESHK(shkp)->bill_p[indx]; *bp = ESHK(shkp)->bill_p[indx];
} }
#else #else
@@ -3454,16 +3464,16 @@ boolean catchup; /* restoring a level */
levl[x][y].doormask = D_CLOSED; /* arbitrary */ levl[x][y].doormask = D_CLOSED; /* arbitrary */
newsym(x, y); newsym(x, y);
} else { } else {
/* don't set doormask - it is (hopefully) the same as it was */ /* don't set doormask - it is (hopefully) the same as it was
/* if not, perhaps save it with the damage array... */ if not, perhaps save it with the damage array... */
if (IS_WALL(tmp_dam->typ) && cansee(x, y)) { if (IS_WALL(tmp_dam->typ) && cansee(x, y)) {
/* Player sees actual repair process, so they KNOW it's a wall */ /* Player sees actual repair process, so they KNOW it's a wall */
levl[x][y].seenv = SVALL; levl[x][y].seenv = SVALL;
newsym(x, y); newsym(x, y);
} }
/* Mark this wall as "repaired". There currently is no code */ /* Mark this wall as "repaired". There currently is no code
/* to do anything about repaired walls, so don't do it. */ to do anything about repaired walls, so don't do it. */
} }
for (i = 0; i < 9; i++) for (i = 0; i < 9; i++)
if (litter[i] & NEED_UPDATE) if (litter[i] & NEED_UPDATE)
@@ -3588,8 +3598,7 @@ register struct monst *shkp;
return z; return z;
} }
/* called after shopkeeper moves, in case the move causes re-entry into shop /* called after shopkeeper moves, in case themove causes re-entry into shop */
*/
void void
after_shk_move(shkp) after_shk_move(shkp)
struct monst *shkp; struct monst *shkp;
@@ -3654,21 +3663,22 @@ register int fall;
You_feel("like a common thief."); You_feel("like a common thief.");
adjalign(-sgn(u.ualign.type)); adjalign(-sgn(u.ualign.type));
} }
} else if (!um_dist(shkp->mx, shkp->my, 5) && !shkp->msleeping } else if (!um_dist(shkp->mx, shkp->my, 5)
&& shkp->mcanmove && !shkp->msleeping && shkp->mcanmove
&& (ESHK(shkp)->billct || ESHK(shkp)->debit)) { && (ESHK(shkp)->billct || ESHK(shkp)->debit)) {
register struct obj *obj, *obj2; register struct obj *obj, *obj2;
if (nolimbs(shkp->data)) { if (nolimbs(shkp->data)) {
grabs = "knocks off"; grabs = "knocks off";
#if 0 #if 0
/* This is what should happen, but for balance /* This is what should happen, but for balance
* reasons, it isn't currently. * reasons, it isn't currently.
*/ */
if (lang == 2) if (lang == 2)
pline("%s curses %s inability to grab your backpack!", pline("%s curses %s inability to grab your backpack!",
shkname(shkp), mhim(shkp)); shkname(shkp), mhim(shkp));
rile_shk(shkp); rile_shk(shkp);
return; return;
#endif #endif
} }
if (distu(shkp->mx, shkp->my) > 2) { if (distu(shkp->mx, shkp->my) > 2) {
@@ -3740,8 +3750,8 @@ boolean cant_mollify;
register boolean uinshp = (*u.ushops != '\0'); register boolean uinshp = (*u.ushops != '\0');
char qbuf[80]; char qbuf[80];
register xchar x, y; register xchar x, y;
boolean dugwall = !strcmp(dmgstr, "dig into") || /* wand */ boolean dugwall = (!strcmp(dmgstr, "dig into") /* wand */
!strcmp(dmgstr, "damage"); /* pick-axe */ || !strcmp(dmgstr, "damage")); /* pick-axe */
boolean animal, pursue; boolean animal, pursue;
struct damage *tmp_dam, *appear_here = 0; struct damage *tmp_dam, *appear_here = 0;
/* any number >= (80*80)+(24*24) would do, actually */ /* any number >= (80*80)+(24*24) would do, actually */
@@ -4060,43 +4070,45 @@ struct monst *shkp;
} }
eshk = ESHK(shkp); eshk = ESHK(shkp);
if (ANGRY(shkp)) if (ANGRY(shkp)) {
pline("%s mentions how much %s dislikes %s customers.", shkname(shkp), pline("%s mentions how much %s dislikes %s customers.",
mhe(shkp), eshk->robbed ? "non-paying" : "rude"); shkname(shkp), mhe(shkp), eshk->robbed ? "non-paying" : "rude");
else if (eshk->following) { } else if (eshk->following) {
if (strncmp(eshk->customer, plname, PL_NSIZ)) { if (strncmp(eshk->customer, plname, PL_NSIZ)) {
verbalize("%s %s! I was looking for %s.", Hello(shkp), plname, verbalize("%s %s! I was looking for %s.",
eshk->customer); Hello(shkp), plname, eshk->customer);
eshk->following = 0; eshk->following = 0;
} else { } else {
verbalize("%s %s! Didn't you forget to pay?", Hello(shkp), verbalize("%s %s! Didn't you forget to pay?",
plname); Hello(shkp), plname);
} }
} else if (eshk->billct) { } else if (eshk->billct) {
register long total = addupbill(shkp) + eshk->debit; register long total = addupbill(shkp) + eshk->debit;
pline("%s says that your bill comes to %ld %s.", shkname(shkp), total,
currency(total)); pline("%s says that your bill comes to %ld %s.",
} else if (eshk->debit) shkname(shkp), total, currency(total));
pline("%s reminds you that you owe %s %ld %s.", shkname(shkp), } else if (eshk->debit) {
mhim(shkp), eshk->debit, currency(eshk->debit)); pline("%s reminds you that you owe %s %ld %s.",
else if (eshk->credit) shkname(shkp), mhim(shkp), eshk->debit, currency(eshk->debit));
} else if (eshk->credit) {
pline("%s encourages you to use your %ld %s of credit.", pline("%s encourages you to use your %ld %s of credit.",
shkname(shkp), eshk->credit, currency(eshk->credit)); shkname(shkp), eshk->credit, currency(eshk->credit));
else if (eshk->robbed) } else if (eshk->robbed) {
pline("%s complains about a recent robbery.", shkname(shkp)); pline("%s complains about a recent robbery.", shkname(shkp));
else if ((shkmoney = money_cnt(shkp->minvent)) < 50) } else if ((shkmoney = money_cnt(shkp->minvent)) < 50) {
pline("%s complains that business is bad.", shkname(shkp)); pline("%s complains that business is bad.", shkname(shkp));
else if (shkmoney > 4000) } else if (shkmoney > 4000) {
pline("%s says that business is good.", shkname(shkp)); pline("%s says that business is good.", shkname(shkp));
else if (is_izchak(shkp, FALSE)) } else if (is_izchak(shkp, FALSE)) {
pline(Izchak_speaks[rn2(SIZE(Izchak_speaks))], shkname(shkp)); pline(Izchak_speaks[rn2(SIZE(Izchak_speaks))], shkname(shkp));
else } else {
pline("%s talks about the problem of shoplifters.", shkname(shkp)); pline("%s talks about the problem of shoplifters.", shkname(shkp));
}
} }
STATIC_OVL void STATIC_OVL void
kops_gone(silent) kops_gone(silent)
register boolean silent; boolean silent;
{ {
register int cnt = 0; register int cnt = 0;
register struct monst *mtmp, *mtmp2; register struct monst *mtmp, *mtmp2;
@@ -4110,8 +4122,8 @@ register boolean silent;
} }
} }
if (cnt && !silent) if (cnt && !silent)
pline_The("Kop%s (disappointed) vanish%s into thin air.", plur(cnt), pline_The("Kop%s (disappointed) vanish%s into thin air.",
cnt == 1 ? "es" : ""); plur(cnt), (cnt == 1) ? "es" : "");
} }
STATIC_OVL long STATIC_OVL long
@@ -4126,9 +4138,9 @@ boolean altusage; /* some items have an "alternate" use with different cost */
return 0L; /* insurance */ return 0L; /* insurance */
tmp = get_cost(otmp, shkp); tmp = get_cost(otmp, shkp);
/* The idea is to make the exhaustive use of */ /* The idea is to make the exhaustive use of an unpaid item
/* an unpaid item more expensive than buying */ * more expensive than buying it outright.
/* it outright. */ */
if (otmp->otyp == MAGIC_LAMP) { /* 1 */ if (otmp->otyp == MAGIC_LAMP) { /* 1 */
/* normal use (ie, as light source) of a magic lamp never /* normal use (ie, as light source) of a magic lamp never
degrades its value, but not charging anything would make degrades its value, but not charging anything would make
@@ -4140,22 +4152,21 @@ boolean altusage; /* some items have an "alternate" use with different cost */
else else
tmp += tmp / 3L; /* djinni is being released */ tmp += tmp / 3L; /* djinni is being released */
} else if (otmp->otyp == MAGIC_MARKER) { /* 70 - 100 */ } else if (otmp->otyp == MAGIC_MARKER) { /* 70 - 100 */
/* no way to determine in advance */ /* No way to determine in advance how many charges will be
/* how many charges will be wasted. */ * wasted. So, arbitrarily, one half of the price per use.
/* so, arbitrarily, one half of the */ */
/* price per use. */
tmp /= 2L; tmp /= 2L;
} else if (otmp->otyp == BAG_OF_TRICKS || /* 1 - 20 */ } else if (otmp->otyp == BAG_OF_TRICKS /* 1 - 20 */
otmp->otyp == HORN_OF_PLENTY) { || otmp->otyp == HORN_OF_PLENTY) {
/* altusage: emptying of all the contents at once */ /* altusage: emptying of all the contents at once */
if (!altusage) if (!altusage)
tmp /= 5L; tmp /= 5L;
} else if (otmp->otyp == CRYSTAL_BALL || /* 1 - 5 */ } else if (otmp->otyp == CRYSTAL_BALL /* 1 - 5 */
otmp->otyp == OIL_LAMP || /* 1 - 10 */ || otmp->otyp == OIL_LAMP /* 1 - 10 */
otmp->otyp == BRASS_LANTERN || otmp->otyp == BRASS_LANTERN
|| (otmp->otyp >= MAGIC_FLUTE || (otmp->otyp >= MAGIC_FLUTE
&& otmp->otyp <= DRUM_OF_EARTHQUAKE) || /* 5 - 9 */ && otmp->otyp <= DRUM_OF_EARTHQUAKE) /* 5 - 9 */
otmp->oclass == WAND_CLASS) { /* 3 - 11 */ || otmp->oclass == WAND_CLASS) { /* 3 - 11 */
if (otmp->spe > 1) if (otmp->spe > 1)
tmp /= 4L; tmp /= 4L;
} else if (otmp->oclass == SPBOOK_CLASS) { } else if (otmp->oclass == SPBOOK_CLASS) {
@@ -4300,8 +4311,8 @@ register xchar x, y;
return FALSE; return FALSE;
} }
/* used in domove to block diagonal shop-entry */ /* used in domove to block diagonal shop-entry;
/* u.ux, u.uy should always be a door */ u.ux, u.uy should always be a door */
boolean boolean
block_entry(x, y) block_entry(x, y)
register xchar x, y; register xchar x, y;
+9 -9
View File
@@ -1,5 +1,5 @@
/* NetHack 3.6 sounds.c $NHDT-Date: 1445906863 2015/10/27 00:47:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.72 $ */ /* NetHack 3.6 sounds.c $NHDT-Date: 1446713641 2015/11/05 08:54:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.74 $ */
/* Copyright (c) 1989 Janet Walz, Mike Threepoint */ /* Copyright (c) 1989 Janet Walz, Mike Threepoint */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
#include "hack.h" #include "hack.h"
@@ -183,8 +183,8 @@ dosounds()
continue; continue;
if (is_mercenary(mtmp->data) if (is_mercenary(mtmp->data)
#if 0 /* don't bother excluding these */ #if 0 /* don't bother excluding these */
&& !strstri(mtmp->data->mname, "watch") && !strstri(mtmp->data->mname, "watch")
&& !strstri(mtmp->data->mname, "guard") && !strstri(mtmp->data->mname, "guard")
#endif #endif
&& mon_in_room(mtmp, BARRACKS) && mon_in_room(mtmp, BARRACKS)
/* sleeping implies not-yet-disturbed (usually) */ /* sleeping implies not-yet-disturbed (usually) */
@@ -511,9 +511,9 @@ register struct monst *mtmp;
else if (msound == MS_GUARDIAN && ptr != &mons[urole.guardnum]) else if (msound == MS_GUARDIAN && ptr != &mons[urole.guardnum])
msound = mons[genus(monsndx(ptr), 1)].msound; msound = mons[genus(monsndx(ptr), 1)].msound;
/* some normally non-speaking types can/will speak if hero is similar */ /* some normally non-speaking types can/will speak if hero is similar */
else if (msound == MS_ORC && /* note: MS_ORC is same as MS_GRUNT */ else if (msound == MS_ORC /* note: MS_ORC is same as MS_GRUNT */
(same_race(ptr, youmonst.data) || /* current form, */ && (same_race(ptr, youmonst.data) /* current form, */
same_race(ptr, &mons[Race_switch]))) /* unpoly'd form */ || same_race(ptr, &mons[Race_switch]))) /* unpoly'd form */
msound = MS_HUMANOID; msound = MS_HUMANOID;
/* silliness, with slight chance to interfere with shopping */ /* silliness, with slight chance to interfere with shopping */
else if (Hallucination && mon_is_gecko(mtmp)) else if (Hallucination && mon_is_gecko(mtmp))
@@ -742,8 +742,8 @@ register struct monst *mtmp;
if (ptr != &mons[PM_PRISONER]) if (ptr != &mons[PM_PRISONER])
verbl_msg = "This will teach you not to disturb me!"; verbl_msg = "This will teach you not to disturb me!";
#if 0 #if 0
else else
verbl_msg = "??????????"; verbl_msg = "??????????";
#endif #endif
} }
break; break;
+14 -15
View File
@@ -1,5 +1,5 @@
/* NetHack 3.6 sp_lev.c $NHDT-Date: 1445906864 2015/10/27 00:47:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.63 $ */ /* NetHack 3.6 sp_lev.c $NHDT-Date: 1446713642 2015/11/05 08:54:02 $ $NHDT-Branch: master $:$NHDT-Revision: 1.66 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
/* /*
@@ -235,7 +235,7 @@ struct splevstack *st;
if (st) { if (st) {
int i; int i;
if (st->stackdata && st->depth) if (st->stackdata && st->depth) {
for (i = 0; i < st->depth; i++) { for (i = 0; i < st->depth; i++) {
switch (st->stackdata[i]->spovartyp) { switch (st->stackdata[i]->spovartyp) {
default: default:
@@ -250,15 +250,14 @@ struct splevstack *st;
case SPOVAR_VARIABLE: case SPOVAR_VARIABLE:
case SPOVAR_STRING: case SPOVAR_STRING:
case SPOVAR_SEL: case SPOVAR_SEL:
if (st->stackdata[i]->vardata.str) Free(st->stackdata[i]->vardata.str);
Free(st->stackdata[i]->vardata.str);
st->stackdata[i]->vardata.str = NULL; st->stackdata[i]->vardata.str = NULL;
break; break;
} }
Free(st->stackdata[i]); Free(st->stackdata[i]);
st->stackdata[i] = NULL; st->stackdata[i] = NULL;
} }
}
Free(st->stackdata); Free(st->stackdata);
st->stackdata = NULL; st->stackdata = NULL;
st->depth = st->depth_alloc = 0; st->depth = st->depth_alloc = 0;
@@ -779,9 +778,9 @@ rndtrap()
/* /*
* Coordinates in special level files are handled specially: * Coordinates in special level files are handled specially:
* *
* if x or y is < 0, we generate a random coordinate. * if x or y is < 0, we generate a random coordinate.
* The "humidity" flag is used to insure that engravings aren't * The "humidity" flag is used to insure that engravings aren't
* created underwater, or eels on dry land. * created underwater, or eels on dry land.
*/ */
STATIC_DCL boolean FDECL(is_ok_location, (SCHAR_P, SCHAR_P, int)); STATIC_DCL boolean FDECL(is_ok_location, (SCHAR_P, SCHAR_P, int));
@@ -1777,7 +1776,7 @@ struct mkroom *croom;
* with what mkobj gave us! */ * with what mkobj gave us! */
} }
/* corpsenm is "empty" if -1, random if -2, otherwise specific */ /* corpsenm is "empty" if -1, random if -2, otherwise specific */
if (o->corpsenm != NON_PM) { if (o->corpsenm != NON_PM) {
if (o->corpsenm == NON_PM - 1) if (o->corpsenm == NON_PM - 1)
set_corpsenm(otmp, rndmonnum()); set_corpsenm(otmp, rndmonnum());
@@ -3859,8 +3858,8 @@ int xc, yc, a, b, filled;
selection_setpoint(xc + x, yc - y, ov, 1); selection_setpoint(xc + x, yc - y, ov, 1);
selection_setpoint(xc - x, yc + y, ov, 1); selection_setpoint(xc - x, yc + y, ov, 1);
} }
if (t + b2 * x <= crit1 || /* e(x+1,y-1/2) <= 0 */ if (t + b2 * x <= crit1 /* e(x+1,y-1/2) <= 0 */
t + a2 * y <= crit3) { /* e(x+1/2,y) <= 0 */ || t + a2 * y <= crit3) { /* e(x+1/2,y) <= 0 */
x++; x++;
dxt += d2xt; dxt += d2xt;
t += dxt; t += dxt;
@@ -3879,8 +3878,8 @@ int xc, yc, a, b, filled;
} }
} else { } else {
while (y >= 0 && x <= a) { while (y >= 0 && x <= a) {
if (t + b2 * x <= crit1 || /* e(x+1,y-1/2) <= 0 */ if (t + b2 * x <= crit1 /* e(x+1,y-1/2) <= 0 */
t + a2 * y <= crit3) { /* e(x+1/2,y) <= 0 */ || t + a2 * y <= crit3) { /* e(x+1/2,y) <= 0 */
x++; x++;
dxt += d2xt; dxt += d2xt;
t += dxt; t += dxt;
@@ -5856,7 +5855,7 @@ sp_lev *lvl;
coder->frame = tmpframe; coder->frame = tmpframe;
} while (coder->frame); } while (coder->frame);
} }
free(coder); Free(coder);
return TRUE; return TRUE;
} }
+10 -10
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 steal.c $NHDT-Date: 1445906866 2015/10/27 00:47:46 $ $NHDT-Branch: master $:$NHDT-Revision: 1.64 $ */ /* NetHack 3.6 steal.c $NHDT-Date: 1446713643 2015/11/05 08:54:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.65 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -57,12 +57,12 @@ long lmoney;
} }
/* /*
Find the first (and hopefully only) gold object in a chain. * Find the first (and hopefully only) gold object in a chain.
Used when leprechaun (or you as leprechaun) looks for * Used when leprechaun (or you as leprechaun) looks for
someone else's gold. Returns a pointer so the gold may * someone else's gold. Returns a pointer so the gold may
be seized without further searching. * be seized without further searching.
May search containers too. * May search containers too.
Deals in gold only, as leprechauns don't care for lesser coins. * Deals in gold only, as leprechauns don't care for lesser coins.
*/ */
struct obj * struct obj *
findgold(chain) findgold(chain)
@@ -74,7 +74,7 @@ register struct obj *chain;
} }
/* /*
Steal gold coins only. Leprechauns don't care for lesser coins. * Steal gold coins only. Leprechauns don't care for lesser coins.
*/ */
void void
stealgold(mtmp) stealgold(mtmp)
@@ -121,6 +121,7 @@ register struct monst *mtmp;
} }
} else if (ygold) { } else if (ygold) {
const int gold_price = objects[GOLD_PIECE].oc_cost; const int gold_price = objects[GOLD_PIECE].oc_cost;
tmp = (somegold(money_cnt(invent)) + gold_price - 1) / gold_price; tmp = (somegold(money_cnt(invent)) + gold_price - 1) / gold_price;
tmp = min(tmp, ygold->quan); tmp = min(tmp, ygold->quan);
if (tmp < ygold->quan) if (tmp < ygold->quan)
@@ -484,8 +485,7 @@ register struct obj *otmp;
/* don't want hidden light source inside the monster; assumes that /* don't want hidden light source inside the monster; assumes that
engulfers won't have external inventories; whirly monsters cause engulfers won't have external inventories; whirly monsters cause
the light to be extinguished rather than letting it shine thru */ the light to be extinguished rather than letting it shine thru */
if (otmp->lamplit && /* hack to avoid function calls for most objs */ if (obj_sheds_light(otmp) && attacktype(mtmp->data, AT_ENGL)) {
obj_sheds_light(otmp) && attacktype(mtmp->data, AT_ENGL)) {
/* this is probably a burning object that you dropped or threw */ /* this is probably a burning object that you dropped or threw */
if (u.uswallow && mtmp == u.ustuck && !Blind) if (u.uswallow && mtmp == u.ustuck && !Blind)
pline("%s out.", Tobjnam(otmp, "go")); pline("%s out.", Tobjnam(otmp, "go"));
+3 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 trap.c $NHDT-Date: 1446604119 2015/11/04 02:28:39 $ $NHDT-Branch: master $:$NHDT-Revision: 1.243 $ */ /* NetHack 3.6 trap.c $NHDT-Date: 1446713644 2015/11/05 08:54:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.244 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -2436,9 +2436,9 @@ register struct monst *mtmp;
/* fall though */ /* fall though */
default: default:
if (mptr->mlet == S_GIANT if (mptr->mlet == S_GIANT
/* exclude baby dragons and relatively short worms */
|| (mptr->mlet == S_DRAGON && extra_nasty(mptr)) || (mptr->mlet == S_DRAGON && extra_nasty(mptr))
|| /* excl. babies */ || (mtmp->wormno && count_wsegs(mtmp) > 5)) {
(mtmp->wormno && count_wsegs(mtmp) > 5)) {
tear_web = TRUE; tear_web = TRUE;
} else if (in_sight) { } else if (in_sight) {
pline("%s is caught in %s spider web.", Monnam(mtmp), pline("%s is caught in %s spider web.", Monnam(mtmp),
+58 -54
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 uhitm.c $NHDT-Date: 1446078766 2015/10/29 00:32:46 $ $NHDT-Branch: master $:$NHDT-Revision: 1.149 $ */ /* NetHack 3.6 uhitm.c $NHDT-Date: 1446713645 2015/11/05 08:54:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.150 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -12,8 +12,8 @@ STATIC_DCL boolean FDECL(hitum, (struct monst *, struct attack *));
STATIC_DCL boolean FDECL(hmon_hitmon, (struct monst *, struct obj *, int)); STATIC_DCL boolean FDECL(hmon_hitmon, (struct monst *, struct obj *, int));
STATIC_DCL int FDECL(joust, (struct monst *, struct obj *)); STATIC_DCL int FDECL(joust, (struct monst *, struct obj *));
STATIC_DCL void NDECL(demonpet); STATIC_DCL void NDECL(demonpet);
STATIC_DCL boolean STATIC_DCL boolean FDECL(m_slips_free, (struct monst * mtmp,
FDECL(m_slips_free, (struct monst * mtmp, struct attack *mattk)); struct attack *mattk));
STATIC_DCL int FDECL(explum, (struct monst *, struct attack *)); STATIC_DCL int FDECL(explum, (struct monst *, struct attack *));
STATIC_DCL void FDECL(start_engulf, (struct monst *)); STATIC_DCL void FDECL(start_engulf, (struct monst *));
STATIC_DCL void NDECL(end_engulf); STATIC_DCL void NDECL(end_engulf);
@@ -305,8 +305,8 @@ int *attk_count, *role_roll_penalty;
return tmp; return tmp;
} }
/* try to attack; return FALSE if monster evaded */ /* try to attack; return False if monster evaded;
/* u.dx and u.dy must be set */ u.dx and u.dy must be set */
boolean boolean
attack(mtmp) attack(mtmp)
register struct monst *mtmp; register struct monst *mtmp;
@@ -405,8 +405,8 @@ register struct monst *mtmp;
/* Is the "it died" check actually correct? */ /* Is the "it died" check actually correct? */
if (mdat->mlet == S_LEPRECHAUN && !mtmp->mfrozen && !mtmp->msleeping if (mdat->mlet == S_LEPRECHAUN && !mtmp->mfrozen && !mtmp->msleeping
&& !mtmp->mconf && mtmp->mcansee && !rn2(7) && !mtmp->mconf && mtmp->mcansee && !rn2(7)
&& (m_move(mtmp, 0) == 2 || /* it died */ && (m_move(mtmp, 0) == 2 /* it died */
mtmp->mx != u.ux + u.dx || mtmp->mx != u.ux + u.dx
|| mtmp->my != u.uy + u.dy)) /* it moved */ || mtmp->my != u.uy + u.dy)) /* it moved */
return FALSE; return FALSE;
@@ -517,8 +517,9 @@ struct attack *uattk;
return malive; return malive;
} }
boolean /* general "damage monster" routine */ /* general "damage monster" routine; return True if mon still alive */
hmon(mon, obj, thrown) /* return TRUE if mon still alive */ boolean
hmon(mon, obj, thrown)
struct monst *mon; struct monst *mon;
struct obj *obj; struct obj *obj;
int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */
@@ -876,6 +877,7 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */
} else { } else {
char *whom = mon_nam(mon); char *whom = mon_nam(mon);
char *what = The(xname(obj)); char *what = The(xname(obj));
if (!thrown && obj->quan > 1L) if (!thrown && obj->quan > 1L)
what = An(singular(obj, xname)); what = An(singular(obj, xname));
/* note: s_suffix returns a modifiable buffer */ /* note: s_suffix returns a modifiable buffer */
@@ -979,15 +981,13 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */
if (ispoisoned) { if (ispoisoned) {
int nopoison = (10 - (obj->owt / 10)); int nopoison = (10 - (obj->owt / 10));
if (nopoison < 2) if (nopoison < 2)
nopoison = 2; nopoison = 2;
if if (Role_if(PM_SAMURAI)) {
Role_if(PM_SAMURAI) You("dishonorably use a poisoned weapon!");
{ adjalign(-sgn(u.ualign.type));
You("dishonorably use a poisoned weapon!"); } else if (u.ualign.type == A_LAWFUL && u.ualign.record > -10) {
adjalign(-sgn(u.ualign.type));
}
else if ((u.ualign.type == A_LAWFUL) && (u.ualign.record > -10)) {
You_feel("like an evil coward for using a poisoned weapon."); You_feel("like an evil coward for using a poisoned weapon.");
adjalign(-1); adjalign(-1);
} }
@@ -1010,8 +1010,8 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */
tmp = 0; tmp = 0;
if (mdat == &mons[PM_SHADE]) { if (mdat == &mons[PM_SHADE]) {
if (!hittxt) { if (!hittxt) {
const char *what = const char *what = *unconventional ? unconventional : "attack";
unconventional[0] ? unconventional : "attack";
Your("%s %s harmlessly through %s.", what, Your("%s %s harmlessly through %s.", what,
vtense(what, "pass"), mon_nam(mon)); vtense(what, "pass"), mon_nam(mon));
hittxt = TRUE; hittxt = TRUE;
@@ -1089,8 +1089,9 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */
} }
} }
if (!hittxt && /*( thrown => obj exists )*/ if (!hittxt /*( thrown => obj exists )*/
(!destroyed || (thrown && m_shot.n > 1 && m_shot.o == obj->otyp))) { && (!destroyed
|| (thrown && m_shot.n > 1 && m_shot.o == obj->otyp))) {
if (thrown) if (thrown)
hit(mshot_xname(obj), mon, exclam(tmp)); hit(mshot_xname(obj), mon, exclam(tmp));
else if (!flags.verbose) else if (!flags.verbose)
@@ -1174,7 +1175,8 @@ struct obj *obj;
* 2) are dealt with properly by other routines * 2) are dealt with properly by other routines
* when it comes to shades. * when it comes to shades.
*/ */
if (obj->otyp == BOULDER || obj->otyp == HEAVY_IRON_BALL if (obj->otyp == BOULDER
|| obj->otyp == HEAVY_IRON_BALL
|| obj->otyp == IRON_CHAIN /* dmgval handles those first three */ || obj->otyp == IRON_CHAIN /* dmgval handles those first three */
|| obj->otyp == MIRROR /* silver in the reflective surface */ || obj->otyp == MIRROR /* silver in the reflective surface */
|| obj->otyp == CLOVE_OF_GARLIC /* causes shades to flee */ || obj->otyp == CLOVE_OF_GARLIC /* causes shades to flee */
@@ -1227,9 +1229,10 @@ struct attack *mattk;
return FALSE; return FALSE;
} }
/* used when hitting a monster with a lance while mounted */ /* used when hitting a monster with a lance while mounted;
STATIC_OVL int /* 1: joust hit; 0: ordinary hit; -1: joust but break lance */ 1: joust hit; 0: ordinary hit; -1: joust but break lance */
joust(mon, obj) STATIC_OVL int
joust(mon, obj)
struct monst *mon; /* target */ struct monst *mon; /* target */
struct obj *obj; /* weapon */ struct obj *obj; /* weapon */
{ {
@@ -1289,11 +1292,10 @@ struct obj *otmp;
|| !touch_petrifies(&mons[otmp->corpsenm]) || Stone_resistance) || !touch_petrifies(&mons[otmp->corpsenm]) || Stone_resistance)
return FALSE; return FALSE;
/* no poly_when_stoned() critter has theft capability */ #if 0 /* no poly_when_stoned() critter has theft capability */
#if 0
if (poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM)) { if (poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM)) {
display_nhwindow(WIN_MESSAGE, FALSE); /* --More-- */ display_nhwindow(WIN_MESSAGE, FALSE); /* --More-- */
return TRUE; return TRUE;
} }
#endif #endif
@@ -1411,10 +1413,12 @@ register struct attack *mattk;
mdef->mstun = 1; mdef->mstun = 1;
goto physical; goto physical;
case AD_LEGS: case AD_LEGS:
/* if (u.ucancelled) { */ #if 0
/* tmp = 0; */ if (u.ucancelled) {
/* break; */ tmp = 0;
/* } */ break;
}
#endif
goto physical; goto physical;
case AD_WERE: /* no special effect on monsters */ case AD_WERE: /* no special effect on monsters */
case AD_HEAL: /* likewise */ case AD_HEAL: /* likewise */
@@ -2062,7 +2066,9 @@ boolean wouldhavehit;
wakeup(mdef); wakeup(mdef);
} }
STATIC_OVL boolean hmonas(mon) /* attack monster as a monster. */ /* attack monster as a monster. */
STATIC_OVL boolean
hmonas(mon)
register struct monst *mon; register struct monst *mon;
{ {
struct attack *mattk, alt_attk; struct attack *mattk, alt_attk;
@@ -2078,11 +2084,9 @@ register struct monst *mon;
use_weapon: use_weapon:
/* Certain monsters don't use weapons when encountered as enemies, /* Certain monsters don't use weapons when encountered as enemies,
* but players who polymorph into them have hands or claws and * but players who polymorph into them have hands or claws and
* thus * thus should be able to use weapons. This shouldn't prohibit
* should be able to use weapons. This shouldn't prohibit the use * the use of most special abilities, either.
* of most special abilities, either. * If monster has multiple claw attacks, only one can use weapon.
* If a monster has multiple claw attacks, only one can use
* weapon.
*/ */
weapon_used = TRUE; weapon_used = TRUE;
/* Potential problem: if the monster gets multiple weapon attacks, /* Potential problem: if the monster gets multiple weapon attacks,
@@ -2113,11 +2117,11 @@ register struct monst *mon;
case AT_CLAW: case AT_CLAW:
if (uwep && !cantwield(youmonst.data) && !weapon_used) if (uwep && !cantwield(youmonst.data) && !weapon_used)
goto use_weapon; goto use_weapon;
/*FALLTHRU*/ /*FALLTHRU*/
case AT_TUCH: case AT_TUCH:
if (uwep && youmonst.data->mlet == S_LICH && !weapon_used) if (uwep && youmonst.data->mlet == S_LICH && !weapon_used)
goto use_weapon; goto use_weapon;
/*FALLTHRU*/ /*FALLTHRU*/
case AT_KICK: case AT_KICK:
case AT_BITE: case AT_BITE:
case AT_STNG: case AT_STNG:
@@ -2259,8 +2263,8 @@ register struct monst *mon;
return (boolean) (nsum != 0); return (boolean) (nsum != 0);
} }
/* Special (passive) attacks on you by monsters done here. */ /* Special (passive) attacks on you by monsters done here.
*/
int int
passive(mon, mhit, malive, aatyp, wep_was_destroyed) passive(mon, mhit, malive, aatyp, wep_was_destroyed)
register struct monst *mon; register struct monst *mon;
@@ -2286,8 +2290,8 @@ boolean wep_was_destroyed;
else else
tmp = 0; tmp = 0;
/* These affect you even if they just died */ /* These affect you even if they just died.
*/
switch (ptr->mattk[i].adtyp) { switch (ptr->mattk[i].adtyp) {
case AD_FIRE: case AD_FIRE:
if (mhit && !mon->mcan) { if (mhit && !mon->mcan) {
@@ -2300,7 +2304,6 @@ boolean wep_was_destroyed;
passive_obj(mon, (struct obj *) 0, &(ptr->mattk[i])); passive_obj(mon, (struct obj *) 0, &(ptr->mattk[i]));
} }
break; break;
case AD_ACID: case AD_ACID:
if (mhit && rn2(2)) { if (mhit && rn2(2)) {
if (Blind || !flags.verbose) if (Blind || !flags.verbose)
@@ -2333,8 +2336,9 @@ boolean wep_was_destroyed;
if (aatyp == AT_MAGC) if (aatyp == AT_MAGC)
protector = W_ARMG; protector = W_ARMG;
if (protector == 0L || /* no protection */ if (protector == 0L /* no protection */
(protector == W_ARMG && !uarmg && !uwep && !wep_was_destroyed) || (protector == W_ARMG && !uarmg
&& !uwep && !wep_was_destroyed)
|| (protector == W_ARMF && !uarmf) || (protector == W_ARMF && !uarmf)
|| (protector == W_ARMH && !uarmh) || (protector == W_ARMH && !uarmh)
|| (protector == (W_ARMC | W_ARMG) && (!uarmc || !uarmg))) { || (protector == (W_ARMC | W_ARMG) && (!uarmc || !uarmg))) {
@@ -2398,8 +2402,8 @@ boolean wep_was_destroyed;
break; break;
} }
/* These only affect you if they still live */ /* These only affect you if they still live.
*/
if (malive && !mon->mcan && rn2(3)) { if (malive && !mon->mcan && rn2(3)) {
switch (ptr->mattk[i].adtyp) { switch (ptr->mattk[i].adtyp) {
case AD_PLYS: case AD_PLYS:
@@ -2409,16 +2413,16 @@ boolean wep_was_destroyed;
} }
if (mon->mcansee) { if (mon->mcansee) {
if (ureflects("%s gaze is reflected by your %s.", if (ureflects("%s gaze is reflected by your %s.",
s_suffix(Monnam(mon)))) s_suffix(Monnam(mon)))) {
; ;
else if (Free_action) } else if (Free_action) {
You("momentarily stiffen under %s gaze!", You("momentarily stiffen under %s gaze!",
s_suffix(mon_nam(mon))); s_suffix(mon_nam(mon)));
else if (Hallucination && rn2(4)) } else if (Hallucination && rn2(4)) {
pline("%s looks %s%s.", Monnam(mon), pline("%s looks %s%s.", Monnam(mon),
!rn2(2) ? "" : "rather ", !rn2(2) ? "" : "rather ",
!rn2(2) ? "numb" : "stupified"); !rn2(2) ? "numb" : "stupified");
else { } else {
You("are frozen by %s gaze!", s_suffix(mon_nam(mon))); You("are frozen by %s gaze!", s_suffix(mon_nam(mon)));
nomul((ACURR(A_WIS) > 12 || rn2(4)) ? -tmp : -127); nomul((ACURR(A_WIS) > 12 || rn2(4)) ? -tmp : -127);
multi_reason = "frozen by a monster's gaze"; multi_reason = "frozen by a monster's gaze";
@@ -2502,7 +2506,7 @@ register struct monst *mon;
register struct obj *obj; /* null means pick uwep, uswapwep or uarmg */ register struct obj *obj; /* null means pick uwep, uswapwep or uarmg */
struct attack *mattk; /* null means we find one internally */ struct attack *mattk; /* null means we find one internally */
{ {
register struct permonst *ptr = mon->data; struct permonst *ptr = mon->data;
register int i; register int i;
/* if caller hasn't specified an object, use uwep, uswapwep or uarmg */ /* if caller hasn't specified an object, use uwep, uswapwep or uarmg */
+40 -32
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 zap.c $NHDT-Date: 1446078771 2015/10/29 00:32:51 $ $NHDT-Branch: master $:$NHDT-Revision: 1.230 $ */ /* NetHack 3.6 zap.c $NHDT-Date: 1446713647 2015/11/05 08:54:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.231 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -948,9 +948,9 @@ register struct obj *obj;
|| otyp == POT_SICKNESS || otyp == POT_SICKNESS
|| (otyp == POT_WATER && (obj->blessed || obj->cursed))) { || (otyp == POT_WATER && (obj->blessed || obj->cursed))) {
if (obj->spe != ((obj->oclass == WAND_CLASS) ? -1 : 0) if (obj->spe != ((obj->oclass == WAND_CLASS) ? -1 : 0)
&& otyp != WAN_CANCELLATION && /* can't cancel cancellation */ && otyp != WAN_CANCELLATION /* can't cancel cancellation */
otyp != MAGIC_LAMP && /* cancelling doesn't remove djinni */ && otyp != MAGIC_LAMP /* cancelling doesn't remove djinni */
otyp != CANDELABRUM_OF_INVOCATION) { && otyp != CANDELABRUM_OF_INVOCATION) {
costly_alteration(obj, COST_CANCEL); costly_alteration(obj, COST_CANCEL);
obj->spe = (obj->oclass == WAND_CLASS) ? -1 : 0; obj->spe = (obj->oclass == WAND_CLASS) ? -1 : 0;
} }
@@ -1338,6 +1338,7 @@ int id;
/* Actually more things use corpsenm but they polymorph differently */ /* Actually more things use corpsenm but they polymorph differently */
#define USES_CORPSENM(typ) \ #define USES_CORPSENM(typ) \
((typ) == CORPSE || (typ) == STATUE || (typ) == FIGURINE) ((typ) == CORPSE || (typ) == STATUE || (typ) == FIGURINE)
if (USES_CORPSENM(obj->otyp) && USES_CORPSENM(id)) if (USES_CORPSENM(obj->otyp) && USES_CORPSENM(id))
set_corpsenm(otmp, obj->corpsenm); set_corpsenm(otmp, obj->corpsenm);
#undef USES_CORPSENM #undef USES_CORPSENM
@@ -2653,7 +2654,7 @@ struct obj *obj; /* wand or spell */
case WAN_STRIKING: case WAN_STRIKING:
case SPE_FORCE_BOLT: case SPE_FORCE_BOLT:
striking = TRUE; striking = TRUE;
/*FALLTHRU*/ /*FALLTHRU*/
case WAN_LOCKING: case WAN_LOCKING:
case SPE_WIZARD_LOCK: case SPE_WIZARD_LOCK:
/* down at open bridge or up or down at open portcullis */ /* down at open bridge or up or down at open portcullis */
@@ -3785,13 +3786,15 @@ const char *fltxt;
xkilled(mon, 2); xkilled(mon, 2);
} }
/* type == 0 to 9 : you shooting a wand */ /*
/* type == 10 to 19 : you casting a spell */ * type == 0 to 9 : you shooting a wand
/* type == 20 to 29 : you breathing as a monster */ * type == 10 to 19 : you casting a spell
/* type == -10 to -19 : monster casting spell */ * type == 20 to 29 : you breathing as a monster
/* type == -20 to -29 : monster breathing at you */ * type == -10 to -19 : monster casting spell
/* type == -30 to -39 : monster shooting a wand */ * type == -20 to -29 : monster breathing at you
/* called with dx = dy = 0 with vertical bolts */ * type == -30 to -39 : monster shooting a wand
* called with dx = dy = 0 with vertical bolts
*/
void void
buzz(type, nd, sx, sy, dx, dy) buzz(type, nd, sx, sy, dx, dy)
register int type, nd; register int type, nd;
@@ -3804,7 +3807,7 @@ register int dx, dy;
struct monst *mon; struct monst *mon;
coord save_bhitpos; coord save_bhitpos;
boolean shopdamage = FALSE; boolean shopdamage = FALSE;
register const char *fltxt; const char *fltxt;
struct obj *otmp; struct obj *otmp;
int spell_type; int spell_type;
@@ -4048,9 +4051,9 @@ const char *msg;
if (!msg) if (!msg)
msg = "The ice crackles and melts."; msg = "The ice crackles and melts.";
if (lev->typ == DRAWBRIDGE_UP) if (lev->typ == DRAWBRIDGE_UP) {
lev->drawbridgemask &= ~DB_ICE; /* revert to DB_MOAT */ lev->drawbridgemask &= ~DB_ICE; /* revert to DB_MOAT */
else { /* lev->typ == ICE */ } else { /* lev->typ == ICE */
#ifdef STUPID #ifdef STUPID
if (lev->icedpool == ICED_POOL) if (lev->icedpool == ICED_POOL)
lev->typ = POOL; lev->typ = POOL;
@@ -4135,8 +4138,8 @@ long timeout UNUSED;
melt_ice(x, y, "Some ice melts away."); melt_ice(x, y, "Some ice melts away.");
} }
/* Burn floor scrolls, evaporate pools, etc... in a single square. Used /* Burn floor scrolls, evaporate pools, etc... in a single square.
* both for normal bolts of fire, cold, etc... and for fireballs. * Used both for normal bolts of fire, cold, etc... and for fireballs.
* Sets shopdamage to TRUE if a shop door is destroyed, and returns the * Sets shopdamage to TRUE if a shop door is destroyed, and returns the
* amount by which range is reduced (the latter is just ignored by fireballs) * amount by which range is reduced (the latter is just ignored by fireballs)
*/ */
@@ -4169,6 +4172,7 @@ short exploding_wand_typ;
melt_ice(x, y, (char *) 0); melt_ice(x, y, (char *) 0);
} else if (is_pool(x, y)) { } else if (is_pool(x, y)) {
const char *msgtxt = "You hear hissing gas."; const char *msgtxt = "You hear hissing gas.";
if (lev->typ != POOL) { /* MOAT or DRAWBRIDGE_UP */ if (lev->typ != POOL) { /* MOAT or DRAWBRIDGE_UP */
if (see_it) if (see_it)
msgtxt = "Some water evaporates."; msgtxt = "Some water evaporates.";
@@ -4323,8 +4327,8 @@ short exploding_wand_typ;
(except on rogue level) */ (except on rogue level) */
newsym(x, y); newsym(x, y);
if (see_it) if (see_it)
pline("%s %s reveals a secret door.", yourzap ? "Your" : "The", pline("%s %s reveals a secret door.",
zapverb); yourzap ? "Your" : "The", zapverb);
else if (Is_rogue_level(&u.uz)) else if (Is_rogue_level(&u.uz))
draft_message(FALSE); /* "You feel a draft." (open doorway) */ draft_message(FALSE); /* "You feel a draft." (open doorway) */
} }
@@ -4333,6 +4337,7 @@ short exploding_wand_typ;
if (closed_door(x, y)) { if (closed_door(x, y)) {
int new_doormask = -1; int new_doormask = -1;
const char *see_txt = 0, *sense_txt = 0, *hear_txt = 0; const char *see_txt = 0, *sense_txt = 0, *hear_txt = 0;
rangemod = -1000; rangemod = -1000;
switch (abstype) { switch (abstype) {
case ZT_FIRE: case ZT_FIRE:
@@ -4523,9 +4528,9 @@ destroy_item(osym, dmgtyp)
register int osym, dmgtyp; register int osym, dmgtyp;
{ {
register struct obj *obj, *obj2; register struct obj *obj, *obj2;
register int dmg, xresist, skip; int dmg, xresist, skip;
register long i, cnt, quan; long i, cnt, quan;
register int dindx; int dindx;
const char *mult; const char *mult;
boolean physical_damage; boolean physical_damage;
@@ -4957,17 +4962,20 @@ retry:
u.uconduct.wishes++; u.uconduct.wishes++;
if (otmp != &zeroobj) { if (otmp != &zeroobj) {
const char
*verb = ((Is_airlevel(&u.uz) || u.uinwater) ? "slip" : "drop"),
*oops_msg = (u.uswallow
? "Oops! %s out of your reach!"
: (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)
|| levl[u.ux][u.uy].typ < IRONBARS
|| levl[u.ux][u.uy].typ >= ICE)
? "Oops! %s away from you!"
: "Oops! %s to the floor!");
/* The(aobjnam()) is safe since otmp is unidentified -dlc */ /* The(aobjnam()) is safe since otmp is unidentified -dlc */
(void) hold_another_object( (void) hold_another_object(otmp, oops_msg,
otmp, u.uswallow ? "Oops! %s out of your reach!" The(aobjnam(otmp, verb)),
: (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz) (const char *) 0);
|| levl[u.ux][u.uy].typ < IRONBARS
|| levl[u.ux][u.uy].typ >= ICE)
? "Oops! %s away from you!"
: "Oops! %s to the floor!",
The(aobjnam(otmp,
Is_airlevel(&u.uz) || u.uinwater ? "slip" : "drop")),
(const char *) 0);
u.ublesscnt += rn1(100, 50); /* the gods take notice */ u.ublesscnt += rn1(100, 50); /* the gods take notice */
} }
} }