hero catches gem thrown by mon iff poly'd into unicorn; might drop it */
| 503 | |
| 504 | /* hero catches gem thrown by mon iff poly'd into unicorn; might drop it */ |
| 505 | staticfn boolean |
| 506 | ucatchgem( |
| 507 | struct obj *gem, /* caller has verified gem->oclass */ |
| 508 | struct monst *mon) |
| 509 | { |
| 510 | /* won't catch rock or gray stone; catch (then drop) worthless glass */ |
| 511 | if (gem->otyp <= LAST_GLASS_GEM && is_unicorn(gy.youmonst.data)) { |
| 512 | char *gem_xname = xname(gem), |
| 513 | *mon_s_name = s_suffix(mon_nam(mon)); |
| 514 | |
| 515 | if (gem->otyp >= FIRST_GLASS_GEM) { |
| 516 | You("catch the %s.", gem_xname); |
| 517 | You("are not interested in %s junk.", mon_s_name); |
| 518 | makeknown(gem->otyp); |
| 519 | dropy(gem); |
| 520 | } else { |
| 521 | You("accept %s gift in the spirit in which it was intended.", |
| 522 | mon_s_name); |
| 523 | (void) hold_another_object(gem, "You catch, but drop, %s.", |
| 524 | gem_xname, "You catch:"); |
| 525 | } |
| 526 | return TRUE; |
| 527 | } |
| 528 | return FALSE; |
| 529 | } |
| 530 | |
| 531 | /* hero may catch thrown obj. it is added to inventory, if possible */ |
| 532 | staticfn boolean |