1
This commit is contained in:
parent
194e9f6257
commit
da19616e66
@ -309,7 +309,10 @@ float Car::GetSpeed()
|
||||
void Car::OnBulletHit(Bullet* bullet)
|
||||
{
|
||||
if (!IsDead(room)) {
|
||||
#ifdef NEWGS
|
||||
//超能电磁枪已删除
|
||||
#ifdef ATTR
|
||||
float finaly_dmg = bullet->sender.Get()->GetBattleContext()->CalcDmg(this, bullet);
|
||||
#else
|
||||
float finaly_dmg = 0;
|
||||
float atk_rate = 0;
|
||||
float def_rate = 0;
|
||||
@ -317,12 +320,6 @@ void Car::OnBulletHit(Bullet* bullet)
|
||||
#if 1
|
||||
finaly_dmg += bullet->gun_meta->i->atk_mech();
|
||||
#endif
|
||||
#else
|
||||
float dmg = bullet->GetAtk() + bullet->gun_meta->i->atk_mech();
|
||||
float def = GetDef() * (1 + GetAbility()->GetAttrRate(kHAT_Def)) +
|
||||
GetAbility()->GetAttrAbs(kHAT_Def);
|
||||
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
||||
finaly_dmg = std::max(finaly_dmg, 0.0f);
|
||||
#endif
|
||||
if (bullet->meta->buff_meta) {
|
||||
MustBeAddBuff(bullet->sender.Get(), bullet->meta->i->buffid());
|
||||
|
@ -143,10 +143,14 @@ void Hero::OnBulletHit(Bullet* bullet)
|
||||
|
||||
RemoveBuffByEffectId(kBET_PeaceMode);
|
||||
if (!IsDead(room) && (bullet->IsBomb() || bullet->sender.Get()->team_id != team_id)) {
|
||||
#ifdef ATTR
|
||||
float finaly_dmg = bullet->sender.Get()->GetBattleContext()->CalcDmg(this, bullet);
|
||||
#else
|
||||
float finaly_dmg = 0;
|
||||
float atk_rate = 0;
|
||||
float def_rate = 0;
|
||||
bullet->CalcDmg(this, finaly_dmg, atk_rate, def_rate);
|
||||
#endif
|
||||
if (bullet->sender.Get()->IsHuman()) {
|
||||
bullet->sender.Get()->AsHuman()->stats.damage_amount_out += finaly_dmg;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user