|
|
@ -12,6 +12,7 @@ using namespace std;
|
|
|
|
#include <DFMemInfo.h>
|
|
|
|
#include <DFMemInfo.h>
|
|
|
|
#include <modules/Materials.h>
|
|
|
|
#include <modules/Materials.h>
|
|
|
|
#include <modules/Creatures.h>
|
|
|
|
#include <modules/Creatures.h>
|
|
|
|
|
|
|
|
#include <modules/Translation.h>
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
template <typename T>
|
|
|
|
void print_bits ( T val, std::ostream& out )
|
|
|
|
void print_bits ( T val, std::ostream& out )
|
|
|
@ -165,14 +166,16 @@ void printCreature(DFHack::API & DF, const DFHack::t_creature & creature)
|
|
|
|
cout << ", nick name: " << creature.name.nickname;
|
|
|
|
cout << ", nick name: " << creature.name.nickname;
|
|
|
|
addendl = true;
|
|
|
|
addendl = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
|
|
|
|
string transName = DF.TranslateName(creature.name,englishWords,foreignWords,false);
|
|
|
|
DFHack::Translation *Tran = DF.getTranslation();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string transName = Tran->TranslateName(creature.name,false);
|
|
|
|
if(!transName.empty())
|
|
|
|
if(!transName.empty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cout << ", trans name: " << transName;
|
|
|
|
cout << ", trans name: " << transName;
|
|
|
|
addendl=true;
|
|
|
|
addendl=true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
cout << ", likes: ";
|
|
|
|
cout << ", likes: ";
|
|
|
|
for(uint32_t i = 0;i<creature.numLikes; i++)
|
|
|
|
for(uint32_t i = 0;i<creature.numLikes; i++)
|
|
|
@ -189,11 +192,12 @@ void printCreature(DFHack::API & DF, const DFHack::t_creature & creature)
|
|
|
|
addendl = false;
|
|
|
|
addendl = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cout << "profession: " << mem->getProfession(creature.profession) << "(" << (int) creature.profession << ")";
|
|
|
|
cout << "profession: " << mem->getProfession(creature.profession) << "(" << (int) creature.profession << ")";
|
|
|
|
/*
|
|
|
|
|
|
|
|
if(creature.custom_profession[0])
|
|
|
|
if(creature.custom_profession[0])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cout << ", custom profession: " << creature.custom_profession;
|
|
|
|
cout << ", custom profession: " << creature.custom_profession;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
if(creature.current_job.active)
|
|
|
|
if(creature.current_job.active)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cout << ", current job: " << mem->getJob(creature.current_job.jobId);
|
|
|
|
cout << ", current job: " << mem->getJob(creature.current_job.jobId);
|
|
|
@ -297,6 +301,7 @@ void printCreature(DFHack::API & DF, const DFHack::t_creature & creature)
|
|
|
|
cout << "from the underworld, ";
|
|
|
|
cout << "from the underworld, ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cout << endl;
|
|
|
|
cout << endl;
|
|
|
|
|
|
|
|
#include <modules/Translation.h>
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
if(creature.flags1.bits.had_mood && (creature.mood == -1 || creature.mood == 8 ) )
|
|
|
|
if(creature.flags1.bits.had_mood && (creature.mood == -1 || creature.mood == 8 ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -325,6 +330,7 @@ int main (void)
|
|
|
|
|
|
|
|
|
|
|
|
DFHack::Creatures * Creatures = DF.getCreatures();
|
|
|
|
DFHack::Creatures * Creatures = DF.getCreatures();
|
|
|
|
DFHack::Materials * Materials = DF.getMaterials();
|
|
|
|
DFHack::Materials * Materials = DF.getMaterials();
|
|
|
|
|
|
|
|
DFHack::Translation * Tran = DF.getTranslation();
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t numCreatures;
|
|
|
|
uint32_t numCreatures;
|
|
|
|
if(!Creatures->Start(numCreatures))
|
|
|
|
if(!Creatures->Start(numCreatures))
|
|
|
@ -358,19 +364,19 @@ int main (void)
|
|
|
|
cerr << "Can't get the creature types." << endl;
|
|
|
|
cerr << "Can't get the creature types." << endl;
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
|
|
|
|
if(!DF.InitReadNameTables(englishWords,foreignWords))
|
|
|
|
if(!Tran->Start())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cerr << "Can't get name tables" << endl;
|
|
|
|
cerr << "Can't get name tables" << endl;
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
//DF.InitViewAndCursor();
|
|
|
|
//DF.InitViewAndCursor();
|
|
|
|
for(uint32_t i = 0; i < numCreatures; i++)
|
|
|
|
for(uint32_t i = 0; i < numCreatures; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DFHack::t_creature temp;
|
|
|
|
DFHack::t_creature temp;
|
|
|
|
Creatures->ReadCreature(i,temp);
|
|
|
|
Creatures->ReadCreature(i,temp);
|
|
|
|
//if(string(creaturestypes[temp.type].id) == "DWARF")
|
|
|
|
if(string(creaturestypes[temp.type].id) == "DWARF")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cout << "index " << i << " ";
|
|
|
|
cout << "index " << i << " ";
|
|
|
|
printCreature(DF,temp);
|
|
|
|
printCreature(DF,temp);
|
|
|
|