getType needs lots of work but its ok(ish). Mostly working .10 creature offsets

develop
Simon Jackson 2010-07-15 12:57:45 +01:00
parent 0256a19760
commit 1e7a705129
4 changed files with 69 additions and 2 deletions

@ -145,6 +145,7 @@ namespace DFHack
void ReadAllMaterials(void);
std::string getType(t_material & mat);
std::string getDescription(t_material & mat);
private:
class Private;

@ -202,7 +202,7 @@ bool Creatures::ReadCreature (const int32_t index, t_creature & furball)
// mood stuff
furball.mood = (int16_t) p->readWord (temp + offs.mood_offset);
furball.mood_skill = p->readWord (temp + offs.mood_skill_offset);
d->d->readName(furball.artifact_name, temp + offs.artifact_name_offset);
d->d->readName(furball.artifact_name, temp + offs.artifact_name_offset);
// custom profession
p->readSTLString(temp + offs.custom_profession_offset, furball.custom_profession, sizeof(furball.custom_profession));

@ -470,3 +470,53 @@ std::string Materials::getDescription(t_material & mat)
return out;
}
//type of material only so we know which vector to retrieve
std::string Materials::getType(t_material & mat)
{
if((mat.subIndex<419) || (mat.subIndex>618))
{
if((mat.subIndex<19) || (mat.subIndex>218))
{
if(mat.subIndex)
{
if(mat.subIndex>0x292)
{
return "unknown";
}
else
{
if(mat.subIndex>=this->other.size())
{
if(mat.subIndex<0)
return "any";
if(mat.subIndex>=this->raceEx.size())
return "unknown";
return "racex";
}
else
{
if (mat.index==-1)
return "other";
else
return "other derivate";
}
}
}
else
return "inorganic";
}
else
{
if (mat.index>=this->raceEx.size())
return "unknown";
return "racex extract";
}
}
else
{
return "organic";
}
}

@ -1685,7 +1685,23 @@ map_data_1b60_offset 0x1B9c
<!-- TODO: small offsets added all over the place, investigate -->
<String name="md5">1a85839ab03df082974dc5629d3fbc26</String>
<HexValue name="pe_timestamp">0x4C3897C0</HexValue>
<Address name="cursor_xyz">0xaff2d8</Address>0xaf12d0
<Address name="cursor_xyz">0xaff2d8</Address>
<Address name="language_vector">0x16D33CC</Address>
<Address name="translation_vector">0x16D33FC</Address>
<Offset name="word_table">0x4c</Offset>
Creatures
=========
<Address name="creature_vector">0x168E73C</Address>
<Address name="dwarf_race_index">0x014b9f1c</Address>
<Offset name="creature_soulskill_vector">0X1F4</Offset>
<Offset name="creature_physical">0x4AC</Offset>
<Offset name="creature_appearance_vector">0x64c</Offset> <!-- Maybe slightly wrong -->
<Offset name="creature_artifact_name">0x71c</Offset>
<Offset name="creature_labors">0x7Bc</Offset>
<Offset name="creature_soul_vector">0x0788</Offset>
<Offset name="creature_default_soul">0x07A0</Offset>
<Offset name="creature_happiness">0x87c</Offset>
</Entry>
<Entry version="v0.31.10" os="windows" id="0.31.10" base="0.31.09">
<String name="md5">349d1ad6eda7b6c5e87f8e4726a0999a</String>