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

Function buzzmu

src/mcastu.c:988–1012  ·  view source on GitHub ↗

monster uses spell (ranged) */

Source from the content-addressed store, hash-verified

986
987/* monster uses spell (ranged) */
988int
989buzzmu(struct monst *mtmp, struct attack *mattk)
990{
991 /* don't print constant stream of curse messages for 'normal'
992 spellcasting monsters at range */
993 if (!BZ_VALID_ADTYP(mattk->adtyp))
994 return M_ATTK_MISS;
995
996 if (mtmp->mcan || m_seenres(mtmp, cvt_adtyp_to_mseenres(mattk->adtyp))) {
997 cursetxt(mtmp, FALSE);
998 return M_ATTK_MISS;
999 }
1000 if (lined_up(mtmp) && rn2(3)) {
1001 nomul(0);
1002 if (canseemon(mtmp))
1003 pline_mon(mtmp, "%s zaps you with a %s!", Monnam(mtmp),
1004 flash_str(BZ_OFS_AD(mattk->adtyp), FALSE));
1005 gb.buzzer = mtmp;
1006 buzz(BZ_M_SPELL(BZ_OFS_AD(mattk->adtyp)), (int) mattk->damn,
1007 mtmp->mx, mtmp->my, sgn(gt.tbx), sgn(gt.tby));
1008 gb.buzzer = 0;
1009 return M_ATTK_HIT;
1010 }
1011 return M_ATTK_MISS;
1012}
1013
1014/*mcastu.c*/

Callers 1

mattackuFunction · 0.85

Calls 11

cvt_adtyp_to_mseenresFunction · 0.85
cursetxtFunction · 0.85
lined_upFunction · 0.85
rn2Function · 0.85
nomulFunction · 0.85
canseemonFunction · 0.85
pline_monFunction · 0.85
MonnamFunction · 0.85
flash_strFunction · 0.85
buzzFunction · 0.85
sgnFunction · 0.85

Tested by

no test coverage detected