This commit is contained in:
aozhiwei 2023-03-29 10:34:04 +08:00
parent c2fee3fc7b
commit 2dec30dbd5
2 changed files with 14 additions and 3 deletions

View File

@ -715,12 +715,22 @@ float BattleDataContext::GetMaxHP()
float BattleDataContext::GetDef()
{
return hero_ability_->GetDef();
float def = hero_ability_->GetDef();
def += owner_.Get()->GetAbility()->GetAttrAbs(kHAT_Def);
def *= 1.0f + owner_.Get()->GetAbility()->GetAttrRate(kHAT_Def);
def *= 1.0f + owner_.Get()->GetAbility()->GetAttrAddition(kHAT_Def) -
owner_.Get()->GetAbility()->GetAttrRuduce(kHAT_Def);
return def;
}
float BattleDataContext::GetHeroTotalAtk()
{
return hero_ability_->GetAtk();
float atk = hero_ability_->GetAtk();
atk += owner_.Get()->GetAbility()->GetAttrAbs(kHAT_Atk);
atk *= 1.0f + owner_.Get()->GetAbility()->GetAttrRate(kHAT_Atk);
atk *= 1.0f + owner_.Get()->GetAbility()->GetAttrAddition(kHAT_Atk) -
owner_.Get()->GetAbility()->GetAttrRuduce(kHAT_Atk);
return atk;
}
float BattleDataContext::GetWeaponAtk(IBullet* bullet)

View File

@ -12,6 +12,7 @@
#include "human.h"
#include "team.h"
#include "collision.h"
#include "battledatacontext.h"
#include "mt/Buff.h"
#include "mt/Skill.h"
@ -35,7 +36,7 @@ void CallFuncBuff::Activate()
hold_param2_ = meta->GetBuffParam2(this);
if (GetCaster().Get()) {
float dmg = hold_param2_;
dmg = owner->CalcReceiveDmg(GetCaster().Get(), dmg);
dmg = owner->GetBattleContext()->CalcReceiveDmg(GetCaster().Get(), dmg);
float dmg_out = 0.0f;
owner->DecHP(dmg,
GetCaster().Get()->GetUniId(),