metaforce/Runtime/World/CDamageInfo.hpp

54 lines
1.5 KiB
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"
#include "Weapon/CWeaponMode.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
{
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;
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_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)
: x0_weaponMode(mode)
, x8_damage(damage)
, xc_radiusDamage(damage)
, x10_radius(radius)
, x14_knockback(knockback)
{}
CDamageInfo(const CDamageInfo& other) = default;
2016-05-20 09:17:51 +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; }
void GetDamage(const CDamageVulnerability& dVuln);
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__