Changed DamageLibrary to use appropriate integer types, instead of 'int'.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
7f197b05a3
commit
e7d3c6afd4
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue