obj->quan bits
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)apply.c 3.4 2004/06/12 */
|
||||
/* SCCS Id: @(#)apply.c 3.4 2004/12/21 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -1135,7 +1135,7 @@ struct obj *obj;
|
||||
/* if it catches while you have it, then it's your tough luck */
|
||||
check_unpaid(obj);
|
||||
verbalize("That's in addition to the cost of %s %s, of course.",
|
||||
yname(obj), obj->quan == 1 ? "itself" : "themselves");
|
||||
yname(obj), obj->quan == 1L ? "itself" : "themselves");
|
||||
bill_dummy_object(obj);
|
||||
}
|
||||
begin_burn(obj, FALSE);
|
||||
@@ -1987,7 +1987,7 @@ struct obj *tstone;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (obj == tstone && obj->quan == 1) {
|
||||
if (obj == tstone && obj->quan == 1L) {
|
||||
You_cant("rub %s on itself.", the(xname(obj)));
|
||||
return;
|
||||
}
|
||||
@@ -2001,7 +2001,7 @@ struct obj *tstone;
|
||||
pline("Oh, wow, look at the pretty shards.");
|
||||
else
|
||||
pline("A sharp crack shatters %s%s.",
|
||||
(obj->quan > 1) ? "one of " : "", the(xname(obj)));
|
||||
(obj->quan > 1L) ? "one of " : "", the(xname(obj)));
|
||||
#ifndef GOLDOBJ
|
||||
/* assert(obj != &goldobj); */
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)dothrow.c 3.4 2004/11/11 */
|
||||
/* SCCS Id: @(#)dothrow.c 3.4 2004/12/21 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -1689,7 +1689,7 @@ boolean in_view;
|
||||
You_hear("%s shatter!", something);
|
||||
else
|
||||
pline("%s shatter%s%s!", Doname2(obj),
|
||||
(obj->quan==1) ? "s" : "", to_pieces);
|
||||
(obj->quan==1L) ? "s" : "", to_pieces);
|
||||
break;
|
||||
case EGG:
|
||||
case MELON:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)end.c 3.4 2004/12/17 */
|
||||
/* SCCS Id: @(#)end.c 3.4 2004/12/21 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -1005,8 +1005,8 @@ boolean identified, all_containers;
|
||||
} else {
|
||||
if (cat || deadcat) {
|
||||
pline("%s%s contains Schroedinger's %scat!",
|
||||
(box->quan > 1) ? "One of the " : "",
|
||||
(box->quan > 1) ? xname(box) : upstart(xname(box)),
|
||||
(box->quan > 1L) ? "One of the " : "",
|
||||
(box->quan > 1L) ? xname(box) : upstart(xname(box)),
|
||||
(deadcat) ? "dead " : "");
|
||||
display_nhwindow(WIN_MESSAGE, FALSE);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)explode.c 3.4 2004/06/12 */
|
||||
/* SCCS Id: @(#)explode.c 3.4 2004/12/21 */
|
||||
/* Copyright (C) 1990 by Ken Arromdee */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -428,7 +428,7 @@ struct obj *obj; /* only scatter this obj */
|
||||
|
||||
while ((otmp = individual_object ? obj : level.objects[sx][sy]) != 0) {
|
||||
if (otmp->quan > 1L) {
|
||||
qtmp = otmp->quan - 1;
|
||||
qtmp = otmp->quan - 1L;
|
||||
if (qtmp > LARGEST_INT) qtmp = LARGEST_INT;
|
||||
qtmp = (long)rnd((int)qtmp);
|
||||
otmp = splitobj(otmp, qtmp);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)mhitu.c 3.4 2004/12/20 */
|
||||
/* SCCS Id: @(#)mhitu.c 3.4 2004/12/21 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -104,7 +104,7 @@ register struct obj *otemp;
|
||||
return;
|
||||
pline("%s %s %s%s %s.", Monnam(mtmp),
|
||||
(objects[otemp->otyp].oc_dir & PIERCE) ? "thrusts" : "swings",
|
||||
(otemp->quan > 1) ? "one of " : "",
|
||||
(otemp->quan > 1L) ? "one of " : "",
|
||||
mhis(mtmp), xname(otemp));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)potion.c 3.4 2004/09/22 */
|
||||
/* SCCS Id: @(#)potion.c 3.4 2004/12/21 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -1991,7 +1991,7 @@ dodip()
|
||||
char oldbuf[BUFSZ], newbuf[BUFSZ];
|
||||
short old_otyp = potion->otyp;
|
||||
boolean old_dknown = FALSE;
|
||||
boolean more_than_one = potion->quan > 1;
|
||||
boolean more_than_one = potion->quan > 1L;
|
||||
|
||||
oldbuf[0] = '\0';
|
||||
if (potion->dknown) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)shk.c 3.4 2004/11/17 */
|
||||
/* SCCS Id: @(#)shk.c 3.4 2004/12/21 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -2137,7 +2137,7 @@ const char *arg;
|
||||
if (was_unknown) {
|
||||
Sprintf(fmtbuf, "%%s; you %s", fmt);
|
||||
obj_name[0] = highc(obj_name[0]);
|
||||
pline(fmtbuf, obj_name, (obj->quan > 1) ? "them" : "it",
|
||||
pline(fmtbuf, obj_name, (obj->quan > 1L) ? "them" : "it",
|
||||
amt, plur(amt), arg);
|
||||
} else {
|
||||
You(fmt, obj_name, amt, plur(amt), arg);
|
||||
@@ -3073,7 +3073,7 @@ boolean catchup; /* restoring a level */
|
||||
/* convert to an object */
|
||||
otmp = mksobj((ttmp->ttyp == LANDMINE) ? LAND_MINE :
|
||||
BEARTRAP, TRUE, FALSE);
|
||||
otmp->quan= 1;
|
||||
otmp->quan= 1L;
|
||||
otmp->owt = weight(otmp);
|
||||
(void) mpickobj(shkp, otmp);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)sit.c 3.4 2002/09/21 */
|
||||
/* SCCS Id: @(#)sit.c 3.4 2004/12/21 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -301,7 +301,7 @@ dosit()
|
||||
|
||||
uegg = mksobj(EGG, FALSE, FALSE);
|
||||
uegg->spe = 1;
|
||||
uegg->quan = 1;
|
||||
uegg->quan = 1L;
|
||||
uegg->owt = weight(uegg);
|
||||
uegg->corpsenm = egg_type_from_parent(u.umonnum, FALSE);
|
||||
uegg->known = uegg->dknown = 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)trap.c 3.4 2004/11/11 */
|
||||
/* SCCS Id: @(#)trap.c 3.4 2004/12/21 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -2729,14 +2729,14 @@ xchar x, y;
|
||||
}
|
||||
dindx = (obj->oclass == SCROLL_CLASS) ? 2 : 3;
|
||||
if (in_sight)
|
||||
pline("%s %s.", Yname2(obj), (obj->quan > 1) ?
|
||||
pline("%s %s.", Yname2(obj), (obj->quan > 1L) ?
|
||||
destroy_strings[dindx*3 + 1] : destroy_strings[dindx*3]);
|
||||
delobj(obj);
|
||||
retval++;
|
||||
} else if (obj->oclass == POTION_CLASS) {
|
||||
dindx = 1;
|
||||
if (in_sight)
|
||||
pline("%s %s.", Yname2(obj), (obj->quan > 1) ?
|
||||
pline("%s %s.", Yname2(obj), (obj->quan > 1L) ?
|
||||
destroy_strings[dindx*3 + 1] : destroy_strings[dindx*3]);
|
||||
delobj(obj);
|
||||
retval++;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)uhitm.c 3.4 2004/11/11 */
|
||||
/* SCCS Id: @(#)uhitm.c 3.4 2004/12/21 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -758,7 +758,7 @@ int thrown;
|
||||
You("hit %s with %s %s.", mon_nam(mon),
|
||||
obj->dknown ? the(mons[obj->corpsenm].mname) :
|
||||
an(mons[obj->corpsenm].mname),
|
||||
(obj->quan > 1) ? makeplural(withwhat) : withwhat);
|
||||
(obj->quan > 1L) ? makeplural(withwhat) : withwhat);
|
||||
if (!munstone(mon, TRUE))
|
||||
minstapetrify(mon, TRUE);
|
||||
if (resists_ston(mon)) break;
|
||||
@@ -786,7 +786,7 @@ int thrown;
|
||||
hand-to-hand attack should yield a "bashing" mesg */
|
||||
if (obj == uwep) unweapon = TRUE;
|
||||
if (obj->spe && obj->corpsenm >= LOW_PM) {
|
||||
if (obj->quan < 5)
|
||||
if (obj->quan < 5L)
|
||||
change_luck((schar) -(obj->quan));
|
||||
else
|
||||
change_luck(-5);
|
||||
@@ -854,7 +854,7 @@ int thrown;
|
||||
} else {
|
||||
char *whom = mon_nam(mon);
|
||||
char *what = The(xname(obj));
|
||||
if (!thrown && obj->quan > 1)
|
||||
if (!thrown && obj->quan > 1L)
|
||||
what = An(singular(obj, xname));
|
||||
/* note: s_suffix returns a modifiable buffer */
|
||||
if (haseyes(mdat)
|
||||
|
||||
14
src/zap.c
14
src/zap.c
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)zap.c 3.4 2004/11/22 */
|
||||
/* SCCS Id: @(#)zap.c 3.4 2004/12/21 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -3300,16 +3300,16 @@ boolean u_caused;
|
||||
obj_resists(obj, 2, 100))
|
||||
continue;
|
||||
scrquan = obj->quan; /* number present */
|
||||
delquan = 0; /* number to destroy */
|
||||
for (i = scrquan; i > 0; i--)
|
||||
delquan = 0L; /* number to destroy */
|
||||
for (i = scrquan; i > 0L; i--)
|
||||
if (!rn2(3)) delquan++;
|
||||
if (delquan) {
|
||||
/* save name before potential delobj() */
|
||||
if (give_feedback) {
|
||||
obj->quan = 1;
|
||||
obj->quan = 1L;
|
||||
Strcpy(buf1, (x == u.ux && y == u.uy) ?
|
||||
xname(obj) : distant_name(obj, xname));
|
||||
obj->quan = 2;
|
||||
obj->quan = 2L;
|
||||
Strcpy(buf2, (x == u.ux && y == u.uy) ?
|
||||
xname(obj) : distant_name(obj, xname));
|
||||
obj->quan = scrquan;
|
||||
@@ -3320,7 +3320,7 @@ boolean u_caused;
|
||||
else delobj(obj);
|
||||
cnt += delquan;
|
||||
if (give_feedback) {
|
||||
if (delquan > 1)
|
||||
if (delquan > 1L)
|
||||
pline("%ld %s burn.", delquan, buf2);
|
||||
else
|
||||
pline("%s burns.", An(buf1));
|
||||
@@ -3963,7 +3963,7 @@ register int osym, dmgtyp;
|
||||
physical_damage = FALSE;
|
||||
if(obj->oclass != osym) continue; /* test only objs of type osym */
|
||||
if(obj->oartifact) continue; /* don't destroy artifacts */
|
||||
if(obj->in_use && obj->quan == 1) continue; /* not available */
|
||||
if(obj->in_use && obj->quan == 1L) continue; /* not available */
|
||||
xresist = skip = 0;
|
||||
#ifdef GCC_WARN
|
||||
dmg = dindx = 0;
|
||||
|
||||
Reference in New Issue
Block a user