Ticket #88: lanterns.patch
| File lanterns.patch, 14.2 kB (added by takkaria, 2 years ago) |
|---|
-
lib/edit/artifact.txt
old new 83 83 I:39:4:0 84 84 W:5:5:10:10000 85 85 P:0:1d1:0:0:0 86 F:ACTIVATE | 86 F:ACTIVATE | NO_FUEL | 87 87 F:INSTA_ART 88 88 A:ILLUMINATION:10:10 89 89 D:A small crystal phial, with the light of Earendil's Star contained inside. … … 96 96 I:39:5:0 97 97 W:30:25:5:30000 98 98 P:0:1d1:0:0:0 99 F:ACTIVATE | SEE_INVIS | 99 F:ACTIVATE | SEE_INVIS | NO_FUEL | 100 100 F:INSTA_ART 101 101 A:MAGIC_MAP:50:50 102 102 D:The shining Star of the West, a treasured heirloom of Elendil's house. … … 107 107 I:39:6:0 108 108 W:50:50:5:50000 109 109 P:0:1d1:0:0:0 110 F:ACTIVATE | SEE_INVIS | HOLD_LIFE | RES_LITE | RES_DARK | 110 F:ACTIVATE | SEE_INVIS | HOLD_LIFE | RES_LITE | RES_DARK | NO_FUEL | 111 111 F:INSTA_ART 112 112 A:DETECT:30:30 113 113 D:A great globe seemingly filled with moonlight, the famed Heart of the … … 162 162 W:75:60:200:100000 163 163 P:0:10d10:0:0:0 164 164 # F:DRAIN_MANA | 165 F:ACTIVATE | 165 F:ACTIVATE | NO_FUEL | 166 166 F:INT | WIS | SEARCH | INFRA | SEE_INVIS | TELEPATHY | 167 167 F:RES_CHAOS | RES_BLIND | AGGRAVATE | DRAIN_EXP | 168 168 F:INSTA_ART | HIDE_TYPE -
lib/edit/ego_item.txt
old new 754 754 T:23:0:99 755 755 F:CON | KILL_DRAGON | RES_FEAR 756 756 757 # 96 (unused)758 757 759 # 97 (unused)758 ### Lanterns/torches 760 759 761 # 98 (unused) 760 N:96:of Shadows 761 X:10:0 762 W:5:4:0:1000 (imported from NPP) 763 C:0:0:0:2 764 T:39:0:1 765 F:STEALTH | HIDE_TYPE | RES_LITE 762 766 763 # 99 (unused) 767 N:97:of Brightness 768 X:10:0 769 W:0:2:0:2000 (imported from S) 770 C:0:0:0:0 771 T:39:0:1 772 F:LITE 764 773 774 N:98:(Everburning) 775 X:10:0 776 W:0:3:0:2500 (imported from S) 777 C:0:0:0:0 778 T:39:1:1 (lanterns only) 779 F:NO_FUEL 780 781 N:99:of True Sight 782 X:10:0 783 #W:depth:rarity:extra weight:cost 784 W:20:8:0:6000 (imported from S) 785 C:0:0:0:0 786 T:39:0:1 787 F:RES_BLIND | SEE_INVIS 788 789 765 790 ### Digging Tools 766 791 767 792 N:100:of Digging -
lib/edit/object.txt
old new 3136 3136 N:347:& Brass Lantern~ 3137 3137 G:~:U 3138 3138 I:39:1:0 3139 W:3:0:50: 353139 W:3:0:50:65 3140 3140 A:3/1 3141 3141 P:0:1d1:0:0:0 3142 3142 F:EASY_KNOW | IGNORE_FIRE -
src/defines.h
old new 298 298 /* 299 299 * Refueling constants 300 300 */ 301 #define FUEL_TORCH 5000 /* Maximum amount of fuel in a torch */301 #define FUEL_TORCH 6000 /* Maximum amount of fuel in a torch */ 302 302 #define FUEL_LAMP 15000 /* Maximum amount of fuel in a lantern */ 303 303 304 304 … … 454 454 TMD_AFRAID, TMD_IMAGE, TMD_POISONED, TMD_CUT, TMD_STUN, TMD_PROTEVIL, 455 455 TMD_INVULN, TMD_HERO, TMD_SHERO, TMD_SHIELD, TMD_BLESSED, TMD_SINVIS, 456 456 TMD_SINFRA, TMD_OPP_ACID, TMD_OPP_ELEC, TMD_OPP_FIRE, TMD_OPP_COLD, 457 TMD_OPP_POIS, 457 TMD_OPP_POIS, TMD_LIGHT_AURA, 458 458 459 459 TMD_MAX 460 460 }; … … 1887 1887 #define TR3_SEE_INVIS 0x00000020L /* See Invis */ 1888 1888 #define TR3_FREE_ACT 0x00000040L /* Free action */ 1889 1889 #define TR3_HOLD_LIFE 0x00000080L /* Hold life */ 1890 #define TR3_ XXX1 0x00000100L1890 #define TR3_NO_FUEL 0x00000100L /* Light source uses no fuel */ 1891 1891 #define TR3_XXX2 0x00000200L 1892 1892 #define TR3_XXX3 0x00000400L 1893 1893 #define TR3_XXX4 0x00000800L … … 3029 3029 #define MSG_KILL_KING 147 3030 3030 #define MSG_DRAIN_STAT 148 3031 3031 #define MSG_MULTIPLY 149 3032 #define MSG_LIGHT_AURA 150 3032 3033 3033 #define MSG_MAX 15 03034 #define MSG_MAX 151 3034 3035 3035 3036 /* 3036 3037 * Hack -- maximum known sounds -
src/dungeon.c
old new 901 901 /* Burn some fuel in the current lite */ 902 902 if (o_ptr->tval == TV_LITE) 903 903 { 904 /* Hack -- Use some fuel (except on artifacts) */ 905 if (!artifact_p(o_ptr) && (o_ptr->timeout > 0)) 904 u32b f1, f2, f3; 905 bool burn_fuel = TRUE; 906 907 /* Get the object flags */ 908 object_flags(o_ptr, &f1, &f2, &f3); 909 910 /* Turn off the wanton burning of light during the day in the town */ 911 if (!p_ptr->depth && ((turn % (10L * TOWN_DAWN)) < ((10L * TOWN_DAWN) / 2))) 912 burn_fuel = FALSE; 913 914 /* If the light has the NO_FUEL flag, well... */ 915 if (f3 & TR3_NO_FUEL) 916 burn_fuel = FALSE; 917 918 /* Use some fuel (except on artifacts, or during the day) */ 919 if (burn_fuel && o_ptr->timeout > 0) 906 920 { 907 921 /* Decrease life-span */ 908 922 o_ptr->timeout--; -
src/init1.c
old new 448 448 "SEE_INVIS", 449 449 "FREE_ACT", 450 450 "HOLD_LIFE", 451 " XXX1",451 "NO_FUEL", 452 452 "XXX2", 453 453 "XXX3", 454 454 "XXX4", -
src/object1.c
old new 1310 1310 if (mode < 2) goto object_desc_done; 1311 1311 1312 1312 /* Hack -- Process Lanterns/Torches */ 1313 if ((o_ptr->tval == TV_LITE) && (!artifact_p(o_ptr)))1313 if ((o_ptr->tval == TV_LITE) && !(f3 & TR3_NO_FUEL)) 1314 1314 { 1315 1315 /* Hack -- Turns of light for normal lites */ 1316 1316 object_desc_str_macro(t, " (with "); -
src/spells2.c
old new 496 496 { 497 497 info[i++] = "You are temporarily invulnerable."; 498 498 } 499 if (p_ptr->timed[TMD_INVULN]) 500 { 501 info[i++] = "You are surrounded by an unearthly light."; 502 } 499 503 if (p_ptr->confusing) 500 504 { 501 505 info[i++] = "Your hands are glowing dull red."; … … 525 529 { 526 530 info[i++] = "You land gently."; 527 531 } 528 if (p_ptr->lite)529 {530 info[i++] = "You are glowing with light.";531 }532 532 if (p_ptr->regenerate) 533 533 { 534 534 info[i++] = "You regenerate quickly."; -
src/store.c
old new 250 250 /* Analyze the type */ 251 251 switch (o_ptr->tval) 252 252 { 253 case TV_FOOD:254 case TV_LITE:255 case TV_FLASK:256 253 case TV_SPIKE: 257 254 case TV_SHOT: 258 255 case TV_ARROW: 259 256 case TV_BOLT: 260 257 case TV_DIGGING: 261 258 case TV_CLOAK: 262 break; 259 break; 260 261 case TV_LITE: 262 if (artifact_p(o_ptr) || ego_item_p(o_ptr)) 263 break; 264 263 265 default: 264 return (FALSE);266 return (FALSE); 265 267 } 266 268 break; 267 269 } … … 281 283 case TV_SOFT_ARMOR: 282 284 case TV_HARD_ARMOR: 283 285 case TV_DRAG_ARMOR: 284 break; 286 break; 287 285 288 default: 286 return (FALSE);289 return (FALSE); 287 290 } 288 291 break; 289 292 } … … 302 305 case TV_HAFTED: 303 306 case TV_POLEARM: 304 307 case TV_SWORD: 305 break; 308 break; 309 306 310 default: 307 return (FALSE);311 return (FALSE); 308 312 } 309 313 break; 310 314 } … … 319 323 case TV_SCROLL: 320 324 case TV_POTION: 321 325 case TV_HAFTED: 322 break; 326 break; 327 323 328 case TV_POLEARM: 324 329 case TV_SWORD: 325 330 { 326 331 /* Known blessed blades are accepted too */ 327 332 if (is_blessed(o_ptr) && object_known_p(o_ptr)) break; 328 333 } 334 329 335 default: 330 return (FALSE);336 return (FALSE); 331 337 } 332 338 break; 333 339 } … … 340 346 { 341 347 case TV_SCROLL: 342 348 case TV_POTION: 343 break; 349 break; 350 344 351 default: 345 return (FALSE);352 return (FALSE); 346 353 } 347 354 break; 348 355 } … … 361 368 case TV_ROD: 362 369 case TV_SCROLL: 363 370 case TV_POTION: 364 break; 371 break; 372 365 373 default: 366 return (FALSE);374 return (FALSE); 367 375 } 368 376 break; 369 377 } … … 1047 1055 * stores have, unless it is an ego-item or has various bonuses. 1048 1056 * 1049 1057 * Based on a suggestion by Lee Vogt <lvogt@cig.mcel.mot.com>. 1050 *1051 * If the stores ever become truly externalised, i.e. if Lua becomes more1052 * integrated, then there should be some way to get this out of the compiled1053 * code, as it is a little hacky. XXX1054 1058 */ 1055 1059 static bool black_market_ok(const object_type *o_ptr) 1056 1060 { 1057 1061 int i, j; 1058 1062 1059 1063 /* Ego items are always fine */ 1060 if ( o_ptr->name2) return (TRUE);1064 if (ego_item_p(o_ptr)) return (TRUE); 1061 1065 1062 1066 /* Good items are normally fine */ 1063 1067 if (o_ptr->to_a > 2) return (TRUE); … … 1278 1282 { TV_FOOD, SV_FOOD_JERKY, MAKE_NORMAL }, 1279 1283 { TV_FOOD, SV_FOOD_PINT_OF_WINE, MAKE_NORMAL }, 1280 1284 { TV_LITE, SV_LITE_TORCH, MAKE_NORMAL }, 1281 { TV_LITE, SV_LITE_LANTERN, MAKE_NORMAL },1282 1285 { TV_FLASK, 0, MAKE_NORMAL }, 1283 1286 { TV_SPIKE, 0, MAKE_NORMAL }, 1284 1287 { TV_SHOT, SV_AMMO_NORMAL, MAKE_MAX }, -
src/types.h
old new 1020 1020 1021 1021 bool slow_digest; /* Slower digestion */ 1022 1022 bool ffall; /* Feather falling */ 1023 bool lite; /* Permanent light */1024 1023 bool regenerate; /* Regeneration */ 1025 1024 bool telepathy; /* Telepathy */ 1026 1025 bool see_inv; /* See invisible */ -
src/variable.c
old new 372 372 "kill_king", 373 373 "drain_stat", 374 374 "multiply", 375 "light_aura", 375 376 }; 376 377 377 378 -
src/xtra1.c
old new 841 841 842 842 843 843 /* 844 * Prints the speed of a character. -CJS-844 * Prints the speed of a character. 845 845 */ 846 846 static void prt_speed(int row, int col) 847 847 { 848 848 int i = p_ptr->pspeed; 849 849 850 850 byte attr = TERM_WHITE; 851 const char *type = NULL; 851 852 char buf[32] = ""; 852 853 853 854 /* Hack -- Visually "undo" the Search Mode Slowdown */ … … 857 858 if (i > 110) 858 859 { 859 860 attr = TERM_L_GREEN; 860 strnfmt(buf, sizeof(buf), "Fast (+%d)", (i - 110));861 type = "Fast"; 861 862 } 862 863 863 864 /* Slow */ 864 865 else if (i < 110) 865 866 { 866 867 attr = TERM_L_UMBER; 867 strnfmt(buf, sizeof(buf), "Slow (-%d)", (110 - i));868 type = "Slow"; 868 869 } 869 870 871 if (type) 872 strnfmt(buf, sizeof(buf), "%s (%+d)", type, (i - 110)); 873 870 874 /* Display the speed */ 871 875 c_put_str(attr, format("%-14s", buf), row, col); 872 876 } … … 1643 1647 1644 1648 1645 1649 /* 1646 * Extract and set the current "lite radius" 1650 * Calculate and set the current light radius. 1651 * 1652 * The brightest wielded object counts as the light source; radii do not add 1653 * up anymore. However, a glowing player will increase radius by one. 1654 * 1655 * Note that a cursed light source no longer emits light. 1647 1656 */ 1648 1657 static void calc_torch(void) 1649 1658 { 1650 1659 int i; 1651 object_type *o_ptr;1652 u32b f1, f2, f3;1653 1660 1654 1661 s16b old_lite = p_ptr->cur_lite; 1662 s16b new_lite = 0; 1663 bool burn_light = TRUE; 1655 1664 1656 1665 1657 /* Assume no light */ 1658 p_ptr->cur_lite = 0; 1666 /* Ascertain lightness if in the town */ 1667 if (!p_ptr->depth && ((turn % (10L * TOWN_DAWN)) < ((10L * TOWN_DAWN) / 2))) 1668 burn_light = FALSE; 1659 1669 1660 /* Loop through all wielded items */ 1670 1671 /* Examine all wielded objects, use the brightest */ 1661 1672 for (i = INVEN_WIELD; i < INVEN_TOTAL; i++) 1662 1673 { 1663 o_ptr = &inventory[i];1674 u32b f1, f2, f3; 1664 1675 1676 int amt = 0; 1677 object_type *o_ptr = &inventory[i]; 1678 1665 1679 /* Skip empty slots */ 1666 1680 if (!o_ptr->k_idx) continue; 1667 1681 1682 /* Extract the flags */ 1683 object_flags(o_ptr, &f1, &f2, &f3); 1684 1685 /* LITE flag on an object always increases radius */ 1686 if (f3 & TR3_LITE) amt++; 1687 1688 /* Cursed objects emit no light */ 1689 if (o_ptr->ident & IDENT_CURSED) 1690 { 1691 amt = 0; 1692 } 1693 1668 1694 /* Examine actual lites */ 1669 if (o_ptr->tval == TV_LITE)1695 else if (o_ptr->tval == TV_LITE) 1670 1696 { 1671 /* Artifact Lites provide permanent , bright, lite*/1697 /* Artifact Lites provide permanent bright light */ 1672 1698 if (artifact_p(o_ptr)) 1699 amt += 3; 1700 1701 /* Non-artifact lights and those without fuel provide no light */ 1702 else if (!burn_light || o_ptr->timeout == 0) 1703 amt = 0; 1704 1705 /* All lit lights provide at least radius 2 light */ 1706 else 1673 1707 { 1674 p_ptr->cur_lite += 3; 1675 continue; 1708 amt += 2; 1709 1710 /* Torches below half fuel provide less light */ 1711 if (o_ptr->sval == SV_LITE_TORCH && o_ptr->timeout < (FUEL_TORCH / 4)) 1712 amt--; 1676 1713 } 1677 1678 /* Lanterns (with fuel) provide more lite */1679 if ((o_ptr->sval == SV_LITE_LANTERN) && (o_ptr->timeout > 0))1680 {1681 p_ptr->cur_lite += 2;1682 continue;1683 }1684 1685 /* Torches (with fuel) provide some lite */1686 if ((o_ptr->sval == SV_LITE_TORCH) && (o_ptr->timeout > 0))1687 {1688 p_ptr->cur_lite += 1;1689 continue;1690 }1691 1714 } 1692 else1693 {1694 /* Extract the flags */1695 object_flags(o_ptr, &f1, &f2, &f3);1696 1715 1697 /* does this item glow?*/1698 if (f3 & TR3_LITE) p_ptr->cur_lite++;1699 }1716 /* Alter p_ptr->cur_lite if reasonable */ 1717 if (new_lite < amt) 1718 new_lite = amt; 1700 1719 } 1701 1720 1702 1721 1703 /* Player is glowing */ 1704 if (p_ptr->lite) p_ptr->cur_lite++; 1722 /* Glowing players should have extra light */ 1723 if (p_ptr->timed[TMD_LIGHT_AURA]) 1724 new_lite++; 1705 1725 1706 1726 1727 /* Limit light radius (paranoia) */ 1728 new_lite = MIN(new_lite, 4); 1729 new_lite = MAX(new_lite, 0); 1730 1707 1731 /* Notice changes in the "lite radius" */ 1708 if (old_lite != p_ptr->cur_lite)1732 if (old_lite != new_lite) 1709 1733 { 1710 1734 /* Update the visuals */ 1735 p_ptr->cur_lite = new_lite; 1711 1736 p_ptr->update |= (PU_UPDATE_VIEW | PU_MONSTERS); 1712 1737 } 1713 1738 } … … 1843 1868 p_ptr->ffall = FALSE; 1844 1869 p_ptr->hold_life = FALSE; 1845 1870 p_ptr->telepathy = FALSE; 1846 p_ptr->lite = FALSE;1847 1871 p_ptr->sustain_str = FALSE; 1848 1872 p_ptr->sustain_int = FALSE; 1849 1873 p_ptr->sustain_wis = FALSE; … … 1915 1939 /* Good flags */ 1916 1940 if (f3 & (TR3_SLOW_DIGEST)) p_ptr->slow_digest = TRUE; 1917 1941 if (f3 & (TR3_FEATHER)) p_ptr->ffall = TRUE; 1918 if (f3 & (TR3_LITE)) p_ptr->lite = TRUE;1919 1942 if (f3 & (TR3_REGEN)) p_ptr->regenerate = TRUE; 1920 1943 if (f3 & (TR3_TELEPATHY)) p_ptr->telepathy = TRUE; 1921 1944 if (f3 & (TR3_SEE_INVIS)) p_ptr->see_inv = TRUE; -
src/xtra2.c
old new 57 57 { "Your eyes feel very sensitive!", "Your eyes feel less sensitive.", 0, 0, (PU_BONUS | PU_MONSTERS), MSG_SEE_INVIS }, 58 58 { "Your eyes begin to tingle!", "Your eyes stop tingling.", 0, 0, (PU_BONUS | PU_MONSTERS), MSG_INFRARED }, 59 59 { "You feel resistant to poison!", "You feel less resistant to poison", PR_OPPOSE_ELEMENTS, 0, 0, MSG_RES_POIS }, 60 { "A soft, unearthly light surrounds you.", "The light fades.", 0, 0, PU_TORCH, MSG_LIGHT_AURA }, 60 61 }; 61 62 62 63 /*
