BUC patch

This adds the BUC-patch, except that it includes four separate choices for
blessed/cursed/uncursed/unknown.  The patch only applies to full menu styles.

--Ken A

(Incidentally, I have a suggestion: when deciding what's the first line for
purposes of mailing out messages, use the first nonblank line...)
This commit is contained in:
arromdee
2002-01-16 03:19:45 +00:00
parent 5bf430c3d3
commit 4361289ec3
6 changed files with 137 additions and 2 deletions

View File

@@ -1631,6 +1631,45 @@ count_unpaid(list)
return count;
}
/*
* Returns the number of items with b/u/c/unknown within the given list.
* This does NOT include contained objects.
*/
int
count_buc(list, type)
struct obj *list;
int type;
{
int count = 0;
while (list) {
switch(type) {
case BUC_BLESSED:
if (list->oclass != GOLD_CLASS && list->bknown && list->blessed)
count++;
break;
case BUC_CURSED:
if (list->oclass != GOLD_CLASS && list->bknown && list->cursed)
count++;
break;
case BUC_UNCURSED:
if (list->oclass != GOLD_CLASS &&
list->bknown && !list->blessed && !list->cursed)
count++;
break;
case BUC_UNKNOWN:
if (list->oclass != GOLD_CLASS && !list->bknown)
count++;
break;
default:
impossible("need count of curse status %d?", type);
return 0;
}
list = list->nobj;
}
return count;
}
STATIC_OVL void
dounpaid()
{