MCPcopy Create free account
hub / github.com/NetHack/NetHack / cursetxt

Function cursetxt

src/mcastu.c:62–85  ·  view source on GitHub ↗

feedback when frustrated monster couldn't cast a spell */

Source from the content-addressed store, hash-verified

60
61/* feedback when frustrated monster couldn't cast a spell */
62staticfn void
63cursetxt(struct monst *mtmp, boolean undirected)
64{
65 if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my)) {
66 const char *point_msg; /* spellcasting monsters are impolite */
67
68 if (undirected)
69 point_msg = "all around, then curses";
70 else if ((Invis && !perceives(mtmp->data)
71 && (mtmp->mux != u.ux || mtmp->muy != u.uy))
72 || is_obj_mappear(&gy.youmonst, STRANGE_OBJECT)
73 || u.uundetected)
74 point_msg = "and curses in your general direction";
75 else if (Displaced && (mtmp->mux != u.ux || mtmp->muy != u.uy))
76 point_msg = "and curses at your displaced image";
77 else
78 point_msg = "at you, then curses";
79
80 pline_mon(mtmp, "%s points %s.", Monnam(mtmp), point_msg);
81 } else if ((!(svm.moves % 4) || !rn2(4))) {
82 if (!Deaf)
83 Norep("You hear a mumbled curse."); /* Deaf-aware */
84 }
85}
86
87/* choose a spell for monster to cast */
88staticfn int

Callers 2

castmuFunction · 0.85
buzzmuFunction · 0.85

Calls 5

canseemonFunction · 0.85
pline_monFunction · 0.85
MonnamFunction · 0.85
rn2Function · 0.85
NorepFunction · 0.85

Tested by

no test coverage detected