1
This commit is contained in:
parent
5c0b89575f
commit
9e8ea7c971
@ -246,7 +246,7 @@ private:
|
||||
pCrit = (hero_meta->GetBasicMeta()->pOrigCrit() + pCritAm) * (1 + pCritRateSe) * (1 + pCritRateIn);
|
||||
|
||||
float vCrit = 0.0f;
|
||||
vCrit = (1 + hero_meta->GetBasicMeta()->vOrigCrit()) * (1 + pCrit / hero_meta->GetBasicMeta()->pBaseCrit()); - 1;
|
||||
vCrit = (1 + hero_meta->GetBasicMeta()->vOrigCrit()) * (1 + pCrit / hero_meta->GetBasicMeta()->pBaseCrit()) - 1;
|
||||
crit_ = vCrit;
|
||||
}
|
||||
}
|
||||
@ -755,7 +755,6 @@ float BattleDataContext::CalcDmg(Creature* target, IBullet* bullet)
|
||||
{
|
||||
g_calc_dmg_context = {0};
|
||||
g_calc_dmg_context.is_crit = 0;
|
||||
#ifdef NEW_NUM
|
||||
float X = (1 + hero_ability_->GetCrit()) * (1 - target->GetNetData()->GetBlock()) - 1;
|
||||
if (X > 0.00001f) {
|
||||
float vCritBon = 0.0f;
|
||||
@ -774,77 +773,13 @@ float BattleDataContext::CalcDmg(Creature* target, IBullet* bullet)
|
||||
float vNormalDamageDealtRateIn = 0.0f;
|
||||
float vNormalDamageTakenRateIn = 0.0f;
|
||||
float vDmg = vAttack * vBullet / BDM * (1 + vNormalDamageDealtRateIn) * ( 1 + vNormalDamageTakenRateIn);
|
||||
return std::round(vDmg);
|
||||
#else
|
||||
|
||||
g_calc_dmg_context.is_crit = IsCrit(bullet) ? 1 : 0;
|
||||
if (owner_.Get()->IsEntityType(ET_Hero)) {
|
||||
int i = 0;
|
||||
}
|
||||
|
||||
float total_atk = GetTotalAtk(bullet);
|
||||
if (bullet->GetSkillMeta() && bullet->GetSkillMeta()->_number_meta) {
|
||||
switch (bullet->GetSkillMeta()->GetMagicId()) {
|
||||
case MAGIC_20201_HX:
|
||||
{
|
||||
total_atk = bullet->GetSkillMeta()->_number_meta->damage() +
|
||||
bullet->GetSkillMeta()->_number_meta->damage_addition() * GetHeroTotalAtk();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
float normal_dmg = total_atk *
|
||||
(1 - target->GetNetData()->GetDef() / (target->GetNetData()->GetDef() + 200));
|
||||
if (g_calc_dmg_context.is_crit) {
|
||||
normal_dmg *= 1.5;
|
||||
}
|
||||
float finaly_dmg = normal_dmg;
|
||||
float dmg_addition = 0.0f;
|
||||
Buff* buff = owner_.Get()->GetBuffByEffectId(kBET_DistanceDmgAddition);
|
||||
if (buff) {
|
||||
DistanceDmgAdditionBuff* spec_buff = (DistanceDmgAdditionBuff*)buff;
|
||||
float distance = owner_.Get()->GetPos().Distance2D2(target->GetPos());
|
||||
if (distance > spec_buff->distance && spec_buff->distance > 0.00001f) {
|
||||
dmg_addition += std::min(10.0f, (distance / spec_buff->distance) * spec_buff->add);
|
||||
} else {
|
||||
dmg_addition += spec_buff->min_add;
|
||||
}
|
||||
#ifdef MYDEBUG
|
||||
if (owner_.Get() && owner_.Get()->IsPlayer()) {
|
||||
owner_.Get()->SendDebugMsg(a8::Format("兔子被动 distance:%f dmg_addition:%f",
|
||||
{
|
||||
distance,
|
||||
dmg_addition
|
||||
}));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
dmg_addition += owner_.Get()->GetAbility()->GetAttrAddition(kHVAT_Dmg);
|
||||
finaly_dmg *= (1 + dmg_addition); //连加
|
||||
#if 1
|
||||
if (target->GetAbility()->GetAttrRuduce(kHVAT_Dmg) > 0.0001) {
|
||||
finaly_dmg *= target->GetAbility()->GetAttrRuduce(kHVAT_Dmg); //(1-减免) 连乘
|
||||
}
|
||||
#else
|
||||
finaly_dmg *= (1 - target->GetAbility()->GetAttrRuduce(kHVAT_Dmg)); //(1-减免) 连乘
|
||||
#endif
|
||||
|
||||
#if 1
|
||||
if (owner_.Get()->IsAndroid() && owner_.Get()->AsAndroid()->robot_meta->dmg_ratio() > 0.0001f) {
|
||||
finaly_dmg *= owner_.Get()->AsAndroid()->robot_meta->dmg_ratio();
|
||||
}
|
||||
#endif
|
||||
|
||||
finaly_dmg = std::max(1.0f, finaly_dmg);
|
||||
if (g_calc_dmg_context.is_crit) {
|
||||
g_calc_dmg_context.crit_dmg = finaly_dmg;
|
||||
}
|
||||
float vEbc = 0.0f;
|
||||
float vEd = 0.0f;
|
||||
float DDR = 0.0f;
|
||||
float DTR = 0.0f;
|
||||
float finaly_dmg = vDmg * vEbc * vEd * (1 + DDR) * (1 + DTR);
|
||||
return std::round(finaly_dmg);
|
||||
#endif
|
||||
}
|
||||
|
||||
float BattleDataContext::CalcDmg(Obstacle* target, IBullet* bullet)
|
||||
|
Loading…
x
Reference in New Issue
Block a user