This commit is contained in:
aozhiwei 2023-03-28 20:51:52 +08:00
parent d07e83656a
commit 7d4c63c8b9
3 changed files with 12 additions and 0 deletions

View File

@ -668,6 +668,16 @@ float BattleDataContext::CalcDmg(Obstacle* target, IBullet* bullet)
return finaly_dmg;
}
float BattleDataContext::CalcReceiveDmg(Creature* sender, float normal_dmg)
{
float finaly_dmg = normal_dmg;
finaly_dmg *= (1 + sender.Get()->GetAbility()->GetAttrAddition(kHVAT_Dmg)); //连加
finaly_dmg *= GetAbility()->GetAttrRuduce(kHVAT_Dmg); //(1-减免) 连乘
finaly_dmg = std::max(1.0f, finaly_dmg);
return std::round(finaly_dmg);
}
float BattleDataContext::CalcDmg(Explosion* e)
{
g_calc_dmg_context = {0};

View File

@ -68,6 +68,7 @@ struct BattleDataContext
float GetDrugEfficacyPct();
float GetTenacityPct();
float GetRecoverHpAdd();
float CalcReceiveDmg(Creature* sender, float normal_dmg);
void SetReviveCoin(int num);
int GetReviveCoin();

View File

@ -323,6 +323,7 @@ int SkillHelper::GetYlzRecoverHp(Creature* sender, Creature* target, const mt::S
float hp =
skill_meta->_number_meta->resume() +
skill_meta->_number_meta->resume_addition() * sender->GetBattleContext()->GetHeroTotalAtk();
hp *= 1.0f + sender->GetBattleContext()->GetRecoverHpAdd();
return hp;
}