home *** CD-ROM | disk | FTP | other *** search
/ ftp.ee.pdx.edu / 2014.02.ftp.ee.pdx.edu.tar / ftp.ee.pdx.edu / pub / frp / rolemaster / chargen next >
Text File  |  1994-03-29  |  5KB  |  204 lines

  1. Path: usenet.ee.pdx.edu!cs.uoregon.edu!sgiblab!sdd.hp.com!math.ohio-state.edu!cs.utexas.edu!uunet!not-for-mail
  2. From: ej345@cleveland.Freenet.Edu (Stephen C. Harvey)
  3. Newsgroups: rec.games.frp.archives
  4. Subject: RESOURCE: Rolemaster char. generator
  5. Followup-To: rec.games.frp.misc
  6. Date: 28 Mar 1994 07:58:01 -0500
  7. Organization: UUNET Technologies, Inc.
  8. Lines: 190
  9. Sender: smm@uunet.uu.net
  10. Approved: smm@uunet.uu.net
  11. Message-ID: <2n6k8p$cj@rodan.UU.NET>
  12. NNTP-Posting-Host: rodan.uu.net
  13.  
  14.  
  15.  
  16. This is the initial module of a program I am writing to generate
  17. Rolemaster characters.  Right now, all it does is rolls the temp and
  18. potential stats for each attribute, and determines % bonus and dev.
  19. points for each.  However, even so, it reduces this aspect of character
  20. generation from ten minutes to about 3 seconds.
  21.   I've compiled this successfully on both an Atari STe running Sozobon
  22. C, and an Ultrix system running GCC.  The only mod you might have to
  23. make is to put a srand statement in (the Atari doesn't need it, but most
  24. mainframes willl, to seed random numbers).
  25.   Anyway, I'd love to hear email feedback for what features people would
  26. like to see in a program of this sort; the next addions are going to be
  27. options to figure racial bonsuses, and to allow the computer to advance
  28. levels for you, to make it easier to roll up high-level NPC's.  I don't
  29. know if I'm going to implement skills or not...
  30.   This program is freeware; share it, but just leave my name on it
  31. somewhere.  Enjoy!
  32.  
  33. /*   ROLEMASTER  Character Generator     */
  34. /*   copyright Steve Harvey, 1994        */
  35.  
  36. char stat[10], statpot[10];
  37. int rawbonus[10], racebonus[10];   /* rawbonus is the unmodified % stat
  38.                     bonus; racebonus is not changed
  39.                     once levels are gained */
  40.  
  41. int devpoints[5];
  42.  
  43. static char *stname[10] = {"Constitution", "Self-Discipline", "Agility",
  44. "Memory  ", "Reasoning", "Strength ", "Quickness", "Presence",
  45. "Intuition",
  46.   "Empathy "};
  47.  
  48. static char potentials[38][11] = {
  49.     {10, 25, 00, 00, 00, 00, 00, 00, 00, 00, 00},
  50.     {20, 30, 00, 00, 00, 00, 00, 00, 00, 00, 00},
  51.     {30, 35, 39, 00, 00, 00, 00, 00, 00, 00, 00},
  52.     {35, 38, 42, 59, 00, 00, 00, 00, 00, 00, 00},
  53.     {40, 40, 45, 62, 00, 00, 00, 00, 00, 00, 00},
  54.     {45, 42, 47, 64, 00, 00, 00, 00, 00, 00, 00},
  55.     {49, 44, 49, 66, 00, 00, 00, 00, 00, 00, 00},
  56.     {51, 46, 51, 68, 00, 00, 00, 00, 00, 00, 00},
  57.     {53, 48, 53, 70, 00, 00, 00, 00, 00, 00, 00},
  58.     {55, 50, 55, 71, 00, 00, 00, 00, 00, 00, 00},
  59.     {57, 52, 57, 72, 74, 84, 00, 00, 00, 00, 00},
  60.     {59, 54, 59, 73, 75, 85, 00, 00, 00, 00, 00},
  61.     {61, 56, 61, 74, 76, 86, 00, 00, 00, 00, 00},
  62.     {63, 58, 63, 75, 77, 87, 00, 00, 00, 00, 00},
  63.     {65, 60, 65, 76, 78, 88, 00, 00, 00, 00, 00},
  64.     {67, 62, 67, 77, 79, 88, 89, 00, 00, 00, 00},
  65.     {69, 64, 69, 89, 80, 89, 89, 00, 00, 00, 00},
  66.     {71, 66, 71, 79, 81, 89, 90, 00, 00, 00, 00},
  67.     {73, 68, 73, 80, 82, 90, 90, 00, 00, 00, 00},
  68.     {75, 70, 75, 81, 83, 90, 91, 00, 00, 00, 00},
  69.     {77, 72, 77, 82, 84, 91, 91, 00, 00, 00, 00},
  70.     {79, 74, 79, 83, 85, 91, 92, 00, 00, 00, 00},
  71.     {81, 76, 81, 84, 86, 92, 92, 00, 00, 00, 00},
  72.     {83, 78, 83, 85, 87, 92, 93, 00, 00, 00, 00},
  73.     {85, 80, 85, 86, 88, 93, 93, 94, 00, 00, 00},
  74.     {87, 82, 86, 87, 89, 93, 94, 94, 00, 00, 00},
  75.     {89, 84, 87, 88, 90, 94, 94, 95, 00, 00, 00},
  76.     {90, 86, 88, 89, 91, 94, 95, 95, 97, 00, 00},
  77.     {91, 88, 89, 90, 92, 95, 95, 96, 97, 00, 00},
  78.     {92, 90, 90, 91, 93, 95, 96, 96, 97, 00, 00},
  79.     {93, 91, 91, 92, 94, 96, 96, 97, 98, 00, 00},
  80.     {94, 92, 92, 93, 95, 96, 97, 97, 98, 99, 00},
  81.     {95, 93, 93, 94, 96, 97, 97, 98, 98, 99, 00},
  82.     {96, 94, 94, 95, 97, 97, 98, 98, 99, 99, 00},
  83.     {97, 95, 95, 96, 97, 98, 98, 99, 99, 99, 00},
  84.     {98, 96, 96, 97, 98, 98, 99, 99, 99,100, 00},
  85.     {99, 97, 98, 98, 99, 99,100,100,100,100, 00},
  86.     {100,98, 98, 99, 99, 99,100,100,100,100,101}
  87.     };
  88.  
  89. static int bonuses[17][4] = {
  90.     102,35,11,4,
  91.     101,30,10,3,
  92.     100,25,10,3,
  93.     98,20,9,2,
  94.     95,15,9,2,
  95.     90,10,8,1,
  96.     85,5,8,1,
  97.     75,5,7,1,
  98.     60,0,6,0,
  99.     40,0,5,0,
  100.     25,0,4,0,
  101.     15,-5,3,0,
  102.     10,-5,3,0,
  103.     5,-10,2,0,
  104.     3,-15,1,0,
  105.     2,-20,1,0,
  106.     1,-25,1,0};    /* stat, bonus, devpoints, powerpoints */
  107.     
  108. struct race {
  109.     cjar 
  110.  
  111. main()
  112.  
  113. {
  114. char flag;
  115.         roll();
  116.         display_stat();
  117. }
  118.  
  119.  
  120. roll()
  121. {
  122. char i;
  123.  
  124. for ( i = 0; i < 10; i++)        /* initial stat rolls */
  125.     stat[i] = rand()%100 + 1;
  126.  
  127. roll_pots();
  128. get_bonus();
  129. }
  130.  
  131.  
  132. display_stat()
  133. {
  134. char i;
  135.     printf("\t\t\tTemp\tPot\tBonus\tDevelopment pts\n\n");
  136. for ( i = 0; i < 10; i++)
  137.     {
  138.     printf("%s\t\t%d\t%d\t%d\t",stname[i],stat[i],
  139.         statpot[i],rawbonus[i]+racebonus[i]);
  140.     if ( i < 5 )
  141.         printf("%d",devpoints[i]);
  142.     printf("\n");
  143.     };
  144. }
  145.  
  146.  
  147. roll_pots()
  148. {
  149. char i,j,t;                /* t is dieroll, j is counter */
  150.  
  151. for ( i = 0; i < 10; i++)        /* determine potentials */
  152.     {
  153.     t = rand()%100 + 1;
  154.     j = 0;
  155.  
  156.     while (potentials[j][0] < t)
  157.         j++;
  158.  
  159.     if (stat[i] < 25)
  160.         statpot[i] = potentials[j][1];
  161.     else if (stat[i] < 39)
  162.         statpot[i] = potentials[j][2];
  163.     else if (stat[i] < 59)
  164.         statpot[i] = potentials[j][3];
  165.     else if (stat[i] < 74)
  166.         statpot[i] = potentials[j][4];
  167.     else if (stat[i] < 84)
  168.         statpot[i] = potentials[j][5];
  169.     else if (stat[i] < 89)
  170.         statpot[i] = potentials[j][6];
  171.     else if (stat[i] < 94)
  172.         statpot[i] = potentials[j][7];
  173.     else if (stat[i] < 97)
  174.         statpot[i] = potentials[j][8];
  175.     else if (stat[i] < 99)
  176.         statpot[i] = potentials[j][9];
  177.     else if (stat[i] == 100)
  178.         statpot[i] = potentials[j][10];
  179.  
  180.     if (statpot[i] == 0)
  181.         statpot[i] = stat[i];
  182.     };
  183. }
  184.  
  185. get_bonus()
  186. {
  187. char i,j;
  188.  
  189. for (i = 0; i < 10; i++ )
  190.     {
  191.     j = 0;
  192.  
  193.     while (bonuses[j][0] > stat[i])
  194.         j++;
  195.  
  196.     rawbonus[i] = bonuses[j][1];
  197.     if (i < 5)
  198.         devpoints[i] = bonuses[j][2];
  199.  
  200.     };
  201. }
  202.  
  203.  
  204.