This commit is contained in:
aozhiwei 2022-09-07 17:46:22 +08:00
parent 774ab0e2dd
commit 76383b40e9

View File

@ -20,40 +20,62 @@ public:
float GetHP()
{
return hero_meta->i->hp();
return hp_;
}
float GetAtk()
{
return hero_meta->i->damage();
return atk_;
}
float GetDef()
{
return hero_meta->i->defence();
return def_;
}
float GetCritAtk()
{
return hero_meta->i->crit_atk();
return crit_atk_;
}
float GetCritAtkRatio()
{
return hero_meta->i->crit_atk_ratio();
return crit_atk_ratio_;
}
float GetDodge()
{
return hero_meta->i->miss();
return dodge_;
}
float GetDodgeDamageRuduce()
{
return hero_meta->i->miss_damage_ruduce();
return dodge_damage_ruduce_;
}
void Init()
{
if (hero_dto) {
DtoInit();
} else {
DefaultInit();
}
}
private:
void DefaultInit()
{
hp_ = hero_meta->i->hp();
atk_ = hero_meta->i->damage();
def_ = hero_meta->i->defence();
crit_atk_ = hero_meta->i->crit_atk();
crit_atk_ratio_ = hero_meta->i->crit_atk_ratio();
dodge_ = hero_meta->i->miss();
dodge_damage_ruduce_ = hero_meta->i->miss_damage_ruduce();
}
void DtoInit()
{
}
@ -62,7 +84,7 @@ private:
float hp_ = 0.0f;
float atk_ = 0.0f;
float def = 0.0f;
float def_ = 0.0f;
float crit_atk_ = 0.0f;
float crit_atk_ratio_ = 0.0f;
float dodge_ = 0.0f;
@ -93,6 +115,22 @@ public:
}
void Init()
{
if (weapon_dto) {
DtoInit();
} else {
DefaultInit();
}
}
private:
void DefaultInit()
{
}
void DtoInit()
{
}