Iron footwear and traps balance fixes

Any sort of iron footwear now protects from traps, and polymorph
traps change one sort of iron footwear into a different sort of
iron footwear (removing any incentive to try to farm them, because
you will see both options very quickly).
This commit is contained in:
Alex Smith
2026-04-14 16:51:20 +01:00
parent acfbd6d0e4
commit 89473216ae
4 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -2917,7 +2917,7 @@ add "make fetch-docs" to download pre-formatted documentation
monsters will use throw-and-return weapons such as an aklys monsters will use throw-and-return weapons such as an aklys
archeologists can identify scrolls by deciphering their labels archeologists can identify scrolls by deciphering their labels
monster destroy armor -spell first erodes armor monster destroy armor -spell first erodes armor
iron shoes protect the wearer against certain floor-based traps iron footwear protects the wearer against certain floor-based traps
ring of stealth prevents hero from leaving tracks ring of stealth prevents hero from leaving tracks
the game now automatically tracks which sell prices and buy prices you have the game now automatically tracks which sell prices and buy prices you have
seen for each type of item; these are visible in the discoveries list, seen for each type of item; these are visible in the discoveries list,
+1
View File
@@ -3289,6 +3289,7 @@ extern struct monst *activate_statue_trap(struct trap *, coordxy, coordxy,
extern int immune_to_trap(struct monst *, unsigned) NO_NNARGS; /* revisit */ extern int immune_to_trap(struct monst *, unsigned) NO_NNARGS; /* revisit */
extern void set_utrap(unsigned, unsigned); extern void set_utrap(unsigned, unsigned);
extern void reset_utrap(boolean); extern void reset_utrap(boolean);
extern boolean wearing_iron_shoes(struct monst *);
extern boolean m_harmless_trap(struct monst *, struct trap *) NONNULLPTRS; extern boolean m_harmless_trap(struct monst *, struct trap *) NONNULLPTRS;
extern void dotrap(struct trap *, unsigned) NONNULLARG1; extern void dotrap(struct trap *, unsigned) NONNULLARG1;
extern void seetrap(struct trap *) NONNULLARG1; extern void seetrap(struct trap *) NONNULLARG1;
+4 -2
View File
@@ -2131,8 +2131,10 @@ find_misc(struct monst *mtmp)
if ((t = t_at(xx, yy)) != 0 if ((t = t_at(xx, yy)) != 0
&& (ignore_boulders || !sobj_at(BOULDER, xx, yy)) && (ignore_boulders || !sobj_at(BOULDER, xx, yy))
&& !onscary(xx, yy, mtmp)) { && !onscary(xx, yy, mtmp)) {
/* use trap if it's the correct type */ /* use trap if it's the correct type and will
if (t->ttyp == POLY_TRAP) { polymorph the monster */
if (t->ttyp == POLY_TRAP &&
!wearing_iron_shoes(mtmp)) {
gt.trapx = xx; gt.trapx = xx;
gt.trapy = yy; gt.trapy = yy;
gm.m.has_misc = MUSE_POLY_TRAP; gm.m.has_misc = MUSE_POLY_TRAP;
+7 -10
View File
@@ -16,7 +16,6 @@ staticfn boolean mu_maybe_destroy_web(struct monst *, boolean, struct trap *);
staticfn struct obj *t_missile(int, struct trap *); staticfn struct obj *t_missile(int, struct trap *);
staticfn boolean floor_trigger(int); staticfn boolean floor_trigger(int);
staticfn boolean check_in_air(struct monst *, unsigned); staticfn boolean check_in_air(struct monst *, unsigned);
staticfn boolean wearing_iron_shoes(struct monst *);
staticfn int trapeffect_arrow_trap(struct monst *, struct trap *, unsigned); staticfn int trapeffect_arrow_trap(struct monst *, struct trap *, unsigned);
staticfn int trapeffect_dart_trap(struct monst *, struct trap *, unsigned); staticfn int trapeffect_dart_trap(struct monst *, struct trap *, unsigned);
staticfn int trapeffect_rocktrap(struct monst *, struct trap *, unsigned); staticfn int trapeffect_rocktrap(struct monst *, struct trap *, unsigned);
@@ -1094,12 +1093,12 @@ check_in_air(struct monst *mtmp, unsigned trflags)
|| ((is_you ? Flying : is_flyer(mtmp->data)) && !plunged)); || ((is_you ? Flying : is_flyer(mtmp->data)) && !plunged));
} }
/* return TRUE if mtmp is wearing iron shoes */ /* return TRUE if mtmp is wearing shoes made of iron (iron/kicking) */
staticfn boolean boolean
wearing_iron_shoes(struct monst *mtmp) wearing_iron_shoes(struct monst *mtmp)
{ {
struct obj *armf = which_armor(mtmp, W_ARMF); struct obj *armf = which_armor(mtmp, W_ARMF);
return armf && armf->otyp == IRON_SHOES; return armf && objects[armf->otyp].oc_material == IRON;
} }
/* is trap ttmp harmless to monster mtmp? */ /* is trap ttmp harmless to monster mtmp? */
@@ -2453,10 +2452,6 @@ trapeffect_poly_trap(
struct trap *trap, struct trap *trap,
unsigned int trflags) unsigned int trflags)
{ {
static int possible_boots[] = {
ELVEN_BOOTS, KICKING_BOOTS, FUMBLE_BOOTS, LEVITATION_BOOTS,
JUMPING_BOOTS, SPEED_BOOTS, WATER_WALKING_BOOTS };
if (mtmp == &gy.youmonst) { if (mtmp == &gy.youmonst) {
boolean viasitting = (trflags & VIASITTING) != 0; boolean viasitting = (trflags & VIASITTING) != 0;
int steed_article = ARTICLE_THE; int steed_article = ARTICLE_THE;
@@ -2480,7 +2475,8 @@ trapeffect_poly_trap(
if (wearing_iron_shoes(mtmp)) { if (wearing_iron_shoes(mtmp)) {
deltrap(trap); deltrap(trap);
pline("%s warps strangely.", Yname2(uarmf)); pline("%s warps strangely.", Yname2(uarmf));
poly_obj(uarmf, ROLL_FROM(possible_boots)); poly_obj(
uarmf, uarmf->otyp == IRON_SHOES ? KICKING_BOOTS : IRON_SHOES);
update_inventory(); update_inventory();
if (uarmf) if (uarmf)
prinv(NULL, uarmf, 0); prinv(NULL, uarmf, 0);
@@ -2506,7 +2502,8 @@ trapeffect_poly_trap(
impossible("re-equipping iron shoes destroyed them?"); impossible("re-equipping iron shoes destroyed them?");
return Trap_Effect_Finished; return Trap_Effect_Finished;
} }
shoes = poly_obj(shoes, ROLL_FROM(possible_boots)); shoes = poly_obj(
shoes, shoes->otyp == IRON_SHOES ? KICKING_BOOTS : IRON_SHOES);
/* now equip them again */ /* now equip them again */
if (shoes) { if (shoes) {
mtmp->misc_worn_check |= W_ARMF; mtmp->misc_worn_check |= W_ARMF;