* You've either stepped onto a statue trap's location or you've triggered a * statue trap by searching next to it or by trying to break it with a wand * or pick-axe. */
| 905 | * or pick-axe. |
| 906 | */ |
| 907 | struct monst * |
| 908 | activate_statue_trap( |
| 909 | struct trap *trap, |
| 910 | coordxy x, |
| 911 | coordxy y, |
| 912 | boolean shatter) |
| 913 | { |
| 914 | struct monst *mtmp = (struct monst *) 0; |
| 915 | struct obj *otmp = sobj_at(STATUE, x, y); |
| 916 | int fail_reason; |
| 917 | |
| 918 | /* |
| 919 | * Try to animate the first valid statue. Stop the loop when we |
| 920 | * actually create something or the failure cause is not because |
| 921 | * the mon was unique. |
| 922 | */ |
| 923 | deltrap(trap); |
| 924 | while (otmp) { |
| 925 | mtmp = animate_statue(otmp, x, y, |
| 926 | shatter ? ANIMATE_SHATTER : ANIMATE_NORMAL, |
| 927 | &fail_reason); |
| 928 | if (mtmp || fail_reason != AS_MON_IS_UNIQUE) |
| 929 | break; |
| 930 | |
| 931 | otmp = nxtobj(otmp, STATUE, TRUE); |
| 932 | } |
| 933 | |
| 934 | feel_newsym(x, y); |
| 935 | return mtmp; |
| 936 | } |
| 937 | |
| 938 | staticfn boolean |
| 939 | keep_saddle_with_steedcorpse( |
no test coverage detected