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

Function mhurtle_to_doom

src/uhitm.c:1941–1958  ·  view source on GitHub ↗

joust or martial arts punch is knocking the target back; that might kill 'mon' (via trap) before known_hitum() has a chance to do so; return True if we kill mon, False otherwise */

Source from the content-addressed store, hash-verified

1939 kill 'mon' (via trap) before known_hitum() has a chance to do so;
1940 return True if we kill mon, False otherwise */
1941staticfn boolean
1942mhurtle_to_doom(
1943 struct monst *mon, /* target monster */
1944 int tmp, /* amount of pending damage */
1945 struct permonst **mptr) /* caller's cached copy of mon->data */
1946{
1947 /* only hurtle if pending physical damage (tmp) isn't going to kill mon */
1948 if (tmp < mon->mhp) {
1949 mhurtle(mon, u.dx, u.dy, 1);
1950 /* update caller's cached mon->data in case mon was pushed into
1951 a polymorph trap or is a vampshifter whose current form has
1952 been killed by a trap so that it reverted to original form */
1953 *mptr = mon->data;
1954 if (DEADMONSTER(mon))
1955 return TRUE;
1956 }
1957 return FALSE; /* mon isn't dead yet */
1958}
1959
1960/* gamelog version of "you've broken never-hit-with-wielded-weapon conduct;
1961 the conduct is tracked in known_hitum(); we're called by hmon_hitmon() */

Callers 2

hmon_hitmon_joustingFunction · 0.85
hmon_hitmon_staggerFunction · 0.85

Calls 1

mhurtleFunction · 0.85

Tested by

no test coverage detected