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

Function mswingsm

src/mhitm.c:1282–1297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1280}
1281
1282staticfn void
1283mswingsm(
1284 struct monst *magr, /* attacker */
1285 struct monst *mdef, /* defender */
1286 struct obj *otemp) /* attacker's weapon */
1287{
1288 if (flags.verbose && !Blind && mon_visible(magr)) {
1289 boolean bash = (is_pole(otemp) && !is_art(otemp, ART_SNICKERSNEE)
1290 && (dist2(magr->mx, magr->my, mdef->mx, mdef->my)
1291 <= 2));
1292
1293 pline("%s %s %s%s %s at %s.", Monnam(magr), mswings_verb(otemp, bash),
1294 (otemp->quan > 1L) ? "one of " : "", mhis(magr), xname(otemp),
1295 mon_nam(mdef));
1296 }
1297}
1298
1299/*
1300 * Passive responses by defenders. Does not replicate responses already

Callers 1

mattackmFunction · 0.85

Calls 8

mon_visibleFunction · 0.85
is_artFunction · 0.85
dist2Function · 0.85
MonnamFunction · 0.85
mswings_verbFunction · 0.85
xnameFunction · 0.85
mon_namFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected