mood skill support in the creature structure

develop
simon 2010-04-26 14:12:07 +02:00
parent 453b4521c0
commit dfea1911ca
4 changed files with 5 additions and 1 deletions

@ -336,6 +336,7 @@ namespace DFHack
t_name name;
int16_t mood;
int16_t mood_skill;
t_name artifact_name;
uint8_t profession;

@ -88,6 +88,7 @@ Creatures::Creatures(APIPrivate* _d)
creatures.default_soul_offset = minfo->getOffset("creature_default_soul");
creatures.physical_offset = minfo->getOffset("creature_physical");
creatures.mood_offset = minfo->getOffset("creature_mood");
creatures.mood_skill_offset = minfo->getOffset("creature_mood_skill");
creatures.pickup_equipment_bit = minfo->getOffset("creature_pickup_equipment_bit");
creatures.current_job_offset = minfo->getOffset("creature_current_job");
// soul offsets
@ -185,6 +186,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);
// custom profession

@ -50,6 +50,7 @@ typedef struct
uint32_t artifact_name_offset;
uint32_t physical_offset;
uint32_t mood_offset;
uint32_t mood_skill_offset;
uint32_t pickup_equipment_bit;
uint32_t soul_vector_offset;
uint32_t default_soul_offset;

@ -243,7 +243,7 @@ void printCreature(DFHack::API & DF, const DFHack::t_creature & creature)
if(creature.mood != -1)
{
cout << "mood: " << creature.mood << endl;
cout << "mood: " << creature.mood << ", skill: " << mem->getSkill(creature.mood_skill) << endl;
vector<DFHack::t_material> mat;
char * maintype;
if(Creatures->ReadJob(&creature, mat))