Changeset 305
- Timestamp:
- 07/08/07 13:10:33 (1 year ago)
- Files:
-
- trunk/lib/edit/artifact.txt (modified) (1 diff)
- trunk/lib/edit/cost_adj.txt (modified) (1 diff)
- trunk/lib/edit/ego_item.txt (modified) (1 diff)
- trunk/lib/edit/flavor.txt (modified) (1 diff)
- trunk/lib/edit/limits.txt (modified) (1 diff)
- trunk/lib/edit/monster.txt (modified) (1 diff)
- trunk/lib/edit/object.txt (modified) (1 diff)
- trunk/lib/edit/p_class.txt (modified) (1 diff)
- trunk/lib/edit/p_hist.txt (modified) (1 diff)
- trunk/lib/edit/p_race.txt (modified) (1 diff)
- trunk/lib/edit/shop_own.txt (modified) (1 diff)
- trunk/lib/edit/spell.txt (modified) (1 diff)
- trunk/lib/edit/terrain.txt (modified) (1 diff)
- trunk/lib/edit/vault.txt (modified) (1 diff)
- trunk/src/cave.c (modified) (1 diff)
- trunk/src/cmd1.c (modified) (2 diffs)
- trunk/src/defines.h (modified) (5 diffs)
- trunk/src/externs.h (modified) (1 diff)
- trunk/src/generate.c (modified) (1 diff)
- trunk/src/init2.c (modified) (2 diffs)
- trunk/src/load.c (modified) (1 diff)
- trunk/src/monster2.c (modified) (2 diffs)
- trunk/src/save.c (modified) (1 diff)
- trunk/src/spells2.c (modified) (2 diffs)
- trunk/src/tables.c (modified) (4 diffs)
- trunk/src/variable.c (modified) (1 diff)
- trunk/src/xtra1.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/edit/artifact.txt
r270 r305 71 71 # Version stamp (required) 72 72 73 V:3.0.1 073 V:3.0.11 74 74 75 75 trunk/lib/edit/cost_adj.txt
r270 r305 17 17 # Version stamp (required) 18 18 19 V:3.0.1 019 V:3.0.11 20 20 21 21 trunk/lib/edit/ego_item.txt
r270 r305 52 52 # Version stamp (required) 53 53 54 V:3.0.1 054 V:3.0.11 55 55 56 56 # 1 (unused) trunk/lib/edit/flavor.txt
r270 r305 15 15 # Version stamp (required) 16 16 17 V:3.0.1 017 V:3.0.11 18 18 19 19 trunk/lib/edit/limits.txt
r270 r305 12 12 # Version stamp (required) 13 13 14 V:3.0.1 014 V:3.0.11 15 15 16 16 trunk/lib/edit/monster.txt
r276 r305 97 97 # Version stamp (required) 98 98 99 V:3.0.1 099 V:3.0.11 100 100 101 101 trunk/lib/edit/object.txt
r270 r305 81 81 # Version stamp (required) 82 82 83 V:3.0.1 083 V:3.0.11 84 84 85 85 trunk/lib/edit/p_class.txt
r270 r305 63 63 # Version stamp (required) 64 64 65 V:3.0.1 065 V:3.0.11 66 66 67 67 trunk/lib/edit/p_hist.txt
r270 r305 30 30 # Version stamp (required) 31 31 32 V:3.0.1 032 V:3.0.11 33 33 34 34 trunk/lib/edit/p_race.txt
r270 r305 51 51 # Version stamp (required) 52 52 53 V:3.0.1 053 V:3.0.11 54 54 55 55 trunk/lib/edit/shop_own.txt
r270 r305 17 17 # Version stamp (required) 18 18 19 V:3.0.1 019 V:3.0.11 20 20 21 21 # General Store trunk/lib/edit/spell.txt
r270 r305 38 38 # Version stamp (required) 39 39 40 V:3.0.1 040 V:3.0.11 41 41 42 42 trunk/lib/edit/terrain.txt
r270 r305 36 36 # Version stamp (required) 37 37 38 V:3.0.1 038 V:3.0.11 39 39 40 40 trunk/lib/edit/vault.txt
r270 r305 47 47 # Version stamp (required) 48 48 49 V:3.0.1 049 V:3.0.11 50 50 51 51 trunk/src/cave.c
r229 r305 3528 3528 /* Process the grid */ 3529 3529 cave_info[y][x] &= ~(CAVE_MARK); 3530 cave_info2[y][x] &= ~(CAVE2_DTRAP); 3530 3531 } 3531 3532 } trunk/src/cmd1.c
r291 r305 1401 1401 1402 1402 1403 bool old_dtrap, new_dtrap; 1404 1405 1403 1406 /* Find the result of moving */ 1404 1407 y = py + ddy[dir]; … … 1501 1504 /* sound(MSG_WALK); */ 1502 1505 1503 /* Move player */ 1504 monster_swap(py, px, y, x); 1506 /* See if trap detection status will change */ 1507 old_dtrap = ((cave_info2[py][px] & (CAVE2_DTRAP)) != 0); 1508 new_dtrap = ((cave_info2[y][x] & (CAVE2_DTRAP)) != 0); 1509 1510 /* Note the change in the detect status */ 1511 if (old_dtrap != new_dtrap) p_ptr->redraw |= (PR_DTRAP); 1512 1513 /* Disturb player if the player is about to leave the detect area XXX */ 1514 if (disturb_detect && p_ptr->running && old_dtrap && !new_dtrap) 1515 { 1516 /* Disturb the player */ 1517 disturb(0, 0); 1518 1519 /* Done XXX */ 1520 return; 1521 } 1522 1523 /* Move player */ 1524 monster_swap(py, px, y, x); 1525 1526 1505 1527 1506 1528 /* New location */ trunk/src/defines.h
r270 r305 45 45 #define VERSION_MAJOR 3 46 46 #define VERSION_MINOR 0 47 #define VERSION_PATCH 1 047 #define VERSION_PATCH 11 48 48 #define VERSION_EXTRA 0 49 49 … … 1607 1607 #define PR_STUN 0x00002000L /* Display Extra (Stun) */ 1608 1608 #define PR_HUNGER 0x00004000L /* Display Extra (Hunger) */ 1609 /* xxx*/1609 #define PR_DTRAP 0x00008000L /* Display Extra (Trap detection) */ 1610 1610 #define PR_BLIND 0x00010000L /* Display Extra (Blind) */ 1611 1611 #define PR_CONFUSED 0x00020000L /* Display Extra (Confused) */ … … 1670 1670 #define CAVE_WALL 0x80 /* wall flag */ 1671 1671 1672 #define CAVE2_DTRAP 0x01 /* trap detected grid */ 1672 1673 1673 1674 … … 2404 2405 #define OPT_disturb_move 20 2405 2406 #define OPT_disturb_near 21 2406 #define OPT_disturb_ panel222407 #define OPT_disturb_detect 22 2407 2408 #define OPT_disturb_state 23 2408 2409 #define OPT_disturb_minor 24 … … 2498 2499 #define disturb_move OPTION(disturb_move) 2499 2500 #define disturb_near OPTION(disturb_near) 2500 #define disturb_ panel OPTION(disturb_panel)2501 #define disturb_detect OPTION(disturb_detect) 2501 2502 #define disturb_state OPTION(disturb_state) 2502 2503 #define disturb_minor OPTION(disturb_minor) trunk/src/externs.h
r303 r305 153 153 extern byte *temp_x; 154 154 extern byte (*cave_info)[256]; 155 extern byte (*cave_info2)[256]; 155 156 extern byte (*cave_feat)[DUNGEON_WID]; 156 157 extern s16b (*cave_o_idx)[DUNGEON_WID]; trunk/src/generate.c
r48 r305 3386 3386 /* No flags */ 3387 3387 cave_info[y][x] = 0; 3388 cave_info2[y][x] = 0; 3388 3389 3389 3390 /* No features */ trunk/src/init2.c
r171 r305 1142 1142 /* Padded into array */ 1143 1143 C_MAKE(cave_info, DUNGEON_HGT, byte_256); 1144 C_MAKE(cave_info2, DUNGEON_HGT, byte_256); 1144 1145 1145 1146 /* Feature array */ … … 1873 1874 FREE(cave_m_idx); 1874 1875 FREE(cave_feat); 1876 FREE(cave_info2); 1875 1877 FREE(cave_info); 1876 1878 trunk/src/load.c
r303 r305 1654 1654 } 1655 1655 1656 /* Load the dungeon data */ 1657 if (!older_than(3, 0, 11)) for (x = y = 0; y < DUNGEON_HGT; ) 1658 { 1659 /* Grab RLE info */ 1660 rd_byte(&count); 1661 rd_byte(&tmp8u); 1662 1663 /* Apply the RLE info */ 1664 for (i = count; i > 0; i--) 1665 { 1666 /* Extract "info" */ 1667 cave_info2[y][x] = tmp8u; 1668 1669 /* Advance/Wrap */ 1670 if (++x >= DUNGEON_WID) 1671 { 1672 /* Wrap */ 1673 x = 0; 1674 1675 /* Advance/Wrap */ 1676 if (++y >= DUNGEON_HGT) break; 1677 } 1678 } 1679 } 1680 1656 1681 1657 1682 /*** Run length decoding ***/ trunk/src/monster2.c
r131 r305 1342 1342 p_ptr->px = x2; 1343 1343 1344 /* Update the trap detection status */ 1345 p_ptr->redraw |= (PR_DTRAP); 1346 1344 1347 /* Update the panel */ 1345 1348 p_ptr->update |= (PU_PANEL); … … 1374 1377 p_ptr->py = y1; 1375 1378 p_ptr->px = x1; 1379 1380 /* Update the trap detection status */ 1381 p_ptr->redraw |= (PR_DTRAP); 1376 1382 1377 1383 /* Update the panel */ trunk/src/save.c
r303 r305 681 681 } 682 682 683 /** Now dump the cave_info2[][] stuff **/ 684 685 /* Note that this will induce two wasted bytes */ 686 count = 0; 687 prev_char = 0; 688 689 /* Dump the cave */ 690 for (y = 0; y < DUNGEON_HGT; y++) 691 { 692 for (x = 0; x < DUNGEON_WID; x++) 693 { 694 /* Keep all the information from info2 */ 695 tmp8u = cave_info2[y][x]; 696 697 /* If the run is broken, or too full, flush it */ 698 if ((tmp8u != prev_char) || (count == MAX_UCHAR)) 699 { 700 wr_byte((byte)count); 701 wr_byte((byte)prev_char); 702 prev_char = tmp8u; 703 count = 1; 704 } 705 706 /* Continue the run */ 707 else 708 { 709 count++; 710 } 711 } 712 } 713 714 /* Flush the data (if any) */ 715 if (count) 716 { 717 wr_byte((byte)count); 718 wr_byte((byte)prev_char); 719 } 720 683 721 684 722 /*** Simple "Run-Length-Encoding" of cave ***/ trunk/src/spells2.c
r291 r305 950 950 lite_spot(y, x); 951 951 952 /* Obvious*/952 /* We found something to detect */ 953 953 detect = TRUE; 954 954 } 955 956 /* Mark as trap-detected */ 957 cave_info2[y][x] |= (CAVE2_DTRAP); 955 958 } 956 959 } … … 958 961 /* Describe */ 959 962 if (detect) 960 {961 963 msg_print("You sense the presence of traps!"); 962 } 964 965 /* Mark the redraw flag */ 966 p_ptr->redraw |= (PR_DTRAP); 963 967 964 968 /* Result */ 965 return ( detect);969 return (TRUE); 966 970 } 967 971 trunk/src/tables.c
r265 r305 1419 1419 "disturb_move", /* OPT_disturb_move */ 1420 1420 "disturb_near", /* OPT_disturb_near */ 1421 "disturb_ panel", /* OPT_disturb_panel*/1421 "disturb_detect", /* OPT_disturb_detect */ 1422 1422 "disturb_state", /* OPT_disturb_state */ 1423 1423 "disturb_minor", /* OPT_disturb_minor */ … … 1683 1683 "Disturb whenever any monster moves", /* OPT_disturb_move */ 1684 1684 "Disturb whenever viewable monster moves", /* OPT_disturb_near */ 1685 "Disturb whenever map panel changes", /* OPT_disturb_panel*/1685 "Disturb whenever leaving trap detected area", /* OPT_disturb_detect */ 1686 1686 "Disturb whenever player state changes", /* OPT_disturb_state */ 1687 1687 "Disturb whenever boring things happen", /* OPT_disturb_minor */ … … 1947 1947 FALSE, /* OPT_disturb_move */ 1948 1948 TRUE, /* OPT_disturb_near */ 1949 TRUE, /* OPT_disturb_ panel*/1949 TRUE, /* OPT_disturb_detect */ 1950 1950 TRUE, /* OPT_disturb_state */ 1951 1951 TRUE, /* OPT_disturb_minor */ … … 2231 2231 OPT_disturb_move, 2232 2232 OPT_disturb_near, 2233 OPT_disturb_ panel,2233 OPT_disturb_detect, 2234 2234 OPT_disturb_state, 2235 2235 OPT_disturb_minor, trunk/src/variable.c
r303 r305 394 394 * Array[DUNGEON_HGT][256] of cave grid info flags (padded) 395 395 * 396 * Th is array ispadded to a width of 256 to allow fast access to elements396 * These arrays are padded to a width of 256 to allow fast access to elements 397 397 * in the array via "grid" values (see the GRID() macros). 398 398 */ 399 399 byte (*cave_info)[256]; 400 byte (*cave_info2)[256]; 400 401 401 402 /* trunk/src/xtra1.c
r265 r305 878 878 879 879 /* Display the speed */ 880 c_put_str(attr, format("%-14s", buf), row, col); 881 } 880 c_put_str(attr, format("%-10s", buf), row, col); 881 } 882 883 884 /* 885 * Prints trap detection status 886 */ 887 static void prt_dtrap(int row, int col) 888 { 889 byte info = cave_info2[p_ptr->py][p_ptr->px]; 890 891 /* The player is in a trap-detected grid */ 892 if (info & (CAVE2_DTRAP)) 893 c_put_str(TERM_GREEN, "DTrap", row, col); 894 895 /* Not in a trap-detected grid */ 896 else 897 put_str(" ", row, col); 898 } 899 882 900 883 901 … … 970 988 { PR_POISONED, 29, prt_poisoned }, /* "Poisoned" */ 971 989 { PR_STATE, 38, prt_state }, /* <state> */ 972 { PR_SPEED, 49, prt_speed }, /* "Slow (-NN)" or "Fast (+NN)" */ 973 { PR_STUDY, 64, prt_study }, /* "Study" */ 974 { PR_DEPTH, 70, prt_depth }, /* "Lev NNN" / "NNNN ft" */ 990 { PR_DTRAP, 49, prt_dtrap }, /* "DTrap" */ 991 { PR_SPEED, 55, prt_speed }, /* "Slow (-NN)" or "Fast (+NN)" */ 992 { PR_STUDY, 66, prt_study }, /* "Study" */ 993 { PR_DEPTH, 72, prt_depth }, /* "Lev NNN" / "NNNN ft" */ 975 994 { PR_OPPOSE_ELEMENTS, 80, prt_elements }, /* Acid Elec Fire Cold Pois */ 976 995 };
