2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-12-22 19:57:21 +00:00
|
|
|
|
2019-09-23 19:00:23 +00:00
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
#include "Runtime/RetroTypes.hpp"
|
|
|
|
#include "Runtime/Collision/CMaterialFilter.hpp"
|
|
|
|
#include "Runtime/World/CActor.hpp"
|
|
|
|
#include "Runtime/World/CDamageInfo.hpp"
|
|
|
|
#include "Runtime/Weapon/WeaponCommon.hpp"
|
2016-12-22 19:57:21 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2018-12-08 05:30:43 +00:00
|
|
|
class CWeapon : public CActor {
|
2018-02-09 07:12:26 +00:00
|
|
|
protected:
|
2018-12-08 05:30:43 +00:00
|
|
|
EProjectileAttrib xe8_projectileAttribs;
|
|
|
|
TUniqueId xec_ownerId;
|
|
|
|
EWeaponType xf0_weaponType;
|
|
|
|
CMaterialFilter xf8_filter;
|
|
|
|
CDamageInfo x110_origDamageInfo;
|
|
|
|
CDamageInfo x12c_curDamageInfo;
|
|
|
|
float x148_curTime = 0.f;
|
|
|
|
float x14c_damageFalloffSpeed = 0.f;
|
|
|
|
float x150_damageDuration = 0.f;
|
|
|
|
float x154_interferenceDuration = 0.f;
|
|
|
|
|
2016-12-22 19:57:21 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CWeapon(TUniqueId uid, TAreaId aid, bool active, TUniqueId owner, EWeaponType type, std::string_view name,
|
|
|
|
const zeus::CTransform& xf, const CMaterialFilter& filter, const CMaterialList& mList, const CDamageInfo&,
|
|
|
|
EProjectileAttrib attribs, CModelData&& mData);
|
2016-12-22 19:57:21 +00:00
|
|
|
|
2019-08-09 12:45:18 +00:00
|
|
|
void Accept(IVisitor& visitor) override;
|
2018-12-08 05:30:43 +00:00
|
|
|
bool HasAttrib(EProjectileAttrib attrib) const { return (int(xe8_projectileAttribs) & int(attrib)) == int(attrib); }
|
|
|
|
EProjectileAttrib GetAttribField() const { return xe8_projectileAttribs; }
|
2020-03-06 15:16:55 +00:00
|
|
|
void AddAttrib(EProjectileAttrib attrib) { xe8_projectileAttribs |= attrib; }
|
2018-12-08 05:30:43 +00:00
|
|
|
const CMaterialFilter& GetFilter() const { return xf8_filter; }
|
|
|
|
void SetFilter(const CMaterialFilter& filter) { xf8_filter = filter; }
|
|
|
|
TUniqueId GetOwnerId() const { return xec_ownerId; }
|
|
|
|
void SetOwnerId(TUniqueId oid) { xec_ownerId = oid; }
|
|
|
|
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; }
|
|
|
|
float GetDamageDuration() const { return x150_damageDuration; }
|
2020-03-06 15:16:55 +00:00
|
|
|
void SetDamageDuration(float dur) { x150_damageDuration = dur; }
|
2018-12-08 05:30:43 +00:00
|
|
|
float GetInterferenceDuration() const { return x154_interferenceDuration; }
|
2020-03-06 15:16:55 +00:00
|
|
|
void SetInterferenceDuration(float dur) { x154_interferenceDuration = dur; }
|
2016-12-22 19:57:21 +00:00
|
|
|
|
2019-08-09 12:45:18 +00:00
|
|
|
void Think(float, CStateManager&) override;
|
2020-04-09 17:28:20 +00:00
|
|
|
void Render(CStateManager&) override;
|
2018-12-08 05:30:43 +00:00
|
|
|
EWeaponCollisionResponseTypes GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&,
|
2019-08-09 12:45:18 +00:00
|
|
|
const CWeaponMode&, EProjectileAttrib) const override;
|
|
|
|
void FluidFXThink(EFluidState state, CScriptWater& water, CStateManager& mgr) override;
|
2016-12-22 19:57:21 +00:00
|
|
|
};
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|