This commit is contained in:
aozhiwei 2023-03-28 20:15:30 +08:00
parent 930d5b1b82
commit 9fb8ef23af
2 changed files with 8 additions and 2 deletions

View File

@ -55,5 +55,7 @@ enum HumanVirtualAttrType_e
{
kHVAT_Begin = 1000,
kHVAT_Dmg = 1001,
kHVAT_BulletAngle = 1002,
kHVAT_WeaponAtk = 1003,
kHVAT_End
};

View File

@ -716,11 +716,15 @@ float BattleDataContext::GetHeroTotalAtk()
float BattleDataContext::GetWeaponAtk(IBullet* bullet)
{
float atk = 0.0f;
auto weapon = GetWeaponByUniId(bullet->GetWeaponUniId());
if (weapon) {
return weapon->GetAtk();
atk = weapon->GetAtk();
} else {
atk = bullet->GetGunMeta()->_atk;
}
return bullet->GetGunMeta()->_atk;
atk *= owner_.Get()->GetAbility()->GetAttrAddition(kHVAT_WeaponAtk);
return atk;
}
bool BattleDataContext::IsCrit(IBullet* bullet)