Gems are now properly detected in prospector. Nuked some legacy garbage.

develop
Petr Mrázek 2011-09-24 06:48:06 +02:00
parent 986a3e0f56
commit dc81367a68
4 changed files with 167 additions and 355 deletions

@ -872,72 +872,9 @@
<Address name="vector"/> <Address name="vector"/>
<Address name="current_race" description="Index of the current player race." /> <Address name="current_race" description="Index of the current player race." />
<Address name="current_civ" description="Index of the current player civilization." /> <Address name="current_civ" description="Index of the current player civilization." />
<Group name="creature">
<Offset name="name" description="Creature name, see the name group." />
<Offset name="custom_profession" description="String object with custom profession." />
<Offset name="profession" description="Profession index." />
<Offset name="race" description="Race of the creature." />
<Offset name="position" description="X,Y,Z." />
<Offset name="flags1" description="First set of flags" />
<Offset name="flags2" description="Second set of flags" />
<Offset name="flags3" description="Third set of flags" />
<Offset name="caste" description="Caste of the creature. Same as sex most of the time." />
<Offset name="sex" description="Sex of the creature." />
<Offset name="id" description="Unique ID of the creature, seems to be used for binary search in the creature vector." />
<Offset name="civ" description="What civ the creature belongs to." />
<Group name="advanced">
<Offset name="pickup_equipment_bit" description="Setting this makes creatures re-check the status of their equip." />
<Offset name="mood" />
<Offset name="pregnancy" description="Pregnancy timer.." />
<Offset name="pregnancy_ptr" description="Pregnancy object." />
<Offset name="birth_year" description="The year the creature has been born." />
<Offset name="birth_time" description="Time of year the creature has been born." />
<Offset name="current_job" />
<Offset name="current_job_skill" description="the skill that will be increased at the end of the mood (or not)" />
<Offset name="physical" value="0x464" description="An array of physical attributes." />
<Offset name="appearance_vector" description="seems to be indexes in the list of possible colors defined in the raws for each group" />
<Offset name="inventory_vector" />
<Offset name="owned_items_vector" />
<Offset name="artifact_name" description="Name of the artifact created by this creature." />
<Offset name="soul_vector" description="A vector of souls attached to the creature." />
<Offset name="current_soul" description="Currently active soul?" />
<Offset name="labors" description="Array of labors. Used by DT to enable/disable them." />
<Offset name="happiness" description="Number that says how happy the creature is." />
<Offset name="hist_figure_id" description="For a creature matching a historical figure, it's ID"/>
</Group>
</Group>
<Group name="soul">
<Offset name="name" description="Name of the soul." />
<Offset name="mental" description="An array of mental attributes." />
<Offset name="skills_vector" description="Vector of non-zero skills the creature has." />
<Offset name="traits" />
</Group>
<Group name="job">
<Offset name="id" description="Incrementaly assigned." />
<Offset name="type" description="seems to be just like the old occupations" />
<Offset name="materials_vector" />
<Group name="material">
<Offset name="maintype" description="like mood materials, 0=bars, 4=stone, 5=wood, 57=cloth, 54=leather ..." />
<Offset name="sectype1" description="subsubtype ?" />
<Offset name="sectype2" description="subtype ?" />
<Offset name="sectype3" description="index of material (for example, 2 is for silver)" />
<Offset name="flags" description="set only for shell / bone mood requirements ?" />
</Group>
</Group>
</Group> </Group>
<Group name="Materials" description="Offsets used by the Materials module."> <Group name="Materials" description="Offsets used by the Materials module.">
<Address name="inorganics" description="Soil, stone, gems and metal."/> <Address name="inorganics" description="Soil, stone, gems and metal."/>
<Group name="inorganic_extras">
<Offset name="ore_types" description="Vector of indexes of metals produced when ore is smelted"/>
<Offset name="ore_chances" description="Vector of percent chance of each type of metal being produced on smelting"/>
<Offset name="strand_types" description="Vector of indexes of metals produced when ore undergoes strand extraction"/>
<Offset name="strand_chances" description="Vector of percent chance of each type of metal being produced on strand extraction"/>
<Offset name="value" description="Meterial value"/>
<Offset name="wall_tile" description="Tile when material is a natural wall"/>
<Offset name="boulder_tile" description="Tile when material is a dug out stone"/>
</Group>
<Address name="organics_all" description="Wood and plant matter, mixed" /> <Address name="organics_all" description="Wood and plant matter, mixed" />
<Address name="organics_plants" description="plant matter" /> <Address name="organics_plants" description="plant matter" />
<Address name="organics_trees" description="just wood" /> <Address name="organics_trees" description="just wood" />
@ -1223,56 +1160,6 @@
<Address name="vector" value="0x0166ecc4" /> <Address name="vector" value="0x0166ecc4" />
<Address name="current_race" value="0x01470fbc" /> <Address name="current_race" value="0x01470fbc" />
<Address name="current_civ" value="0x01470fb0" /> <Address name="current_civ" value="0x01470fb0" />
<Group name="creature">
<Offset name="name" value="0x0" />
<Offset name="custom_profession" value="0x6c" />
<Offset name="profession" value="0x88" />
<Offset name="race" value="0x8C" />
<Offset name="position" value="0x90" />
<Offset name="flags1" value="0xF8" />
<Offset name="flags2" value="0xFC" />
<Offset name="caste" value="0x110" />
<Offset name="sex" value="0x112" />
<Offset name="id" value="0x114" />
<Offset name="civ" value="0X120" />
<Group name="advanced">
<Offset name="pickup_equipment_bit" value="0X21C" />
<Offset name="mood" value="0x288" />
<Offset name="pregnancy" value="0x28C" />
<Offset name="pregnancy_ptr" value="0x290" />
<Offset name="birth_year" value="0x298" />
<Offset name="birth_time" value="0x29C" />
<Offset name="current_job" value="0x390" /> <!-- from chmod -->
<Offset name="current_job_skill" value="0x394" /> the skill that will be increased at the end of the mood (or not)
<Offset name="physical" value="0x464" />
<Offset name="appearance_vector" value="0x604" /> seems to be indexes in the list of possible colors defined in the raws for each group
<Offset name="artifact_name" value="0x6D0" />
<Offset name="soul_vector" value="0x073C" />
<Offset name="current_soul" value="0x0754" />
<Offset name="labors" value="0x770" />
<Offset name="happiness" value="0x830" />
</Group>
</Group>
<Group name="soul">
<Offset name="name" value="0x0" />
<Offset name="mental" value="0x88" />
<Offset name="skills_vector" value="0x1F4" />
<Offset name="traits" value="0x224" />
</Group>
<Group name="job">
<Offset name="id" value="0x0" /> Incrementaly assigned
<Offset name="type" value="0x8" /> seems to be just like the old occupations
<Offset name="materials_vector" value="0xa4" />
<Group name="material">
<Offset name="maintype" value="0x0" /> like mood materials, 0=bars, 4=stone, 5=wood, 57=cloth, 54=leather ...
<Offset name="sectype1" value="0x2" /> subsubtype ?
<Offset name="sectype2" value="0x4" /> subtype ?
<Offset name="sectype3" value="0x8" /> index of material (for example, 2 is for silver)
<Offset name="flags" value="0x18" /> set only for shell / bone mood requirements ?
</Group>
</Group>
</Group> </Group>
<Group name="Materials"> <Group name="Materials">
<Address name="inorganics" value="0x16afd04" /><!-- WORLD + 0x54B7C --> <Address name="inorganics" value="0x16afd04" /><!-- WORLD + 0x54B7C -->
@ -1396,15 +1283,6 @@
</Group> </Group>
<Group name="Creatures"> <Group name="Creatures">
<Address name="vector" value="0x166FD0C" /> <Address name="vector" value="0x166FD0C" />
<Group name="creature">
<Group name="advanced">
<Offset name="artifact_name" value="0x6D4" />
<Offset name="soul_vector" value="0x0740" />
<Offset name="current_soul" value="0x0758" />
<Offset name="labors" value="0x774" />
<Offset name="happiness" value="0x834" />
</Group>
</Group>
</Group> </Group>
<Group name="Materials"> <Group name="Materials">
<Address name="inorganics" value="0x16B0D4C" /><!--inorganics vector = WORLD + 0x54B7C = 0x16B0D4C--> <Address name="inorganics" value="0x16B0D4C" /><!--inorganics vector = WORLD + 0x54B7C = 0x16B0D4C-->
@ -1592,18 +1470,6 @@
</Group> </Group>
<Group name="Creatures"> <Group name="Creatures">
<Address name="vector" value="0x168E73C" /> <Address name="vector" value="0x168E73C" />
<Group name="creature">
<Group name="advanced">
<Offset name="inventory_vector" value="0x2FC" />
<Offset name="physical" value="0x4AC" />
<Offset name="appearance_vector" value="0x64c" /> <!-- Maybe slightly wrong -->
<Offset name="artifact_name" value="0x71c" />
<Offset name="labors" value="0x7Bc" />
<Offset name="soul_vector" value="0x0788" />
<Offset name="current_soul" value="0x07A0" />
<Offset name="happiness" value="0x87c" />
</Group>
</Group>
</Group> </Group>
</Offsets> </Offsets>
</Version> </Version>
@ -1799,49 +1665,6 @@
<Address name="vector" value="0x01655fe4"/> <Address name="vector" value="0x01655fe4"/>
<Address name="current_race" value="0x1482874" /> <Address name="current_race" value="0x1482874" />
<Address name="current_civ" value="0x1482868" /> <Address name="current_civ" value="0x1482868" />
<Group name="creature">
<Offset name="name" value="0x0" />
<Offset name="custom_profession" value="0x006C" />
<Offset name="profession" value="0x0088" />
<Offset name="race" value="0x008C" />
<Offset name="position" value="0x90" />
<Offset name="flags1" value="0x00E0" />
<Offset name="flags2" value="0x00E4" />
<Offset name="caste" value="0x00F8"/>
<Offset name="sex" value="0x00FA" /> <!-- ASSUMED -->
<Offset name="id" value="0x00FC" />
<Offset name="civ" value="0x108" />
<Group name="advanced">
<Offset name="pickup_equipment_bit" value="0x01BC" />
<Offset name="mood" value="0x210" />
<Offset name="pregnancy" value="0x214" />
<Offset name="pregnancy_ptr" value="0x218" />
<Offset name="birth_year" value="0x220" />
<Offset name="birth_time" value="0x224" />
<Offset name="inventory_vector" value="0x284" />
<Offset name="current_job" value="0x02F0" />
<Offset name="current_job_skill" value="0x02F4" />
<Offset name="physical" value="0x3C4" />
<Offset name="appearance_vector" value="0x524" />
<Offset name="artifact_name" value="0x5D4" />
<Offset name="soul_vector" value="0x640" />
<Offset name="current_soul" value="0x650" />
<Offset name="labors" value="0x0664" />
<Offset name="happiness" value="0x0704" />
</Group>
</Group>
<Group name="soul">
<Offset name="name" value="0x4" />
<Offset name="mental" value="0x88" />
<Offset name="skills_vector" value="0x1F4 0x01F0" />
<Offset name="traits" value="0x0214" /> is it a vector?
</Group>
<Group name="job">
<Offset name="id" value="0x08" />
<Offset name="type" value="0x40" />
</Group>
</Group> </Group>
<Group name="Vegetation"> <Group name="Vegetation">
<Offset name="tree_desc_offset" value="0x6C"/> <Offset name="tree_desc_offset" value="0x6C"/>
@ -2016,28 +1839,6 @@
<Address name="current_civ" value="0x01506c1C" /> maybe <Address name="current_civ" value="0x01506c1C" /> maybe
<Address name="current_race" value="0x01506c28" /> <Address name="current_race" value="0x01506c28" />
<Address name="vector" value="0x016da47C" /> <Address name="vector" value="0x016da47C" />
<Group name="creature">
<Group name="advanced">
<Offset name="birth_year" value="0x224" />
<Offset name="birth_time" value="0x228" />
<Offset name="inventory_vector" value="0x288" />
<Offset name="owned_items_vector" value="0x298"/>
<Offset name="current_job" value="0x2f4" />
<Offset name="current_job_skill" value="0x2f8" /> THIS IS TOTAL BS
<Offset name="physical" value="0x3cc" /> DT: 0x3C4, I don't believe that's OK'
<Offset name="appearance_vector" value="0x52C" /> DT calls it 'states' it seems
<Offset name="artifact_name" value="0x5E0" /> maybe
<Offset name="soul_vector" value="0x64c" />
<Offset name="current_soul" value="0x65c" />
<Offset name="labors" value="0x670" />
<Offset name="happiness" value="0x710" />
</Group>
</Group>
<Group name="job" valid="false">
<Offset name="id" valid="true" />
<Offset name="type" valid="true" />
</Group>
</Group> </Group>
<Group name="Maps" valid="true"> <Group name="Maps" valid="true">
<Address name="map_data" value="0x171C128" /> <Address name="map_data" value="0x171C128" />
@ -2264,20 +2065,6 @@
</Group> </Group>
<Group name="Creatures"> <Group name="Creatures">
<Address name="current_race" value="0x14F0C28" /> <Address name="current_race" value="0x14F0C28" />
<Group name="creature">
<Offset name="flags3" value="0xE8"/>
</Group>
</Group>
<Group name="Materials">
<Group name="inorganic_extras">
<Offset name="ore_types" value="0x18"/>
<Offset name="ore_chances" value="0x24"/>
<Offset name="strand_types" value="0x3c"/>
<Offset name="strand_chances" value="0x48"/>
<Offset name="value" value="0x17c"/>
<Offset name="wall_tile" value="0x20c"/>
<Offset name="boulder_tile" value="0x21e"/>
</Group>
</Group> </Group>
<Group name="Items" valid="true"> <Group name="Items" valid="true">
<Address name="items_vector" value="0x16c4540"/> <Address name="items_vector" value="0x16c4540"/>
@ -2422,57 +2209,6 @@
<Address name="vector" value="0x92D9AC0" /> <Address name="vector" value="0x92D9AC0" />
<Address name="current_race" value="0x92C1628" /> <Address name="current_race" value="0x92C1628" />
<Address name="current_civ" value="0x92C161C" /> <Address name="current_civ" value="0x92C161C" />
<Group name="creature">
<Offset name="name" value="0x0" />
<Offset name="custom_profession" value="0x3c" />
<Offset name="profession" value="0x40" />
<Offset name="race" value="0x44" />
<Offset name="position" value="0x48" />
<Offset name="flags1" value="0x8C" />
<Offset name="flags2" value="0x90" />
<Offset name="caste" value="0xA4" />
<Offset name="sex" value="0xA6" />
<Offset name="id" value="0xA8" />
<Offset name="civ" value="0xB4" />
<Group name="advanced">
<Offset name="pickup_equipment_bit" value="0x144" /> CHMOD
<Offset name="mood" value="0x18C"/> It's good
<Offset name="birth_year" value="0x19C" />
<Offset name="birth_time" value="0x1A0" />
<Offset name="current_job" value="0x258" /> chmod
<Offset name="current_job_skill" value="0x394" />
<Offset name="physical" value="0x464" />
<Offset name="appearance_vector" value="0x604" valid="false" />
<Offset name="artifact_name" value="0x6D4" valid="false" />
<Offset name="soul_vector" value="0x0500" />
<Offset name="current_soul" value="0x0758" valid="false" />
<Offset name="labors" value="0x51C" />
<Offset name="happiness" value="0x5AC" />
</Group>
</Group>
<!--
The vector is bad.
<Group name="soul" valid="verify">
<Offset name="name" value="0x0" />
<Offset name="mental" value="0x88" />
<Offset name="skills_vector" value="0x1C4" /> CHMOD
<Offset name="traits" value="0x1DC" />
</Group>
-->
<!--
<Group name="job">
<Offset name="id" value="0x0" /> Incrementaly assigned
<Offset name="type" value="0x8" /> seems to be just like the old occupations
<Offset name="materials_vector" value="0xa4" />
<Group name="material">
<Offset name="maintype" value="0x0" /> like mood materials, 0=bars, 4=stone, 5=wood, 57=cloth, 54=leather ...
<Offset name="sectype1" value="0x2" /> subsubtype ?
<Offset name="sectype2" value="0x4" /> subtype ?
<Offset name="sectype3" value="0x8" /> index of material (for example, 2 is for silver)
<Offset name="flags" value="0x18" /> set only for shell / bone mood requirements ?
</Group>
</Group>
-->
</Group> </Group>
<Group name="Materials"> <Group name="Materials">
<Address name="inorganics" value="0x931ae88" /><!-- WORLD + 0x54B7C --> <Address name="inorganics" value="0x931ae88" /><!-- WORLD + 0x54B7C -->
@ -2553,24 +2289,6 @@
<!-- TODO: fix creature offsets --> <!-- TODO: fix creature offsets -->
<!-- TODO: small offsets added all over the place, investigate --> <!-- TODO: small offsets added all over the place, investigate -->
<MD5 value="4f1f988bc1b425d4193d3d8b7b0579a5" /> <MD5 value="4f1f988bc1b425d4193d3d8b7b0579a5" />
<Offsets>
<Group name="Creatures">
<Group name="creature"> VERIFY
<Group name="advanced">
<Offset name="soul_vector" value="0x0524" />
<Offset name="current_soul" value="0x0530" />
<Offset name="labors" value="0x540" />
<Offset name="happiness" value="0x5d0" />
</Group>
</Group>
<Group name="soul">
<Offset name="name" value="0x0" />
<Offset name="mental" value="0x88" />
<Offset name="skills_vector" value="0x1C4" /> CHMOD
<Offset name="traits" value="0x1DC" />
</Group>
</Group>
</Offsets>
</Version> </Version>
<Version name="v0.31.10 linux" os="linux" base="v0.31.09 linux"> <Version name="v0.31.10 linux" os="linux" base="v0.31.09 linux">
<MD5 value="3e7bea269018a6fb88ef53715685aa64" /> <MD5 value="3e7bea269018a6fb88ef53715685aa64" />
@ -2920,48 +2638,6 @@
<Group name="Creatures"> <Group name="Creatures">
<Address name="current_civ" value="0x93f2cdc" /> <Address name="current_civ" value="0x93f2cdc" />
<Address name="current_race" value="0x93f2ce8" /> <Address name="current_race" value="0x93f2ce8" />
<Group name="creature">
<Group name="advanced">
<Offset name="pregnancy" value="0x190" />
<Offset name="pregnancy_ptr" value="0x194" />
<Offset name="birth_year" value="0x1A0" />
<Offset name="birth_time" value="0x1A4" />
<Offset name="inventory_vector" value="0x204" />
<Offset name="owned_items_vector" value="0x210"/>
<Offset name="current_job" value="0x25C" />
<Offset name="current_job_skill" value="0x260" />
<Offset name="physical" value="0x310" />
<Offset name="appearance_vector" value="0x450" />
<Offset name="artifact_name" value="0x4f4" />
<Offset name="soul_vector" value="0x530" />
<Offset name="current_soul" value="0x53C" />
<Offset name="labors" value="0x54C" />
<Offset name="happiness" value="0x05dc" />
<Offset name="hist_figure_id" value="0x640"/>
</Group>
</Group>
<Group name="job">
<Offset name="id" value="0x8" />
<!--<Offset name="materials_vector" />-->
<Offset name="type" value="0x40" /> MAYBE, DT SAYS SO
<!--
<Group name="material">
<Offset name="flags" /> NOT SET!
<Offset name="maintype" /> NOT SET!
<Offset name="sectype1" /> NOT SET!
<Offset name="sectype2" /> NOT SET!
<Offset name="sectype3" /> NOT SET!
</Group>
-->
</Group>
<Group name="soul">
<Offset name="name" value="0x4" />
<!--
<Offset name="mental" value="0x88" />
<Offset name="skills_vector" value="0x1c4" />
<Offset name="traits" value="0x1dc" />
-->
</Group>
</Group> </Group>
<Group name="GUI"> <Group name="GUI">
<Address name="pause_state" value="0x93f0850" /> <Address name="pause_state" value="0x93f0850" />
@ -3074,21 +2750,6 @@
Maybe, possibly. Maybe, possibly.
<Address name="current_civ" value="0x093f2b50 0x93f2cdc" /> <Address name="current_civ" value="0x093f2b50 0x93f2cdc" />
<Address name="current_race" value="0x093f2b5c 0x93f2ce8" /> <Address name="current_race" value="0x093f2b5c 0x93f2ce8" />
Address name="vector" value="0x0940b174"
<Group name="creature">
<Offset name="flags3" value="0x94"/>
</Group>
</Group>
<Group name="Materials">
<Group name="inorganic_extras">
<Offset name="ore_types" value="0x18"/>
<Offset name="ore_chances" value="0x24"/>
<Offset name="strand_types" value="0x3c"/>
<Offset name="strand_chances" value="0x48"/>
<Offset name="value" value="0x17c"/>
<Offset name="wall_tile" value="0x20c"/>
<Offset name="boulder_tile" value="0x21e"/>
</Group>
</Group> </Group>
<Group name="Vermin" valid="true"> <Group name="Vermin" valid="true">
<Group name="Spawn Points"> <Group name="Spawn Points">

