MCPcopy Create free account
hub / github.com/NetHack/NetHack / ghod_hitsu

Function ghod_hitsu

src/priest.c:795–874  ·  view source on GitHub ↗

when attacking "priest" in his temple */

Source from the content-addressed store, hash-verified

793
794/* when attacking "priest" in his temple */
795void
796ghod_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!\"",

Callers 2

hmonFunction · 0.85
wakeupFunction · 0.85

Calls 10

temple_occupiedFunction · 0.85
has_shrineFunction · 0.85
linedupFunction · 0.85
rn2Function · 0.85
a_gname_atFunction · 0.85
s_suffixFunction · 0.85
buzzFunction · 0.85
sgnFunction · 0.85
exerciseFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected