MCPcopy Index your code
hub / github.com/NetHack/NetHack / hmon

Function hmon

src/uhitm.c:818–834  ·  view source on GitHub ↗

general "damage monster" routine; return True if mon still alive */

Source from the content-addressed store, hash-verified

816
817/* general "damage monster" routine; return True if mon still alive */
818boolean
819hmon(struct monst *mon,
820 struct obj *obj,
821 int thrown, /* HMON_xxx (0 => hand-to-hand, other => ranged) */
822 int dieroll)
823{
824 boolean result, anger_guards;
825
826 anger_guards = (mon->mpeaceful
827 && (mon->ispriest || mon->isshk || is_watch(mon->data)));
828 result = hmon_hitmon(mon, obj, thrown, dieroll);
829 if (mon->ispriest && !rn2(2))
830 ghod_hitsu(mon);
831 if (anger_guards)
832 (void) angry_guards(!!Deaf);
833 return result;
834}
835
836/* hero hits monster bare handed */
837staticfn void

Callers 4

known_hitumFunction · 0.85
drag_ballFunction · 0.85
flooreffectsFunction · 0.85
thitmonstFunction · 0.85

Calls 4

hmon_hitmonFunction · 0.85
rn2Function · 0.85
ghod_hitsuFunction · 0.85
angry_guardsFunction · 0.85

Tested by

no test coverage detected