Support for blocking a creature from gaining experience, don't give experience when a creature is fainted.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-05-20 15:18:27 +02:00
parent 6c40f4291d
commit 2e860192c7
4 changed files with 17 additions and 7 deletions

View File

@@ -6,6 +6,10 @@ void CreatureLib::Battling::ExperienceLibrary::HandleExperienceGain(
for (auto opponent : opponents) {
if (opponent == nullptr)
continue;
if (opponent->IsFainted())
continue;
if (!opponent->AllowedExperienceGain())
continue;
auto levelDiff = faintedMon->GetLevel() - opponent->GetLevel() + 10;
if (levelDiff <= 0)
continue;