ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/readable.C
(Generate patch)

Comparing deliantra/server/common/readable.C (file contents):
Revision 1.20 by root, Tue Jan 23 01:05:17 2007 UTC vs.
Revision 1.21 by root, Mon Feb 5 01:24:45 2007 UTC

919 if (book->type != BOOK) 919 if (book->type != BOOK)
920 return; 920 return;
921 921
922 switch (msgtype) 922 switch (msgtype)
923 { 923 {
924 case 1: /*monster */ 924 case 1: /*monster */
925 nbr = sizeof (mon_book_name) / sizeof (char *); 925 nbr = sizeof (mon_book_name) / sizeof (char *);
926 strcpy (name, mon_book_name[rndm (nbr)]); 926 assign (name, mon_book_name[rndm (nbr)]);
927 break; 927 break;
928 case 2: /*artifact */ 928 case 2: /*artifact */
929 nbr = sizeof (art_book_name) / sizeof (char *); 929 nbr = sizeof (art_book_name) / sizeof (char *);
930 strcpy (name, art_book_name[rndm (nbr)]); 930 assign (name, art_book_name[rndm (nbr)]);
931 break; 931 break;
932 case 3: /*spellpath */ 932 case 3: /*spellpath */
933 nbr = sizeof (path_book_name) / sizeof (char *); 933 nbr = sizeof (path_book_name) / sizeof (char *);
934 strcpy (name, path_book_name[rndm (nbr)]); 934 assign (name, path_book_name[rndm (nbr)]);
935 break; 935 break;
936 case 4: /*alchemy */ 936 case 4: /*alchemy */
937 nbr = sizeof (formula_book_name) / sizeof (char *); 937 nbr = sizeof (formula_book_name) / sizeof (char *);
938 strcpy (name, formula_book_name[rndm (nbr)]); 938 assign (name, formula_book_name[rndm (nbr)]);
939 break; 939 break;
940 case 5: /*gods */ 940 case 5: /*gods */
941 nbr = sizeof (gods_book_name) / sizeof (char *); 941 nbr = sizeof (gods_book_name) / sizeof (char *);
942 strcpy (name, gods_book_name[rndm (nbr)]); 942 assign (name, gods_book_name[rndm (nbr)]);
943 break; 943 break;
944 case 6: /*msg file */ 944 case 6: /*msg file */
945 default: 945 default:
946 if (book->weight > 2000) 946 if (book->weight > 2000)
947 { /* based on weight */ 947 { /* based on weight */
948 nbr = sizeof (heavy_book_name) / sizeof (char *); 948 nbr = sizeof (heavy_book_name) / sizeof (char *);
949 strcpy (name, heavy_book_name[rndm (nbr)]); 949 assign (name, heavy_book_name[rndm (nbr)]);
950 } 950 }
951 else if (book->weight < 2001) 951 else if (book->weight < 2001)
952 { 952 {
953 nbr = sizeof (light_book_name) / sizeof (char *); 953 nbr = sizeof (light_book_name) / sizeof (char *);
954 strcpy (name, light_book_name[rndm (nbr)]); 954 assign (name, light_book_name[rndm (nbr)]);
955 } 955 }
956 break; 956 break;
957 } 957 }
958 958
959 book->name = name; 959 book->name = name;
960} 960}
961 961
973 if (msgtype < 0 || strlen (op->msg) < 5) 973 if (msgtype < 0 || strlen (op->msg) < 5)
974 return; 974 return;
975 975
976 switch (msgtype) 976 switch (msgtype)
977 { 977 {
978 case 1: /* monster */ 978 case 1: /* monster */
979 nbr = sizeof (mon_author) / sizeof (char *); 979 nbr = sizeof (mon_author) / sizeof (char *);
980 strcpy (name, mon_author[rndm (nbr)]); 980 assign (name, mon_author[rndm (nbr)]);
981 break; 981 break;
982 case 2: /* artifacts */ 982 case 2: /* artifacts */
983 nbr = sizeof (art_author) / sizeof (char *); 983 nbr = sizeof (art_author) / sizeof (char *);
984 strcpy (name, art_author[rndm (nbr)]); 984 assign (name, art_author[rndm (nbr)]);
985 break; 985 break;
986 case 3: /* spellpath */ 986 case 3: /* spellpath */
987 nbr = sizeof (path_author) / sizeof (char *); 987 nbr = sizeof (path_author) / sizeof (char *);
988 strcpy (name, path_author[rndm (nbr)]); 988 assign (name, path_author[rndm (nbr)]);
989 break; 989 break;
990 case 4: /* alchemy */ 990 case 4: /* alchemy */
991 nbr = sizeof (formula_author) / sizeof (char *); 991 nbr = sizeof (formula_author) / sizeof (char *);
992 strcpy (name, formula_author[rndm (nbr)]); 992 assign (name, formula_author[rndm (nbr)]);
993 break; 993 break;
994 case 5: /* gods */ 994 case 5: /* gods */
995 nbr = sizeof (gods_author) / sizeof (char *); 995 nbr = sizeof (gods_author) / sizeof (char *);
996 strcpy (name, gods_author[rndm (nbr)]); 996 assign (name, gods_author[rndm (nbr)]);
997 break; 997 break;
998 case 6: /* msg file */ 998 case 6: /* msg file */
999 default: 999 default:
1000 strcpy (name, book_author[rndm (nbr)]); 1000 assign (name, book_author[rndm (nbr)]);
1001 } 1001 }
1002 1002
1003 sprintf (title, "of %s", name); 1003 sprintf (title, "of %s", name);
1004 op->title = title; 1004 op->title = title;
1005} 1005}
1413 art = al->items; /* hmm, out of stuff, loop back around */ 1413 art = al->items; /* hmm, out of stuff, loop back around */
1414 art = art->next; 1414 art = art->next;
1415 } 1415 }
1416 1416
1417 /* the base 'generic' name for our artifact */ 1417 /* the base 'generic' name for our artifact */
1418 strcpy (name, art_name_array[index].name); 1418 assign (name, art_name_array[index].name);
1419 1419
1420 /* Ok, lets print out the contents */ 1420 /* Ok, lets print out the contents */
1421 sprintf (retbuf, "Herein %s detailed %s...\n", book_entries > 1 ? "are" : "is", book_entries > 1 ? "some artifacts" : "an artifact"); 1421 sprintf (retbuf, "Herein %s detailed %s...\n", book_entries > 1 ? "are" : "is", book_entries > 1 ? "some artifacts" : "an artifact");
1422 1422
1423 /* artifact msg attributes loop. Lets keep adding entries to the 'book' 1423 /* artifact msg attributes loop. Lets keep adding entries to the 'book'
1527 * or not), and must be within the valid level range. 1527 * or not), and must be within the valid level range.
1528 */ 1528 */
1529 if (at->clone.type == SPELL && at->clone.path_attuned & pnum && 1529 if (at->clone.type == SPELL && at->clone.path_attuned & pnum &&
1530 ((at->clone.stats.grace && prayers) || (at->clone.stats.sp && !prayers)) && (at->clone.level < (level * 8))) 1530 ((at->clone.stats.grace && prayers) || (at->clone.stats.sp && !prayers)) && (at->clone.level < (level * 8)))
1531 { 1531 {
1532 strcpy (tmpbuf, at->clone.name); 1532 assign (tmpbuf, at->clone.name);
1533 1533
1534 if (book_overflow (retbuf, tmpbuf, booksize)) 1534 if (book_overflow (retbuf, tmpbuf, booksize))
1535 break; 1535 break;
1536 else 1536 else
1537 { 1537 {
1695 for (i = 0; msg && i < nrofmsg && i != msgnum; i++) 1695 for (i = 0; msg && i < nrofmsg && i != msgnum; i++)
1696 msg = msg->next; 1696 msg = msg->next;
1697 } 1697 }
1698 1698
1699 if (msg && !book_overflow (retbuf, msg->name, booksize)) 1699 if (msg && !book_overflow (retbuf, msg->name, booksize))
1700 strcpy (retbuf, msg->name); 1700 assign (retbuf, msg->name);
1701 else 1701 else
1702 sprintf (retbuf, "\n <undecipherable text>"); 1702 sprintf (retbuf, "\n <undecipherable text>");
1703 1703
1704#ifdef BOOK_MSG_DEBUG 1704#ifdef BOOK_MSG_DEBUG
1705 LOG (llevDebug, "\n info_list_msg() created strng: %d\n", strlen (retbuf)); 1705 LOG (llevDebug, "\n info_list_msg() created strng: %d\n", strlen (retbuf));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines