Implements Pokemon stat calculation.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -70,10 +70,34 @@ PkmnLib::Battling::Pokemon* PkmnLib::Battling::CreatePokemon::Build() {
|
||||
_nature = _library->GetNatureLibrary()->GetRandomNature(rand);
|
||||
}
|
||||
|
||||
return new Pokemon(_library, species, forme, _level, experience, identifier, gender, _coloring, heldItem, _nickname,
|
||||
auto pkmn = new Pokemon(_library, species, forme, _level, experience, identifier, gender, _coloring, heldItem, _nickname,
|
||||
ability, attacks, ivs, evs,_nature);
|
||||
pkmn->Initialize();
|
||||
return pkmn;
|
||||
}
|
||||
PkmnLib::Battling::CreatePokemon* PkmnLib::Battling::CreatePokemon::WithNature(const std::string& nature) {
|
||||
_nature = _library->GetNatureLibrary()->GetNatureIdByName(nature);
|
||||
return this;
|
||||
}
|
||||
PkmnLib::Battling::CreatePokemon* PkmnLib::Battling::CreatePokemon::WithIndividualValues(uint8_t hp, uint8_t att,
|
||||
uint8_t def, uint8_t spAtt,
|
||||
uint8_t spDef, uint8_t speed) {
|
||||
_ivHp = hp;
|
||||
_ivAttack = att;
|
||||
_ivDefense = def;
|
||||
_ivSpAtt = spAtt;
|
||||
_ivSpDef = spDef;
|
||||
_ivSpeed = speed;
|
||||
return this;
|
||||
}
|
||||
PkmnLib::Battling::CreatePokemon* PkmnLib::Battling::CreatePokemon::WithEffortValues(uint8_t hp, uint8_t att,
|
||||
uint8_t def, uint8_t spAtt,
|
||||
uint8_t spDef, uint8_t speed) {
|
||||
_evHp = hp;
|
||||
_evAttack = att;
|
||||
_evDefense = def;
|
||||
_evSpAtt = spAtt;
|
||||
_evSpDef = spDef;
|
||||
_evSpeed = speed;
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user