Difference for server/alchemy.c from version 1.9 to 1.10


version 1.9 version 1.10
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_alchemy_c =   * static char *rcsid_alchemy_c =
  *   "$Id: alchemy.c,v 1.9 2001/09/26 21:34:08 garbled Exp $";   *   "$Id: alchemy.c,v 1.10 2001/10/15 21:12:08 garbled Exp $";
  */   */
 /*  /*
     CrossFire, A Multiplayer game for X-windows      CrossFire, A Multiplayer game for X-windows
Line 64
 
Line 64
 char * cauldron_sound ( void ) {  char * cauldron_sound ( void ) {
   int size=sizeof(cauldron_effect)/sizeof(char *);    int size=sizeof(cauldron_effect)/sizeof(char *);
   
   return cauldron_effect[RANDOM()%size];     return cauldron_effect[rndm(0, size-1)];
 }  }
   
 /* attempt_do_alchemy() - Main part of the ALCHEMY code. From this we call fctns  /* attempt_do_alchemy() - Main part of the ALCHEMY code. From this we call fctns
Line 288
 
Line 288
    if(lvl<=0) lvl = 1; /* lets avoid div by zero! */      if(lvl<=0) lvl = 1; /* lets avoid div by zero! */
    if(item->nrof) {     if(item->nrof) {
 /*     nrof = (RANDOM() % yield + RANDOM() % yield + RANDOM() % yield)/ 3 + 1;*/  /*     nrof = (RANDOM() % yield + RANDOM() % yield + RANDOM() % yield)/ 3 + 1;*/
      nrof = ( 1.0 - 1.0/(lvl/10.0 + 1.0)) * (RANDOM() % yield + RANDOM() % yield + RANDOM() % yield) + 1;       nrof = ( 1.0 - 1.0/(lvl/10.0 + 1.0)) * (rndm(0, yield-1) + rndm(0, yield-1) + rndm(0, yield-1)) + 1;
      if(nrof > yield) nrof = yield;       if(nrof > yield) nrof = yield;
      item->nrof=nrof;       item->nrof=nrof;
    }     }
Line 382
 
Line 382
   if(level<25) {        /* INGREDIENTS USED/SLAGGED */    if(level<25) {        /* INGREDIENTS USED/SLAGGED */
       object *item=NULL;        object *item=NULL;
    
       if(RANDOM()%3) {  /* slag created */        if(rndm(0, 2)) {  /* slag created */
         object *tmp=cauldron->inv;          object *tmp=cauldron->inv;
         int weight=0;          int weight=0;
  uint16 material=M_STONE;   uint16 material=M_STONE;
Line 421
 
Line 421
   
      /* special stuff for consumables */       /* special stuff for consumables */
            if(tmp->type==POTION||tmp->type==FOOD) {             if(tmp->type==POTION||tmp->type==FOOD) {
             if(tmp->stats.sp&&RANDOM()%2) /* drains magic */              if(tmp->stats.sp && rndm(0 ,1)) /* drains magic */
  tmp->stats.sp = SP_REGENERATE_SPELLPOINTS;   tmp->stats.sp = SP_REGENERATE_SPELLPOINTS;
  else    else
  tmp->stats.sp = 0; /* so it can drain stats */    tmp->stats.sp = 0; /* so it can drain stats */
             if(RANDOM()%2) { /* poisonous */              if(rndm(0, 1)) { /* poisonous */
  tmp->type=FOOD;    tmp->type=FOOD;
  tmp->stats.hp=random_roll(0, 149, op, PREFER_LOW);   tmp->stats.hp=random_roll(0, 149, op, PREFER_LOW);
      }       }
Line 435
 
Line 435
    
           /* change stats downward */            /* change stats downward */
     do {      do {
            change_attr_value(&tmp->stats,RANDOM()%7,-1*(RANDOM()%3+1));             change_attr_value(&tmp->stats,rndm(0, 6),-1*(rndm(1, 3)));
            } while (RANDOM()%3);             } while (rndm(0, 2));
       }          } 
       return;        return;
   
Line 466
 
Line 466
    else if (level<50) {                /* MINOR EXPLOSION/FIREBALL */     else if (level<50) {                /* MINOR EXPLOSION/FIREBALL */
       object *tmp;        object *tmp;
       remove_contents(cauldron->inv,NULL);        remove_contents(cauldron->inv,NULL);
       switch(RANDOM()%3) {        switch(rndm(0, 2)) {
  case 0:    case 0:
            tmp=get_archetype("bomb");             tmp=get_archetype("bomb");
      tmp->stats.dam=random_roll(1, level, op, PREFER_LOW);       tmp->stats.dam=random_roll(1, level, op, PREFER_LOW);
Line 506
 
Line 506
         SET_FLAG(cauldron,FLAG_CURSED);          SET_FLAG(cauldron,FLAG_CURSED);
       else cauldron->magic--;        else cauldron->magic--;
       cauldron->magic -= random_roll(0, 4, op, PREFER_LOW);        cauldron->magic -= random_roll(0, 4, op, PREFER_LOW);
       if(RANDOM()%2) {        if(rndm(0, 1)) {
         remove_contents(cauldron->inv,NULL);          remove_contents(cauldron->inv,NULL);
         new_draw_info_format(NDI_UNIQUE,0,op,          new_draw_info_format(NDI_UNIQUE,0,op,
     "Your %s turns darker then makes a gulping sound!",      "Your %s turns darker then makes a gulping sound!",
Line 532
 
Line 532
       return;        return;
   
   } else if (level<150) {               /* COMBO EFFECT */    } else if (level<150) {               /* COMBO EFFECT */
       int roll = RANDOM()%3+1;        int roll = rndm(1, 3);
       while(roll) {        while(roll) {
  alchemy_failure_effect(op,cauldron,rp,level-39);   alchemy_failure_effect(op,cauldron,rp,level-39);
  roll--;   roll--;


Legend:
line(s) removed in v.1.9 
line(s) changed
 line(s) added in v.1.10

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:21