* 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
| 3368 | * for polearm skill; Yeoman in slash'em can become expert.) |
| 3369 | */ |
| 3370 | staticfn void |
| 3371 | calc_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 */ |
no test coverage detected