diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 8861dc69f..b4078d700 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -2917,7 +2917,7 @@ add "make fetch-docs" to download pre-formatted documentation monsters will use throw-and-return weapons such as an aklys archeologists can identify scrolls by deciphering their labels 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 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, diff --git a/include/extern.h b/include/extern.h index 66a5120b4..3b357ec0d 100644 --- a/include/extern.h +++ b/include/extern.h @@ -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 void set_utrap(unsigned, unsigned); extern void reset_utrap(boolean); +extern boolean wearing_iron_shoes(struct monst *); extern boolean m_harmless_trap(struct monst *, struct trap *) NONNULLPTRS; extern void dotrap(struct trap *, unsigned) NONNULLARG1; extern void seetrap(struct trap *) NONNULLARG1; diff --git a/src/muse.c b/src/muse.c index 2d5e82bd4..78b61c10b 100644 --- a/src/muse.c +++ b/src/muse.c @@ -2131,8 +2131,10 @@ find_misc(struct monst *mtmp) if ((t = t_at(xx, yy)) != 0 && (ignore_boulders || !sobj_at(BOULDER, xx, yy)) && !onscary(xx, yy, mtmp)) { - /* use trap if it's the correct type */ - if (t->ttyp == POLY_TRAP) { + /* use trap if it's the correct type and will + polymorph the monster */ + if (t->ttyp == POLY_TRAP && + !wearing_iron_shoes(mtmp)) { gt.trapx = xx; gt.trapy = yy; gm.m.has_misc = MUSE_POLY_TRAP; diff --git a/src/trap.c b/src/trap.c index ce00d3403..630334228 100644 --- a/src/trap.c +++ b/src/trap.c @@ -16,7 +16,6 @@ staticfn boolean mu_maybe_destroy_web(struct monst *, boolean, struct trap *); staticfn struct obj *t_missile(int, struct trap *); staticfn boolean floor_trigger(int); 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_dart_trap(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)); } -/* return TRUE if mtmp is wearing iron shoes */ -staticfn boolean +/* return TRUE if mtmp is wearing shoes made of iron (iron/kicking) */ +boolean wearing_iron_shoes(struct monst *mtmp) { 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? */ @@ -2453,10 +2452,6 @@ trapeffect_poly_trap( struct trap *trap, 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) { boolean viasitting = (trflags & VIASITTING) != 0; int steed_article = ARTICLE_THE; @@ -2480,7 +2475,8 @@ trapeffect_poly_trap( if (wearing_iron_shoes(mtmp)) { deltrap(trap); 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(); if (uarmf) prinv(NULL, uarmf, 0); @@ -2506,7 +2502,8 @@ trapeffect_poly_trap( impossible("re-equipping iron shoes destroyed them?"); 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 */ if (shoes) { mtmp->misc_worn_check |= W_ARMF;