Update to latest Arbutils.
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:
@@ -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())) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
auto aggregator = source->GetScriptIterator(); \
|
||||
while (aggregator.HasNext()) { \
|
||||
auto next = aggregator.GetNext(); \
|
||||
if (next == nullptr) \
|
||||
continue; \
|
||||
auto castNext = next.ForceAs<PkmnLib::Battling::PkmnScript>(); \
|
||||
castNext->hookName(__VA_ARGS__); \
|
||||
} \
|
||||
|
||||
@@ -49,7 +49,6 @@ namespace PkmnLib::Battling {
|
||||
err << "Invalid forme '" << _forme << "' for species '" << _forme << "'.";
|
||||
throw ArbUt::Exception(err.str());
|
||||
}
|
||||
AssertNotNull(forme);
|
||||
CreatureLib::Library::TalentIndex ability;
|
||||
if (this->_ability.IsEmpty()) {
|
||||
ability = forme.value()->GetRandomTalent(rand);
|
||||
@@ -79,10 +78,7 @@ namespace PkmnLib::Battling {
|
||||
for (size_t i = 0; i < _attacks.Count(); i++) {
|
||||
auto& kv = _attacks[i];
|
||||
auto move = kv.Move;
|
||||
if (move != nullptr)
|
||||
attacks[i] = new LearnedMove(move, kv.LearnMethod);
|
||||
else
|
||||
attacks[i] = nullptr;
|
||||
attacks[i] = new LearnedMove(move, kv.LearnMethod);
|
||||
}
|
||||
auto ivs = CreatureLib::Library::ClampedStatisticSet<uint8_t, 0, 31>(_ivHp, _ivAttack, _ivDefense, _ivSpAtt,
|
||||
_ivSpDef, _ivSpeed);
|
||||
@@ -156,7 +152,6 @@ namespace PkmnLib::Battling {
|
||||
if (_currentMove >= _library->GetSettings()->GetMaximalAttacks()) {
|
||||
throw ArbUt::Exception("This pokemon already has the maximal allowed moves.");
|
||||
}
|
||||
Assert(v.value() != nullptr);
|
||||
_attacks.Append(ToLearnMethod(v.value(), method));
|
||||
return *this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user