obj->quan bits

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