pacify or tame an undead monster */
| 208 | |
| 209 | /* pacify or tame an undead monster */ |
| 210 | staticfn void |
| 211 | deadbook_pacify_undead(struct monst *mtmp) |
| 212 | { |
| 213 | if ((is_undead(mtmp->data) || is_vampshifter(mtmp)) |
| 214 | && cansee(mtmp->mx, mtmp->my)) { |
| 215 | mtmp->mpeaceful = TRUE; |
| 216 | if (sgn(mtmp->data->maligntyp) == sgn(u.ualign.type) |
| 217 | && mdistu(mtmp) < 4) |
| 218 | if (mtmp->mtame) { |
| 219 | if (mtmp->mtame < 20) |
| 220 | mtmp->mtame++; |
| 221 | } else |
| 222 | (void) tamedog(mtmp, (struct obj *) 0, TRUE); |
| 223 | else |
| 224 | monflee(mtmp, 0, FALSE, TRUE); |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | /* special effects for the Book of the Dead; reading it while blind is |
| 229 | allowed so that needs to be taken into account too */ |