Re: [EXP GAINS] [CODE]

From: Gordon Forsythe (boah@SPRYNET.COM)
Date: 06/12/98


On 12-Jun-98, Brian wrote:
> Well, I'm using modifiers now, which work fine... However, there's a
> problem...    When you type in "levels", it only takes into account your
> current level modifier when it displays the table.  So someone typing
> "Levels" at 1st level gets a different table than someone typing "levels" at
> 10th level.  This, however, is because of my lack of better coding skills.
> My hope is to figure out how to keep the tables displayed the same, somehow,
> no matter what level you are when you type it in.  If all else fails,
> though, I'll just yank the formula code and put back in the stock tables.
> I'm not quitting just yet, so I'll see if I can figure out some method.
>
> - Brian
Here's what I use now, and it seems to work well.
  switch (chclass) {
    case CLASS_MAGIC_USER:
    if (level == 0)
      return 0;
    else if (level == 1)
      return 1;
    else if (level == 2)
      return 2200;
    else if (level < 7)
      modifier = 2;
    else if (level < 11)
      modifier = 1.5;
    else if (level < 25)
      modifier = 1.25;
    else if (level < 30)
      modifier = 1.2;
    else if (level < 40)
      modifier = 1.15;
    else if (level < 50)
      modifier = 1.1;
    else if (level < 61)
      modifier = 1.05;
    else
      modifier = 1.05;
    //Compute race and class modifiers here
    exp = (level_exp(chclass, level - 1) * modifier);
    return exp;
    break;
.
.
.
True, this is probably considered bad coding by some, and you still have to
repeat it for each class (just change the amount at lvl 2), but it cut more
than 15k out of my class.c files from getting rid of those nasty tables.  Oh
yea, for my do_levels:
    sprintf(buf + strlen(buf), "[%2d] %11d-%-11d : ", i,
        level_exp(GET_CLASS(ch), i), level_exp(GET_CLASS(ch), i+1) - 1);
    switch (GET_SEX(ch)) {
    case SEX_MALE:

The machine probably gets dizzy from recalling level_exp so much, but it seems
to work.  BTW, I've only been coding for a little while, so if you have
something to say about this, please respond personally, don't flame the list.
Regards
Gordon Forsythe
--
+++++++++++++++++++++++++++++++++++++++++++++
Visit G on the web:  |Coder for SlashFang MUD
http://gman.base.org |mud.guam.net:4000
---------------------------------------------
      GRF Web-Publishing (coming soon!)
+++++++++++++++++++++++++++++++++++++++++++++


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



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