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

Function calc_pole_range

src/apply.c:3370–3386  ·  view source on GitHub ↗

* Calculate allowable range (pole's reach is always 2 steps): * unskilled and basic: orthogonal direction, 4..4; * skilled: as basic, plus knight's jump position, 4..5; * expert: as skilled, plus diagonal, 4..8. * ...9... * .85458. * .52125. * 9410149 * .52125. * .85458. * ...9... * (Note: no roles in NetHack can become expert or better * for pol

Source from the content-addressed store, hash-verified

3368 * for polearm skill; Yeoman in slash'em can become expert.)
3369 */
3370staticfn void
3371calc_pole_range(int *min_range, int *max_range)
3372{
3373 int typ = uwep_skill_type();
3374
3375 *min_range = 4;
3376 if (typ == P_NONE || P_SKILL(typ) <= P_BASIC)
3377 *max_range = 4;
3378 else if (P_SKILL(typ) == P_SKILLED)
3379 *max_range = 5;
3380 else
3381 *max_range = 8; /* (P_SKILL(typ) >= P_EXPERT) */
3382
3383 gp.polearm_range_min = *min_range;
3384 gp.polearm_range_max = *max_range;
3385
3386}
3387
3388/* return TRUE if hero is wielding a polearm and there's
3389 at least one monster they could hit with it */

Callers 2

could_pole_monFunction · 0.85
use_poleFunction · 0.85

Calls 1

uwep_skill_typeFunction · 0.85

Tested by

no test coverage detected