Changeset 808
- Timestamp:
- 03/19/08 18:42:43 (5 months ago)
- Files:
-
- trunk/src/cave.c (modified) (9 diffs)
- trunk/src/spells2.c (modified) (2 diffs)
- trunk/src/types.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cave.c
r789 r808 501 501 /* Use "gray" */ 502 502 if (*a == TERM_WHITE) *a = TERM_SLATE; 503 else if (*a == TERM_L_GREEN) *a = TERM_GREEN; 503 504 break; 504 505 case GRAPHICS_ADAM_BOLT: … … 577 578 578 579 580 /* 581 * Checks if a square is at the (inner) edge of a trap detect area 582 */ 583 static bool dtrap_edge(int y, int x) 584 { 585 /* Check if the square is a dtrap in the first place */ 586 if (!cave_info2[y][x] & CAVE2_DTRAP) return FALSE; 587 588 /* Check for non-dtrap adjacent grids */ 589 if (in_bounds(y + 1, x ) && (!cave_info2[y + 1][x ] & CAVE2_DTRAP)) return TRUE; 590 if (in_bounds(y , x + 1) && (!cave_info2[y ][x + 1] & CAVE2_DTRAP)) return TRUE; 591 if (in_bounds(y - 1, x ) && (!cave_info2[y - 1][x ] & CAVE2_DTRAP)) return TRUE; 592 if (in_bounds(y , x - 1) && (!cave_info2[y ][x - 1] & CAVE2_DTRAP)) return TRUE; 593 594 return FALSE; 595 } 596 597 579 598 /* 580 599 * This function takes a pointer to a grid info struct describing the … … 623 642 c = f_ptr->x_char; 624 643 644 /* Check for trap detection boundaries */ 645 if (g->trapborder && g->f_idx == FEAT_FLOOR) a = TERM_L_GREEN; 646 625 647 /* Special lighting effects */ 626 648 if (g->f_idx <= FEAT_INVIS && view_special_lite) … … 630 652 if (g->f_idx > FEAT_INVIS && view_granite_lite) 631 653 special_wall_display(&a, &c, g->in_view, g->f_idx); 632 654 633 655 /* Save the terrain info for the transparency effects */ 634 656 (*tap) = a; … … 809 831 810 832 833 834 811 835 /* 812 836 * This function takes a grid location (x, y) and extracts information the … … 859 883 { 860 884 object_type *o_ptr; 861 byte info ;885 byte info, info2; 862 886 863 887 assert(x < DUNGEON_WID); … … 865 889 866 890 info = cave_info[y][x]; 891 info2 = cave_info2[y][x]; 867 892 868 893 /* Default "clear" values, others will be set later where appropriate. */ … … 877 902 g->m_idx = (g->is_player) ? 0 : cave_m_idx[y][x]; 878 903 g->hallucinate = p_ptr->timed[TMD_IMAGE] ? TRUE : FALSE; 904 g->trapborder = (dtrap_edge(y, x)) ? TRUE : FALSE; 879 905 880 906 /* If the grid is memorised or can currently be seen */ … … 3887 3913 3888 3914 3889 trunk/src/spells2.c
r796 r808 1045 1045 cave_info[y][x] |= (CAVE_MARK); 1046 1046 1047 /* Redraw */1048 lite_spot(y, x);1049 1050 1047 /* We found something to detect */ 1051 1048 detect = TRUE; … … 1056 1053 } 1057 1054 } 1055 1056 /* Rescan the map for the new dtrap edge */ 1057 for (y = y1-1; y < y2+1; y++) 1058 { 1059 for (x = x1-1; x < x2+1; x++) 1060 { 1061 if (!in_bounds_fully(y, x)) continue; 1062 1063 /* Redraw */ 1064 lite_spot(y, x); 1065 } 1066 } 1067 1058 1068 1059 1069 /* Describe */ trunk/src/types.h
r789 r808 1099 1099 bool is_player; 1100 1100 bool hallucinate; 1101 bool trapborder; 1101 1102 } grid_data; 1102 1103
