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

Function mswings_verb

src/mhitu.c:104–126  ·  view source on GitHub ↗

strike types P|S|B: Pierce (pointed: stab) => "thrusts", Slash (edged: slice) or whack (blunt: Bash) => "swings" */

Source from the content-addressed store, hash-verified

102/* strike types P|S|B: Pierce (pointed: stab) => "thrusts",
103 Slash (edged: slice) or whack (blunt: Bash) => "swings" */
104const char *
105mswings_verb(
106 struct obj *mwep, /* attacker's weapon */
107 boolean bash) /* True: using polearm while too close */
108{
109 const char *verb;
110 int otyp = mwep->otyp,
111 /* (monsters don't actually wield towels, wet or otherwise) */
112 lash = (objects[otyp].oc_skill == P_WHIP || is_wet_towel(mwep)),
113 /* some weapons can have more than one strike type; for those,
114 give a mix of thrust and swing (caller doesn't care either way) */
115 thrust = ((objects[otyp].oc_dir & PIERCE) != 0
116 && ((objects[otyp].oc_dir & ~PIERCE) == 0 || !rn2(2)));
117
118 verb = bash ? "bashes with" /*sigh*/
119 : lash ? "lashes"
120 : thrust ? "thrusts"
121 : "swings";
122 /* (might have caller also pass attacker's formatted name so that
123 if hallucination makes that be plural, we could use vtense() to
124 adjust the result to match) */
125 return verb;
126}
127
128/* monster swings obj */
129staticfn void

Callers 3

mswingsmFunction · 0.85
thrwmuFunction · 0.85
mswingsFunction · 0.85

Calls 1

rn2Function · 0.85

Tested by

no test coverage detected