Update to latest Arbutils.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-12-13 12:32:52 +01:00
parent ecf8582c59
commit bbb2691b91
18 changed files with 152 additions and 164 deletions

View File

@@ -83,7 +83,7 @@ float PkmnLib::Battling::DamageLibrary::GetDamageModifier(CreatureLib::Battling:
PKMN_HOOK(OverrideCriticalModifier, attack, attack, target, hitIndex, &critModifier);
mod *= critModifier;
}
Assert(attack->GetUser()->GetBattle().GetValue());
Ensure(attack->GetUser()->GetBattle().GetValue());
float randPercentage = 85 + attack->GetUser()->GetBattle().GetValue()->GetRandom()->Get(0, 16);
mod *= randPercentage / 100.0;
if (attack->GetUser()->HasType(hitData.GetType())) {

View File

@@ -20,9 +20,8 @@ void PkmnLib::Battling::ExperienceLibrary::HandleExperienceGain(
const std::unordered_set<ArbUt::BorrowedPtr<CreatureLib::Battling::Creature>>& opponents) const {
auto fainted = dynamic_cast<Pokemon*>(faintedMon);
AssertNotNull(fainted);
EnsureNotNull(fainted);
auto& forme = fainted->GetForme();
AssertNotNull(forme);
auto expGain = forme->GetBaseExperience();
auto level = fainted->GetLevel();

View File

@@ -7,7 +7,7 @@ bool PkmnLib::Battling::MiscLibrary::IsCritical(CreatureLib::Battling::Executing
CreatureLib::Battling::Creature* target, uint8_t hit) const {
uint8_t critStage = 0;
PKMN_HOOK(ModifyCriticalStage, attack, attack, target, hit, &critStage);
Assert(target->GetBattle().HasValue());
Ensure(target->GetBattle().HasValue());
auto rand = target->GetBattle().GetValue()->GetRandom();
switch (critStage) {
case 0: return rand->Get(24) == 0;