2011-07-10 13:07:14 -06:00
|
|
|
#include <dfhack/Core.h>
|
|
|
|
#include <dfhack/Console.h>
|
|
|
|
#include <dfhack/Export.h>
|
|
|
|
#include <dfhack/PluginManager.h>
|
2011-07-11 14:23:13 -06:00
|
|
|
#include <dfhack/modules/Maps.h>
|
|
|
|
#include <dfhack/modules/Gui.h>
|
|
|
|
#include <dfhack/extra/MapExtras.h>
|
2011-07-10 13:07:14 -06:00
|
|
|
#include <vector>
|
2011-07-11 14:23:13 -06:00
|
|
|
#include <cstdio>
|
|
|
|
#include <stack>
|
2011-07-10 13:07:14 -06:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
using std::vector;
|
|
|
|
using std::string;
|
2011-07-11 14:23:13 -06:00
|
|
|
using std::stack;
|
2011-07-10 13:07:14 -06:00
|
|
|
using namespace DFHack;
|
|
|
|
|
|
|
|
DFhackCExport command_result vdig (Core * c, vector <string> & parameters);
|
2011-08-17 05:26:03 -06:00
|
|
|
DFhackCExport command_result vdigx (Core * c, vector <string> & parameters);
|
2011-07-11 14:23:13 -06:00
|
|
|
DFhackCExport command_result autodig (Core * c, vector <string> & parameters);
|
2011-08-17 05:26:03 -06:00
|
|
|
DFhackCExport command_result expdig (Core * c, vector <string> & parameters);
|
2011-08-22 07:18:35 -06:00
|
|
|
DFhackCExport command_result digcircle (Core *c, vector <string> & parameters);
|
|
|
|
|
2011-07-10 13:07:14 -06:00
|
|
|
|
|
|
|
DFhackCExport const char * plugin_name ( void )
|
|
|
|
{
|
2011-08-17 05:26:03 -06:00
|
|
|
return "vdig";
|
2011-07-10 13:07:14 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
|
|
|
|
{
|
|
|
|
commands.clear();
|
2011-08-17 05:26:03 -06:00
|
|
|
commands.push_back(PluginCommand("vdig","Dig a whole vein.",vdig));
|
|
|
|
commands.push_back(PluginCommand("vdigx","Dig a whole vein, follow vein through z-levels with stairs.",vdigx));
|
|
|
|
commands.push_back(PluginCommand("expdig","Select or designate an exploratory pattern. Use 'expdig ?' for help.",expdig));
|
2011-08-22 07:18:35 -06:00
|
|
|
commands.push_back(PluginCommand("digcircle","Dig desingate a circle (filled or hollow) with given radius.",digcircle));
|
2011-08-07 21:45:35 -06:00
|
|
|
//commands.push_back(PluginCommand("autodig","Mark a tile for continuous digging.",autodig));
|
2011-07-10 13:07:14 -06:00
|
|
|
return CR_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
DFhackCExport command_result plugin_shutdown ( Core * c )
|
|
|
|
{
|
|
|
|
return CR_OK;
|
|
|
|
}
|
2011-08-22 07:18:35 -06:00
|
|
|
|
|
|
|
template <class T>
|
|
|
|
bool from_string(T& t,
|
|
|
|
const std::string& s,
|
|
|
|
std::ios_base& (*f)(std::ios_base&))
|
|
|
|
{
|
|
|
|
std::istringstream iss(s);
|
|
|
|
return !(iss >> f >> t).fail();
|
|
|
|
}
|
|
|
|
|
|
|
|
enum circle_what
|
|
|
|
{
|
|
|
|
circle_set,
|
|
|
|
circle_unset,
|
|
|
|
};
|
|
|
|
|
|
|
|
DFhackCExport command_result digcircle (Core * c, vector <string> & parameters)
|
|
|
|
{
|
|
|
|
static bool filled = false;
|
|
|
|
static circle_what what = circle_set;
|
|
|
|
static int r = 0;
|
|
|
|
auto saved_r = r;
|
|
|
|
bool force_help = false;
|
|
|
|
for(int i = 0; i < parameters.size();i++)
|
|
|
|
{
|
|
|
|
if(parameters[i] == "help" || parameters[i] == "?")
|
|
|
|
{
|
|
|
|
force_help = true;
|
|
|
|
}
|
|
|
|
else if(parameters[i] == "hollow")
|
|
|
|
{
|
|
|
|
filled = false;
|
|
|
|
}
|
|
|
|
else if(parameters[i] == "filled")
|
|
|
|
{
|
|
|
|
filled = true;
|
|
|
|
}
|
|
|
|
else if(parameters[i] == "set")
|
|
|
|
{
|
|
|
|
what = circle_set;
|
|
|
|
}
|
|
|
|
else if(parameters[i] == "unset")
|
|
|
|
{
|
|
|
|
what = circle_unset;
|
|
|
|
}
|
|
|
|
else if (!from_string(r,parameters[i], std::dec))
|
|
|
|
{
|
|
|
|
r = saved_r;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(r < 0)
|
|
|
|
r = -r;
|
|
|
|
if(force_help || r == 0)
|
|
|
|
{
|
|
|
|
c->con.print( "A command for easy designation of filled and hollow circles.\n"
|
|
|
|
"\n"
|
|
|
|
"Options:\n"
|
|
|
|
" hollow = Set the circle to hollow (default)\n"
|
|
|
|
" filled = Set the circle to filled\n"
|
|
|
|
" set = set designation\n"
|
|
|
|
" unset = unset current designation\n"
|
|
|
|
" # = radius in tiles (default = 0)\n"
|
|
|
|
"\n"
|
|
|
|
"After you have set the options, the command called with no options\n"
|
|
|
|
"repeats with the last selected parameters:\n"
|
|
|
|
"'digcircle filled 3' = Dig a filled circle with radius = 3.\n"
|
|
|
|
"'digcircle' = Do it again.\n"
|
|
|
|
);
|
|
|
|
return CR_OK;
|
|
|
|
}
|
|
|
|
int32_t cx, cy, cz;
|
|
|
|
c->Suspend();
|
|
|
|
Gui * gui = c->getGui();
|
|
|
|
Maps * maps = c->getMaps();
|
|
|
|
if(!maps->Start())
|
|
|
|
{
|
|
|
|
c->Resume();
|
|
|
|
c->con.printerr("Can't init the map...\n");
|
|
|
|
return CR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t x_max, y_max, z_max;
|
|
|
|
maps->getSize(x_max,y_max,z_max);
|
|
|
|
|
|
|
|
MapExtras::MapCache MCache (maps);
|
|
|
|
if(!gui->getCursorCoords(cx,cy,cz) || cx == -30000)
|
|
|
|
{
|
|
|
|
c->Resume();
|
|
|
|
c->con.printerr("Can't get the cursor coords...\n");
|
|
|
|
return CR_FAILURE;
|
|
|
|
}
|
|
|
|
auto dig = [&](int32_t x, int32_t y, int32_t z) -> bool
|
|
|
|
{
|
|
|
|
DFCoord at (x,y,z);
|
|
|
|
auto b = MCache.BlockAt(at/16);
|
|
|
|
if(!b || !b->valid)
|
|
|
|
return false;
|
|
|
|
if(x == 0 || x == x_max - 1)
|
|
|
|
return false;
|
|
|
|
if(y == 0 || y == y_max - 1)
|
|
|
|
return false;
|
|
|
|
uint16_t tt = MCache.tiletypeAt(at);
|
|
|
|
t_designation des = MCache.designationAt(at);
|
|
|
|
// could be potentially used to locate hidden constructions?
|
|
|
|
if(tileMaterial(tt) == CONSTRUCTED && !des.bits.hidden)
|
|
|
|
return false;
|
|
|
|
if(!isWallTerrain(tt) && !des.bits.hidden)
|
|
|
|
return false;
|
|
|
|
switch(what)
|
|
|
|
{
|
|
|
|
case circle_set:
|
|
|
|
if(des.bits.dig == designation_no)
|
|
|
|
{
|
|
|
|
des.bits.dig = designation_default;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case circle_unset:
|
|
|
|
if (des.bits.dig == designation_default)
|
|
|
|
{
|
|
|
|
des.bits.dig = designation_no;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
MCache.setDesignationAt(at,des);
|
|
|
|
return true;
|
|
|
|
};
|
|
|
|
auto lineX = [&](int32_t y1, int32_t y2, int32_t x, int32_t z) -> bool
|
|
|
|
{
|
|
|
|
for(int32_t y = y1; y <= y2; y++)
|
|
|
|
{
|
|
|
|
dig(x,y,z);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
};
|
|
|
|
auto lineY = [&](int32_t x1, int32_t x2, int32_t y, int32_t z) -> bool
|
|
|
|
{
|
|
|
|
for(int32_t x = x1; x <= x2; x++)
|
|
|
|
{
|
|
|
|
dig(x,y,z);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
};
|
|
|
|
int f = 1 - r;
|
|
|
|
int ddF_x = 1;
|
|
|
|
int ddF_y = -2 * r;
|
|
|
|
int x = 0;
|
|
|
|
int y = r;
|
|
|
|
if(!filled)
|
|
|
|
{
|
|
|
|
dig(cx, cy + r, cz);
|
|
|
|
dig(cx, cy - r, cz);
|
|
|
|
dig(cx + r, cy, cz);
|
|
|
|
dig(cx - r, cy, cz);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
lineX(cy-r, cy+r, cx, cz);
|
|
|
|
lineY(cx-r, cx+r, cy, cz);
|
|
|
|
}
|
|
|
|
|
|
|
|
while(x < y)
|
|
|
|
{
|
|
|
|
// ddF_x == 2 * x + 1;
|
|
|
|
// ddF_y == -2 * y;
|
|
|
|
// f == x*x + y*y - radius*radius + 2*x - y + 1;
|
|
|
|
if(f >= 0)
|
|
|
|
{
|
|
|
|
y--;
|
|
|
|
ddF_y += 2;
|
|
|
|
f += ddF_y;
|
|
|
|
}
|
|
|
|
x++;
|
|
|
|
ddF_x += 2;
|
|
|
|
f += ddF_x;
|
|
|
|
if(!filled)
|
|
|
|
{
|
|
|
|
dig(cx + x, cy + y, cz);
|
|
|
|
dig(cx - x, cy + y, cz);
|
|
|
|
dig(cx + x, cy - y, cz);
|
|
|
|
dig(cx - x, cy - y, cz);
|
|
|
|
dig(cx + y, cy + x, cz);
|
|
|
|
dig(cx - y, cy + x, cz);
|
|
|
|
dig(cx + y, cy - x, cz);
|
|
|
|
dig(cx - y, cy - x, cz);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
lineY(cx-x, cx+x, cy+y, cz);
|
|
|
|
lineY(cx-x, cx+x, cy-y, cz);
|
|
|
|
lineY(cx-y, cx+y, cy+x, cz);
|
|
|
|
lineY(cx-y, cx+y, cy-x, cz);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
int x = -r, y = 0, err = 2-2*r; // 2. quadrant
|
|
|
|
do
|
|
|
|
{
|
|
|
|
dig(cx-x, cy+y, cz); // 1. quadrant
|
|
|
|
dig(cx-y, cy-x, cz); // 2. quadrant
|
|
|
|
dig(cx+x, cy-y, cz); // 3. quadrant
|
|
|
|
dig(cx+y, cy+x, cz); // 4. quadrant
|
|
|
|
r = err;
|
|
|
|
if (r > x)
|
|
|
|
{
|
|
|
|
err += ++x*2+1; // e_xy+e_x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,0,0,0,0,0,0,0,0,0,0},
|
|
|
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
|
|
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
|
|
|
};
|
2011-08-17 05:26:03 -06:00
|
|
|
enum explo_how
|
|
|
|
{
|
|
|
|
EXPLO_NOTHING,
|
|
|
|
EXPLO_DIAG5,
|
|
|
|
EXPLO_LADDER,
|
|
|
|
EXPLO_CLEAR,
|
2011-08-17 06:27:24 -06:00
|
|
|
EXPLO_CROSS,
|
2011-08-17 05:26:03 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
enum explo_what
|
|
|
|
{
|
|
|
|
EXPLO_ALL,
|
|
|
|
EXPLO_HIDDEN,
|
|
|
|
EXPLO_DESIGNATED,
|
|
|
|
};
|
|
|
|
|
|
|
|
DFhackCExport command_result expdig (Core * c, vector <string> & parameters)
|
|
|
|
{
|
|
|
|
bool force_help = false;
|
|
|
|
static explo_how how = EXPLO_NOTHING;
|
|
|
|
static explo_what what = EXPLO_HIDDEN;
|
|
|
|
for(int i = 0; i < parameters.size();i++)
|
|
|
|
{
|
|
|
|
if(parameters[i] == "help" || parameters[i] == "?")
|
|
|
|
{
|
|
|
|
force_help = true;
|
|
|
|
}
|
|
|
|
else if(parameters[i] == "all")
|
|
|
|
{
|
|
|
|
what = EXPLO_ALL;
|
|
|
|
}
|
|
|
|
else if(parameters[i] == "hidden")
|
|
|
|
{
|
|
|
|
what = EXPLO_HIDDEN;
|
|
|
|
}
|
|
|
|
else if(parameters[i] == "designated")
|
|
|
|
{
|
|
|
|
what = EXPLO_DESIGNATED;
|
|
|
|
}
|
|
|
|
else if(parameters[i] == "diag5")
|
|
|
|
{
|
|
|
|
how = EXPLO_DIAG5;
|
|
|
|
}
|
|
|
|
else if(parameters[i] == "clear")
|
|
|
|
{
|
|
|
|
how = EXPLO_CLEAR;
|
|
|
|
}
|
|
|
|
else if(parameters[i] == "ladder")
|
|
|
|
{
|
|
|
|
how = EXPLO_LADDER;
|
|
|
|
}
|
2011-08-17 06:27:24 -06:00
|
|
|
else if(parameters[i] == "cross")
|
|
|
|
{
|
|
|
|
how = EXPLO_CROSS;
|
|
|
|
}
|
2011-08-17 05:26:03 -06:00
|
|
|
}
|
|
|
|
if(force_help || how == EXPLO_NOTHING)
|
|
|
|
{
|
|
|
|
c->con.print("This command can be used for exploratory mining.\n"
|
|
|
|
"http://df.magmawiki.com/index.php/DF2010:Exploratory_mining\n"
|
|
|
|
"\n"
|
|
|
|
"There are two variables that can be set: pattern and filter.\n"
|
|
|
|
"Patterns:\n"
|
|
|
|
" diag5 = diagonals separated by 5 tiles\n"
|
|
|
|
" ladder = A 'ladder' pattern\n"
|
|
|
|
" clear = Just remove all dig designations\n"
|
2011-08-17 06:27:24 -06:00
|
|
|
" cross = A cross, exactly in the middle of the map.\n"
|
2011-08-17 05:26:03 -06:00
|
|
|
"Filters:\n"
|
|
|
|
" all = designate whole z-level\n"
|
|
|
|
" hidden = designate only hidden tiles of z-level (default)\n"
|
|
|
|
" designated = Take current designation and apply pattern to it.\n"
|
|
|
|
"\n"
|
|
|
|
"After you have a pattern set, you can use 'expdig' to apply it:\n"
|
|
|
|
"'expdig diag5 hidden' = set filter to hidden, pattern to diag5.\n"
|
|
|
|
"'expdig' = apply the pattern with filter.\n"
|
|
|
|
);
|
|
|
|
return CR_OK;
|
|
|
|
}
|
|
|
|
c->Suspend();
|
|
|
|
Gui * gui = c->getGui();
|
|
|
|
Maps * maps = c->getMaps();
|
|
|
|
uint32_t x_max, y_max, z_max;
|
|
|
|
if(!maps->Start())
|
|
|
|
{
|
|
|
|
c->Resume();
|
|
|
|
c->con.printerr("Can't init the map...\n");
|
|
|
|
return CR_FAILURE;
|
|
|
|
}
|
|
|
|
maps->getSize(x_max,y_max,z_max);
|
|
|
|
int32_t xzzz,yzzz,z_level;
|
|
|
|
if(!gui->getViewCoords(xzzz,yzzz,z_level))
|
|
|
|
{
|
|
|
|
c->Resume();
|
|
|
|
c->con.printerr("Can't get view coords...\n");
|
|
|
|
return CR_FAILURE;
|
|
|
|
}
|
|
|
|
auto apply = [&](uint32_t bx, uint32_t by, digmask & dm) -> bool
|
|
|
|
{
|
|
|
|
df_block * bl = maps->getBlock(bx,by,z_level);
|
|
|
|
if(!bl)
|
|
|
|
return false;
|
|
|
|
int x = 0,mx = 16;
|
|
|
|
if(bx == 0)
|
|
|
|
x = 1;
|
|
|
|
if(bx == x_max - 1)
|
|
|
|
mx = 15;
|
|
|
|
for(; x < mx; x++)
|
|
|
|
{
|
|
|
|
int y = 0,my = 16;
|
|
|
|
if(by == 0)
|
|
|
|
y = 1;
|
|
|
|
if(by == y_max - 1)
|
|
|
|
my = 15;
|
|
|
|
for(; y < my; y++)
|
|
|
|
{
|
|
|
|
naked_designation & des = bl->designation[x][y].bits;
|
|
|
|
short unsigned int tt = bl->tiletype[x][y];
|
|
|
|
// could be potentially used to locate hidden constructions?
|
|
|
|
if(tileMaterial(tt) == CONSTRUCTED && !des.hidden)
|
|
|
|
continue;
|
|
|
|
if(!isWallTerrain(tt) && !des.hidden)
|
|
|
|
continue;
|
|
|
|
if(how == EXPLO_CLEAR)
|
|
|
|
{
|
|
|
|
des.dig = designation_no;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if(dm[y][x])
|
|
|
|
{
|
|
|
|
if(what == EXPLO_ALL
|
|
|
|
|| des.dig == designation_default && what == EXPLO_DESIGNATED
|
|
|
|
|| des.hidden && what == EXPLO_HIDDEN)
|
|
|
|
{
|
|
|
|
des.dig = designation_default;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(what == EXPLO_DESIGNATED)
|
|
|
|
{
|
|
|
|
des.dig = designation_no;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bl->flags.set(BLOCK_DESIGNATED);
|
|
|
|
return true;
|
|
|
|
};
|
|
|
|
if(how == EXPLO_DIAG5)
|
|
|
|
{
|
|
|
|
int which;
|
|
|
|
for(uint32_t x = 0; x < x_max; x++)
|
|
|
|
{
|
|
|
|
for(int32_t y = 0 ; y < y_max; y++)
|
|
|
|
{
|
|
|
|
which = (4*x + y) % 5;
|
|
|
|
apply(x,y_max - 1 - y,diag5[which]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(how == EXPLO_LADDER)
|
|
|
|
{
|
|
|
|
int which;
|
|
|
|
for(uint32_t x = 0; x < x_max; x++)
|
|
|
|
{
|
|
|
|
which = x % 3;
|
|
|
|
for(int32_t y = 0 ; y < y_max; y++)
|
|
|
|
{
|
|
|
|
apply(x,y,ladder[which]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-08-17 06:27:24 -06:00
|
|
|
else if(how == EXPLO_CROSS)
|
|
|
|
{
|
|
|
|
// middle + recentering for the image
|
|
|
|
int xmid = x_max * 8 - 8;
|
|
|
|
int ymid = y_max * 8 - 8;
|
|
|
|
MapExtras::MapCache mx (maps);
|
|
|
|
for(int x = 0; x < 16; x++)
|
|
|
|
for(int y = 0; y < 16; y++)
|
|
|
|
{
|
|
|
|
DFCoord pos(xmid+x,ymid+y,z_level);
|
|
|
|
short unsigned int tt = mx.tiletypeAt(pos);
|
|
|
|
if(tt == 0)
|
|
|
|
continue;
|
|
|
|
t_designation des = mx.designationAt(pos);
|
2011-08-17 06:29:30 -06:00
|
|
|
if(tileMaterial(tt) == CONSTRUCTED && !des.bits.hidden)
|
|
|
|
continue;
|
|
|
|
if(!isWallTerrain(tt) && !des.bits.hidden)
|
|
|
|
continue;
|
2011-08-17 06:27:24 -06:00
|
|
|
if(cross[y][x])
|
|
|
|
{
|
|
|
|
des.bits.dig = designation_default;
|
|
|
|
mx.setDesignationAt(pos,des);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
mx.WriteAll();
|
|
|
|
}
|
2011-08-17 05:26:03 -06:00
|
|
|
else for(uint32_t x = 0; x < x_max; x++)
|
|
|
|
for(int32_t y = 0 ; y < y_max; y++)
|
|
|
|
apply(x,y,all_tiles);
|
|
|
|
c->Resume();
|
|
|
|
return CR_OK;
|
|
|
|
}
|
|
|
|
DFhackCExport command_result vdigx (Core * c, vector <string> & parameters)
|
|
|
|
{
|
|
|
|
for(int i = 0; i < parameters.size();i++)
|
|
|
|
{
|
|
|
|
if(parameters[i] == "help" || parameters[i] == "?")
|
|
|
|
{
|
|
|
|
c->con.print("Designates a whole vein under the cursor for digging.\n"
|
|
|
|
"Also follows the vein between z-levels with stairs, like 'vdig x' would.\n"
|
|
|
|
);
|
|
|
|
return CR_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
vector <string> lol;
|
|
|
|
lol.push_back("x");
|
|
|
|
return vdig(c,lol);
|
|
|
|
}
|
2011-07-10 13:07:14 -06:00
|
|
|
|
|
|
|
DFhackCExport command_result vdig (Core * c, vector <string> & parameters)
|
|
|
|
{
|
2011-07-11 14:23:13 -06:00
|
|
|
uint32_t x_max,y_max,z_max;
|
|
|
|
bool updown = false;
|
2011-08-14 00:42:21 -06:00
|
|
|
for(int i = 0; i < parameters.size();i++)
|
|
|
|
{
|
|
|
|
if(parameters.size() && parameters[0]=="x")
|
|
|
|
updown = true;
|
|
|
|
else if(parameters[i] == "help" || parameters[i] == "?")
|
|
|
|
{
|
|
|
|
c->con.print("Designates a whole vein under the cursor for digging.\n"
|
|
|
|
"Options:\n"
|
|
|
|
"x - follow veins through z-levels with stairs.\n"
|
|
|
|
);
|
|
|
|
return CR_OK;
|
|
|
|
}
|
|
|
|
}
|
2011-07-11 14:23:13 -06:00
|
|
|
|
2011-07-13 20:05:27 -06:00
|
|
|
Console & con = c->con;
|
|
|
|
|
2011-07-11 14:23:13 -06:00
|
|
|
c->Suspend();
|
|
|
|
DFHack::Maps * Maps = c->getMaps();
|
|
|
|
DFHack::Gui * Gui = c->getGui();
|
|
|
|
// init the map
|
|
|
|
if(!Maps->Start())
|
|
|
|
{
|
2011-07-15 07:55:01 -06:00
|
|
|
con.printerr("Can't init map. Make sure you have a map loaded in DF.\n");
|
2011-07-11 14:23:13 -06:00
|
|
|
c->Resume();
|
|
|
|
return CR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
int32_t cx, cy, cz;
|
|
|
|
Maps->getSize(x_max,y_max,z_max);
|
|
|
|
uint32_t tx_max = x_max * 16;
|
|
|
|
uint32_t ty_max = y_max * 16;
|
|
|
|
Gui->getCursorCoords(cx,cy,cz);
|
|
|
|
while(cx == -30000)
|
|
|
|
{
|
2011-07-15 07:55:01 -06:00
|
|
|
con.printerr("Cursor is not active. Point the cursor at a vein.\n");
|
2011-07-11 14:23:13 -06:00
|
|
|
c->Resume();
|
|
|
|
return CR_FAILURE;
|
|
|
|
}
|
|
|
|
DFHack::DFCoord xy ((uint32_t)cx,(uint32_t)cy,cz);
|
|
|
|
if(xy.x == 0 || xy.x == tx_max - 1 || xy.y == 0 || xy.y == ty_max - 1)
|
|
|
|
{
|
2011-07-15 07:55:01 -06:00
|
|
|
con.printerr("I won't dig the borders. That would be cheating!\n");
|
2011-07-11 14:23:13 -06:00
|
|
|
c->Resume();
|
|
|
|
return CR_FAILURE;
|
|
|
|
}
|
|
|
|
MapExtras::MapCache * MCache = new MapExtras::MapCache(Maps);
|
|
|
|
DFHack::t_designation des = MCache->designationAt(xy);
|
|
|
|
int16_t tt = MCache->tiletypeAt(xy);
|
|
|
|
int16_t veinmat = MCache->veinMaterialAt(xy);
|
|
|
|
if( veinmat == -1 )
|
|
|
|
{
|
2011-07-15 07:55:01 -06:00
|
|
|
con.printerr("This tile is not a vein.\n");
|
2011-07-11 14:23:13 -06:00
|
|
|
delete MCache;
|
|
|
|
c->Resume();
|
|
|
|
return CR_FAILURE;
|
|
|
|
}
|
2011-07-13 20:05:27 -06:00
|
|
|
con.print("%d/%d/%d tiletype: %d, veinmat: %d, designation: 0x%x ... DIGGING!\n", cx,cy,cz, tt, veinmat, des.whole);
|
2011-07-11 14:23:13 -06:00
|
|
|
stack <DFHack::DFCoord> flood;
|
|
|
|
flood.push(xy);
|
|
|
|
|
|
|
|
while( !flood.empty() )
|
|
|
|
{
|
|
|
|
DFHack::DFCoord current = flood.top();
|
|
|
|
flood.pop();
|
|
|
|
int16_t vmat2 = MCache->veinMaterialAt(current);
|
|
|
|
tt = MCache->tiletypeAt(current);
|
|
|
|
if(!DFHack::isWallTerrain(tt))
|
|
|
|
continue;
|
|
|
|
if(vmat2!=veinmat)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
// found a good tile, dig+unset material
|
|
|
|
DFHack::t_designation des = MCache->designationAt(current);
|
|
|
|
DFHack::t_designation des_minus;
|
|
|
|
DFHack::t_designation des_plus;
|
|
|
|
des_plus.whole = des_minus.whole = 0;
|
|
|
|
int16_t vmat_minus = -1;
|
|
|
|
int16_t vmat_plus = -1;
|
|
|
|
bool below = 0;
|
|
|
|
bool above = 0;
|
|
|
|
if(updown)
|
|
|
|
{
|
|
|
|
if(MCache->testCoord(current-1))
|
|
|
|
{
|
|
|
|
below = 1;
|
|
|
|
des_minus = MCache->designationAt(current-1);
|
|
|
|
vmat_minus = MCache->veinMaterialAt(current-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(MCache->testCoord(current+1))
|
|
|
|
{
|
|
|
|
above = 1;
|
|
|
|
des_plus = MCache->designationAt(current+1);
|
|
|
|
vmat_plus = MCache->veinMaterialAt(current+1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(MCache->testCoord(current))
|
|
|
|
{
|
|
|
|
MCache->clearMaterialAt(current);
|
|
|
|
if(current.x < tx_max - 2)
|
|
|
|
{
|
|
|
|
flood.push(DFHack::DFCoord(current.x + 1, current.y, current.z));
|
|
|
|
if(current.y < ty_max - 2)
|
|
|
|
{
|
|
|
|
flood.push(DFHack::DFCoord(current.x + 1, current.y + 1,current.z));
|
|
|
|
flood.push(DFHack::DFCoord(current.x, current.y + 1,current.z));
|
|
|
|
}
|
|
|
|
if(current.y > 1)
|
|
|
|
{
|
|
|
|
flood.push(DFHack::DFCoord(current.x + 1, current.y - 1,current.z));
|
|
|
|
flood.push(DFHack::DFCoord(current.x, current.y - 1,current.z));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(current.x > 1)
|
|
|
|
{
|
|
|
|
flood.push(DFHack::DFCoord(current.x - 1, current.y,current.z));
|
|
|
|
if(current.y < ty_max - 2)
|
|
|
|
{
|
|
|
|
flood.push(DFHack::DFCoord(current.x - 1, current.y + 1,current.z));
|
|
|
|
flood.push(DFHack::DFCoord(current.x, current.y + 1,current.z));
|
|
|
|
}
|
|
|
|
if(current.y > 1)
|
|
|
|
{
|
|
|
|
flood.push(DFHack::DFCoord(current.x - 1, current.y - 1,current.z));
|
|
|
|
flood.push(DFHack::DFCoord(current.x, current.y - 1,current.z));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(updown)
|
|
|
|
{
|
|
|
|
if(current.z > 0 && below && vmat_minus == vmat2)
|
|
|
|
{
|
|
|
|
flood.push(current-1);
|
|
|
|
|
|
|
|
if(des_minus.bits.dig == DFHack::designation_d_stair)
|
|
|
|
des_minus.bits.dig = DFHack::designation_ud_stair;
|
|
|
|
else
|
|
|
|
des_minus.bits.dig = DFHack::designation_u_stair;
|
|
|
|
MCache->setDesignationAt(current-1,des_minus);
|
|
|
|
|
|
|
|
des.bits.dig = DFHack::designation_d_stair;
|
|
|
|
}
|
|
|
|
if(current.z < z_max - 1 && above && vmat_plus == vmat2)
|
|
|
|
{
|
|
|
|
flood.push(current+ 1);
|
|
|
|
|
|
|
|
if(des_plus.bits.dig == DFHack::designation_u_stair)
|
|
|
|
des_plus.bits.dig = DFHack::designation_ud_stair;
|
|
|
|
else
|
|
|
|
des_plus.bits.dig = DFHack::designation_d_stair;
|
|
|
|
MCache->setDesignationAt(current+1,des_plus);
|
|
|
|
|
|
|
|
if(des.bits.dig == DFHack::designation_d_stair)
|
|
|
|
des.bits.dig = DFHack::designation_ud_stair;
|
|
|
|
else
|
|
|
|
des.bits.dig = DFHack::designation_u_stair;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(des.bits.dig == DFHack::designation_no)
|
|
|
|
des.bits.dig = DFHack::designation_default;
|
|
|
|
MCache->setDesignationAt(current,des);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MCache->WriteAll();
|
|
|
|
c->Resume();
|
2011-07-10 13:07:14 -06:00
|
|
|
return CR_OK;
|
|
|
|
}
|
2011-07-11 14:23:13 -06:00
|
|
|
|
|
|
|
DFhackCExport command_result autodig (Core * c, vector <string> & parameters)
|
|
|
|
{
|
2011-07-12 04:13:14 -06:00
|
|
|
return CR_NOT_IMPLEMENTED;
|
2011-07-11 14:23:13 -06:00
|
|
|
}
|