| 4615 | } |
| 4616 | |
| 4617 | void |
| 4618 | acid_damage(struct obj *obj) |
| 4619 | { |
| 4620 | /* Scrolls but not spellbooks can be erased by acid. */ |
| 4621 | struct monst *victim; |
| 4622 | boolean vismon; |
| 4623 | |
| 4624 | if (!obj) |
| 4625 | return; |
| 4626 | |
| 4627 | victim = carried(obj) ? &gy.youmonst : mcarried(obj) ? obj->ocarry : NULL; |
| 4628 | vismon = victim && (victim != &gy.youmonst) && canseemon(victim); |
| 4629 | |
| 4630 | if (victim == &gy.youmonst && inventory_resistance_check(AD_ACID)) |
| 4631 | return; |
| 4632 | |
| 4633 | if (obj->greased) { |
| 4634 | grease_protect(obj, (char *) 0, victim); |
| 4635 | } else if (obj->oclass == SCROLL_CLASS && obj->otyp != SCR_BLANK_PAPER) { |
| 4636 | if (obj->otyp != SCR_BLANK_PAPER |
| 4637 | #ifdef MAIL_STRUCTURES |
| 4638 | && obj->otyp != SCR_MAIL |
| 4639 | #endif |
| 4640 | ) { |
| 4641 | if (!Blind) { |
| 4642 | if (victim == &gy.youmonst) |
| 4643 | Your("%s.", aobjnam(obj, "fade")); |
| 4644 | else if (vismon) |
| 4645 | pline("%s %s.", s_suffix(Monnam(victim)), |
| 4646 | aobjnam(obj, "fade")); |
| 4647 | } |
| 4648 | } |
| 4649 | obj->otyp = SCR_BLANK_PAPER; |
| 4650 | obj->spe = 0; |
| 4651 | obj->dknown = 0; |
| 4652 | } else |
| 4653 | erode_obj(obj, (char *) 0, ERODE_CORRODE, EF_GREASE | EF_VERBOSE); |
| 4654 | } |
| 4655 | |
| 4656 | staticfn void |
| 4657 | pot_acid_damage( |
no test coverage detected