2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 17:07:41 +00:00

CDamageInfo and CDamageVulnerability imps

This commit is contained in:
2017-02-09 21:43:07 -08:00
parent 48c295f9d8
commit 43bfb638c9
8 changed files with 265 additions and 73 deletions

View File

@@ -5,8 +5,6 @@
namespace urde
{
float CDamageInfo::GetRadiusDamage(const CDamageVulnerability& dVuln) { return 0.f; }
CDamageInfo::CDamageInfo(const DataSpec::SShotParam& other)
: x0_weaponMode(CWeaponMode(EWeaponType(other.weaponType), other.Charged(), other.Comboed(), other.InstaKill()))
, x8_damage(other.damage)
@@ -26,4 +24,27 @@ CDamageInfo& CDamageInfo::operator=(const DataSpec::SShotParam& other)
x18_ = false;
return *this;
}
float CDamageInfo::GetDamage(const CDamageVulnerability& dVuln)
{
EVulnerability vuln = dVuln.GetVulnerability(x0_weaponMode, false);
if (vuln == EVulnerability::Reflect)
return 0.f;
else if (vuln == EVulnerability::DoubleDamage)
return 2.f * x8_damage;
return x8_damage;
}
float CDamageInfo::GetRadiusDamage(const CDamageVulnerability& dVuln)
{
EVulnerability vuln = dVuln.GetVulnerability(x0_weaponMode, false);
if (vuln == EVulnerability::Reflect)
return 0.f;
else if (vuln == EVulnerability::DoubleDamage)
return 2.f * xc_radiusDamage;
return xc_radiusDamage;
}
}