t_creaturecaste shouldn't be using t_attrib, because those AREN'T actual attribute values, just the PHYS/MENT_ATT_RANGE values from the raws

develop
Quietust 2012-01-21 13:24:38 -06:00
parent 7b2835e2a9
commit d2c78646ea
2 changed files with 43 additions and 60 deletions

@ -253,25 +253,25 @@ namespace DFHack
std::vector<t_colormodifier> ColorModifier; std::vector<t_colormodifier> ColorModifier;
std::vector<t_bodypart> bodypart; std::vector<t_bodypart> bodypart;
t_attrib strength; int32_t strength[7];
t_attrib agility; int32_t agility[7];
t_attrib toughness; int32_t toughness[7];
t_attrib endurance; int32_t endurance[7];
t_attrib recuperation; int32_t recuperation[7];
t_attrib disease_resistance; int32_t disease_resistance[7];
t_attrib analytical_ability; int32_t analytical_ability[7];
t_attrib focus; int32_t focus[7];
t_attrib willpower; int32_t willpower[7];
t_attrib creativity; int32_t creativity[7];
t_attrib intuition; int32_t intuition[7];
t_attrib patience; int32_t patience[7];
t_attrib memory; int32_t memory[7];
t_attrib linguistic_ability; int32_t linguistic_ability[7];
t_attrib spatial_sense; int32_t spatial_sense[7];
t_attrib musicality; int32_t musicality[7];
t_attrib kinesthetic_sense; int32_t kinesthetic_sense[7];
t_attrib empathy; int32_t empathy[7];
t_attrib social_awareness; int32_t social_awareness[7];
}; };
/** /**

@ -60,6 +60,9 @@ using namespace std;
#include "df/descriptor_pattern.h" #include "df/descriptor_pattern.h"
#include "df/descriptor_shape.h" #include "df/descriptor_shape.h"
#include "df/physical_attribute_type.h"
#include "df/mental_attribute_type.h"
using namespace DFHack; using namespace DFHack;
using namespace df::enums; using namespace df::enums;
using df::global::world; using df::global::world;
@ -747,48 +750,28 @@ bool Materials::ReadCreatureTypesEx (void)
caste.bodypart.push_back(part); caste.bodypart.push_back(part);
} }
t_attrib *phys[] = { for (int32_t k = 0; k < 7; k++)
&caste.strength,
&caste.agility,
&caste.toughness,
&caste.endurance,
&caste.recuperation,
&caste.disease_resistance
};
for (uint32_t k = 0; k < 6; k++)
{
phys[k]->level = ca->attributes.phys_att_range[k][0];
phys[k]->field_4 = ca->attributes.phys_att_range[k][1];
phys[k]->field_8 = ca->attributes.phys_att_range[k][2];
phys[k]->field_C = ca->attributes.phys_att_range[k][3];
phys[k]->leveldiff = ca->attributes.phys_att_range[k][4];
phys[k]->field_14 = ca->attributes.phys_att_range[k][5];
phys[k]->field_18 = ca->attributes.phys_att_range[k][6];
}
t_attrib *ment[] = {
&caste.analytical_ability,
&caste.focus,
&caste.willpower,
&caste.creativity,
&caste.intuition,
&caste.patience,
&caste.memory,
&caste.linguistic_ability,
&caste.spatial_sense,
&caste.musicality,
&caste.kinesthetic_sense,
&caste.empathy,
&caste.social_awareness
};
for (uint32_t k = 0; k < 13; k++)
{ {
ment[k]->level = ca->attributes.ment_att_range[k][0]; caste.strength[k] = ca->attributes.phys_att_range[df::physical_attribute_type::STRENGTH][k];
ment[k]->field_4 = ca->attributes.ment_att_range[k][1]; caste.agility[k] = ca->attributes.phys_att_range[df::physical_attribute_type::AGILITY][k];
ment[k]->field_8 = ca->attributes.ment_att_range[k][2]; caste.toughness[k] = ca->attributes.phys_att_range[df::physical_attribute_type::TOUGHNESS][k];
ment[k]->field_C = ca->attributes.ment_att_range[k][3]; caste.endurance[k] = ca->attributes.phys_att_range[df::physical_attribute_type::ENDURANCE][k];
ment[k]->leveldiff = ca->attributes.ment_att_range[k][4]; caste.recuperation[k] = ca->attributes.phys_att_range[df::physical_attribute_type::RECUPERATION][k];
ment[k]->field_14 = ca->attributes.ment_att_range[k][5]; caste.disease_resistance[k] = ca->attributes.phys_att_range[df::physical_attribute_type::DISEASE_RESISTANCE][k];
ment[k]->field_18 = ca->attributes.ment_att_range[k][6];
caste.analytical_ability[k] = ca->attributes.phys_att_range[df::mental_attribute_type::ANALYTICAL_ABILITY][k];
caste.focus[k] = ca->attributes.phys_att_range[df::mental_attribute_type::FOCUS][k];
caste.willpower[k] = ca->attributes.phys_att_range[df::mental_attribute_type::WILLPOWER][k];
caste.creativity[k] = ca->attributes.phys_att_range[df::mental_attribute_type::CREATIVITY][k];
caste.intuition[k] = ca->attributes.phys_att_range[df::mental_attribute_type::INTUITION][k];
caste.patience[k] = ca->attributes.phys_att_range[df::mental_attribute_type::PATIENCE][k];
caste.memory[k] = ca->attributes.phys_att_range[df::mental_attribute_type::MEMORY][k];
caste.linguistic_ability[k] = ca->attributes.phys_att_range[df::mental_attribute_type::LINGUISTIC_ABILITY][k];
caste.spatial_sense[k] = ca->attributes.phys_att_range[df::mental_attribute_type::SPATIAL_SENSE][k];
caste.musicality[k] = ca->attributes.phys_att_range[df::mental_attribute_type::MUSICALITY][k];
caste.kinesthetic_sense[k] = ca->attributes.phys_att_range[df::mental_attribute_type::KINESTHETIC_SENSE][k];
caste.empathy[k] = ca->attributes.phys_att_range[df::mental_attribute_type::EMPATHY][k];
caste.social_awareness[k] = ca->attributes.phys_att_range[df::mental_attribute_type::SOCIAL_AWARENESS][k];
} }
mat.castes.push_back(caste); mat.castes.push_back(caste);
} }