| 4654 | } |
| 4655 | |
| 4656 | staticfn void |
| 4657 | pot_acid_damage( |
| 4658 | struct obj *obj, |
| 4659 | boolean in_invent, |
| 4660 | boolean described) |
| 4661 | { |
| 4662 | char *bufp; |
| 4663 | boolean one, exploded; |
| 4664 | |
| 4665 | one = (obj->quan == 1L); |
| 4666 | exploded = FALSE; |
| 4667 | |
| 4668 | if (Blind && !in_invent) |
| 4669 | obj->dknown = 0; |
| 4670 | if (ga.acid_ctx.ctx_valid) |
| 4671 | exploded = ((obj->dknown ? ga.acid_ctx.dkn_boom |
| 4672 | : ga.acid_ctx.unk_boom) > 0); |
| 4673 | if (described) { |
| 4674 | /* just gave "The grease washes off your potion of acid." |
| 4675 | or "...your <color> potion." (or just "...your potion."); |
| 4676 | don't re-describe potion here; if we used "It explodes!" |
| 4677 | then "it" might be misconstrued as applying to "grease" */ |
| 4678 | pline_The("potion%s %s!", |
| 4679 | plur(obj->quan), otense(obj, "explode")); |
| 4680 | } else { |
| 4681 | /* First message is |
| 4682 | * "a [potion|<color> potion|potion of acid] explodes" |
| 4683 | * depending on obj->dknown (potion has been seen) and |
| 4684 | * objects[POT_ACID].oc_name_known (fully discovered), |
| 4685 | * or "some {plural version} explode" when relevant. |
| 4686 | * Second and subsequent messages for same chain and |
| 4687 | * matching dknown status are |
| 4688 | * "another [potion|<color> &c] explodes" or plural |
| 4689 | * variant. |
| 4690 | */ |
| 4691 | bufp = simpleonames(obj); |
| 4692 | pline("%s%s %s!", /* "A potion explodes!" */ |
| 4693 | !exploded ? (one ? "A " : "Some ") |
| 4694 | : (one ? "Another " : "More "), |
| 4695 | bufp, vtense(bufp, "explode")); |
| 4696 | } |
| 4697 | if (ga.acid_ctx.ctx_valid) { |
| 4698 | if (obj->dknown) |
| 4699 | ga.acid_ctx.dkn_boom++; |
| 4700 | else |
| 4701 | ga.acid_ctx.unk_boom++; |
| 4702 | } |
| 4703 | setnotworn(obj); |
| 4704 | delobj(obj); |
| 4705 | if (in_invent) |
| 4706 | update_inventory(); |
| 4707 | } |
| 4708 | |
| 4709 | /* Get an object wet and damage it appropriately. |
| 4710 | Returns an erosion return value (ER_*). */ |
no test coverage detected