preliminary improvement system

develop
simon 2010-05-04 16:46:15 +02:00
parent f4d6836a85
commit 32176875f9
3 changed files with 25 additions and 1 deletions

@ -33,6 +33,24 @@ struct t_item
int32_t quality; int32_t quality;
}; };
struct t_improvement
{
t_material matdesc;
int32_t quality;
};
class DFHACK_EXPORT ItemImprovementDesc
{
private:
Accessor * AType;
Process * p;
public:
ItemImprovementDesc(uint32_t VTable, Process * p);
bool getImprovement(uint32_t descptr, t_improvement & imp);
uint32_t vtable;
uint32_t maintype;
};
class DFHACK_EXPORT ItemDesc class DFHACK_EXPORT ItemDesc
{ {
private: private:
@ -49,6 +67,7 @@ public:
std::string className; std::string className;
uint32_t vtable; uint32_t vtable;
uint32_t mainType; uint32_t mainType;
std::vector<ItemImprovementDesc> improvement;
}; };
class DFHACK_EXPORT Items class DFHACK_EXPORT Items

@ -178,6 +178,8 @@ int main ()
uint32_t dqual = p->readWord(decoration + 20); uint32_t dqual = p->readWord(decoration + 20);
if ( (dtypefunct&0xFFFFFFFFFFFF00FFLL) == 0xCCCCC300000000B8LL) if ( (dtypefunct&0xFFFFFFFFFFFF00FFLL) == 0xCCCCC300000000B8LL)
dtype = (dtypefunct>>8)&0xfffffff; dtype = (dtypefunct>>8)&0xfffffff;
else if ( dtypefunct == 0xCCCCCCCCCCC3C033LL)
dtype = 0;
else else
printf("bad decoration type function, address=%p\n", (void*) dtypefunc); printf("bad decoration type function, address=%p\n", (void*) dtypefunc);
if (sep) if (sep)

@ -1510,7 +1510,10 @@ map_data_1b60_offset 0x1B9c
<Offset name="item_quality_accessor">0x238</Offset> <Offset name="item_quality_accessor">0x238</Offset>
<Offset name="item_improvement_vector">0xA0</Offset> <Offset name="item_improvement_vector">0xA0</Offset>
<Offset name="item_improvement_subindex">0x4</Offset>
<Offset name="item_improvement_index">0x8</Offset>
<Offset name="item_improvement_quality">0x14</Offset> <Offset name="item_improvement_quality">0x14</Offset>
<Offset name="item_type_accessor">0x14</Offset> (in the vtable)
</Entry> </Entry>
.-"""-. .-"""-.