| 6 | #include "hack.h" |
| 7 | |
| 8 | void |
| 9 | were_change(struct monst *mon) |
| 10 | { |
| 11 | if (!is_were(mon->data)) |
| 12 | return; |
| 13 | |
| 14 | if (is_human(mon->data)) { |
| 15 | if (!Protection_from_shape_changers |
| 16 | && !rn2(night() ? (flags.moonphase == FULL_MOON ? 3 : 30) |
| 17 | : (flags.moonphase == FULL_MOON ? 10 : 50))) { |
| 18 | new_were(mon); /* change into animal form */ |
| 19 | gw.were_changes++; |
| 20 | if (!Deaf && !canseemon(mon)) { |
| 21 | const char *howler; |
| 22 | |
| 23 | switch (monsndx(mon->data)) { |
| 24 | case PM_WEREWOLF: |
| 25 | howler = "wolf"; |
| 26 | break; |
| 27 | case PM_WEREJACKAL: |
| 28 | howler = "jackal"; |
| 29 | break; |
| 30 | default: |
| 31 | howler = (char *) 0; |
| 32 | break; |
| 33 | } |
| 34 | if (howler) { |
| 35 | Soundeffect(se_canine_howl, 50); |
| 36 | You_hear("a %s howling at the moon.", howler); |
| 37 | wake_nearto(mon->mx, mon->my, 4 * 4); |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | } else if (!rn2(30) || Protection_from_shape_changers) { |
| 42 | new_were(mon); /* change back into human form */ |
| 43 | gw.were_changes++; |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | int |
| 48 | counter_were(int pm) |