This commit is contained in:
aozhiwei 2024-01-04 16:41:17 +08:00
parent 6ecd3349e8
commit 2873d27a5a
2 changed files with 2 additions and 39 deletions

View File

@ -79,16 +79,6 @@ public:
return crit_atk_ratio_;
}
float GetDodge()
{
return dodge_;
}
float GetDodgeDamageRuduce()
{
return dodge_damage_ruduce_;
}
float GetBrainLifePct()
{
return brain_life_pct_;
@ -265,8 +255,6 @@ private:
def_ = hero_meta->defence();
crit_atk_ = hero_meta->crit_atk();
crit_atk_ratio_ = hero_meta->crit_atk_ratio();
dodge_ = hero_meta->miss();
dodge_damage_ruduce_ = hero_meta->miss_damage_ruduce();
if (c->room->pve_instance) {
const mt::NpcStandard* standard_meta = mt::NpcStandard::GetById
(c->room->pve_instance->gemini_lv());
@ -395,8 +383,6 @@ private:
def_ = finaly_attr_abs[kHAT_Def] + base_attr_abs[kHAT_Def] * finaly_attr_rate[kHAT_DEF_RATE];
crit_atk_ = finaly_attr_rate[kHAT_CRIT] * 1000;
crit_atk_ratio_ = finaly_attr_rate[kHAT_CRIT_DAMAGE_RATE];
dodge_ = finaly_attr_rate[kHAT_DODGE];
dodge_damage_ruduce_ = finaly_attr_rate[kHAT_DODGE_DAMAGE_RATE];
brain_life_pct_ = finaly_attr_rate[kHAT_BrainLifePct];
skill_cd_pct_ = finaly_attr_rate[kHAT_SkillTime];
rescue_time_pct_ = finaly_attr_rate[kHAT_RescueTime];
@ -414,8 +400,6 @@ private:
float def_ = 0.0f;
float crit_atk_ = 0.0f;
float crit_atk_ratio_ = 0.0f;
float dodge_ = 0.0f;
float dodge_damage_ruduce_ = 0.0f;
float brain_life_pct_ = 0.0f;
float skill_cd_pct_ = 0.0f;
float rescue_time_pct_ = 0.0f;
@ -910,17 +894,15 @@ float BattleDataContext::CalcDmg(Obstacle* target, IBullet* bullet)
float total_atk = GetTotalAtk(bullet);
float normal_dmg = total_atk * (1 - 0 / 1000);
float crit = g_calc_dmg_context.is_crit ? GetCritRate(bullet) : 0;
float dodge = IsDodge(bullet) ? GetDodgeRuduce(bullet) : 0;
float finaly_dmg = normal_dmg * (1.0f + crit + dodge);
float finaly_dmg = normal_dmg * (1.0f + crit);
#ifdef MYDEBUG
if (owner_.Get()->IsPlayer()) {
std::string data = a8::Format
("数值: 子弹攻击物件 total_atk:%f normal_dmg:%f crit:%f dodge:%f finaly_dmg:%f target_def:%f",
("数值: 子弹攻击物件 total_atk:%f normal_dmg:%f crit:%f finaly_dmg:%f target_def:%f",
{
total_atk,
normal_dmg,
crit,
dodge,
finaly_dmg,
0
});
@ -1033,23 +1015,12 @@ bool BattleDataContext::IsCrit(IBullet* bullet)
return GetCrit(bullet) > rnd;;
}
bool BattleDataContext::IsDodge(IBullet* bullet)
{
int rnd = a8::RandEx(0, 1000 - 1);
return GetDodge(bullet) > rnd;;
}
float BattleDataContext::GetCritRate(IBullet* bullet)
{
auto weapon = GetWeaponByUniId(bullet ? bullet->GetWeaponUniId() : 0);
return hero_ability_->GetCritAtkRatio() + (weapon ? weapon->GetCritAtkRatio() : 0);
}
float BattleDataContext::GetDodgeRuduce(IBullet* bullet)
{
return hero_ability_->GetDodgeDamageRuduce();
}
std::shared_ptr<WeaponAbility> BattleDataContext::GetWeaponByUniId(long long weapon_uuid)
{
if (weapon1_ability_ && weapon1_ability_->weapon_uniid == weapon_uuid) {
@ -1170,11 +1141,6 @@ float BattleDataContext::GetCrit(IBullet* bullet)
return hero_ability_->GetCritAtk() + (weapon ? weapon->GetCritAtk() : 0);
}
float BattleDataContext::GetDodge(IBullet* bullet)
{
return hero_ability_->GetDodge();
}
int BattleDataContext::GetClipVolume(Creature* c, Weapon* weapon)
{
if (!weapon->meta) {

View File

@ -98,9 +98,6 @@ private:
bool IsCrit(IBullet* bullet);
float GetCrit(IBullet* bullet);
float GetCritRate(IBullet* bullet);
bool IsDodge(IBullet* bullet);
float GetDodge(IBullet* bullet);
float GetDodgeRuduce(IBullet* bullet);
std::shared_ptr<WeaponAbility> GetWeaponByUniId(long long weapon_uniid);
private: