metaforce/Runtime/Weapon/CWeapon.hpp

76 lines
2.8 KiB
C++
Raw Normal View History

#ifndef __URDE_CWEAPON_HPP__
#define __URDE_CWEAPON_HPP__
#include "World/CActor.hpp"
#include "Weapon/WeaponCommon.hpp"
#include "World/CDamageInfo.hpp"
#include "Collision/CMaterialFilter.hpp"
namespace urde
{
class CWeapon : public CActor
{
public:
enum class EProjectileAttrib
{
None = 0,
2017-09-05 03:00:19 +00:00
PartialCharge = (1 << 0),
PlasmaProjectile = (1 << 1),
Charged = (1 << 2),
Ice = (1 << 3),
Wave = (1 << 4),
Plasma = (1 << 5),
2017-01-15 03:59:37 +00:00
Phazon = (1 << 6),
2018-02-01 23:19:34 +00:00
ComboShot = (1 << 7),
2017-01-15 03:59:37 +00:00
Bombs = (1 << 8),
PowerBombs = (1 << 9),
2017-09-05 03:00:19 +00:00
ArmCannon = (1 << 11),
2017-08-26 04:36:25 +00:00
BigStrike = (1 << 12),
2018-02-01 23:19:34 +00:00
DamageFalloff = (1 << 13),
2017-06-12 04:23:34 +00:00
StaticInterference = (1 << 14),
2017-11-24 08:23:28 +00:00
KeepInCinematic = (1 << 17),
};
private:
2017-01-15 03:59:37 +00:00
EProjectileAttrib xe8_projectileAttribs;
2017-11-24 08:23:28 +00:00
TUniqueId xec_ownerId;
EWeaponType xf0_weaponType;
u32 xf4_;
2018-02-01 23:19:34 +00:00
CMaterialFilter xf8_filter;
u32 x10c_;
2018-02-01 23:19:34 +00:00
CDamageInfo x110_origDamageInfo;
CDamageInfo x12c_curDamageInfo;
float x148_curTime;
float x14c_damageFalloffSpeed;
2017-08-25 06:18:09 +00:00
float x150_damageDuration;
2017-06-12 04:23:34 +00:00
float x154_interferenceDuration;
public:
2017-09-05 03:00:19 +00:00
CWeapon(TUniqueId uid, TAreaId aid, bool active, TUniqueId owner, EWeaponType type,
2017-11-13 06:19:18 +00:00
std::string_view name, const zeus::CTransform& xf, const CMaterialFilter& filter,
2017-09-05 03:00:19 +00:00
const CMaterialList& mList, const CDamageInfo&, EProjectileAttrib attribs, CModelData&& mData);
2017-01-15 03:59:37 +00:00
virtual void Accept(IVisitor &visitor);
2018-02-01 23:19:34 +00:00
bool HasAttrib(EProjectileAttrib attrib) const
{ return (int(xe8_projectileAttribs) & int(attrib)) == int(attrib); }
2017-01-15 03:59:37 +00:00
EProjectileAttrib GetAttribField() const { return xe8_projectileAttribs; }
2018-02-01 23:19:34 +00:00
const CMaterialFilter& GetFilter() const { return xf8_filter; }
void SetFilter(const CMaterialFilter& filter) { xf8_filter = filter; }
2017-11-24 08:23:28 +00:00
TUniqueId GetOwnerId() const { return xec_ownerId; }
void SetOwnerId(TUniqueId oid) { xec_ownerId = oid; }
2018-02-01 23:19:34 +00:00
EWeaponType GetType() const { return xf0_weaponType; }
const CDamageInfo& GetDamageInfo() const { return x12c_curDamageInfo; }
CDamageInfo& DamageInfo() { return x12c_curDamageInfo; }
void SetDamageInfo(const CDamageInfo& dInfo) { x12c_curDamageInfo = dInfo; }
2017-08-25 06:18:09 +00:00
float GetDamageDuration() const { return x150_damageDuration; }
2017-06-12 04:23:34 +00:00
float GetInterferenceDuration() const { return x154_interferenceDuration; }
2018-02-01 23:19:34 +00:00
void Think(float, CStateManager &);
void Render(const CStateManager&) const;
2017-08-13 05:26:14 +00:00
EWeaponCollisionResponseTypes GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&,
2018-02-01 23:19:34 +00:00
const CWeaponMode&, int) const;
void FluidFXThink(EFluidState state, CScriptWater& water, CStateManager& mgr);
};
ENABLE_BITWISE_ENUM(CWeapon::EProjectileAttrib)
}
#endif // __URDE_CWEAPON_HPP__