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