MCPcopy Create free account
hub / github.com/NetHack/NetHack / impact_arti_light

Function impact_arti_light

src/potion.c:1594–1621  ·  view source on GitHub ↗

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) */

Source from the content-addressed store, hash-verified

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) */
1594void
1595impact_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 */
1624void

Callers 1

litroomFunction · 0.85

Calls 8

obj_resistsFunction · 0.85
mksobjFunction · 0.85
curseFunction · 0.85
blessFunction · 0.85
H2Opotion_dipFunction · 0.85
Yobjnam2Function · 0.85
dealloc_objFunction · 0.85
update_inventoryFunction · 0.85

Tested by

no test coverage detected