* pri_move: return 1: moved 0: didn't -1: let m_move do it -2: died */
| 174 | * pri_move: return 1: moved 0: didn't -1: let m_move do it -2: died |
| 175 | */ |
| 176 | int |
| 177 | pri_move(struct monst *priest) |
| 178 | { |
| 179 | coordxy ggx, ggy, omx, omy; |
| 180 | schar temple; |
| 181 | boolean avoid = TRUE; |
| 182 | |
| 183 | omx = priest->mx; |
| 184 | omy = priest->my; |
| 185 | |
| 186 | if (!histemple_at(priest, omx, omy)) |
| 187 | return -1; |
| 188 | |
| 189 | temple = EPRI(priest)->shroom; |
| 190 | |
| 191 | ggx = EPRI(priest)->shrpos.x; |
| 192 | ggy = EPRI(priest)->shrpos.y; |
| 193 | |
| 194 | ggx += rn1(3, -1); /* mill around the altar */ |
| 195 | ggy += rn1(3, -1); |
| 196 | |
| 197 | if (!priest->mpeaceful |
| 198 | || (Conflict && !resist_conflict(priest))) { |
| 199 | if (monnear(priest, u.ux, u.uy)) { |
| 200 | if (Displaced) |
| 201 | Your("displaced image doesn't fool %s!", mon_nam(priest)); |
| 202 | (void) mattacku(priest); |
| 203 | return 0; |
| 204 | } else if (strchr(u.urooms, temple)) { |
| 205 | /* chase player if inside temple & can see him */ |
| 206 | if (priest->mcansee && m_canseeu(priest)) { |
| 207 | ggx = u.ux; |
| 208 | ggy = u.uy; |
| 209 | } |
| 210 | avoid = FALSE; |
| 211 | } |
| 212 | } else if (Invis) |
| 213 | avoid = FALSE; |
| 214 | |
| 215 | return move_special(priest, FALSE, TRUE, FALSE, avoid, omx, omy, ggx, ggy); |
| 216 | } |
| 217 | |
| 218 | /* exclusively for mktemple() */ |
| 219 | void |
no test coverage detected