anger the Minetown watch */
| 5708 | |
| 5709 | /* anger the Minetown watch */ |
| 5710 | boolean |
| 5711 | angry_guards(boolean silent) |
| 5712 | { |
| 5713 | struct monst *mtmp; |
| 5714 | int ct = 0, nct = 0, sct = 0, slct = 0; |
| 5715 | |
| 5716 | for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { |
| 5717 | if (DEADMONSTER(mtmp)) |
| 5718 | continue; |
| 5719 | if (is_watch(mtmp->data) && mtmp->mpeaceful) { |
| 5720 | ct++; |
| 5721 | if (canspotmon(mtmp) && mtmp->mcanmove) { |
| 5722 | if (m_next2u(mtmp)) |
| 5723 | nct++; |
| 5724 | else |
| 5725 | sct++; |
| 5726 | } |
| 5727 | if (mtmp->msleeping || mtmp->mfrozen) { |
| 5728 | slct++; |
| 5729 | mtmp->msleeping = mtmp->mfrozen = 0; |
| 5730 | } |
| 5731 | mtmp->mpeaceful = 0; |
| 5732 | } |
| 5733 | } |
| 5734 | if (ct) { |
| 5735 | if (!silent) { /* do we want pline msgs? */ |
| 5736 | char buf[BUFSZ]; |
| 5737 | |
| 5738 | if (slct) { /* sleeping guard(s) */ |
| 5739 | Sprintf(buf, "guard%s", plur(slct)); |
| 5740 | pline_The("%s %s up.", buf, vtense(buf, "wake")); |
| 5741 | } |
| 5742 | |
| 5743 | if (nct) { /* seen/sensed adjacent guard(s) */ |
| 5744 | Sprintf(buf, "guard%s", plur(nct)); |
| 5745 | pline_The("%s %s angry!", buf, vtense(buf, "get")); |
| 5746 | } else if (sct) { /* seen/sensed non-adjacent guard(s) */ |
| 5747 | Sprintf(buf, "guard%s", plur(sct)); |
| 5748 | pline("%s %s %s approaching!", |
| 5749 | (sct == 1) ? "An angry" : "Angry", |
| 5750 | buf, vtense(buf, "are")); |
| 5751 | } else { |
| 5752 | Strcpy(buf, (ct == 1) ? "a guard's" : "guards'"); |
| 5753 | Soundeffect(se_shrill_whistle, 100); |
| 5754 | You_hear("the shrill sound of %s whistle%s.", buf, plur(ct)); |
| 5755 | } |
| 5756 | } |
| 5757 | return TRUE; |
| 5758 | } |
| 5759 | return FALSE; |
| 5760 | } |
| 5761 | |
| 5762 | staticfn void |
| 5763 | pacify_guard(struct monst *mtmp) |
no test coverage detected