used when blessed or cursed scroll of light interacts with artifact light; if the lit object (Sunsword or gold dragon scales/mail) doesn't resist, treat like dipping it in holy or unholy water (BUC change, glow message) */
| 1592 | if the lit object (Sunsword or gold dragon scales/mail) doesn't resist, |
| 1593 | treat like dipping it in holy or unholy water (BUC change, glow message) */ |
| 1594 | void |
| 1595 | impact_arti_light( |
| 1596 | struct obj *obj, /* wielded Sunsword or worn gold dragon scales/mail */ |
| 1597 | boolean worsen, /* True: lower BUC state unless already cursed; |
| 1598 | * False: raise BUC state unless already blessed */ |
| 1599 | boolean seeit) /* True: give "<obj> glows <color>" message */ |
| 1600 | { |
| 1601 | struct obj *otmp; |
| 1602 | |
| 1603 | /* if already worst/best BUC it can be, or if it resists, do nothing */ |
| 1604 | if ((worsen ? obj->cursed : obj->blessed) || obj_resists(obj, 25, 75)) |
| 1605 | return; |
| 1606 | |
| 1607 | /* curse() and bless() take care of maybe_adjust_light() */ |
| 1608 | otmp = mksobj(POT_WATER, TRUE, FALSE); |
| 1609 | if (worsen) |
| 1610 | curse(otmp); |
| 1611 | else |
| 1612 | bless(otmp); |
| 1613 | H2Opotion_dip(otmp, obj, seeit, seeit ? Yobjnam2(obj, "glow") : ""); |
| 1614 | dealloc_obj(otmp); |
| 1615 | #if 0 /* defer this until caller has used up the scroll so it won't be |
| 1616 | * visible; player was told that it disappeared as hero read it */ |
| 1617 | if (carried(obj)) /* carried() will always be True here */ |
| 1618 | update_inventory(); |
| 1619 | #endif |
| 1620 | return; |
| 1621 | } |
| 1622 | |
| 1623 | /* potion obj hits monster mon, which might be youmonst; obj always used up */ |
| 1624 | void |
no test coverage detected