give a "silver sears " message; not used for weapon hit, so we only handle rings */
| 433 | /* give a "silver <item> sears <target>" message; |
| 434 | not used for weapon hit, so we only handle rings */ |
| 435 | void |
| 436 | silver_sears(struct monst *magr UNUSED, struct monst *mdef, |
| 437 | long silverhit) |
| 438 | { |
| 439 | char rings[20]; /* plenty of room for "rings" */ |
| 440 | int ltyp = ((uleft && (silverhit & W_RINGL) != 0L) |
| 441 | ? uleft->otyp : STRANGE_OBJECT), |
| 442 | rtyp = ((uright && (silverhit & W_RINGR) != 0L) |
| 443 | ? uright->otyp : STRANGE_OBJECT); |
| 444 | boolean both, |
| 445 | l_dknown = (uleft && uleft->dknown), |
| 446 | r_dknown = (uright && uright->dknown), |
| 447 | l_ag = (objects[ltyp].oc_material == SILVER && l_dknown), |
| 448 | r_ag = (objects[rtyp].oc_material == SILVER && r_dknown); |
| 449 | |
| 450 | if ((silverhit & (W_RINGL | W_RINGR)) != 0L) { |
| 451 | /* plural if both the same type (so not multi_claw and both rings |
| 452 | are non-Null) and either both known or neither known, or both |
| 453 | silver (in case there is ever more than one type of silver ring) |
| 454 | and both known; singular if multi_claw (where one of ltyp or |
| 455 | rtyp will always be STRANGE_OBJECT) even if both rings are known |
| 456 | silver [see hmonas(uhitm.c) for explanation of 'multi_claw'] */ |
| 457 | both = ((ltyp == rtyp && l_dknown == r_dknown) || (l_ag && r_ag)); |
| 458 | Sprintf(rings, "ring%s", both ? "s" : ""); |
| 459 | Your("%s%s %s %s!", |
| 460 | (l_ag || r_ag) ? "silver " |
| 461 | : both ? "" |
| 462 | : ((silverhit & W_RINGL) != 0L) ? "left " |
| 463 | : "right ", |
| 464 | rings, vtense(rings, "sear"), mon_nam(mdef)); |
| 465 | } |
| 466 | } |
| 467 | |
| 468 | staticfn struct obj *oselect(struct monst *, int); |
| 469 | #define Oselect(x) \ |