common to dothrow() and dofire() */
| 294 | |
| 295 | /* common to dothrow() and dofire() */ |
| 296 | staticfn boolean |
| 297 | ok_to_throw(int *shotlimit_p) /* (see dothrow()) */ |
| 298 | { |
| 299 | *shotlimit_p = LIMIT_TO_RANGE_INT(0, LARGEST_INT, gc.command_count); |
| 300 | gm.multi = 0; /* reset; it's been used up */ |
| 301 | |
| 302 | if (notake(gy.youmonst.data)) { |
| 303 | You("are physically incapable of throwing or shooting anything."); |
| 304 | return FALSE; |
| 305 | } else if (nohands(gy.youmonst.data)) { |
| 306 | You_cant("throw or shoot without hands."); /* not body_part(HAND) */ |
| 307 | return FALSE; |
| 308 | /*[what about !freehand(), aside from cursed missile launcher?]*/ |
| 309 | } |
| 310 | if (check_capacity((char *) 0)) |
| 311 | return FALSE; |
| 312 | return TRUE; |
| 313 | } |
| 314 | |
| 315 | /* getobj callback for object to be thrown */ |
| 316 | staticfn int |
no test coverage detected