Re: [EXP GAINS] Follow-up

From: Axiem (bertelse@SWBELL.NET)
Date: 06/09/98


Kyle Goodwin wrote:

> Here is another example of the same problem with my code below:
>
> Outside The East Gate Of Midgaard
>    You are by two small towers that have been built into the city wall and
> connected with a footbridge across the heavy wooden gate.  To the east the
> plains stretch out in the distance.
> [ Exits: e w ]
> An oozing green gelatinous blob is here, sucking in bits of debris.
> A beastly fido is mucking through the garbage looking for food here.
> A Peacekeeper is standing here, ready to jump in at the first sign of
> trouble.
>
> <14/14H 57/100M 70/84V> cast 'magic missile' blob
> Okay.
> You rise 23 levels!
> You watch with selfpride as your magic missile hits the green gelatinous
> blob!
>
> <14/129H 32/306M 70/117V>
> The green gelatinous blob crushes you extremely hard.
> You are incapacitated an will slowly die, if not aided.
>
> <-5/129H 32/306M 70/117V> cast 'magic missile' blob
> You are in a pretty bad shape, unable to do anything!
>
> <-5/129H 32/306M 70/117V>
> The green gelatinous blob crushes your entire body, making a terrible mess!
> You are dead!  Sorry...
>
> Code:
>
> /*
>  * This is the exp given to implementors -- it must always be greater
>  * than the exp required for immortality, plus at least 20,000 or so.
>  */
> #define EXP_MAX  99999999
>
> /* Function to return the exp required for each class/level */
> int level_exp(int class, int level)
> {
>     int modifier, exp, racemod, classmod;
>
>         //TODO: Add race and class modifiers
>
>         if (level > LVL_IMPL || level < 0) {
>     log("SYSERR: Requesting exp for invalid level!");
>     return 0;
>   }
>
>   /*
>    * Gods have exp close to EXP_MAX.  This statement should never have to
>    * changed, regardless of how many mortal or immortal levels exist.
>    */
>
>         if (level > LVL_IMMORT)
>      return EXP_MAX - ((LVL_IMPL-level) * 1000);
>
>   /* Exp required for normal mortals is below */
>
>   //int modifier, exp;
>
>   if (level < 5)
>     modifier = 1;
>   else if (level < 10)
>     modifier = 1;
>   else if (level < 25)
>     modifier = 1;
>   else if (level < 30)
>     modifier = 2;
>   else if (level < 35)
>     modifier = 2;
>   else if (level < 40)
>     modifier = 2;
>   else if (level < 45)
>     modifier = 3;
>   else if (level < 50)
>     modifier = 3;
>   else if (level < 55)
>     modifier = 3;
>   else
>     modifier = 4;
>
>   //Compute race and class modifiers here
>   racemod = 0;
>   classmod = 0;
>
>   exp = (modifier * 600) + racemod + classmod;

                ^^^^^^^^^^^^- that is your problem. the modifier is the same in
each set of levels. my suggestion is to use decimal places by doing some
subtraction and division, to change modifier. and racemod and classmod should
not be added, but multiplied (like 1, 1.2, 0.8, 2.1, etc...)


>   return exp;
> }
>
> /* I didn't change do_advance so that code is still stock */
>
> Kyle Goodwin

a table is easier to mess with value, imo, tho, but, a function like this could
be useful for small MUDs.
 - Axiem


     +------------------------------------------------------------+
     | 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