Blessed scroll of destroy armor asks which armor to destroy

via xNetHack with some slight modifications.
This commit is contained in:
Pasi Kallinen
2024-12-06 11:09:23 +02:00
parent 9b4f38eebe
commit e23e6ef235
4 changed files with 45 additions and 0 deletions

View File

@@ -3367,4 +3367,31 @@ takeoff_ok(struct obj *obj)
return equip_ok(obj, TRUE, FALSE);
}
/* getobj callback for blessed destroy armor.
suggest any worn armor, even if covered by other armor */
int
any_worn_armor_ok(struct obj *obj)
{
if (obj && (obj->owornmask & W_ARMOR))
return GETOBJ_SUGGEST;
return GETOBJ_EXCLUDE;
}
/* number of armor pieces worn by hero */
int
count_worn_armor(void)
{
int ret = 0;
if (uarm) ret++;
if (uarmc) ret++;
if (uarmh) ret++;
if (uarms) ret++;
if (uarmg) ret++;
if (uarmf) ret++;
if (uarmu) ret++;
return ret;
}
/*do_wear.c*/