metaforce/Runtime/World/CDamageInfo.hpp

48 lines
1013 B
C++
Raw Normal View History

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-04-19 21:25:26 +00:00
namespace urde
{
2016-05-20 09:17:51 +00:00
class CDamageVulnerability;
2016-04-19 21:25:26 +00:00
class CDamageInfo
{
EWeaponType x0_type = EWeaponType::None;
union
{
struct
{
bool x4_24_ : 1;
bool x4_25_ : 1;
bool x4_26_ : 1;
};
u8 _dummy = 0;
};
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;
bool x18_ = false;
public:
2016-04-25 05:46:28 +00:00
CDamageInfo() = default;
2016-04-19 21:25:26 +00:00
CDamageInfo(CInputStream& in)
{
in.readUint32Big();
x0_type = 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();
}
2016-05-20 09:17:51 +00:00
float GetRadiusDamage() const { return xc_radiusDamage; }
float GetRadiusDamage(const CDamageVulnerability& dVuln);
2016-04-19 21:25:26 +00:00
};
}
#endif // __URDE_CDAMAGEINFO_HPP__