| 1701 | } |
| 1702 | |
| 1703 | void |
| 1704 | maybe_adjust_light(struct obj *obj, int old_range) |
| 1705 | { |
| 1706 | char buf[BUFSZ]; |
| 1707 | coordxy ox, oy; |
| 1708 | int new_range = arti_light_radius(obj), delta = new_range - old_range; |
| 1709 | |
| 1710 | /* radius of light emitting artifact varies by curse/bless state |
| 1711 | so will change after blessing or cursing */ |
| 1712 | if (delta) { |
| 1713 | obj_adjust_light_radius(obj, new_range); |
| 1714 | /* simplifying assumptions: hero is wielding or wearing this object; |
| 1715 | artifacts have to be in use to emit light and monsters' gear won't |
| 1716 | change bless or curse state */ |
| 1717 | if (!Blind && get_obj_location(obj, &ox, &oy, 0)) { |
| 1718 | *buf = '\0'; |
| 1719 | if (iflags.last_msg == PLNMSG_OBJ_GLOWS) |
| 1720 | /* we just saw "The <obj> glows <color>." from dipping */ |
| 1721 | Strcpy(buf, (obj->quan == 1L) ? "It" : "They"); |
| 1722 | else if (carried(obj) || cansee(ox, oy)) |
| 1723 | Strcpy(buf, Yname2(obj)); |
| 1724 | if (*buf) { |
| 1725 | /* initial activation says "dimly" if cursed, |
| 1726 | "brightly" if uncursed, and "brilliantly" if blessed; |
| 1727 | when changing intensity, using "less brightly" is |
| 1728 | straightforward for dimming, but we need "brighter" |
| 1729 | rather than "more brightly" for brightening; ugh */ |
| 1730 | pline("%s %s %s%s.", buf, otense(obj, "shine"), |
| 1731 | (abs(delta) > 1) ? "much " : "", |
| 1732 | (delta > 0) ? "brighter" : "less brightly"); |
| 1733 | } |
| 1734 | } |
| 1735 | } |
| 1736 | } |
| 1737 | |
| 1738 | /* |
| 1739 | * bless(), curse(), unbless(), uncurse() -- any relevant message |
no test coverage detected