Probe now displays the "surroundings" name for the biome (e.g. Joyous Wilds, or Terrifying).

Rprobe can be used from the embark screen to set the evilness of the selected biome; use with due care.
develop
Kelly Martin 2012-04-22 10:17:14 -05:00
parent f5644f385b
commit 26cec5f60c
2 changed files with 30 additions and 1 deletions

@ -61,6 +61,9 @@ command_result rprobe (color_ostream &out, vector <string> & parameters)
{ {
CoreSuspender suspend; CoreSuspender suspend;
bool set = false;
int to_set, set_val;
// Embark screen active: estimate using world geology data // Embark screen active: estimate using world geology data
VIRTUAL_CAST_VAR(screen, df::viewscreen_choose_start_sitest, Core::getTopViewscreen()); VIRTUAL_CAST_VAR(screen, df::viewscreen_choose_start_sitest, Core::getTopViewscreen());
@ -73,6 +76,17 @@ command_result rprobe (color_ostream &out, vector <string> & parameters)
return CR_FAILURE; return CR_FAILURE;
} }
if (parameters.size() == 1)
{
if (!screen->biome_highlighted)
{
return CR_WRONG_USAGE;
}
set = true;
to_set = screen->biome_idx;
set_val = atoi(parameters[0].c_str());
}
df::world_data *data = world->world_data; df::world_data *data = world->world_data;
coord2d cur_region = screen->region_pos; coord2d cur_region = screen->region_pos;
@ -80,10 +94,16 @@ command_result rprobe (color_ostream &out, vector <string> & parameters)
for (int i = 0; i < screen->biome_rgn.size(); i++) for (int i = 0; i < screen->biome_rgn.size(); i++)
{ {
coord2d rg = screen->biome_rgn[i]; coord2d rg = screen->biome_rgn[i];
out << i << ": x = " << rg.x << ", y = " << rg.y;
df::world_data::T_region_map* rd = &data->region_map[rg.x][rg.y]; df::world_data::T_region_map* rd = &data->region_map[rg.x][rg.y];
if (set && i == to_set) {
rd->evilness = set_val;
out << "* Set evilness to " << set_val << endl;
}
out << i << ": x = " << rg.x << ", y = " << rg.y;
out << out <<
" region_id: " << rd->region_id << " region_id: " << rd->region_id <<
" geo_index: " << rd->geo_index << " geo_index: " << rd->geo_index <<

@ -216,9 +216,18 @@ command_result df_probe (color_ostream &out, vector <string> & parameters)
df::world_data::T_region_map* biome = df::world_data::T_region_map* biome =
&world->world_data->region_map[region_pos.x][region_pos.y]; &world->world_data->region_map[region_pos.x][region_pos.y];
int sav = biome->savagery;
int evi = biome->evilness;
int sindex = sav > 65 ? 2 : sav < 33 ? 0 : 1;
int eindex = evi > 65 ? 2 : evi < 33 ? 0 : 1;
int surr = sindex + eindex * 3;
char* surroundings[] = { "Serene", "Mirthful", "Joyous Wilds", "Calm", "Wilderness", "Untamed Wilds", "Sinister", "Haunted", "Terrifying" };
// biome, geolayer // biome, geolayer
out << "biome: " << des.bits.biome << " (" << out << "biome: " << des.bits.biome << " (" <<
"region id=" << biome->region_id << ", " << "region id=" << biome->region_id << ", " <<
surroundings[surr] << ", " <<
"savagery " << biome->savagery << ", " << "savagery " << biome->savagery << ", " <<
"evilness " << biome->evilness << ")" << std::endl; "evilness " << biome->evilness << ")" << std::endl;
out << "geolayer: " << des.bits.geolayer_index out << "geolayer: " << des.bits.geolayer_index