| 2722 | } |
| 2723 | |
| 2724 | staticfn int |
| 2725 | trapeffect_vibrating_square( |
| 2726 | struct monst *mtmp, |
| 2727 | struct trap *trap, |
| 2728 | unsigned int trflags UNUSED) |
| 2729 | { |
| 2730 | if (mtmp == &gy.youmonst) { |
| 2731 | feeltrap(trap); |
| 2732 | /* messages handled elsewhere; the trap symbol is merely to mark the |
| 2733 | square for future reference */ |
| 2734 | } else { |
| 2735 | boolean in_sight = canseemon(mtmp) || (mtmp == u.usteed); |
| 2736 | boolean see_it = cansee(mtmp->mx, mtmp->my); |
| 2737 | |
| 2738 | if (see_it && !Blind) { |
| 2739 | seetrap(trap); /* before messages */ |
| 2740 | if (in_sight) { |
| 2741 | char buf[BUFSZ], *p, *monnm = mon_nam(mtmp); |
| 2742 | |
| 2743 | if (nolimbs(mtmp->data) || m_in_air(mtmp)) { |
| 2744 | /* just "beneath <mon>" */ |
| 2745 | Strcpy(buf, monnm); |
| 2746 | } else { |
| 2747 | Strcpy(buf, s_suffix(monnm)); |
| 2748 | p = eos(strcat(buf, " ")); |
| 2749 | Strcpy(p, makeplural(mbodypart(mtmp, FOOT))); |
| 2750 | /* avoid "beneath 'rear paws'" or 'rear hooves' */ |
| 2751 | (void) strsubst(p, "rear ", ""); |
| 2752 | } |
| 2753 | You_see("a strange vibration beneath %s.", buf); |
| 2754 | } else { |
| 2755 | /* notice something (hearing uses a larger threshold |
| 2756 | for 'nearby') */ |
| 2757 | You_see("the ground vibrate %s.", |
| 2758 | (mdistu(mtmp) <= 2 * 2) |
| 2759 | ? "nearby" : "in the distance"); |
| 2760 | } |
| 2761 | } |
| 2762 | } |
| 2763 | return Trap_Effect_Finished; |
| 2764 | } |
| 2765 | |
| 2766 | /* |
| 2767 | * for PR#259 - paranoid_confirm:trap |
no test coverage detected