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

Function pre_mm_attack

src/mhitm.c:40–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40staticfn void
41pre_mm_attack(struct monst *magr, struct monst *mdef)
42{
43 boolean showit = FALSE;
44
45 /* unhiding or unmimicking happens even if hero can't see it
46 because the formerly concealed monster is now in action */
47 if (M_AP_TYPE(mdef)) {
48 seemimic(mdef);
49 showit |= gv.vis;
50 } else if (mdef->mundetected) {
51 mdef->mundetected = 0;
52 showit |= gv.vis;
53 }
54 if (M_AP_TYPE(magr)) {
55 seemimic(magr);
56 showit |= gv.vis;
57 } else if (magr->mundetected) {
58 magr->mundetected = 0;
59 showit |= gv.vis;
60 }
61
62 if (gv.vis) {
63 if (!canspotmon(magr))
64 map_invisible(magr->mx, magr->my);
65 else if (showit)
66 newsym(magr->mx, magr->my);
67 if (!canspotmon(mdef))
68 map_invisible(mdef->mx, mdef->my);
69 else if (showit)
70 newsym(mdef->mx, mdef->my);
71 }
72}
73
74/* feedback for when a monster-vs-monster attack misses */
75staticfn void

Callers 2

missmmFunction · 0.85
hitmmFunction · 0.85

Calls 3

seemimicFunction · 0.85
map_invisibleFunction · 0.85
newsymFunction · 0.85

Tested by

no test coverage detected