* Town Watchmen frown on damage to the town walls, trees or fountains. * It's OK to dig holes in the ground, however. * If mtmp is assumed to be a watchman, a watchman is found if mtmp == 0 * zap == TRUE if wand/spell of digging, FALSE otherwise (chewing) */
| 1374 | * zap == TRUE if wand/spell of digging, FALSE otherwise (chewing) |
| 1375 | */ |
| 1376 | void |
| 1377 | watch_dig(struct monst *mtmp, coordxy x, coordxy y, boolean zap) |
| 1378 | { |
| 1379 | struct rm *lev = &levl[x][y]; |
| 1380 | |
| 1381 | if (in_town(x, y) |
| 1382 | && (closed_door(x, y) || lev->typ == SDOOR || IS_WALL(lev->typ) |
| 1383 | || IS_FOUNTAIN(lev->typ) || IS_TREE(lev->typ))) { |
| 1384 | if (!mtmp) |
| 1385 | mtmp = get_iter_mons(watchman_canseeu); |
| 1386 | |
| 1387 | if (mtmp) { |
| 1388 | SetVoice(mtmp, 0, 80, 0); |
| 1389 | if (zap || svc.context.digging.warned) { |
| 1390 | verbalize("Halt, vandal! You're under arrest!"); |
| 1391 | (void) angry_guards(!!Deaf); |
| 1392 | } else { |
| 1393 | const char *str; |
| 1394 | |
| 1395 | if (IS_DOOR(lev->typ)) |
| 1396 | str = "door"; |
| 1397 | else if (IS_TREE(lev->typ)) |
| 1398 | str = "tree"; |
| 1399 | else if (IS_OBSTRUCTED(lev->typ)) |
| 1400 | str = "wall"; |
| 1401 | else |
| 1402 | str = "fountain"; |
| 1403 | verbalize("Hey, stop damaging that %s!", str); |
| 1404 | svc.context.digging.warned = TRUE; |
| 1405 | } |
| 1406 | if (is_digging()) |
| 1407 | stop_occupation(); |
| 1408 | } |
| 1409 | } |
| 1410 | } |
| 1411 | |
| 1412 | /* Return TRUE if monster died, FALSE otherwise. Called from m_move(). */ |
| 1413 | boolean |
no test coverage detected