@ -163,7 +163,7 @@ namespace DFHack
/// bit mask describing how the vein maps to the map block /// bit mask describing how the vein maps to the map block
/// assignment[y] & (1 << x) describes the tile (x, y) of the block /// assignment[y] & (1 << x) describes the tile (x, y) of the block
int16_t assignment[16]; int16_t assignment[16];
uint32_t flags; uint32_t flags; // FIXME: figure those out
//zilpin: Functions to more conveniently check the assignment flags of the vein. //zilpin: Functions to more conveniently check the assignment flags of the vein.
//Coordinates are given in tile within the block. //Coordinates are given in tile within the block.

@ -32,6 +32,7 @@ distribution.
#include "dfhack/Export.h" #include "dfhack/Export.h"
#include "dfhack/Module.h" #include "dfhack/Module.h"
#include "dfhack/Types.h" #include "dfhack/Types.h"
#include "dfhack/BitArray.h"
#include <vector> #include <vector>
#include <string> #include <string>
@ -42,6 +43,157 @@ namespace DFHack
{ {
// it's lonely here... // it's lonely here...
}; };
enum material_flags
{
MATERIAL_BONE = 0,
MATERIAL_MEAT,
MATERIAL_EDIBLE_VERMIN,
MATERIAL_EDIBLE_RAW,
MATERIAL_EDIBLE_COOKED,
MATERIAL_UNK5,
MATERIAL_ITEMS_METAL,
MATERIAL_ITEMS_BARRED,
MATERIAL_ITEMS_SCALED = 8,
MATERIAL_ITEMS_LEATHER,
MATERIAL_ITEMS_SOFT,
MATERIAL_ITEMS_HARD,
MATERIAL_IMPLIES_ANIMAL_KILL,
MATERIAL_ALCOHOL_PLANT,
MATERIAL_ALCOHOL_CREATURE,
MATERIAL_CHEESE_PLANT,
MATERIAL_CHEESE_CREATURE = 16,
MATERIAL_POWDER_MISC_PLANT,
MATERIAL_POWDER_MISC_CREATURE,
MATERIAL_STOCKPILE_GLOB,
MATERIAL_LIQUID_MISC_PLANT,
MATERIAL_LIQUID_MISC_CREATURE,
MATERIAL_LIQUID_MISC_OTHER,
MATERIAL_WOOD,
MATERIAL_THREAD_PLANT = 24,
MATERIAL_TOOTH,
MATERIAL_HORN,
MATERIAL_PEARL,
MATERIAL_SHELL,
MATERIAL_LEATHER,
MATERIAL_SILK,
MATERIAL_SOAP,
MATERIAL_ROTS = 32,
MATERIAL_UNK33,
MATERIAL_UNK34,
MATERIAL_UNK35,
MATERIAL_STRUCTURAL_PLANT_MAT,
MATERIAL_SEED_MAT,
MATERIAL_LEAF_MAT,
MATERIAL_UNK39,
MATERIAL_ENTERS_BLOOD = 40,
MATERIAL_BLOOD_MAP_DESCRIPTOR,
MATERIAL_ICHOR_MAP_DESCRIPTOR,
MATERIAL_GOO_MAP_DESCRIPTOR,
MATERIAL_SLIME_MAP_DESCRIPTOR,
MATERIAL_PUS_MAP_DESCRIPTOR,
MATERIAL_GENERATES_MIASMA,
MATERIAL_IS_METAL,
MATERIAL_IS_GEM = 48,
MATERIAL_IS_GLASS,
MATERIAL_CRYSTAL_GLASSABLE,
MATERIAL_ITEMS_WEAPON,
MATERIAL_ITEMS_WEAPON_RANGED,
MATERIAL_ITEMS_ANVIL,
MATERIAL_ITEMS_AMMO,
MATERIAL_ITEMS_DIGGER,
MATERIAL_ITEMS_ARMOR = 56,
MATERIAL_ITEMS_DELICATE,
MATERIAL_ITEMS_SIEGE_ENGINE,
MATERIAL_ITEMS_QUERN,
MATERIAL_IS_STONE,
MATERIAL_UNDIGGABLE,
MATERIAL_YARN,
MATERIAL_STOCKPILE_GLOB_PASTE,
MATERIAL_STOCKPILE_GLOB_PRESSED = 64,
MATERIAL_DISPLAY_UNGLAZED,
MATERIAL_DO_NOT_CLEAN_GLOB,
MATERIAL_NO_STONE_STOCKPILE,
MATERIAL_STOCKPILE_THREAD_METAL,
MATERIAL_UNK69,
MATERIAL_UNK70,
MATERIAL_UNK71,
MATERIAL_UNK72 = 72,
MATERIAL_UNK73,
MATERIAL_UNK74,
MATERIAL_UNK75,
MATERIAL_UNK76,
MATERIAL_UNK77,
MATERIAL_UNK78,
MATERIAL_UNK79,
};
enum inorganic_flags
{
INORGANIC_LAVA = 0,
INORGANIC_UNK1,
INORGANIC_UNK2,
INORGANIC_SEDIMENTARY,
INORGANIC_SEDIMENTARY_OCEAN_SHALLOW,
INORGANIC_IGNEOUS_INTRUSIVE,
INORGANIC_IGNEOUS_EXTRUSIVE,
INORGANIC_METAMORPHIC,
INORGANIC_DEEP_SURFACE = 8,
INORGANIC_METAL_ORE, // maybe
INORGANIC_AQUIFER,
INORGANIC_SOIL,
INORGANIC_SOIL_OCEAN,
INORGANIC_SOIL_SAND,
INORGANIC_SEDIMENTARY_OCEAN_DEEP,
INORGANIC_THREAD_METAL, // maybe
INORGANIC_DEEP = 16, // in general
INORGANIC_SOIL2, // more soil?
INORGANIC_DEEP_SPECIAL,
INORGANIC_UNK19,
INORGANIC_UNK20,
INORGANIC_UNK21,
INORGANIC_UNK22,
INORGANIC_UNK23,
INORGANIC_UNK24 = 24,
INORGANIC_WAFERS,
INORGANIC_UNK26,
INORGANIC_UNK27,
INORGANIC_UNK28,
INORGANIC_UNK29,
INORGANIC_UNK30,
INORGANIC_UNK31,
};
//Environment locations:
enum environment_location
{
ENV_SOIL,
ENV_SOIL_OCEAN,
ENV_SOIL_SAND,
ENV_METAMORPHIC,
ENV_SEDIMENTARY,
ENV_IGNEOUS_INTRUSIVE,
ENV_IGNEOUS_EXTRUSIVE,
ENV_ALLUVIAL,
};
//Inclusion types:
enum inclusion_type
{
INCLUSION_NONE, // maybe
INCLUSION_VEIN,
INCLUSION_CLUSTER,
INCLUSION_CLUSTER_SMALL,
INCLUSION_CLUSTER_ONE,
};
/// Research by Quietust /// Research by Quietust
struct df_material struct df_material
{ {
@ -99,9 +251,7 @@ namespace DFHack
int32_t COMPRESSIVE_STRAIN_AT_YIELD; int32_t COMPRESSIVE_STRAIN_AT_YIELD;
int32_t MAX_EDGE; int32_t MAX_EDGE;
int32_t MATERIAL_VALUE; int32_t MATERIAL_VALUE;
// FIXME: needs flagarray implementation! BitArray <material_flags> mat_flags;
uint8_t * flagarray_properties;
uint32_t flagarray_properties_length;
int16_t EXTRACT_STORAGE;// (item type) int16_t EXTRACT_STORAGE;// (item type)
int16_t BUTCHER_SPECIAL_type;// (item type) int16_t BUTCHER_SPECIAL_type;// (item type)
int16_t BUTCHER_SPECIAL_subtype;// (item subtype) int16_t BUTCHER_SPECIAL_subtype;// (item subtype)
@ -124,7 +274,7 @@ namespace DFHack
std::string HARDENS_WITH_WATER_2nd_parm;// (e.g. GYPSUM) std::string HARDENS_WITH_WATER_2nd_parm;// (e.g. GYPSUM)
std::string HARDENS_WITH_WATER_3rd_parm;// (if you used CREATURE_MAT or PLANT_MAT) std::string HARDENS_WITH_WATER_3rd_parm;// (if you used CREATURE_MAT or PLANT_MAT)
std::vector <std::string> REACTION_CLASS; std::vector <std::string> REACTION_CLASS;
int8_t TILE; int8_t TILE; // Tile when material is a natural wall
int16_t BASIC_COLOR_foreground; int16_t BASIC_COLOR_foreground;
int16_t BASIC_COLOR_bright; int16_t BASIC_COLOR_bright;
// what exactly ARE those colors? // what exactly ARE those colors?
@ -135,7 +285,7 @@ namespace DFHack
int16_t TILE_COLOR_foreground; int16_t TILE_COLOR_foreground;
int16_t TILE_COLOR_background; int16_t TILE_COLOR_background;
int16_t TILE_COLOR_bright; int16_t TILE_COLOR_bright;
int8_t ITEM_SYMBOL; int8_t ITEM_SYMBOL; // Tile when material is a dug out stone
int16_t POWDER_DYE; // (color token index) int16_t POWDER_DYE; // (color token index)
int16_t TEMP_DIET_INFO;// (whatever it means) int16_t TEMP_DIET_INFO;// (whatever it means)
std::vector <t_syndrome *> SYNDROME; std::vector <t_syndrome *> SYNDROME;
@ -143,19 +293,18 @@ namespace DFHack
std::string PREFIX; std::string PREFIX;
// etc... // etc...
}; };
/// Research by Quietust /// Research by Quietust
struct df_inorganic_base struct df_inorganic_base
{ {
std::string Inorganic_ID; std::string Inorganic_ID;
// FIXME: needs flagarray implementation! BitArray<inorganic_flags> inorg_flags;
uint8_t * flagarray_inorganic;
uint32_t flagarray_inorganic_length;
std::vector <uint32_t> empty1; std::vector <uint32_t> empty1;
std::vector <int16_t> METAL_ORE_matID; std::vector <int16_t> METAL_ORE_matID; // Vector of indexes of metals produced when ore is smelted
std::vector <int16_t> METAL_ORE_prob; std::vector <int16_t> METAL_ORE_prob; // Vector of percent chance of each type of metal being produced on smelting
std::vector <uint32_t> empty2; std::vector <uint32_t> empty2;
std::vector <int16_t> THREAD_METAL_matID; std::vector <int16_t> THREAD_METAL_matID;// Vector of indexes of metals produced when ore undergoes strand extraction
std::vector <int16_t> THREAD_METAL_prob; std::vector <int16_t> THREAD_METAL_prob; // Vector of percent chance of each type of metal being produced on strand extraction
std::vector <uint32_t> unknown_in_1; std::vector <uint32_t> unknown_in_1;
std::vector <uint32_t> empty3; std::vector <uint32_t> empty3;
std::vector <int16_t> ENVIRONMENT_SPEC_matID; std::vector <int16_t> ENVIRONMENT_SPEC_matID;
@ -183,6 +332,7 @@ namespace DFHack
int32_t value; // Material value int32_t value; // Material value
uint8_t wall_tile; // Tile when a natural wall uint8_t wall_tile; // Tile when a natural wall
uint8_t boulder_tile; // Tile when a dug-out stone; uint8_t boulder_tile; // Tile when a dug-out stone;
bool is_gem;
public: public:
t_matgloss(); t_matgloss();

@ -103,10 +103,10 @@ bool t_matglossInorganic::isOre()
return true; return true;
return false; return false;
} }
// FIXME: implement properly
bool t_matglossInorganic::isGem() bool t_matglossInorganic::isGem()
{ {
return (wall_tile == 15 && boulder_tile == 7); return is_gem;
} }
// good for now // good for now
@ -147,6 +147,7 @@ bool Materials::ReadInorganicMaterials (void)
mat.boulder_tile = orig->ITEM_SYMBOL; mat.boulder_tile = orig->ITEM_SYMBOL;
mat.bright = orig->BASIC_COLOR_bright; mat.bright = orig->BASIC_COLOR_bright;
mat.fore = orig->BASIC_COLOR_foreground; mat.fore = orig->BASIC_COLOR_foreground;
mat.is_gem = orig->mat_flags.is_set(MATERIAL_IS_GEM);
inorganic.push_back(mat); inorganic.push_back(mat);
} }
return true; return true;