return TRUE if hero is wielding a polearm and there's at least one monster they could hit with it */
| 3388 | /* return TRUE if hero is wielding a polearm and there's |
| 3389 | at least one monster they could hit with it */ |
| 3390 | boolean |
| 3391 | could_pole_mon(void) |
| 3392 | { |
| 3393 | int min_range, max_range; |
| 3394 | coord cc; |
| 3395 | struct monst *hitm = svc.context.polearm.hitmon; |
| 3396 | |
| 3397 | if (!uwep || !is_pole(uwep)) |
| 3398 | return FALSE; |
| 3399 | |
| 3400 | calc_pole_range(&min_range, &max_range); |
| 3401 | |
| 3402 | cc.x = u.ux; |
| 3403 | cc.y = u.uy; |
| 3404 | if (!find_poleable_mon(&cc)) { |
| 3405 | if (hitm && !DEADMONSTER(hitm) && sensemon(hitm) |
| 3406 | && mdistu(hitm) <= max_range && mdistu(hitm) >= min_range) |
| 3407 | return TRUE; |
| 3408 | } else { |
| 3409 | return TRUE; |
| 3410 | } |
| 3411 | return FALSE; |
| 3412 | } |
| 3413 | |
| 3414 | /* was Snickersnee used to attack at distance this turn already? */ |
| 3415 | staticfn boolean |
no test coverage detected