Changeset 1425
- Timestamp:
- 06/01/09 19:01:29 (15 months ago)
- Location:
- trunk/src/monster
- Files:
-
- 2 modified
-
monster2.c (modified) (7 diffs)
-
types.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/monster/monster2.c
r1418 r1425 627 627 list[m_ptr->r_idx].los++; 628 628 629 /* Check if a wakeand increment accordingly */630 if ( !m_ptr->csleep) list[m_ptr->r_idx].los_awake++;631 } 632 /* Not in LOS so increment if a wake*/633 else if ( !m_ptr->csleep) list[m_ptr->r_idx].awake++;629 /* Check if asleep and increment accordingly */ 630 if (m_ptr->csleep) list[m_ptr->r_idx].los_asleep++; 631 } 632 /* Not in LOS so increment if asleep */ 633 else if (m_ptr->csleep) list[m_ptr->r_idx].asleep++; 634 634 635 635 /* Bump the count for this race, and the total count */ … … 699 699 } 700 700 701 /* Message for monsters in LOS */ 702 prt(format("You can see %d monster%s", los_count, 703 (los_count > 0 ? (los_count == 1 ? ":" : "s:") : "s.")), 0, 0); 701 /* Message for monsters in LOS - even if there are none */ 702 if (!los_count) prt(format("You can see no monsters."), 0, 0); 703 else prt(format("You can see %d monster%s", los_count, (los_count == 1 704 ? ":" : "s:")), 0, 0); 704 705 705 706 /* Print out in-LOS monsters in descending order */ … … 729 730 /* Build the monster name */ 730 731 if (list[order[i]].los == 1) 731 strnfmt(buf, sizeof(buf), (list[order[i]].los_awake == 732 1 ? "%s (awake) " : "%s (asleep) "), m_name); 733 else strnfmt(buf, sizeof(buf), "%s (x%d, %d awake) ", m_name, 734 list[order[i]].los, list[order[i]].los_awake); 732 strnfmt(buf, sizeof(buf), (list[order[i]].los_asleep == 733 1 ? "%s (asleep) " : "%s "), m_name); 734 else strnfmt(buf, sizeof(buf), (list[order[i]].los_asleep > 0 ? 735 "%s (x%d, %d asleep) " : "%s (x%d)"), m_name, 736 list[order[i]].los, list[order[i]].los_asleep); 735 737 736 738 /* Display the pict */ … … 751 753 /* Clear the screen */ 752 754 for (line = 1; line <= max; line++) 753 prt("", line, x);755 prt("", line, 0); 754 756 755 757 /* Reprint Message */ … … 763 765 } 764 766 765 /* Message for monsters outside LOS */ 766 prt(format("You are aware of %d %smonster%s", 767 /* Message for monsters outside LOS, if there are any */ 768 if (total_count > los_count) 769 { 770 /* Leave a blank line */ 771 line++; 772 773 prt(format("You are aware of %d %smonster%s", 767 774 (total_count - los_count), (los_count > 0 ? "other " : ""), 768 ((total_count - los_count) > 0 ? ((total_count - los_count) ==769 1 ? ":" : "s:") : "s.")), line++, 0);775 ((total_count - los_count) == 1 ? ":" : "s:")), line++, 0); 776 } 770 777 771 778 /* Print out non-LOS monsters in descending order */ … … 795 802 /* Build the monster name */ 796 803 if ((list[order[i]].count - list[order[i]].los) == 1) 797 strnfmt(buf, sizeof(buf), (list[order[i]].awake == 798 1 ? "%s (awake) " : "%s (asleep) "), m_name); 799 else strnfmt(buf, sizeof(buf), "%s (x%d, %d awake) ", m_name, 804 strnfmt(buf, sizeof(buf), (list[order[i]].asleep == 805 1 ? "%s (asleep) " : "%s "), m_name); 806 else strnfmt(buf, sizeof(buf), (list[order[i]].asleep > 0 ? 807 "%s (x%d, %d asleep) " : "%s (x%d) "), m_name, 800 808 (list[order[i]].count - list[order[i]].los), 801 list[order[i]].a wake);809 list[order[i]].asleep); 802 810 803 811 /* Display the pict */ … … 818 826 /* Clear the screen */ 819 827 for (line = 1; line <= max; line++) 820 prt("", line, x);828 prt("", line, 0); 821 829 822 830 /* Reprint Message */ 823 prt(format("You can see%d %smonster%s",831 prt(format("You are aware of %d %smonster%s", 824 832 (total_count - los_count), (los_count > 0 ? 825 833 "other " : ""), ((total_count - los_count) > 0 -
trunk/src/monster/types.h
r1418 r1425 161 161 { 162 162 u16b count; /* total number of this type visible */ 163 u16b a wake; /* number awake*/163 u16b asleep; /* number asleep (not in LOS) */ 164 164 u16b los; /* number in LOS */ 165 u16b los_a wake; /* number awakeand in LOS */165 u16b los_asleep; /* number asleep and in LOS */ 166 166 } monster_vis; 167 167
