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

@@ -608,6 +608,10 @@ int retry;
menu_item *pick_list;
boolean all_categories = TRUE;
boolean drop_everything = FALSE;
boolean drop_blessed = FALSE;
boolean drop_cursed = FALSE;
boolean drop_uncursed = FALSE;
boolean drop_buc_unknown = FALSE;
#ifndef GOLDOBJ
if (u.ugold) {
@@ -626,7 +630,8 @@ int retry;
all_categories = FALSE;
n = query_category("Drop what type of items?",
invent,
UNPAID_TYPES | ALL_TYPES | CHOOSE_ALL,
UNPAID_TYPES | ALL_TYPES | CHOOSE_ALL |
BUC_BLESSED | BUC_CURSED | BUC_UNCURSED | BUC_UNKNOWN,
&pick_list, PICK_ANY);
if (!n) goto drop_done;
for (i = 0; i < n; i++) {
@@ -634,6 +639,14 @@ int retry;
all_categories = TRUE;
else if (pick_list[i].item.a_int == 'A')
drop_everything = TRUE;
else if (pick_list[i].item.a_int == 'B')
drop_blessed = TRUE;
else if (pick_list[i].item.a_int == 'C')
drop_cursed = TRUE;
else if (pick_list[i].item.a_int == 'U')
drop_uncursed = TRUE;
else if (pick_list[i].item.a_int == 'X')
drop_buc_unknown = TRUE;
else
add_valid_menu_class(pick_list[i].item.a_int);
}
@@ -653,6 +666,35 @@ int retry;
otmp2 = otmp->nobj;
n_dropped += drop(otmp);
}
} else if (drop_blessed) {
for(otmp = invent; otmp; otmp = otmp2) {
/* zw, gold is never blessed or cursed */
otmp2 = otmp->nobj;
if (otmp->oclass != GOLD_CLASS && otmp->bknown && otmp->blessed)
n_dropped += drop(otmp);
}
} else if (drop_cursed) {
for(otmp = invent; otmp; otmp = otmp2) {
/* zw, gold is never blessed or cursed */
otmp2 = otmp->nobj;
if (otmp->oclass != GOLD_CLASS && otmp->bknown && otmp->cursed)
n_dropped += drop(otmp);
}
} else if (drop_uncursed) {
for(otmp = invent; otmp; otmp = otmp2) {
/* zw, gold is never blessed or cursed */
otmp2 = otmp->nobj;
if (otmp->oclass != GOLD_CLASS &&
otmp->bknown && !otmp->blessed && !otmp->cursed)
n_dropped += drop(otmp);
}
} else if (drop_buc_unknown) {
for(otmp = invent; otmp; otmp = otmp2) {
/* zw, gold is never blessed or cursed */
otmp2 = otmp->nobj;
if (otmp->oclass != GOLD_CLASS && !otmp->bknown)
n_dropped += drop(otmp);
}
} else {
/* should coordinate with perm invent, maybe not show worn items */
n = query_objlist("What would you like to drop?", invent,