Ticket #222: cave.diff
| File cave.diff, 2.8 kB (added by Big Al, 1 year ago) |
|---|
-
trunk-r440/src/cave.c
old new 469 469 break; 470 470 } 471 471 } 472 /* Use a brightly lit tile */ 473 switch (use_graphics) 474 { 475 case GRAPHICS_NONE: 476 case GRAPHICS_PSEUDO: 477 if (*a == TERM_GREEN) *a = TERM_L_GREEN; 478 break; 479 case GRAPHICS_ADAM_BOLT: 480 break; 481 case GRAPHICS_DAVID_GERVAIS: 482 break; 483 } 472 484 } 473 485 474 486 /* Handle "dark" grids and "blindness" */ … … 564 576 } 565 577 } 566 578 579 /* 580 * Checks if a square is at the (inner) edge of a trap detect area 581 */ 582 static bool dtrap_edge(int y, int x) 583 { 584 /* Check if the square is a dtrap in the first place */ 585 if (!cave_info2[y][x] & CAVE2_DTRAP) 586 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 /* Looks better without the diagonals */ 595 #if 0 596 if (in_bounds(y + 1, x + 1) && (!cave_info2[y + 1][x + 1] & CAVE2_DTRAP)) return TRUE; 597 if (in_bounds(y - 1, x + 1) && (!cave_info2[y - 1][x + 1] & CAVE2_DTRAP)) return TRUE; 598 if (in_bounds(y - 1, x - 1) && (!cave_info2[y - 1][x - 1] & CAVE2_DTRAP)) return TRUE; 599 if (in_bounds(y + 1, x - 1) && (!cave_info2[y + 1][x - 1] & CAVE2_DTRAP)) return TRUE; 600 #endif 601 return FALSE; 602 } 567 603 568 604 /* 569 605 * Extract the attr/char to display at the given (legal) map location … … 735 771 char c; 736 772 737 773 byte feat; 738 byte info ;774 byte info, info2; 739 775 740 776 feature_type *f_ptr; 741 777 object_type *o_ptr; … … 754 790 755 791 /* Cave flags */ 756 792 info = cave_info[y][x]; 793 info2 = cave_info2[y][x]; 757 794 758 795 /* Hack -- rare random hallucination on non-outer walls */ 759 796 if (image && (!rand_int(256)) && (feat < FEAT_PERM_SOLID)) … … 780 817 /* Normal char */ 781 818 c = f_ptr->x_char; 782 819 820 if (dtrap_edge(y, x)) 821 { 822 a = TERM_GREEN; 823 c = '.'; 824 } 825 783 826 /* Special lighting effects */ 784 827 if (view_special_lite) special_lighting_floor(&a, &c, info); 828 785 829 } 786 830 787 831 /* Unknown */ … … 795 839 796 840 /* Normal char */ 797 841 c = f_ptr->x_char; 842 843 /* Check the dtrap edge */ 844 if (dtrap_edge(y, x)) 845 { 846 a = TERM_GREEN; 847 c = '.'; 848 } 849 798 850 } 799 851 } 800 852 … … 818 870 819 871 /* Special lighting effects (walls only) */ 820 872 if (view_granite_lite) special_lighting_wall(&a, &c, feat, info); 873 821 874 } 822 875 823 876 /* Unknown */ … … 831 884 832 885 /* Normal char */ 833 886 c = f_ptr->x_char; 887 888 /* Check the dtrap edge */ 889 if (dtrap_edge(y, x)) 890 { 891 a = TERM_GREEN; 892 c = '.'; 893 } 834 894 } 835 895 } 836 896
