1 | |
1 | |
2 | /* |
2 | /* |
3 | * static char *rcs_treasure_c = |
3 | * static char *rcs_treasure_c = |
4 | * "$Id: treasure.c,v 1.1 2006/02/03 07:11:41 root Exp $"; |
4 | * "$Id: treasure.c,v 1.2 2006/07/11 16:50:16 elmex Exp $"; |
5 | */ |
5 | */ |
6 | |
6 | |
7 | /* |
7 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
8 | CrossFire, A Multiplayer game for X-windows |
9 | |
9 | |
… | |
… | |
155 | |
155 | |
156 | #ifdef TREASURE_DEBUG |
156 | #ifdef TREASURE_DEBUG |
157 | /* recursived checks the linked list. Treasurelist is passed only |
157 | /* recursived checks the linked list. Treasurelist is passed only |
158 | * so that the treasure name can be printed out |
158 | * so that the treasure name can be printed out |
159 | */ |
159 | */ |
160 | static void check_treasurelist(treasure *t, treasurelist *tl) |
160 | static void check_treasurelist(const treasure *t, const treasurelist *tl) |
161 | { |
161 | { |
162 | if (t->item==NULL && t->name==NULL) |
162 | if (t->item==NULL && t->name==NULL) |
163 | LOG(llevError,"Treasurelist %s has element with no name or archetype\n", tl->name); |
163 | LOG(llevError,"Treasurelist %s has element with no name or archetype\n", tl->name); |
164 | if (t->chance>=100 && t->next_yes && (t->next || t->next_no)) |
164 | if (t->chance>=100 && t->next_yes && (t->next || t->next_no)) |
165 | LOG(llevError,"Treasurelist %s has element that has 100%% generation, next_yes field as well as next or next_no\n", |
165 | LOG(llevError,"Treasurelist %s has element that has 100%% generation, next_yes field as well as next or next_no\n", |
… | |
… | |
220 | #endif |
220 | #endif |
221 | tl->total_chance += t->chance; |
221 | tl->total_chance += t->chance; |
222 | } |
222 | } |
223 | } |
223 | } |
224 | } else |
224 | } else |
225 | LOG(llevError,"Treasure-list didn't understand: %s, line %d\n",buf, line); |
225 | LOG(llevError,"Treasure-list %s didn't understand: %s, line %d\n", filename, buf, line); |
226 | } |
226 | } |
227 | close_and_delete(fp, comp); |
227 | close_and_delete(fp, comp); |
228 | |
228 | |
229 | #ifdef TREASURE_DEBUG |
229 | #ifdef TREASURE_DEBUG |
230 | /* Perform some checks on how valid the treasure data actually is. |
230 | /* Perform some checks on how valid the treasure data actually is. |
… | |
… | |
483 | /* calculate the appropriate level for wands staves and scrolls. If |
483 | /* calculate the appropriate level for wands staves and scrolls. If |
484 | * retmult is 1, return the multiplier, not the level, for computing value |
484 | * retmult is 1, return the multiplier, not the level, for computing value |
485 | * This code presumes that op has had its spell object created (in op->inv) |
485 | * This code presumes that op has had its spell object created (in op->inv) |
486 | */ |
486 | */ |
487 | |
487 | |
488 | int level_for_item(object *op, int difficulty, int retmult) |
488 | int level_for_item(const object *op, int difficulty, int retmult) |
489 | { |
489 | { |
490 | int level, mult, olevel; |
490 | int level, mult, olevel; |
491 | |
491 | |
492 | mult = 0; |
492 | mult = 0; |
493 | if (!op->inv) { |
493 | if (!op->inv) { |