|
|
|
@ -332,25 +332,27 @@ namespace embark_assist {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
|
// Exported operations
|
|
|
|
|
//=================================================================================
|
|
|
|
|
//=================================================================================
|
|
|
|
|
// Exported operations
|
|
|
|
|
//=================================================================================
|
|
|
|
|
|
|
|
|
|
void setup(uint16_t max_inorganic) {
|
|
|
|
|
state = new(states);
|
|
|
|
|
state->max_inorganic = max_inorganic;
|
|
|
|
|
}
|
|
|
|
|
void embark_assist::survey::setup(uint16_t max_inorganic) {
|
|
|
|
|
embark_assist::survey::state = new(embark_assist::survey::states);
|
|
|
|
|
embark_assist::survey::state->max_inorganic = max_inorganic;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
|
//=================================================================================
|
|
|
|
|
|
|
|
|
|
df::coord2d get_last_pos() {
|
|
|
|
|
return{state->x, state->y};
|
|
|
|
|
}
|
|
|
|
|
df::coord2d embark_assist::survey::get_last_pos() {
|
|
|
|
|
return{ embark_assist::survey::state->x, embark_assist::survey::state->y };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
|
//=================================================================================
|
|
|
|
|
|
|
|
|
|
void initiate(embark_assist::defs::mid_level_tiles *mlt) {
|
|
|
|
|
void embark_assist::survey::initiate(embark_assist::defs::mid_level_tiles *mlt) {
|
|
|
|
|
for (uint8_t i = 0; i < 16; i++) {
|
|
|
|
|
for (uint8_t k = 0; k < 16; k++) {
|
|
|
|
|
mlt->at(i).at(k).metals.resize(state->max_inorganic);
|
|
|
|
@ -358,11 +360,11 @@ namespace embark_assist {
|
|
|
|
|
mlt->at(i).at(k).minerals.resize(state->max_inorganic);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
|
//=================================================================================
|
|
|
|
|
|
|
|
|
|
void clear_results(embark_assist::defs::match_results *match_results) {
|
|
|
|
|
void embark_assist::survey::clear_results(embark_assist::defs::match_results *match_results) {
|
|
|
|
|
for (uint16_t i = 0; i < world->worldgen.worldgen_parms.dim_x; i++) {
|
|
|
|
|
for (uint16_t k = 0; k < world->worldgen.worldgen_parms.dim_y; k++) {
|
|
|
|
|
match_results->at(i).at(k).preliminary_match = false;
|
|
|
|
@ -375,15 +377,15 @@ namespace embark_assist {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
|
//=================================================================================
|
|
|
|
|
|
|
|
|
|
void high_level_world_survey(embark_assist::defs::geo_data *geo_summary,
|
|
|
|
|
void embark_assist::survey::high_level_world_survey(embark_assist::defs::geo_data *geo_summary,
|
|
|
|
|
embark_assist::defs::world_tile_data *survey_results) {
|
|
|
|
|
// color_ostream_proxy out(Core::getInstance().getConsole());
|
|
|
|
|
// color_ostream_proxy out(Core::getInstance().getConsole());
|
|
|
|
|
|
|
|
|
|
geo_survey(geo_summary);
|
|
|
|
|
embark_assist::survey::geo_survey(geo_summary);
|
|
|
|
|
for (uint16_t i = 0; i < world->worldgen.worldgen_parms.dim_x; i++) {
|
|
|
|
|
for (uint16_t k = 0; k < world->worldgen.worldgen_parms.dim_y; k++) {
|
|
|
|
|
df::coord2d adjusted;
|
|
|
|
@ -467,16 +469,16 @@ namespace embark_assist {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
survey_rivers(survey_results);
|
|
|
|
|
survey_evil_weather(survey_results);
|
|
|
|
|
}
|
|
|
|
|
embark_assist::survey::survey_rivers(survey_results);
|
|
|
|
|
embark_assist::survey::survey_evil_weather(survey_results);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
|
//=================================================================================
|
|
|
|
|
|
|
|
|
|
void survey_mid_level_tile(embark_assist::defs::geo_data *geo_summary,
|
|
|
|
|
void embark_assist::survey::survey_mid_level_tile(embark_assist::defs::geo_data *geo_summary,
|
|
|
|
|
embark_assist::defs::world_tile_data *survey_results,
|
|
|
|
|
embark_assist::defs::mid_level_tiles *mlt) {
|
|
|
|
|
// color_ostream_proxy out(Core::getInstance().getConsole());
|
|
|
|
|
// color_ostream_proxy out(Core::getInstance().getConsole());
|
|
|
|
|
auto screen = Gui::getViewscreenByType<df::viewscreen_choose_start_sitest>(0);
|
|
|
|
|
int16_t x = screen->location.region_pos.x;
|
|
|
|
|
int16_t y = screen->location.region_pos.y;
|
|
|
|
@ -819,10 +821,10 @@ namespace embark_assist {
|
|
|
|
|
|
|
|
|
|
tile->biome_count = count;
|
|
|
|
|
tile->surveyed = true;
|
|
|
|
|
}
|
|
|
|
|
//=================================================================================
|
|
|
|
|
}
|
|
|
|
|
//=================================================================================
|
|
|
|
|
|
|
|
|
|
df::coord2d apply_offset(uint16_t x, uint16_t y, int8_t offset) {
|
|
|
|
|
df::coord2d embark_assist::survey::apply_offset(uint16_t x, uint16_t y, int8_t offset) {
|
|
|
|
|
df::coord2d result;
|
|
|
|
|
result.x = x;
|
|
|
|
|
result.y = y;
|
|
|
|
@ -887,12 +889,12 @@ namespace embark_assist {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
|
//=================================================================================
|
|
|
|
|
|
|
|
|
|
void embark_assist::survey::survey_region_sites(embark_assist::defs::site_lists *site_list) {
|
|
|
|
|
// color_ostream_proxy out(Core::getInstance().getConsole());
|
|
|
|
|
void embark_assist::survey::survey_region_sites(embark_assist::defs::site_lists *site_list) {
|
|
|
|
|
// color_ostream_proxy out(Core::getInstance().getConsole());
|
|
|
|
|
auto screen = Gui::getViewscreenByType<df::viewscreen_choose_start_sitest>(0);
|
|
|
|
|
df::world_data *world_data = world->world_data;
|
|
|
|
|
int8_t index = 0;
|
|
|
|
@ -921,7 +923,7 @@ namespace embark_assist {
|
|
|
|
|
site->subtype_info->is_monument == 0) { // Not Tomb, which is visible already
|
|
|
|
|
}
|
|
|
|
|
else if (site->subtype_info->lair_type == -1) {
|
|
|
|
|
site_list->push_back( { (uint8_t)site->rgn_min_x , (uint8_t)site->rgn_min_y, 'V' }); // Vault
|
|
|
|
|
site_list->push_back({ (uint8_t)site->rgn_min_x , (uint8_t)site->rgn_min_y, 'V' }); // Vault
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
site_list->push_back({ (uint8_t)site->rgn_min_x , (uint8_t)site->rgn_min_y, 'M' }); // Any other Monument type. Pyramid?
|
|
|
|
@ -958,15 +960,15 @@ namespace embark_assist {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
|
//=================================================================================
|
|
|
|
|
|
|
|
|
|
void embark_assist::survey::survey_embark(embark_assist::defs::mid_level_tiles *mlt,
|
|
|
|
|
void embark_assist::survey::survey_embark(embark_assist::defs::mid_level_tiles *mlt,
|
|
|
|
|
embark_assist::defs::site_infos *site_info,
|
|
|
|
|
bool use_cache) {
|
|
|
|
|
|
|
|
|
|
// color_ostream_proxy out(Core::getInstance().getConsole());
|
|
|
|
|
// color_ostream_proxy out(Core::getInstance().getConsole());
|
|
|
|
|
auto screen = Gui::getViewscreenByType<df::viewscreen_choose_start_sitest>(0);
|
|
|
|
|
int16_t elevation;
|
|
|
|
|
uint16_t x = screen->location.region_pos.x;
|
|
|
|
@ -1050,7 +1052,7 @@ namespace embark_assist {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (uint16_t l = 0; l < state->max_inorganic; l++) {
|
|
|
|
|
metals[l] = metals [l] || mlt->at(i).at(k).metals[l];
|
|
|
|
|
metals[l] = metals[l] || mlt->at(i).at(k).metals[l];
|
|
|
|
|
economics[l] = economics[l] || mlt->at(i).at(k).economics[l];
|
|
|
|
|
minerals[l] = minerals[l] || mlt->at(i).at(k).minerals[l];
|
|
|
|
|
}
|
|
|
|
@ -1069,12 +1071,11 @@ namespace embark_assist {
|
|
|
|
|
site_info->minerals.push_back(l);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
|
//=================================================================================
|
|
|
|
|
|
|
|
|
|
void embark_assist::survey::shutdown() {
|
|
|
|
|
void embark_assist::survey::shutdown() {
|
|
|
|
|
delete state;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|