| 2658 | #undef MINE_TRIGGER_WT |
| 2659 | |
| 2660 | staticfn int |
| 2661 | trapeffect_rolling_boulder_trap( |
| 2662 | struct monst *mtmp, |
| 2663 | struct trap *trap, |
| 2664 | unsigned int trflags UNUSED) |
| 2665 | { |
| 2666 | if (mtmp == &gy.youmonst) { |
| 2667 | int style = ROLL | (trap->tseen ? LAUNCH_KNOWN : 0); |
| 2668 | |
| 2669 | feeltrap(trap); |
| 2670 | pline("%sYou trigger a rolling boulder trap!", |
| 2671 | !Deaf ? "Click! " : ""); |
| 2672 | if (!launch_obj(BOULDER, trap->launch.x, trap->launch.y, |
| 2673 | trap->launch2.x, trap->launch2.y, style)) { |
| 2674 | /* if this is a known trap, the player may have known there wasn't |
| 2675 | a lined up boulder, so use a shorter message to avoid --More-- |
| 2676 | spam */ |
| 2677 | if (style & LAUNCH_KNOWN) |
| 2678 | pline("No boulder was released."); |
| 2679 | else |
| 2680 | pline("Fortunately for you, no boulder was released."); |
| 2681 | } |
| 2682 | } else { |
| 2683 | if (!m_in_air(mtmp)) { |
| 2684 | boolean in_sight = (mtmp == u.usteed |
| 2685 | || (cansee(mtmp->mx, mtmp->my) |
| 2686 | && canspotmon(mtmp))); |
| 2687 | int style = ROLL | (in_sight ? 0 : LAUNCH_UNSEEN); |
| 2688 | boolean trapkilled = FALSE; |
| 2689 | |
| 2690 | newsym(mtmp->mx, mtmp->my); |
| 2691 | if (in_sight) |
| 2692 | pline_mon(mtmp, "%s%s triggers %s.", |
| 2693 | !Deaf ? "Click! " : "", Monnam(mtmp), |
| 2694 | trap->tseen ? "a rolling boulder trap" : something); |
| 2695 | if (launch_obj(BOULDER, trap->launch.x, trap->launch.y, |
| 2696 | trap->launch2.x, trap->launch2.y, style)) { |
| 2697 | if (in_sight) |
| 2698 | trap->tseen = TRUE; |
| 2699 | if (DEADMONSTER(mtmp)) |
| 2700 | trapkilled = TRUE; |
| 2701 | } |
| 2702 | return trapkilled ? Trap_Killed_Mon : mtmp->mtrapped |
| 2703 | ? Trap_Caught_Mon : Trap_Effect_Finished; |
| 2704 | } |
| 2705 | } |
| 2706 | return Trap_Effect_Finished; |
| 2707 | } |
| 2708 | |
| 2709 | staticfn int |
| 2710 | trapeffect_magic_portal( |
no test coverage detected