Update CreatureLib.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-02-16 12:19:14 +01:00
parent 5bbb880700
commit 85d402c2c1
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
2 changed files with 4 additions and 4 deletions

View File

@ -44,7 +44,7 @@ class PkmnLibConan(ConanFile):
self.options["AngelScript"].link_std_statically = True
def requirements(self):
self.requires("CreatureLib/252be18630a42289bbd093dc0823668f545360f7@creaturelib/master")
self.requires("CreatureLib/579ee82f02d6eedb5d924c8b4b056bfdb561ef53@creaturelib/master")
if self.options.script_handler == "angelscript":
self.requires("AngelScript/2.34@AngelScript/Deukhoofd")
else:

View File

@ -3,7 +3,7 @@
int PkmnLib::Battling::DamageLibrary::GetDamage(CreatureLib::Battling::ExecutingAttack* attack,
CreatureLib::Battling::Creature* target, uint8_t hitIndex) const {
auto levelMod = static_cast<float>(2 * attack->GetUser()->GetLevel());
auto hit = attack->GetAttackDataForTarget(target).GetHit(hitIndex);
auto hit = attack->GetAttackDataForTarget(target)->GetHit(hitIndex);
auto bp = hit->GetBasePower();
auto statMod = GetStatModifier(attack, target, hitIndex);
// HOOK: Modify stat modifier
@ -23,7 +23,7 @@ float PkmnLib::Battling::DamageLibrary::GetStatModifier(CreatureLib::Battling::E
uint8_t hitIndex) const {
auto user = attack->GetUser();
// HOOK: allow overriding for which users stat we use.
auto hit = attack->GetAttackDataForTarget(target).GetHit(hitIndex);
auto hit = attack->GetAttackDataForTarget(target)->GetHit(hitIndex);
CreatureLib::Core::Statistic offensiveStat;
CreatureLib::Core::Statistic defensiveStat;
auto learnedMove = dynamic_cast<LearnedMove*>(attack->GetAttack());
@ -61,7 +61,7 @@ float PkmnLib::Battling::DamageLibrary::GetDamageModifier(CreatureLib::Battling:
CreatureLib::Battling::Creature* target,
uint8_t hitIndex) const {
float mod = 1;
auto hit = attack->GetAttackDataForTarget(target).GetHit(hitIndex);
auto hit = attack->GetAttackDataForTarget(target)->GetHit(hitIndex);
mod *= hit->GetEffectiveness();
// HOOK: Modify damage modifier.
return mod;