Changed DamageLibrary to use appropriate integer types, instead of 'int'.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-03-04 18:28:14 +01:00
parent 7f197b05a3
commit e7d3c6afd4
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
2 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@
#include "../ScriptHandling/ScriptMacros.hpp"
using namespace CreatureLib::Battling;
int DamageLibrary::GetDamage(ExecutingAttack* attack, Creature* target, uint8_t hitIndex) const {
uint32_t DamageLibrary::GetDamage(ExecutingAttack* attack, Creature* target, uint8_t hitIndex) const {
auto levelMod = static_cast<float>(2 * attack->GetUser()->GetLevel());
auto hit = attack->GetAttackDataForTarget(target)->GetHit(hitIndex);
auto bp = hit->GetBasePower();
@ -14,7 +14,7 @@ int DamageLibrary::GetDamage(ExecutingAttack* attack, Creature* target, uint8_t
return damage;
}
int DamageLibrary::GetBasePower(ExecutingAttack* attack, Creature* target, uint8_t hitIndex) const {
uint8_t DamageLibrary::GetBasePower(ExecutingAttack* attack, Creature* target, uint8_t hitIndex) const {
auto bp = attack->GetAttack()->GetAttack()->GetBasePower();
HOOK(OverrideBasePower, attack, attack, target, hitIndex, &bp);
return bp;

View File

@ -8,9 +8,9 @@ namespace CreatureLib::Battling {
class DamageLibrary {
public:
virtual ~DamageLibrary() = default;
virtual int GetDamage(ExecutingAttack* attack, Creature* target, uint8_t hitIndex) const;
virtual uint32_t GetDamage(ExecutingAttack* attack, Creature* target, uint8_t hitIndex) const;
virtual int GetBasePower(ExecutingAttack* attack, Creature* target, uint8_t hitIndex) const;
virtual uint8_t GetBasePower(ExecutingAttack* attack, Creature* target, uint8_t hitIndex) const;
virtual float GetStatModifier(ExecutingAttack* attack, Creature* target, uint8_t hitIndex) const;
virtual float GetDamageModifier(ExecutingAttack* attack, Creature* target, uint8_t hitIndex) const;
};