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

Function hmon_hitmon_weapon

src/uhitm.c:1069–1092  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1067}
1068
1069staticfn void
1070hmon_hitmon_weapon(
1071 struct _hitmon_data *hmd,
1072 struct monst *mon,
1073 struct obj *obj) /* obj is not NULL */
1074{
1075 /* is it not a melee weapon? */
1076 if (/* if you strike with a bow... */
1077 is_launcher(obj)
1078 /* or strike with a missile in your hand... */
1079 || (!hmd->thrown && (is_missile(obj) || is_ammo(obj)))
1080 /* or use a pole at short range and not mounted... */
1081 || (!hmd->thrown && !u.usteed && is_pole(obj)
1082 && !is_art(obj,ART_SNICKERSNEE))
1083 /* or throw a missile without the proper bow... */
1084 || (is_ammo(obj) && (hmd->thrown != HMON_THROWN
1085 || !ammo_and_launcher(obj, uwep)))) {
1086 hmon_hitmon_weapon_ranged(hmd, mon, obj);
1087 } else {
1088 hmon_hitmon_weapon_melee(hmd, mon, obj);
1089 if (hmd->doreturn)
1090 return;
1091 }
1092}
1093
1094staticfn void
1095hmon_hitmon_potion(

Callers 1

hmon_hitmon_do_hitFunction · 0.85

Calls 3

is_artFunction · 0.85
hmon_hitmon_weapon_meleeFunction · 0.85

Tested by

no test coverage detected