Changeset 163
- Timestamp:
- 06/06/07 18:20:49 (3 years ago)
- Files:
-
- trunk/COPYING (modified) (1 diff)
- trunk/lib/edit/artifact.txt (modified) (4 diffs)
- trunk/lib/edit/ego_item.txt (modified) (1 diff)
- trunk/lib/edit/object.txt (modified) (2 diffs)
- trunk/src/defines.h (modified) (2 diffs)
- trunk/src/dungeon.c (modified) (1 diff)
- trunk/src/init1.c (modified) (1 diff)
- trunk/src/main-sdl.c (modified) (1 diff)
- trunk/src/object1.c (modified) (1 diff)
- trunk/src/spells2.c (modified) (1 diff)
- trunk/src/store.c (modified) (11 diffs)
- trunk/src/types.h (modified) (1 diff)
- trunk/src/variable.c (modified) (1 diff)
- trunk/src/xtra1.c (modified) (7 diffs)
- trunk/src/xtra2.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/COPYING
r150 r163 24 24 otherwise, would be much appreciated. Note that as a result of these 25 25 remaining restrictions, the game itself is not quite GPL-clean. 26 27 * The SDL runtime libraries (if provided with your copy of the game) are under 28 the following licence: 29 30 The Simple DirectMedia Layer (SDL for short) is a cross-platfrom library 31 designed to make it easy to write multi-media software, such as games and 32 emulators. 33 34 The Simple DirectMedia Layer library source code is available from: 35 http://www.libsdl.org/ 36 37 This library is distributed under the terms of the GNU LGPL license: 38 http://www.gnu.org/copyleft/lesser.html 26 39 27 40 * Adam Bolt's (16x16) graphics may be redistributed and used for any purpose, trunk/lib/edit/artifact.txt
r157 r163 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 … … 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 … … 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 … … 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 | trunk/lib/edit/ego_item.txt
r157 r163 755 755 F:CON | KILL_DRAGON | RES_FEAR 756 756 757 # 96 (unused) 758 759 # 97 (unused) 760 761 # 98 (unused) 762 763 # 99 (unused) 757 758 ### Lanterns/torches 759 760 # Not for now -- need to figure out how ID applies 761 #N:96:of Shadows 762 #X:10:0 763 #W:5:4:0:1000 (imported from NPP) 764 #C:0:0:0:2 765 #T:39:0:1 766 #F:STEALTH | HIDE_TYPE | RES_LITE 767 768 N:97:of Brightness 769 X:10:0 770 W:0:2:0:2000 771 C:0:0:0:0 772 T:39:0:1 773 F:LITE 774 775 N:98:(Everburning) 776 X:10:0 777 W:0:3:0:2500 778 C:0:0:0:0 779 T:39:1:1 (lanterns only) 780 F:NO_FUEL 781 782 #N:99:of True Sight 783 #X:10:0 784 #W:depth:rarity:extra weight:cost 785 #W:20:8:0:6000 (imported from S) 786 #C:0:0:0:0 787 #T:39:0:1 788 #F:RES_BLIND | SEE_INVIS 789 764 790 765 791 ### Digging Tools trunk/lib/edit/object.txt
r157 r163 3134 3134 D: turns of light. 3135 3135 3136 N:347:& BrassLantern~3136 N:347:& Lantern~ 3137 3137 G:~:U 3138 3138 I:39:1:0 … … 3151 3151 P:0:2d6:0:0:0 3152 3152 F:EASY_KNOW 3153 D:It can be used to fuel a brasslantern with 7500 turns of light, up to3153 D:It can be used to fuel a lantern with 7500 turns of light, up to 3154 3154 D: a maximum of 15000 turns of light. 3155 3155 D: When thrown, it is considered lit, so it does more than nominal trunk/src/defines.h
r158 r163 288 288 * Refueling constants 289 289 */ 290 #define FUEL_TORCH 5000 /* Maximum amount of fuel in a torch */290 #define FUEL_TORCH 6000 /* Maximum amount of fuel in a torch */ 291 291 #define FUEL_LAMP 15000 /* Maximum amount of fuel in a lantern */ 292 292 … … 1850 1850 #define TR3_FREE_ACT 0x00000040L /* Free action */ 1851 1851 #define TR3_HOLD_LIFE 0x00000080L /* Hold life */ 1852 #define TR3_ XXX1 0x00000100L1852 #define TR3_NO_FUEL 0x00000100L /* Light source uses no fuel */ 1853 1853 #define TR3_XXX2 0x00000200L 1854 1854 #define TR3_XXX3 0x00000400L trunk/src/dungeon.c
r156 r163 896 896 if (o_ptr->tval == TV_LITE) 897 897 { 898 /* Hack -- Use some fuel (except on artifacts) */ 899 if (!artifact_p(o_ptr) && (o_ptr->timeout > 0)) 898 u32b f1, f2, f3; 899 bool burn_fuel = TRUE; 900 901 /* Get the object flags */ 902 object_flags(o_ptr, &f1, &f2, &f3); 903 904 /* Turn off the wanton burning of light during the day in the town */ 905 if (!p_ptr->depth && ((turn % (10L * TOWN_DAWN)) < ((10L * TOWN_DAWN) / 2))) 906 burn_fuel = FALSE; 907 908 /* If the light has the NO_FUEL flag, well... */ 909 if (f3 & TR3_NO_FUEL) 910 burn_fuel = FALSE; 911 912 /* Use some fuel (except on artifacts, or during the day) */ 913 if (burn_fuel && o_ptr->timeout > 0) 900 914 { 901 915 /* Decrease life-span */ trunk/src/init1.c
r155 r163 449 449 "FREE_ACT", 450 450 "HOLD_LIFE", 451 " XXX1",451 "NO_FUEL", 452 452 "XXX2", 453 453 "XXX3", trunk/src/main-sdl.c
r148 r163 3478 3478 while (my_dread(dir, buf, sizeof buf)) 3479 3479 { 3480 /* Check for at least an extension */3481 signed extension_pos = strlen(buf) - 4;3482 if (extension_pos <= 0) continue;3483 3484 3480 /* Check for file extension */ 3485 if (s trcmp((buf + extension_pos), ".fon") == 0)3481 if (suffix(buf, ".fon")) 3486 3482 FontList[num_fonts++] = string_make(buf); 3487 3483 trunk/src/object1.c
r156 r163 1310 1310 if (mode < 2) goto object_desc_done; 1311 1311 1312 /* Hack -- Process Lanterns/Torches*/1313 if ((o_ptr->tval == TV_LITE) && (!artifact_p(o_ptr)))1314 { 1315 /* Hack --Turns of light for normal lites */1316 object_desc_str_macro(t, " ( with");1312 /* Fuelled light sources get number of remaining turns appended */ 1313 if ((o_ptr->tval == TV_LITE) && !(f3 & TR3_NO_FUEL)) 1314 { 1315 /* Turns of light for normal lites */ 1316 object_desc_str_macro(t, " ("); 1317 1317 object_desc_num_macro(t, o_ptr->timeout); 1318 object_desc_str_macro(t, " turns of light)");1318 object_desc_str_macro(t, " turns)"); 1319 1319 } 1320 1320 trunk/src/spells2.c
r158 r163 515 515 { 516 516 info[i++] = "You land gently."; 517 }518 if (p_ptr->lite)519 {520 info[i++] = "You are glowing with light.";521 517 } 522 518 if (p_ptr->regenerate) trunk/src/store.c
r156 r163 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: … … 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; … … 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; … … 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; … … 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: … … 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; … … 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; … … 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; … … 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) … … 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 */ … … 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 }, trunk/src/types.h
r156 r163 1018 1018 bool slow_digest; /* Slower digestion */ 1019 1019 bool ffall; /* Feather falling */ 1020 bool lite; /* Permanent light */1021 1020 bool regenerate; /* Regeneration */ 1022 1021 bool telepathy; /* Telepathy */ trunk/src/variable.c
r141 r163 372 372 "kill_king", 373 373 "drain_stat", 374 "multiply" ,374 "multiply" 375 375 }; 376 376 trunk/src/xtra1.c
r158 r163 847 847 848 848 /* 849 * Prints the speed of a character. -CJS-849 * Prints the speed of a character. 850 850 */ 851 851 static void prt_speed(int row, int col) … … 854 854 855 855 byte attr = TERM_WHITE; 856 const char *type = NULL; 856 857 char buf[32] = ""; 857 858 … … 863 864 { 864 865 attr = TERM_L_GREEN; 865 strnfmt(buf, sizeof(buf), "Fast (+%d)", (i - 110));866 type = "Fast"; 866 867 } 867 868 … … 870 871 { 871 872 attr = TERM_L_UMBER; 872 strnfmt(buf, sizeof(buf), "Slow (-%d)", (110 - i)); 873 } 873 type = "Slow"; 874 } 875 876 if (type) 877 strnfmt(buf, sizeof(buf), "%s (%+d)", type, (i - 110)); 874 878 875 879 /* Display the speed */ … … 1649 1653 1650 1654 /* 1651 * Extract and set the current "lite radius" 1655 * Calculate and set the current light radius. 1656 * 1657 * The brightest wielded object counts as the light source; radii do not add 1658 * up anymore. 1659 * 1660 * Note that a cursed light source no longer emits light. 1652 1661 */ 1653 1662 static void calc_torch(void) 1654 1663 { 1655 1664 int i; 1656 object_type *o_ptr;1657 u32b f1, f2, f3;1658 1665 1659 1666 s16b old_lite = p_ptr->cur_lite; 1660 1661 1662 /* Assume no light */ 1663 p_ptr->cur_lite = 0; 1664 1665 /* Loop through all wielded items */ 1667 s16b new_lite = 0; 1668 bool burn_light = TRUE; 1669 1670 1671 /* Ascertain lightness if in the town */ 1672 if (!p_ptr->depth && ((turn % (10L * TOWN_DAWN)) < ((10L * TOWN_DAWN) / 2))) 1673 burn_light = FALSE; 1674 1675 1676 /* Examine all wielded objects, use the brightest */ 1666 1677 for (i = INVEN_WIELD; i < INVEN_TOTAL; i++) 1667 1678 { 1668 o_ptr = &inventory[i]; 1679 u32b f1, f2, f3; 1680 1681 int amt = 0; 1682 object_type *o_ptr = &inventory[i]; 1669 1683 1670 1684 /* Skip empty slots */ 1671 1685 if (!o_ptr->k_idx) continue; 1672 1686 1687 /* Extract the flags */ 1688 object_flags(o_ptr, &f1, &f2, &f3); 1689 1690 /* LITE flag on an object always increases radius */ 1691 if (f3 & TR3_LITE) amt++; 1692 1693 /* Cursed objects emit no light */ 1694 if (o_ptr->ident & IDENT_CURSED) 1695 { 1696 amt = 0; 1697 } 1698 1673 1699 /* Examine actual lites */ 1674 if (o_ptr->tval == TV_LITE)1675 { 1676 /* Artifact Lites provide permanent , bright, lite*/1700 else if (o_ptr->tval == TV_LITE) 1701 { 1702 /* Artifact Lites provide permanent bright light */ 1677 1703 if (artifact_p(o_ptr)) 1704 amt += 3; 1705 1706 /* Non-artifact lights and those without fuel provide no light */ 1707 else if (!burn_light || o_ptr->timeout == 0) 1708 amt = 0; 1709 1710 /* All lit lights provide at least radius 2 light */ 1711 else 1678 1712 { 1679 p_ptr->cur_lite += 3; 1680 continue; 1713 amt += 2; 1714 1715 /* Torches below half fuel provide less light */ 1716 if (o_ptr->sval == SV_LITE_TORCH && o_ptr->timeout < (FUEL_TORCH / 4)) 1717 amt--; 1681 1718 } 1682 1683 /* Lanterns (with fuel) provide more lite */ 1684 if ((o_ptr->sval == SV_LITE_LANTERN) && (o_ptr->timeout > 0)) 1685 { 1686 p_ptr->cur_lite += 2; 1687 continue; 1688 } 1689 1690 /* Torches (with fuel) provide some lite */ 1691 if ((o_ptr->sval == SV_LITE_TORCH) && (o_ptr->timeout > 0)) 1692 { 1693 p_ptr->cur_lite += 1; 1694 continue; 1695 } 1696 } 1697 else 1698 { 1699 /* Extract the flags */ 1700 object_flags(o_ptr, &f1, &f2, &f3); 1701 1702 /* does this item glow? */ 1703 if (f3 & TR3_LITE) p_ptr->cur_lite++; 1704 } 1705 } 1706 1707 1708 /* Player is glowing */ 1709 if (p_ptr->lite) p_ptr->cur_lite++; 1710 1719 } 1720 1721 /* Alter p_ptr->cur_lite if reasonable */ 1722 if (new_lite < amt) 1723 new_lite = amt; 1724 } 1725 1726 /* Limit light radius (paranoia) */ 1727 new_lite = MIN(new_lite, 4); 1728 new_lite = MAX(new_lite, 0); 1711 1729 1712 1730 /* Notice changes in the "lite radius" */ 1713 if (old_lite != p_ptr->cur_lite)1731 if (old_lite != new_lite) 1714 1732 { 1715 1733 /* Update the visuals */ 1734 p_ptr->cur_lite = new_lite; 1716 1735 p_ptr->update |= (PU_UPDATE_VIEW | PU_MONSTERS); 1717 1736 } … … 1849 1868 p_ptr->hold_life = FALSE; 1850 1869 p_ptr->telepathy = FALSE; 1851 p_ptr->lite = FALSE;1852 1870 p_ptr->sustain_str = FALSE; 1853 1871 p_ptr->sustain_int = FALSE; … … 1921 1939 if (f3 & (TR3_SLOW_DIGEST)) p_ptr->slow_digest = TRUE; 1922 1940 if (f3 & (TR3_FEATHER)) p_ptr->ffall = TRUE; 1923 if (f3 & (TR3_LITE)) p_ptr->lite = TRUE;1924 1941 if (f3 & (TR3_REGEN)) p_ptr->regenerate = TRUE; 1925 1942 if (f3 & (TR3_TELEPATHY)) p_ptr->telepathy = TRUE; trunk/src/xtra2.c
r158 r163 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 { "You feel your memories fade.", " Suddenly you can remember things again.", PR_CONFUSED, 0, 0, MSG_GENERIC },60 { "You feel your memories fade.", "Your memories come flooding back.", PR_CONFUSED, 0, 0, MSG_GENERIC }, 61 61 }; 62 62
