Add possibility to reveal hell without pausing.

develop
Petr Mrázek 2011-10-25 21:36:22 +02:00
parent 866b63f567
commit 70ebacead0
1 changed files with 17 additions and 4 deletions

@ -52,7 +52,8 @@ enum revealstate
{
NOT_REVEALED,
REVEALED,
SAFE_REVEALED
SAFE_REVEALED,
DEMON_REVEALED
};
revealstate revealed = NOT_REVEALED;
@ -70,7 +71,7 @@ DFhackCExport const char * plugin_name ( void )
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{
commands.clear();
commands.push_back(PluginCommand("reveal","Reveal the map. 'reveal hell' will also reveal hell.",reveal));
commands.push_back(PluginCommand("reveal","Reveal the map. 'reveal hell' will also reveal hell. 'reveal demon' won't pause.",reveal));
commands.push_back(PluginCommand("unreveal","Revert the map to its previous state.",unreveal));
commands.push_back(PluginCommand("revtoggle","Reveal/unreveal depending on state.",revtoggle));
commands.push_back(PluginCommand("revflood","Hide all, reveal all tiles reachable from cursor position.",revflood));
@ -101,6 +102,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c )
DFhackCExport command_result reveal(DFHack::Core * c, std::vector<std::string> & params)
{
bool no_hell = true;
bool pause = true;
for(int i = 0; i < params.size();i++)
{
if(params[i]=="hell")
@ -110,6 +112,7 @@ DFhackCExport command_result reveal(DFHack::Core * c, std::vector<std::string> &
c->con.print("Reveals the map, by default ignoring hell.\n"
"Options:\n"
"hell - also reveal hell, while forcing the game to pause.\n"
"demon - reveal hell, do not pause.\n"
);
return CR_OK;
}
@ -118,6 +121,11 @@ DFhackCExport command_result reveal(DFHack::Core * c, std::vector<std::string> &
{
no_hell = false;
}
if(params.size() && params[0] == "demon")
{
no_hell = false;
pause = false;
}
Console & con = c->con;
if(revealed != NOT_REVEALED)
{
@ -188,8 +196,13 @@ DFhackCExport command_result reveal(DFHack::Core * c, std::vector<std::string> &
}
else
{
revealed = REVEALED;
World->SetPauseState(true);
if(pause)
{
revealed = REVEALED;
World->SetPauseState(true);
}
else
revealed = DEMON_REVEALED;
}
c->Resume();
con.print("Map revealed.\n");