when attacking "priest" in his temple */
| 793 | |
| 794 | /* when attacking "priest" in his temple */ |
| 795 | void |
| 796 | ghod_hitsu(struct monst *priest) |
| 797 | { |
| 798 | struct mkroom *troom; |
| 799 | struct monst *oldbuzzer; |
| 800 | struct obj *oldcurrwand; |
| 801 | coordxy x, y, ax, ay; |
| 802 | int roomno = (int) temple_occupied(u.urooms); |
| 803 | |
| 804 | if (!roomno || !has_shrine(priest)) |
| 805 | return; |
| 806 | |
| 807 | ax = x = EPRI(priest)->shrpos.x; |
| 808 | ay = y = EPRI(priest)->shrpos.y; |
| 809 | troom = &svr.rooms[roomno - ROOMOFFSET]; |
| 810 | |
| 811 | if (u_at(x, y) || !linedup(u.ux, u.uy, x, y, 1)) { |
| 812 | if (IS_DOOR(levl[u.ux][u.uy].typ)) { |
| 813 | if (u.ux == troom->lx - 1) { |
| 814 | x = troom->hx; |
| 815 | y = u.uy; |
| 816 | } else if (u.ux == troom->hx + 1) { |
| 817 | x = troom->lx; |
| 818 | y = u.uy; |
| 819 | } else if (u.uy == troom->ly - 1) { |
| 820 | x = u.ux; |
| 821 | y = troom->hy; |
| 822 | } else if (u.uy == troom->hy + 1) { |
| 823 | x = u.ux; |
| 824 | y = troom->ly; |
| 825 | } |
| 826 | } else { |
| 827 | switch (rn2(4)) { |
| 828 | case 0: |
| 829 | x = u.ux; |
| 830 | y = troom->ly; |
| 831 | break; |
| 832 | case 1: |
| 833 | x = u.ux; |
| 834 | y = troom->hy; |
| 835 | break; |
| 836 | case 2: |
| 837 | x = troom->lx; |
| 838 | y = u.uy; |
| 839 | break; |
| 840 | default: |
| 841 | x = troom->hx; |
| 842 | y = u.uy; |
| 843 | break; |
| 844 | } |
| 845 | } |
| 846 | if (!linedup(u.ux, u.uy, x, y, 1)) |
| 847 | return; |
| 848 | } |
| 849 | |
| 850 | switch (rn2(3)) { |
| 851 | case 0: |
| 852 | pline("%s roars in anger: \"Thou shalt suffer!\"", |
no test coverage detected