添加子弹属性
This commit is contained in:
parent
e78921be40
commit
37481d59a1
@ -284,7 +284,11 @@ float Bullet::GetAtk()
|
|||||||
Android* android = (Android*)sender.Get();
|
Android* android = (Android*)sender.Get();
|
||||||
atk *= android->ai->GetAttackRate();
|
atk *= android->ai->GetAttackRate();
|
||||||
}
|
}
|
||||||
return atk;
|
float attr_rate = 1 + sender.Get()->GetAttrRate(kHAT_Atk);
|
||||||
|
if (IsCurrWeapon()) {
|
||||||
|
attr_rate += sender.Get()->GetAttrRate(kHAT_WeaponDmg);
|
||||||
|
}
|
||||||
|
return atk * attr_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bullet::Check(float distance)
|
void Bullet::Check(float distance)
|
||||||
|
@ -267,8 +267,7 @@ float Car::GetSpeed()
|
|||||||
void Car::OnBulletHit(Bullet* bullet)
|
void Car::OnBulletHit(Bullet* bullet)
|
||||||
{
|
{
|
||||||
if (!IsDead(room)) {
|
if (!IsDead(room)) {
|
||||||
float dmg = bullet->GetAtk() * (1 + bullet->sender.Get()->GetAttrRate(kHAT_Atk)) +
|
float dmg = bullet->GetAtk() + bullet->gun_meta->i->atk_mech();
|
||||||
bullet->sender.Get()->GetAttrAbs(kHAT_Atk) + bullet->gun_meta->i->atk_mech();
|
|
||||||
float def = ability.def * (1 + GetAttrRate(kHAT_Def)) +
|
float def = ability.def * (1 + GetAttrRate(kHAT_Def)) +
|
||||||
GetAttrAbs(kHAT_Def);
|
GetAttrAbs(kHAT_Def);
|
||||||
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
||||||
|
@ -82,8 +82,7 @@ void Hero::OnBulletHit(Bullet* bullet)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!IsDead(room) && (bullet->IsBomb() || bullet->sender.Get()->team_id != team_id)) {
|
if (!IsDead(room) && (bullet->IsBomb() || bullet->sender.Get()->team_id != team_id)) {
|
||||||
float dmg = bullet->GetAtk() * (1 + bullet->sender.Get()->GetAttrRate(kHAT_Atk)) +
|
float dmg = bullet->GetAtk();
|
||||||
bullet->sender.Get()->GetAttrAbs(kHAT_Atk);
|
|
||||||
float def = ability.def * (1 + GetAttrRate(kHAT_Def)) +
|
float def = ability.def * (1 + GetAttrRate(kHAT_Def)) +
|
||||||
GetAttrAbs(kHAT_Def);
|
GetAttrAbs(kHAT_Def);
|
||||||
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
||||||
|
@ -3469,13 +3469,8 @@ void Human::OnBulletHit(Bullet* bullet)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!dead && (bullet->IsBomb() || bullet->sender.Get()->team_id != team_id)) {
|
if (!dead && (bullet->IsBomb() || bullet->sender.Get()->team_id != team_id)) {
|
||||||
float attr_rate = 1 + bullet->sender.Get()->GetAttrRate(kHAT_Atk);
|
float dmg = bullet->GetAtk();
|
||||||
if (bullet->IsCurrWeapon()) {
|
float def = ability.def * (1 + GetAttrRate(kHAT_Def)) + GetAttrAbs(kHAT_Def);
|
||||||
attr_rate += bullet->sender.Get()->GetAttrRate(kHAT_WeaponDmg);
|
|
||||||
}
|
|
||||||
float dmg = bullet->GetAtk() * attr_rate + bullet->sender.Get()->GetAttrAbs(kHAT_Atk);
|
|
||||||
float def = ability.def * (1 + GetAttrRate(kHAT_Def)) +
|
|
||||||
GetAttrAbs(kHAT_Def);
|
|
||||||
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
||||||
finaly_dmg = std::max(finaly_dmg, 0.0f);
|
finaly_dmg = std::max(finaly_dmg, 0.0f);
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -487,8 +487,7 @@ void Obstacle::OnBulletHit(Bullet* bullet)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
float dmg = bullet->GetAtk() * (1 + bullet->sender.Get()->GetAttrRate(kHAT_Atk)) +
|
float dmg = bullet->GetAtk();
|
||||||
bullet->sender.Get()->GetAttrAbs(kHAT_Atk);
|
|
||||||
float def = 0;
|
float def = 0;
|
||||||
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
float finaly_dmg = dmg * (1 - def/MetaMgr::Instance()->K);
|
||||||
SetHealth(bullet->room, std::max(0.0f, GetHealth(bullet->room) - finaly_dmg));
|
SetHealth(bullet->room, std::max(0.0f, GetHealth(bullet->room) - finaly_dmg));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user