hero may catch thrown obj. it is added to inventory, if possible */
| 530 | |
| 531 | /* hero may catch thrown obj. it is added to inventory, if possible */ |
| 532 | staticfn boolean |
| 533 | u_catch_thrown_obj(struct obj *otmp) |
| 534 | { |
| 535 | int catch_chance = 100 - ACURR(A_DEX) |
| 536 | - ((Role_if(PM_MONK) || Role_if(PM_ROGUE)) ? 20 : 0); |
| 537 | |
| 538 | if (!Blind && !Confusion && !Stunned && !Fumbling |
| 539 | && otmp->oclass != VENOM_CLASS |
| 540 | && !nohands(gy.youmonst.data) && freehand() |
| 541 | && calc_capacity(otmp->owt) <= SLT_ENCUMBER && !rn2(catch_chance)) { |
| 542 | char buf[BUFSZ]; |
| 543 | |
| 544 | Snprintf(buf, BUFSZ, "You catch the %s!", simpleonames(otmp)); |
| 545 | (void) hold_another_object(otmp, "You catch, but drop, the %s.", |
| 546 | simpleonames(otmp), buf); |
| 547 | return TRUE; |
| 548 | } |
| 549 | return FALSE; |
| 550 | } |
| 551 | |
| 552 | #define MT_FLIGHTCHECK(pre,forcehit) \ |
| 553 | (/* missile hits edge of screen */ \ |
no test coverage detected