1
This commit is contained in:
parent
0d4335cd4e
commit
35ad701382
@ -2,10 +2,19 @@
|
||||
|
||||
#include "attr.h"
|
||||
|
||||
#include "creature.h"
|
||||
|
||||
float Attr::CalcDmg(Creature* target, int weapon_uniid)
|
||||
{
|
||||
float total_atk = (GetTotalAtk() / 100 + 1) * GetWeaponAtk();
|
||||
float normal_dmg = total_atk * (1 - target->attr->GetDef() / 1000);
|
||||
float crit = IsCrit() ? 1 + GetCritRate() : 1;
|
||||
float dodge = IsDodge() ? 1 + GetDodgeRate() : 1;
|
||||
}
|
||||
|
||||
float Attr::GetTotalAtk()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
float Attr::GetDef()
|
||||
@ -33,3 +42,14 @@ bool Attr::IsDodge()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
float Attr::GetCritRate()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
float Attr::GetDodgeRate()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -21,10 +21,13 @@ class Attr
|
||||
|
||||
float GetDef();
|
||||
private:
|
||||
float GetTotalAtk();
|
||||
float GetHeroTotalAtk();
|
||||
float GetWeaponAtk();
|
||||
bool IsCrit();
|
||||
float GetCritRate();
|
||||
bool IsDodge();
|
||||
float GetDodgeRate();
|
||||
|
||||
private:
|
||||
CreatureWeakPtr owner_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user