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

Function hmon_hitmon_potion

src/uhitm.c:1094–1116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1092}
1093
1094staticfn void
1095hmon_hitmon_potion(
1096 struct _hitmon_data *hmd,
1097 struct monst *mon,
1098 struct obj *obj) /* obj is not NULL */
1099{
1100 if (obj->quan > 1L)
1101 obj = splitobj(obj, 1L);
1102 else
1103 setuwep((struct obj *) 0);
1104 freeinv(obj);
1105 potionhit(mon, obj,
1106 hmd->hand_to_hand ? POTHIT_HERO_BASH : POTHIT_HERO_THROW);
1107 if (DEADMONSTER(mon)) {
1108 hmd->doreturn = TRUE;
1109 hmd->retval = FALSE; /* killed */
1110 return;
1111 }
1112 hmd->hittxt = TRUE;
1113 /* in case potion effect causes transformation */
1114 hmd->mdat = mon->data;
1115 hmd->dmg = (hmd->mdat == &mons[PM_SHADE]) ? 0 : 1;
1116}
1117
1118staticfn void
1119hmon_hitmon_misc_obj(

Callers 1

hmon_hitmon_do_hitFunction · 0.85

Calls 4

splitobjFunction · 0.85
setuwepFunction · 0.85
freeinvFunction · 0.85
potionhitFunction · 0.85

Tested by

no test coverage detected