*VERY* Specific Blood

develop
Petr Mrázek 2010-04-07 23:56:23 +02:00
parent 62fc5bd677
commit 13571a9bde
1 changed files with 87 additions and 0 deletions

@ -24,6 +24,81 @@ using namespace std;
using namespace DFHack; using namespace DFHack;
void PrintSplatterType (int16_t mat1, int32_t mat2, vector<t_matgloss> creature_types)
{
switch (mat1)
{
case 0:
cout <<"Rock";
break;
case 1:
cout <<"Amber";
break;
case 2:
cout <<"Coral";
break;
case 3:
cout <<"Green Glass";
break;
case 4:
cout <<"Clear Glass";
break;
case 5:
cout <<"Crystal Glass";
break;
case 6:
cout <<"Ice";
break;
case 7:
cout <<"Coal";
break;
case 8:
cout <<"Potash";
break;
case 9:
cout <<"Ash";
break;
case 10:
cout <<"Pearlash";
break;
case 11:
cout <<"Lye";
break;
case 12:
cout <<"Mud";
break;
case 13:
cout <<"Vomit";
break;
case 14:
cout <<"Salt";
break;
case 15:
cout <<"Filth";
break;
case 16:
cout <<"Frozen? Filth";
break;
case 18:
cout <<"Grime";
break;
case 0xF2:
cout << "Very Specific Blood (references a named creature)";
break;
case 0x2A:
case 0x2B:
if(mat2 != -1)
{
cout << creature_types[mat2].id << " ";
}
cout<<"Blood";
break;
default:
cout <<"Unknown";
break;
}
}
char shades[10] = {'#','$','O','=','+','|','-','^','.',' '}; char shades[10] = {'#','$','O','=','+','|','-','^','.',' '};
int main (int numargs, const char ** args) int main (int numargs, const char ** args)
{ {
@ -49,6 +124,11 @@ int main (int numargs, const char ** args)
DFHack::Maps *Maps =DF.getMaps(); DFHack::Maps *Maps =DF.getMaps();
DFHack::Position *Pos =DF.getPosition(); DFHack::Position *Pos =DF.getPosition();
DFHack::Materials *Mats =DF.getMaterials();
vector<t_matgloss> creature_types;
Mats->ReadCreatureTypes(creature_types);
// init the map // init the map
if(!Maps->Start()) if(!Maps->Start())
{ {
@ -58,6 +138,7 @@ int main (int numargs, const char ** args)
#endif #endif
return 1; return 1;
} }
int32_t cx, cy, cz; int32_t cx, cy, cz;
Maps->getSize(x_max,y_max,z_max); Maps->getSize(x_max,y_max,z_max);
Pos->getCursorCoords(cx,cy,cz); Pos->getCursorCoords(cx,cy,cz);
@ -77,6 +158,9 @@ int main (int numargs, const char ** args)
for(int i = 0; i < splatter.size(); i++) for(int i = 0; i < splatter.size(); i++)
{ {
printf("Splatter %d\nmat1: %d\nunknown: %d\nmat2: %d\nmat3: %d\n",i,splatter[i].mat1,splatter[i].unk1,splatter[i].mat2,splatter[i].mat3); printf("Splatter %d\nmat1: %d\nunknown: %d\nmat2: %d\nmat3: %d\n",i,splatter[i].mat1,splatter[i].unk1,splatter[i].mat2,splatter[i].mat3);
PrintSplatterType(splatter[i].mat1,splatter[i].mat2,creature_types);
cout << endl;
printf("Address 0x%08x\n",splatter[i].address_of);
for(uint32_t yyy = 0; yyy < 16; yyy++) for(uint32_t yyy = 0; yyy < 16; yyy++)
{ {
cout << "|"; cout << "|";
@ -110,6 +194,9 @@ int main (int numargs, const char ** args)
for(int i = 0; i < splatter.size(); i++) for(int i = 0; i < splatter.size(); i++)
{ {
printf("Splatter %d\nmat1: %d\nunknown: %d\nmat2: %d\nmat3: %d\n",i,splatter[i].mat1,splatter[i].unk1,splatter[i].mat2,splatter[i].mat3); printf("Splatter %d\nmat1: %d\nunknown: %d\nmat2: %d\nmat3: %d\n",i,splatter[i].mat1,splatter[i].unk1,splatter[i].mat2,splatter[i].mat3);
PrintSplatterType(splatter[i].mat1,splatter[i].mat2,creature_types);
cout << endl;
printf("Address 0x%08x\n",splatter[i].address_of);
for(uint32_t y = 0; y < 16; y++) for(uint32_t y = 0; y < 16; y++)
{ {
cout << "|"; cout << "|";