2016-04-19 21:25:26 +00:00
|
|
|
#ifndef __URDE_CDAMAGEINFO_HPP__
|
|
|
|
#define __URDE_CDAMAGEINFO_HPP__
|
|
|
|
|
|
|
|
#include "RetroTypes.hpp"
|
2016-11-22 20:43:16 +00:00
|
|
|
#include "Weapon/CWeaponMgr.hpp"
|
2016-12-22 19:57:21 +00:00
|
|
|
#include "Weapon/CWeaponMode.hpp"
|
2016-04-19 21:25:26 +00:00
|
|
|
|
2017-01-27 02:58:21 +00:00
|
|
|
namespace DataSpec
|
2016-04-19 21:25:26 +00:00
|
|
|
{
|
2017-01-27 02:58:21 +00:00
|
|
|
struct SShotParam;
|
|
|
|
}
|
2016-04-19 21:25:26 +00:00
|
|
|
|
2017-01-27 02:58:21 +00:00
|
|
|
namespace urde
|
|
|
|
{
|
2016-05-20 09:17:51 +00:00
|
|
|
class CDamageVulnerability;
|
2016-04-19 21:25:26 +00:00
|
|
|
class CDamageInfo
|
|
|
|
{
|
2016-12-22 19:57:21 +00:00
|
|
|
CWeaponMode x0_weaponMode;
|
2016-05-20 09:17:51 +00:00
|
|
|
float x8_damage;
|
|
|
|
float xc_radiusDamage;
|
2016-04-19 21:25:26 +00:00
|
|
|
float x10_radius;
|
|
|
|
float x14_knockback;
|
2017-08-19 06:52:13 +00:00
|
|
|
bool x18_noImmunity = false;
|
2017-01-27 02:58:21 +00:00
|
|
|
|
2016-04-19 21:25:26 +00:00
|
|
|
public:
|
2016-04-25 05:46:28 +00:00
|
|
|
CDamageInfo() = default;
|
2016-04-19 21:25:26 +00:00
|
|
|
CDamageInfo(CInputStream& in)
|
|
|
|
{
|
|
|
|
in.readUint32Big();
|
2016-12-22 19:57:21 +00:00
|
|
|
x0_weaponMode = CWeaponMode(EWeaponType(in.readUint32Big()));
|
2016-05-20 09:17:51 +00:00
|
|
|
x8_damage = in.readFloatBig();
|
|
|
|
xc_radiusDamage = x8_damage;
|
2016-04-19 21:25:26 +00:00
|
|
|
x10_radius = in.readFloatBig();
|
|
|
|
x14_knockback = in.readFloatBig();
|
|
|
|
}
|
2017-01-15 03:59:37 +00:00
|
|
|
CDamageInfo(const CWeaponMode& mode, float damage, float radius, float knockback)
|
2017-01-27 02:58:21 +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
|
|
|
|
2016-12-22 19:57:21 +00:00
|
|
|
CDamageInfo(const CDamageInfo& other) = default;
|
2017-01-27 02:58:21 +00:00
|
|
|
CDamageInfo(const DataSpec::SShotParam& other);
|
|
|
|
CDamageInfo& operator=(const DataSpec::SShotParam& other);
|
2016-05-20 09:17:51 +00:00
|
|
|
|
2016-12-22 19:57:21 +00:00
|
|
|
const CWeaponMode& GetWeaponMode() const { return x0_weaponMode; }
|
|
|
|
float GetRadius() const { return x10_radius; }
|
|
|
|
void SetRadius(float r) { x10_radius = r; }
|
|
|
|
float GetKnockBackPower() const { return x14_knockback; }
|
|
|
|
float GetDamage() const { return x8_damage; }
|
2017-03-29 02:51:12 +00:00
|
|
|
float GetDamage(const CDamageVulnerability& dVuln) const;
|
2016-05-20 09:17:51 +00:00
|
|
|
float GetRadiusDamage() const { return xc_radiusDamage; }
|
2017-03-29 02:51:12 +00:00
|
|
|
float GetRadiusDamage(const CDamageVulnerability& dVuln) const;
|
2017-08-19 06:52:13 +00:00
|
|
|
bool NoImmunity() const { return x18_noImmunity; }
|
2016-04-19 21:25:26 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CDAMAGEINFO_HPP__
|