MCPcopy Create free account
hub / github.com/crawl/crawl / _write_object_stats

Function _write_object_stats

crawl-ref/source/dbg-objstat.cc:1345–1387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1343}
1344
1345static void _write_object_stats()
1346{
1347 _write_stat_info();
1348
1349 for (int i = 0; i < NUM_ITEM_BASE_TYPES; i++)
1350 {
1351 item_base_type base_type = static_cast<item_base_type>(i);
1352 _write_base_item_stats(base_type);
1353 }
1354
1355 string out_file = make_stringf("%s%s%s", stat_out_prefix, "Spells",
1356 stat_out_ext);
1357 stat_outf = _open_stat_file(out_file.c_str());
1358
1359 _write_stat_headers(spell_fields, "Spell");
1360 for (const auto spell : objstat_spells)
1361 _write_spell_stats(spell);
1362
1363 fclose(stat_outf);
1364 printf("Wrote Spell stats to %s.\n", out_file.c_str());
1365
1366 out_file = make_stringf("%s%s%s", stat_out_prefix, "Monsters",
1367 stat_out_ext);
1368 stat_outf = _open_stat_file(out_file.c_str());
1369
1370 _write_stat_headers(monster_fields, "Monster");
1371 for (const auto mc : objstat_monsters)
1372 _write_monster_stats(mc);
1373
1374 fclose(stat_outf);
1375 printf("Wrote Monster stats to %s.\n", out_file.c_str());
1376
1377 out_file = make_stringf("%s%s%s", stat_out_prefix, "Features",
1378 stat_out_ext);
1379 stat_outf = _open_stat_file(out_file.c_str());
1380
1381 _write_stat_headers(feature_fields, "Feature");
1382 for (auto feat : objstat_features)
1383 _write_feature_stats(feat);
1384
1385 fclose(stat_outf);
1386 printf("Wrote Feature stats to %s.\n", out_file.c_str());
1387}
1388
1389void objstat_generate_stats()
1390{

Callers 1

objstat_generate_statsFunction · 0.85

Calls 8

_write_stat_infoFunction · 0.85
_write_base_item_statsFunction · 0.85
make_stringfFunction · 0.85
_open_stat_fileFunction · 0.85
_write_stat_headersFunction · 0.85
_write_spell_statsFunction · 0.85
_write_monster_statsFunction · 0.85
_write_feature_statsFunction · 0.85

Tested by

no test coverage detected