|
|
|
@ -10,11 +10,14 @@ using namespace std;
|
|
|
|
|
#include <DFHackAPI.h>
|
|
|
|
|
#include <modules/Maps.h>
|
|
|
|
|
#include <modules/Position.h>
|
|
|
|
|
#include <DFTileTypes.h>
|
|
|
|
|
|
|
|
|
|
int main (void)
|
|
|
|
|
{
|
|
|
|
|
int32_t x,y,z;
|
|
|
|
|
DFHack::designations40d designations;
|
|
|
|
|
DFHack::tiletypes40d tiles;
|
|
|
|
|
uint32_t x_max,y_max,z_max;
|
|
|
|
|
|
|
|
|
|
DFHack::API DF("Memory.xml");
|
|
|
|
|
DFHack::Maps * Maps;
|
|
|
|
@ -41,6 +44,7 @@ int main (void)
|
|
|
|
|
int amount = 7;
|
|
|
|
|
while(!end)
|
|
|
|
|
{
|
|
|
|
|
Maps->getSize(x_max,y_max,z_max);
|
|
|
|
|
DF.Resume();
|
|
|
|
|
string command = "";
|
|
|
|
|
cout <<"[" << mode << ":" << amount << ":" << flowmode << "]# ";
|
|
|
|
@ -50,6 +54,7 @@ int main (void)
|
|
|
|
|
cout << "Modes:" << endl
|
|
|
|
|
<< "m - switch to magma" << endl
|
|
|
|
|
<< "w - switch to water" << endl
|
|
|
|
|
<< "o - make obsidian wall instead" << endl
|
|
|
|
|
<< "f - flow bits only" << endl
|
|
|
|
|
<< "Properties:" << endl
|
|
|
|
|
<< "f+ - make the spawned liquid flow" << endl
|
|
|
|
@ -72,6 +77,14 @@ int main (void)
|
|
|
|
|
{
|
|
|
|
|
mode = "magma";
|
|
|
|
|
}
|
|
|
|
|
else if(command == "o")
|
|
|
|
|
{
|
|
|
|
|
mode = "obsidian";
|
|
|
|
|
}
|
|
|
|
|
else if(command == "clmn")
|
|
|
|
|
{
|
|
|
|
|
mode = "column";
|
|
|
|
|
}
|
|
|
|
|
else if(command == "w")
|
|
|
|
|
{
|
|
|
|
|
mode = "water";
|
|
|
|
@ -142,8 +155,32 @@ int main (void)
|
|
|
|
|
cout << "Not a valid block." << endl;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if(mode == "obsidian")
|
|
|
|
|
{
|
|
|
|
|
Maps->ReadTileTypes((x/16),(y/16),z, &tiles);
|
|
|
|
|
tiles[x%16][y%16] = 331;
|
|
|
|
|
Maps->WriteTileTypes((x/16),(y/16),z, &tiles);
|
|
|
|
|
}
|
|
|
|
|
else if(mode == "column")
|
|
|
|
|
{
|
|
|
|
|
int zzz = z;
|
|
|
|
|
int16_t tile;
|
|
|
|
|
while ( zzz < z_max )
|
|
|
|
|
{
|
|
|
|
|
Maps->ReadTileTypes((x/16),(y/16),zzz, &tiles);
|
|
|
|
|
tile = tiles[x%16][y%16];
|
|
|
|
|
if (DFHack::tileTypeTable[tile].c == DFHack::WALL)
|
|
|
|
|
break;
|
|
|
|
|
tiles[x%16][y%16] = 331;
|
|
|
|
|
Maps->WriteTileTypes((x/16),(y/16),zzz, &tiles);
|
|
|
|
|
zzz++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// place the magma
|
|
|
|
|
Maps->ReadDesignations((x/16),(y/16),z, &designations);
|
|
|
|
|
|
|
|
|
|
if(brush == "point")
|
|
|
|
|
{
|
|
|
|
|
if(mode != "flowbits")
|
|
|
|
@ -166,6 +203,7 @@ int main (void)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Maps->WriteDesignations(x/16,y/16,z, &designations);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// make the magma flow :)
|
|
|
|
|
DFHack::t_blockflags bflags;
|
|
|
|
|