ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/treasure.C
(Generate patch)

Comparing deliantra/server/common/treasure.C (file contents):
Revision 1.107 by root, Sun Apr 25 07:08:57 2010 UTC vs.
Revision 1.109 by root, Sun May 2 20:37:57 2010 UTC

1169 */ 1169 */
1170void 1170void
1171init_artifacts () 1171init_artifacts ()
1172{ 1172{
1173 static int has_been_inited = 0; 1173 static int has_been_inited = 0;
1174 char filename[MAX_BUF];
1175 artifact *art = NULL; 1174 artifact *art = NULL;
1176 artifactlist *al; 1175 artifactlist *al;
1177 1176
1178 if (has_been_inited) 1177 if (has_been_inited)
1179 return; 1178 return;
1180 else 1179 else
1181 has_been_inited = 1; 1180 has_been_inited = 1;
1182 1181
1183 sprintf (filename, "%s/artifacts", settings.datadir); 1182 object_thawer f (settings.datadir, "artifacts");
1184 object_thawer f (filename);
1185 1183
1186 if (!f) 1184 if (!f)
1187 return; 1185 return;
1188 1186
1189 for (;;) 1187 for (;;)
1274 } 1272 }
1275#if 0 1273#if 0
1276 LOG (llevDebug, "Artifact list type %d has %d total chance\n", al->type, al->total_chance); 1274 LOG (llevDebug, "Artifact list type %d has %d total chance\n", al->type, al->total_chance);
1277#endif 1275#endif
1278 } 1276 }
1279
1280 LOG (llevDebug, "done.\n");
1281} 1277}
1282 1278
1283/* 1279/*
1284 * Used in artifact generation. The bonuses of the first object 1280 * Used in artifact generation. The bonuses of the first object
1285 * is modified by the bonuses of the second object. 1281 * is modified by the bonuses of the second object.
1286 */ 1282 */
1287void 1283void
1288add_abilities (object *op, object *change) 1284add_abilities (object *op, object *change)
1289{ 1285{
1290 if (change->face != blank_face) 1286 if (change->face != blank_face)
1291 {
1292#ifdef TREASURE_VERBOSE
1293 LOG (llevDebug, "add_abilities change face: %d\n", change->face);
1294#endif
1295 op->face = change->face; 1287 op->face = change->face;
1296 }
1297 1288
1298 for (int i = 0; i < NUM_STATS; i++) 1289 for (int i = 0; i < NUM_STATS; i++)
1299 change_attr_value (&(op->stats), i, change->stats.stat (i)); 1290 change_attr_value (&(op->stats), i, change->stats.stat (i));
1300 1291
1301 op->attacktype |= change->attacktype; 1292 op->attacktype |= change->attacktype;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines