Add Pokemon Status.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-08-08 12:01:05 +02:00
parent d8e166e49a
commit 683f3ad08b
8 changed files with 67 additions and 11 deletions

View File

@@ -50,7 +50,7 @@ namespace PkmnLib::Battling {
}
AssertNotNull(forme);
CreatureLib::Library::TalentIndex ability;
if (this->_ability.Empty()) {
if (this->_ability.IsEmpty()) {
ability = forme->GetRandomTalent(rand);
} else {
ability = forme->GetTalentIndex(this->_ability);
@@ -64,7 +64,7 @@ namespace PkmnLib::Battling {
gender = species->GetRandomGender(rand);
}
ArbUt::BorrowedPtr<const Library::Item> heldItem = nullptr;
if (!this->_heldItem.Empty()) {
if (!this->_heldItem.IsEmpty()) {
if (!_library->GetItemLibrary()->TryGet(this->_heldItem, heldItem)) {
THROW_CREATURE("Unknown Item: " << this->_heldItem.std_str());
}
@@ -84,7 +84,7 @@ namespace PkmnLib::Battling {
auto ivs = CreatureLib::Library::StatisticSet(_ivHp, _ivAttack, _ivDefense, _ivSpAtt, _ivSpDef, _ivSpeed);
auto evs = CreatureLib::Library::StatisticSet(_evHp, _evAttack, _evDefense, _evSpAtt, _evSpDef, _evSpeed);
if (_nature.Empty()) {
if (_nature.IsEmpty()) {
_nature = _library->GetNatureLibrary()->GetRandomNatureName(rand);
}
auto nature = _library->GetNatureLibrary()->GetNatureByName(_nature);