Changeset 376
- Timestamp:
- 07/27/07 11:42:49 (1 year ago)
- Files:
-
- branches/angband-3.0.8/src/xtra1.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/angband-3.0.8/src/xtra1.c
r265 r376 1665 1665 1666 1666 s16b old_lite = p_ptr->cur_lite; 1667 bool burn_light = TRUE; 1668 1667 1669 s16b new_lite = 0; 1668 bool burn_light = TRUE; 1670 int extra_lite = 0; 1671 1669 1672 1670 1673 … … 1688 1691 object_flags(o_ptr, &f1, &f2, &f3); 1689 1692 1690 /* LITE flag on an object always increases radius */1691 if (f3 & TR3_LITE) amt++;1692 1693 1693 /* Cursed objects emit no light */ 1694 1694 if (o_ptr->ident & IDENT_CURSED) … … 1700 1700 else if (o_ptr->tval == TV_LITE) 1701 1701 { 1702 int flag_inc = (f3 & TR3_LITE) ? 1 : 0; 1703 1702 1704 /* Artifact Lites provide permanent bright light */ 1703 1705 if (artifact_p(o_ptr)) 1704 amt += 3;1706 amt = 3 + flag_inc; 1705 1707 1706 1708 /* Non-artifact lights and those without fuel provide no light */ 1707 1709 else if (!burn_light || o_ptr->timeout == 0) 1708 amt = 0;1710 amt = 0; 1709 1711 1710 1712 /* All lit lights provide at least radius 2 light */ 1711 1713 else 1712 1714 { 1713 amt += 2;1715 amt = 2 + flag_inc; 1714 1716 1715 1717 /* Torches below half fuel provide less light */ … … 1719 1721 } 1720 1722 1723 else 1724 { 1725 /* LITE flag on an non-cursed non-lights always increases radius */ 1726 if (f3 & TR3_LITE) extra_lite++; 1727 } 1728 1721 1729 /* Alter p_ptr->cur_lite if reasonable */ 1722 1730 if (new_lite < amt) … … 1724 1732 } 1725 1733 1726 /* Limit light radius (paranoia) */ 1727 new_lite = MIN(new_lite, 4); 1734 /* Add bonus from LITE flags */ 1735 new_lite += extra_lite; 1736 1737 /* Limit light */ 1738 new_lite = MIN(new_lite, 5); 1728 1739 new_lite = MAX(new_lite, 0); 1729 1740
