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

Function noattacks

src/mondata.c:60–76  ·  view source on GitHub ↗

returns True if monster doesn't attack, False if it does */

Source from the content-addressed store, hash-verified

58
59/* returns True if monster doesn't attack, False if it does */
60boolean
61noattacks(struct permonst *ptr)
62{
63 int i;
64 struct attack *mattk = ptr->mattk;
65
66 for (i = 0; i < NATTK; i++) {
67 /* AT_BOOM "passive attack" (gas spore's explosion upon death)
68 isn't an attack as far as our callers are concerned */
69 if (mattk[i].aatyp == AT_BOOM)
70 continue;
71
72 if (mattk[i].aatyp)
73 return FALSE;
74 }
75 return TRUE;
76}
77
78/* does monster-type transform into something else when petrified? */
79boolean

Callers 4

do_attackFunction · 0.85
monster_nearbyFunction · 0.85
dochugwFunction · 0.85
dochugFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected