Blessed scroll of destroy armor asks which armor to destroy
via xNetHack with some slight modifications.
This commit is contained in:
@@ -1485,6 +1485,7 @@ digging in ice was handled inconsistently, particularly if done at the span
|
|||||||
spot in front of closed drawbridge
|
spot in front of closed drawbridge
|
||||||
angry god may remove an intrinsic
|
angry god may remove an intrinsic
|
||||||
blessed scroll of taming increases tameness of already tame creatures
|
blessed scroll of taming increases tameness of already tame creatures
|
||||||
|
blessed scroll of destroy armor asks which armor to destroy
|
||||||
|
|
||||||
|
|
||||||
Fixes to 3.7.0-x General Problems Exposed Via git Repository
|
Fixes to 3.7.0-x General Problems Exposed Via git Repository
|
||||||
|
|||||||
@@ -732,6 +732,8 @@ extern int remarm_swapwep(void);
|
|||||||
extern int destroy_arm(struct obj *);
|
extern int destroy_arm(struct obj *);
|
||||||
extern void adj_abon(struct obj *, schar) NONNULLARG1;
|
extern void adj_abon(struct obj *, schar) NONNULLARG1;
|
||||||
extern boolean inaccessible_equipment(struct obj *, const char *, boolean);
|
extern boolean inaccessible_equipment(struct obj *, const char *, boolean);
|
||||||
|
extern int any_worn_armor_ok(struct obj *);
|
||||||
|
extern int count_worn_armor(void);
|
||||||
|
|
||||||
/* ### dog.c ### */
|
/* ### dog.c ### */
|
||||||
|
|
||||||
|
|||||||
@@ -3367,4 +3367,31 @@ takeoff_ok(struct obj *obj)
|
|||||||
return equip_ok(obj, TRUE, FALSE);
|
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*/
|
/*do_wear.c*/
|
||||||
|
|||||||
+15
@@ -1279,6 +1279,21 @@ seffect_destroy_armor(struct obj **sobjp)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!scursed || !otmp || !otmp->cursed) {
|
if (!scursed || !otmp || !otmp->cursed) {
|
||||||
|
boolean gets_choice = (otmp && sobj && sobj->blessed
|
||||||
|
&& count_worn_armor() > 1);
|
||||||
|
|
||||||
|
if (gets_choice) {
|
||||||
|
struct obj *atmp;
|
||||||
|
|
||||||
|
if (!objects[sobj->otyp].oc_name_known)
|
||||||
|
pline("This is %s!", an(actualoname(sobj)));
|
||||||
|
gk.known = TRUE;
|
||||||
|
atmp = getobj("destroy", any_worn_armor_ok, GETOBJ_PROMPT);
|
||||||
|
/* check the return value, if user picked non-valid obj */
|
||||||
|
if (any_worn_armor_ok(atmp) == GETOBJ_SUGGEST)
|
||||||
|
otmp = atmp;
|
||||||
|
}
|
||||||
|
|
||||||
if (!destroy_arm(otmp)) {
|
if (!destroy_arm(otmp)) {
|
||||||
strange_feeling(sobj, "Your skin itches.");
|
strange_feeling(sobj, "Your skin itches.");
|
||||||
*sobjp = 0; /* useup() in strange_feeling() */
|
*sobjp = 0; /* useup() in strange_feeling() */
|
||||||
|
|||||||
Reference in New Issue
Block a user