monster hits hero (most callers have been moved to uthim.c) */
| 26 | |
| 27 | /* monster hits hero (most callers have been moved to uthim.c) */ |
| 28 | void |
| 29 | hitmsg(struct monst *mtmp, struct attack *mattk) |
| 30 | { |
| 31 | int compat; |
| 32 | const char *verb = 0, *again, *punct = "!"; |
| 33 | char *Monst_name = Monnam(mtmp); |
| 34 | |
| 35 | /* Note: if opposite gender, "seductively"; |
| 36 | if same gender, "engagingly" for nymph, normal msg for others. */ |
| 37 | if ((compat = could_seduce(mtmp, &gy.youmonst, mattk)) != 0 |
| 38 | && !mtmp->mcan && !mtmp->mspec_used) { |
| 39 | pline_mon(mtmp, "%s %s you %s.", Monst_name, |
| 40 | !Blind ? "smiles at" : !Deaf ? "talks to" : "touches", |
| 41 | (compat == 2) ? "engagingly" : "seductively"); |
| 42 | } else { |
| 43 | switch (mattk->aatyp) { |
| 44 | case AT_BITE: |
| 45 | verb = "bites"; |
| 46 | break; |
| 47 | case AT_KICK: |
| 48 | if (thick_skinned(gy.youmonst.data)) |
| 49 | punct = "."; |
| 50 | verb = "kicks"; |
| 51 | break; |
| 52 | case AT_STNG: |
| 53 | verb = "stings"; |
| 54 | break; |
| 55 | case AT_BUTT: |
| 56 | verb = "butts"; |
| 57 | break; |
| 58 | case AT_TUCH: |
| 59 | verb = "touches you"; |
| 60 | break; |
| 61 | case AT_TENT: |
| 62 | verb = "tentacles suck your brain"; |
| 63 | Monst_name = s_suffix(Monst_name); |
| 64 | break; |
| 65 | case AT_EXPL: |
| 66 | case AT_BOOM: |
| 67 | verb = "explodes"; |
| 68 | break; |
| 69 | default: |
| 70 | verb = "hits"; |
| 71 | } |
| 72 | /* if a monster hits more than once with similar attack, say so */ |
| 73 | again = (mtmp->m_id == gh.hitmsg_mid |
| 74 | && gh.hitmsg_prev != NULL |
| 75 | && mattk == gh.hitmsg_prev + 1 |
| 76 | && mattk->aatyp == gh.hitmsg_prev->aatyp) ? " again" : ""; |
| 77 | pline_mon(mtmp, "%s %s%s%s", Monst_name, verb, again, punct); |
| 78 | } |
| 79 | gh.hitmsg_mid = mtmp->m_id; |
| 80 | gh.hitmsg_prev = mattk; |
| 81 | } |
| 82 | |
| 83 | /* monster missed you */ |
| 84 | staticfn void |
no test coverage detected