Added Creature C Interface, misc fixes and changes for Creature.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-03-05 11:25:41 +01:00
parent 985c2720c5
commit e990c13109
6 changed files with 153 additions and 26 deletions

View File

@@ -34,7 +34,7 @@ Creature* CreateCreature::Create() {
auto rand = Arbutils::Random();
auto species = this->_library->GetSpeciesLibrary()->Get(this->_species);
auto variant = species->GetVariant(this->_variant);
TalentIndex talent;
Library::TalentIndex talent;
if (this->_talent.Empty()) {
talent = variant->GetRandomTalent(&rand);
} else {
@@ -54,8 +54,7 @@ Creature* CreateCreature::Create() {
throw CreatureException("Invalid held item.");
}
}
// FIXME: implement experience
auto experience = 0;
auto experience = _library->GetGrowthRateLibrary()->CalculateExperience(species->GetGrowthRate(), _level);
auto attacks = std::vector<LearnedAttack*>(_attacks.size());
for (size_t i = 0; i < attacks.size(); i++) {