| 2450 | } |
| 2451 | |
| 2452 | staticfn int |
| 2453 | trapeffect_poly_trap( |
| 2454 | struct monst *mtmp, |
| 2455 | struct trap *trap, |
| 2456 | unsigned int trflags) |
| 2457 | { |
| 2458 | if (mtmp == &gy.youmonst) { |
| 2459 | boolean viasitting = (trflags & VIASITTING) != 0; |
| 2460 | int steed_article = ARTICLE_THE; |
| 2461 | char verbbuf[BUFSZ]; |
| 2462 | |
| 2463 | /* suppress article in various steed messages when using its |
| 2464 | name (which won't occur when hallucinating) */ |
| 2465 | if (u.usteed && has_mgivenname(u.usteed) && !Hallucination) |
| 2466 | steed_article = ARTICLE_NONE; |
| 2467 | |
| 2468 | seetrap(trap); |
| 2469 | if (viasitting) |
| 2470 | Strcpy(verbbuf, "trigger"); /* follows "You sit down." */ |
| 2471 | else if (u.usteed) |
| 2472 | Sprintf(verbbuf, "lead %s onto", |
| 2473 | x_monnam(u.usteed, steed_article, (char *) 0, |
| 2474 | SUPPRESS_SADDLE, FALSE)); |
| 2475 | else |
| 2476 | Sprintf(verbbuf, "%s onto", u_locomotion("step")); |
| 2477 | You("%s a polymorph trap!", verbbuf); |
| 2478 | if (wearing_iron_shoes(mtmp)) { |
| 2479 | deltrap(trap); |
| 2480 | pline("%s warps strangely.", Yname2(uarmf)); |
| 2481 | poly_obj( |
| 2482 | uarmf, uarmf->otyp == IRON_SHOES ? KICKING_BOOTS : IRON_SHOES); |
| 2483 | update_inventory(); |
| 2484 | if (uarmf) |
| 2485 | prinv(NULL, uarmf, 0); |
| 2486 | } else if (Antimagic || Unchanging) { |
| 2487 | shieldeff(u.ux, u.uy); |
| 2488 | You_feel("momentarily different."); |
| 2489 | /* Trap did nothing; don't remove it --KAA */ |
| 2490 | } else { |
| 2491 | (void) steedintrap(trap, (struct obj *) 0); |
| 2492 | deltrap(trap); /* delete trap before polymorph */ |
| 2493 | newsym(u.ux, u.uy); /* get rid of trap symbol */ |
| 2494 | You_feel("a change coming over you."); |
| 2495 | polyself(POLY_NOFLAGS); |
| 2496 | } |
| 2497 | } else { |
| 2498 | boolean in_sight = canseemon(mtmp) || (mtmp == u.usteed); |
| 2499 | |
| 2500 | if (wearing_iron_shoes(mtmp)) { |
| 2501 | /* remove and readd the shoes to forcibly unwear them */ |
| 2502 | struct obj *shoes = which_armor(mtmp, W_ARMF); |
| 2503 | extract_from_minvent(mtmp, shoes, TRUE, TRUE); |
| 2504 | if (mpickobj(mtmp, shoes)) { |
| 2505 | impossible("re-equipping iron shoes destroyed them?"); |
| 2506 | return Trap_Effect_Finished; |
| 2507 | } |
| 2508 | shoes = poly_obj( |
| 2509 | shoes, shoes->otyp == IRON_SHOES ? KICKING_BOOTS : IRON_SHOES); |
no test coverage detected