Difference for common/treasure.c from version 1.21 to 1.22


version 1.21 version 1.22
Line 1
 
Line 1
   
 /*  /*
  * static char *rcs_treasure_c =   * static char *rcs_treasure_c =
  *   "$Id: treasure.c,v 1.21 2001/10/30 02:30:19 michtoen Exp $";   *   "$Id: treasure.c,v 1.22 2001/11/16 01:34:17 michtoen Exp $";
  */   */
   
 /*  /*
Line 45
 
Line 45
 #include <funcpoint.h>  #include <funcpoint.h>
 #include <loader.h>  #include <loader.h>
   
   
   static change_treasure(treasure *t, object *op); /* overrule default values */
   
 /*  /*
  * Initialize global archtype pointers:   * Initialize global archtype pointers:
  */   */
Line 121
 
Line 124
         LOG(llevError,"Treasure lacks archetype: %s\n",variable);          LOG(llevError,"Treasure lacks archetype: %s\n",variable);
     } else if (sscanf(cp, "list %s", variable))      } else if (sscanf(cp, "list %s", variable))
  t->name = add_string(variable);   t->name = add_string(variable);
       else if (sscanf(cp, "change_name %s", variable))
         t->change_arch.name = add_string(variable);
     else if(sscanf(cp,"chance %d",&value))      else if(sscanf(cp,"chance %d",&value))
       t->chance=(uint8) value;        t->chance=(uint8) value;
     else if(sscanf(cp,"nrof %d",&value))      else if(sscanf(cp,"nrof %d",&value))
Line 281
 
Line 286
     }      }
 }  }
   
   /* if there are change_xxx commands in the treasure, we include the changes
    * in the generated object
    */
   static change_treasure(treasure *t, object *op)
   {
       /* CMD: change_name xxxx */
       if(t->change_arch.name)
       {
           if(op->name)
               free_string(op->name);
           op->name = add_string(t->change_arch.name);
       }
   
   }
   
 void create_all_treasures(treasure *t, object *op, int flag, int difficulty, int tries) {  void create_all_treasures(treasure *t, object *op, int flag, int difficulty, int tries) {
   object *tmp;    object *tmp;
   
Line 296
 
Line 316
         if(t->nrof&&tmp->nrof<=1)          if(t->nrof&&tmp->nrof<=1)
           tmp->nrof = RANDOM()%((int) t->nrof) + 1;            tmp->nrof = RANDOM()%((int) t->nrof) + 1;
         fix_generated_item (tmp, op, difficulty, t->magic, flag);          fix_generated_item (tmp, op, difficulty, t->magic, flag);
           change_treasure(t, tmp);       
         put_treasure (tmp, op, flag);          put_treasure (tmp, op, flag);
       }        }
     }      }
Line 338
 
Line 359
         if(t->nrof&&tmp->nrof<=1)          if(t->nrof&&tmp->nrof<=1)
           tmp->nrof = RANDOM()%((int) t->nrof) + 1;            tmp->nrof = RANDOM()%((int) t->nrof) + 1;
         fix_generated_item (tmp, op, difficulty, t->magic, flag);          fix_generated_item (tmp, op, difficulty, t->magic, flag);
           change_treasure(t, tmp);       
         put_treasure (tmp, op, flag);          put_treasure (tmp, op, flag);
     }      }
 }  }
Line 539
 
Line 561
  case 4:   case 4:
  case 5:   case 5:
  case 6:   case 6:
      set_attr_value(&op->stats, r, bonus + get_attr_value(&op->stats,r));       set_attr_value(&op->stats, r, (signed char)(bonus + get_attr_value(&op->stats,r)));
      break;       break;
   
  case 7:   case 7:
Line 878
 
Line 900
   
   if ( ! (flags & GT_ENVIRONMENT))    if ( ! (flags & GT_ENVIRONMENT))
     fix_flesh_item (op, creator);      fix_flesh_item (op, creator);
   
 }  }
   
 /*  /*
Line 1417
 
Line 1440
  free_string(item->name);   free_string(item->name);
  item->name=add_string(tmpbuf);   item->name=add_string(tmpbuf);
  /* weight is FLESH weight/100 * donor */   /* weight is FLESH weight/100 * donor */
  if((item->weight = (float) (item->weight/100.0) * donor->weight)==0)   if((item->weight = (signed long) (((double)item->weight/(double)100.0) * (double)donor->weight))==0)
  item->weight=1;   item->weight=1;
   
  /* value is multiplied by level of donor */   /* value is multiplied by level of donor */


Legend:
line(s) removed in v.1.21 
line(s) changed
 line(s) added in v.1.22

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