summaryrefslogtreecommitdiff
path: root/plugins/prospector.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-02-03 11:43:13 +0400
committerAlexander Gavrilov2012-02-03 11:43:13 +0400
commitd4163fcde35e813dbe7d5355dbd351a7bc18ea55 (patch)
tree97abf55cbda1a4449d6a309c16e1d9f5a36f1a81 /plugins/prospector.cpp
parent1e89b8d79b09257d1e342eae582f47ec4da341dd (diff)
downloaddfhack-d4163fcde35e813dbe7d5355dbd351a7bc18ea55.tar.gz
dfhack-d4163fcde35e813dbe7d5355dbd351a7bc18ea55.tar.bz2
dfhack-d4163fcde35e813dbe7d5355dbd351a7bc18ea55.tar.xz
Improve results of the embark-time prospector.
Diffstat (limited to 'plugins/prospector.cpp')
-rw-r--r--plugins/prospector.cpp53
1 files changed, 30 insertions, 23 deletions
diff --git a/plugins/prospector.cpp b/plugins/prospector.cpp
index d550132a..25ff08cb 100644
--- a/plugins/prospector.cpp
+++ b/plugins/prospector.cpp
@@ -280,33 +280,40 @@ static command_result embark_prospector(DFHack::Core *c, df::viewscreen_choose_s
{
auto layer = geo_biome->layers[i];
- for (int z = layer->bottom_height; z <= layer->top_height; z++)
- {
- layerMats[layer->mat_index].add(z, 48*48*cnt);
+ layerMats[layer->mat_index].add(layer->bottom_height, 0);
- for (unsigned j = 0; j < layer->vein_mat.size(); j++)
- {
- // TODO: find out how to estimate the real density
- int bias = 100;
- switch (layer->vein_type[j])
- {
- case inclusion_type::VEIN:
- bias = 360;
- break;
- case inclusion_type::CLUSTER:
- bias = 1800;
- break;
- case inclusion_type::CLUSTER_SMALL:
- bias = 18;
- break;
- case inclusion_type::CLUSTER_ONE:
- bias = 3;
- break;
- }
+ int level_cnt = layer->top_height - layer->bottom_height + 1;
+ int layer_size = 48*48*cnt*level_cnt;
- veinMats[layer->vein_mat[j]].add(z, layer->vein_unk_38[j]*bias*cnt/100);
+ for (unsigned j = 0; j < layer->vein_mat.size(); j++)
+ {
+ // TODO: find out how to estimate the real density
+ int bias = 100;
+ switch (layer->vein_type[j])
+ {
+ case inclusion_type::VEIN:
+ bias = 200;
+ break;
+ case inclusion_type::CLUSTER:
+ bias = 1000;
+ break;
+ case inclusion_type::CLUSTER_SMALL:
+ bias = 15;
+ break;
+ case inclusion_type::CLUSTER_ONE:
+ bias = 2;
+ break;
}
+
+ int size = layer->vein_unk_38[j]*bias*cnt*level_cnt/100;
+
+ veinMats[layer->vein_mat[j]].add(layer->bottom_height, 0);
+ veinMats[layer->vein_mat[j]].add(layer->top_height, size);
+
+ layer_size -= size;
}
+
+ layerMats[layer->mat_index].add(layer->top_height, std::max(0,layer_size));
}
}