From 2480a9473ece5681213757341b23c5a2ac58d6f1 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 6 Sep 2022 13:35:54 +0800 Subject: [PATCH] 1 --- server/gameserver/battledatacontext.cc | 8 ++++---- server/gameserver/battledatacontext.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/gameserver/battledatacontext.cc b/server/gameserver/battledatacontext.cc index 882778a7..7ac16481 100644 --- a/server/gameserver/battledatacontext.cc +++ b/server/gameserver/battledatacontext.cc @@ -270,7 +270,7 @@ void BattleDataContext::CalcBattleStat(struct PlayerStats* stats) float BattleDataContext::CalcDmg(Creature* target, Bullet* bullet) { - float total_atk = GetTotalAtk(); + float total_atk = GetTotalAtk(bullet); float normal_dmg = total_atk * (1 - target->GetBattleContext()->GetDef() / 1000); float crit = IsCrit() ? GetCritRate() : 0; float dodge = IsDodge() ? GetDodgeRate() : 0; @@ -278,9 +278,9 @@ float BattleDataContext::CalcDmg(Creature* target, Bullet* bullet) return finaly_dmg; } -float BattleDataContext::GetTotalAtk() +float BattleDataContext::GetTotalAtk(Bullet* bullet) { - float total_atk = (GetHeroTotalAtk() / 100 + 1) * GetWeaponAtk(); + float total_atk = (GetHeroTotalAtk() / 100 + 1) * GetWeaponAtk(bullet); return total_atk; } @@ -294,7 +294,7 @@ float BattleDataContext::GetHeroTotalAtk() return atk_; } -float BattleDataContext::GetWeaponAtk() +float BattleDataContext::GetWeaponAtk(Bullet* bullet) { return 0; } diff --git a/server/gameserver/battledatacontext.h b/server/gameserver/battledatacontext.h index 22c20134..f11ddfbc 100644 --- a/server/gameserver/battledatacontext.h +++ b/server/gameserver/battledatacontext.h @@ -58,9 +58,9 @@ private: std::array& attr_rate, std::shared_ptr obj); - float GetTotalAtk(); + float GetTotalAtk(Bullet* bullet); float GetHeroTotalAtk(); - float GetWeaponAtk(); + float GetWeaponAtk(Bullet* bullet); bool IsCrit(); float GetCritRate(); bool IsDodge();