2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-04-19 21:25:26 +00:00
|
|
|
|
2019-09-22 21:52:05 +00:00
|
|
|
#include "Runtime/RetroTypes.hpp"
|
|
|
|
#include "Runtime/Weapon/CWeaponMgr.hpp"
|
|
|
|
#include "Runtime/Weapon/CWeaponMode.hpp"
|
2016-04-19 21:25:26 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace DataSpec {
|
2017-01-27 02:58:21 +00:00
|
|
|
struct SShotParam;
|
|
|
|
}
|
2016-04-19 21:25:26 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2016-05-20 09:17:51 +00:00
|
|
|
class CDamageVulnerability;
|
2018-12-08 05:30:43 +00:00
|
|
|
class CDamageInfo {
|
|
|
|
CWeaponMode x0_weaponMode;
|
|
|
|
float x8_damage = 0.f;
|
|
|
|
float xc_radiusDamage = 0.f;
|
|
|
|
float x10_radius = 0.f;
|
|
|
|
float x14_knockback = 0.f;
|
|
|
|
bool x18_noImmunity = false;
|
2017-01-27 02:58:21 +00:00
|
|
|
|
2016-04-19 21:25:26 +00:00
|
|
|
public:
|
2020-01-31 06:48:04 +00:00
|
|
|
constexpr CDamageInfo() = default;
|
2018-12-08 05:30:43 +00:00
|
|
|
CDamageInfo(CInputStream& in) {
|
|
|
|
in.readUint32Big();
|
|
|
|
x0_weaponMode = CWeaponMode(EWeaponType(in.readUint32Big()));
|
|
|
|
x8_damage = in.readFloatBig();
|
|
|
|
xc_radiusDamage = x8_damage;
|
|
|
|
x10_radius = in.readFloatBig();
|
|
|
|
x14_knockback = in.readFloatBig();
|
|
|
|
}
|
2020-01-31 06:48:04 +00:00
|
|
|
constexpr CDamageInfo(const CWeaponMode& mode, float damage, float radius, float knockback)
|
2018-12-08 05:30:43 +00:00
|
|
|
: x0_weaponMode(mode), x8_damage(damage), xc_radiusDamage(damage), x10_radius(radius), x14_knockback(knockback) {}
|
2017-01-15 03:59:37 +00:00
|
|
|
|
2020-01-31 06:48:04 +00:00
|
|
|
constexpr CDamageInfo(const CDamageInfo&) = default;
|
|
|
|
constexpr CDamageInfo& operator=(const CDamageInfo&) = default;
|
|
|
|
|
|
|
|
constexpr CDamageInfo(CDamageInfo&&) = default;
|
|
|
|
constexpr CDamageInfo& operator=(CDamageInfo&&) = default;
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
CDamageInfo(const CDamageInfo&, float);
|
|
|
|
CDamageInfo(const DataSpec::SShotParam& other);
|
|
|
|
CDamageInfo& operator=(const DataSpec::SShotParam& other);
|
2016-05-20 09:17:51 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
const CWeaponMode& GetWeaponMode() const { return x0_weaponMode; }
|
|
|
|
void SetWeaponMode(const CWeaponMode& mode) { x0_weaponMode = mode; }
|
|
|
|
float GetRadius() const { return x10_radius; }
|
|
|
|
void SetRadius(float r) { x10_radius = r; }
|
|
|
|
float GetKnockBackPower() const { return x14_knockback; }
|
|
|
|
void SetKnockBackPower(float k) { x14_knockback = k; }
|
|
|
|
float GetDamage() const { return x8_damage; }
|
|
|
|
void SetDamage(float d) { x8_damage = d; }
|
|
|
|
float GetDamage(const CDamageVulnerability& dVuln) const;
|
|
|
|
float GetRadiusDamage() const { return xc_radiusDamage; }
|
2019-06-27 01:06:03 +00:00
|
|
|
void SetRadiusDamage(float r) { xc_radiusDamage = r; }
|
2018-12-08 05:30:43 +00:00
|
|
|
float GetRadiusDamage(const CDamageVulnerability& dVuln) const;
|
|
|
|
bool NoImmunity() const { return x18_noImmunity; }
|
|
|
|
void SetNoImmunity(bool b) { x18_noImmunity = b; }
|
|
|
|
void MultiplyDamage(float m) {
|
|
|
|
x8_damage *= m;
|
|
|
|
xc_radiusDamage *= m;
|
|
|
|
x14_knockback *= m;
|
|
|
|
}
|
|
|
|
void MultiplyDamageAndRadius(float m) {
|
|
|
|
x8_damage *= m;
|
|
|
|
xc_radiusDamage *= m;
|
|
|
|
x10_radius *= m;
|
|
|
|
x14_knockback *= m;
|
|
|
|
}
|
2016-04-19 21:25:26 +00:00
|
|
|
};
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|