Changeset 132
- Timestamp:
- 05/12/07 10:36:48 (2 years ago)
- Files:
-
- trunk/src/birth.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/birth.c
r120 r132 687 687 static region race_region = {RACE_COL, TABLE_ROW, 15, -2}; 688 688 static region class_region = {CLASS_COL, TABLE_ROW, 19, -2}; 689 static region roller_region = {44, TABLE_ROW, 20, -2}; 689 690 690 691 … … 763 764 } 764 765 766 /* ROLLER */ 767 static void display_roller(menu_type *menu, int oid, bool cursor, 768 int row, int col, int width) 769 { 770 byte attr = curs_attrs[CURS_KNOWN][0 != cursor]; 771 const char *str; 772 773 if (oid == 0) 774 str = "Point-based"; 775 else if (oid == 1) 776 str = "Autoroller"; 777 else if (oid == 2) 778 str = "Standard roller"; 779 780 c_prt(attr, str, row, col); 781 } 782 783 784 static byte roller_type = 0; 785 #define ROLLER_POINT 0 786 #define ROLLER_AUTO 1 787 #define ROLLER_STD 2 788 789 static bool roller_handler(char cmd, void *db, int oid) 790 { 791 if (cmd == '\xff' || cmd == '\r') 792 roller_type = oid; 793 else if (cmd == '*') 794 roller_type = 3; 795 else if(cmd == '=') 796 do_cmd_options(); 797 else if(cmd == KTRL('X')) 798 quit(NULL); 799 else 800 return FALSE; 801 802 return TRUE; 803 } 804 765 805 766 806 static const menu_iter menu_defs[] = { … … 768 808 { 0, 0, 0, display_race, race_handler }, 769 809 { 0, 0, 0, display_class, class_handler }, 810 { 0, 0, 0, display_roller, roller_handler }, 770 811 }; 771 812 … … 775 816 #define ARACE 1 776 817 #define ACLASS 2 818 #define AROLL 3 819 777 820 778 821 … … 781 824 int i = 0; 782 825 783 const region *regions[] = { &gender_region, &race_region, &class_region };784 byte *values[ 3]; /* { &p_ptr->psex, &p_ptr->prace, &p_ptr->pclass }; */785 int limits[ 3]; /* { SEX_MALE +1, z_info->p_max, z_info->c_max }; */826 const region *regions[] = { &gender_region, &race_region, &class_region, &roller_region }; 827 byte *values[4]; /* { &p_ptr->psex, &p_ptr->prace, &p_ptr->pclass }; */ 828 int limits[4]; /* { SEX_MALE +1, z_info->p_max, z_info->c_max }; */ 786 829 787 830 menu_type menu; … … 791 834 "Your 'sex' does not have any significant gameplay effects.", 792 835 "Your 'race' determines various intrinsic factors and bonuses.", 793 "Your 'class' determines various intrinsic abilities and bonuses" 836 "Your 'class' determines various intrinsic abilities and bonuses", 837 "Your choice of character generation. Point-based is recommended." 794 838 }; 795 839 796 840 typedef void (*browse_f) (int oid, void *, const region *loc); 797 browse_f browse[] = {NULL, race_aux_hook, class_aux_hook };841 browse_f browse[] = {NULL, race_aux_hook, class_aux_hook, NULL }; 798 842 799 843 /* Stupid ISO C array initialization. */ … … 801 845 values[ARACE] = &p_ptr->prace; 802 846 values[ACLASS] = &p_ptr->pclass; 847 values[AROLL] = &roller_type; 803 848 limits[ASEX] = SEX_MALE + 1; 804 849 limits[ARACE] = z_info->p_max; 805 850 limits[ACLASS] = z_info->c_max; 851 limits[AROLL] = 3; 806 852 807 853 WIPE(&menu, menu); … … 896 942 text_out_indent = 0; 897 943 898 if (!choose_character()) return FALSE;944 if (!choose_character()) return FALSE; 899 945 900 946 … … 1483 1529 cptr prompt = "['Q' to suicide, 'S' to start over, or any other key to continue]"; 1484 1530 1485 bool point_based = FALSE, autoroll = FALSE;1486 1531 bool done = FALSE; 1487 1532 … … 1489 1534 if (!player_birth_aux_1()) return (FALSE); 1490 1535 1491 /* XXX Ask for autoroll preference */1492 /* Turn into a real menu later */1493 Term_clear();1494 while (!done)1495 {1496 prt("To create a character, would you like to:", 1, 1);1497 prt(" a) Use the point-based system", 2, 1);1498 prt(" b) Use the autoroller", 3, 1);1499 prt(" c/*) Use the basic roller", 4, 1);1500 1501 prt("", 6, 1);1502 ch = inkey();1503 1504 switch (ch)1505 {1506 case 'a':1507 case 'A':1508 done = point_based = TRUE;1509 break;1510 1511 case 'b':1512 case 'B':1513 done = autoroll = TRUE;1514 break;1515 1516 case 'c':1517 case 'C':1518 case '*':1519 done = TRUE;1520 break;1521 }1522 }1523 1524 1536 /* Point-based */ 1525 if ( point_based)1537 if (roller_type == ROLLER_POINT) 1526 1538 { 1527 1539 /* Point based */ … … 1533 1545 { 1534 1546 /* Auto-roll */ 1535 if (!player_birth_aux_3( autoroll)) return (FALSE);1547 if (!player_birth_aux_3(roller_type == ROLLER_AUTO)) return (FALSE); 1536 1548 } 1537 1549
