Re: Stats

From: Peter Ajamian (pajamian@cheapsam.com)
Date: 12/27/99


Manafort wrote:
>
> this is the main code that was added so i hope this helps...

<snip>

Where are you calling init_char from?  Stock circle calls it from
CON_QCLASS.  init_char resets all the stats to 25 so if you call it
after rolling the abilities the roll will be overwritten by init_char.

Also I have two comments about the method you chose, first, never, ever
rely on what a human being will or will not type, if the player types
anything starting with a 'y' or 'Y' at the "Press enter to roll your
stats." prompt thier stats will not be rolled.You can avoid that by
doing something like the following...

  case CON_QROLLSTATS2:
    switch (*arg) {
    case 'y':
    case 'Y':
-     break;
+     /* whatever you had after the switch would go in here */
+     STATE(d) = CON_whatever;
+     return;
    case 'n':
    case 'N':
+     break;
    default:
+     SEND_TO_Q("\r\nPlease answer with 'Y'es or 'N'o.\r\n"
+               "Keep these stats? (Y/N)", d);
+     return;
+   }
+   /* Fall through on purpose here (no break or return) */
+ case CON_QROLLSTATS:
    roll_real_abils(d->character);
    sprintf(buf, "\r\nStr: [%d/%d] Int: [%d] Wis: [%d] Dex:"
            " [%d] Con: [%d] Cha: [%d]",
            GET_STR(d->character), GET_ADD(d->character),
            GET_INT(d->character), GET_WIS(d->character),
            GET_DEX(d->character), GET_CON(d->character),
            GET_CHA(d->character));

    SEND_TO_Q(buf, d);
!   SEND_TO_Q("\r\n\r\nKeep these stats? (Y/N)", d);
+   STATE(d) = CON_QROLLSTATS2;
    return;

Well, I said I had two comments, and that was one, the second is that if
you really want players to be able to pick thier own stats then allow
them to do exactly that instead of making them re-roll stats over and
over again until they are satisfied.  One method that is generally used
for allowing players to pick thier own stats is to give them a total
number of points they can use and allowing them to divide those points
between thier stats as they see fit, except for strength-add the average
stat roll (given the circlemud default of taking the best 3 out of 4
rolls of a 6 sided dice) is 13.  So the average total number of stat
points will be 6 * 13 = 78.  So give them 78 points to split up as they
wish, I will use the current possible maximum (18) and minimum (3) roll
values as the maximum and minimum value for each, an example follows...

Class: t

Current stats:

Strength:     13
Intelligence: 13
Wisdom:       13
Dexterity:    13
Constitution: 13
Charisma:     13

Keep current stats? (Y/N): n

You can assign each stat a value in the range 3 to 18 with the total of
the stats not exceeding 78.

Points left: [78] Number of points to assign to Strength: 10
Points left: [68] Number of points to assign to Intelligence: 18
Points left: [50] Number of points to assign to Wisdom: 15
Points left: [35] Number of points to assign to Dexterity: 5
Points left: [30] Number of points to assign to Constitution: 18
Remaining 12 points assigned to Charisma.

Current stats:

Strength:     10
Intelligence: 18
Wisdom:       15
Dexterity:    5
Constitution: 18
Charisma:     12

Keep current stats? (Y/N): y

Good luck and I hope this helps,

Peter


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST