2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CWEAPON
|
|
|
|
#define _CWEAPON
|
2022-10-04 00:00:46 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
#include "MetroidPrime/CActor.hpp"
|
|
|
|
#include "MetroidPrime/CDamageInfo.hpp"
|
|
|
|
#include "MetroidPrime/Weapons/WeaponTypes.hpp"
|
|
|
|
|
|
|
|
class CWeapon : public CActor {
|
|
|
|
public:
|
2024-09-30 06:02:23 +00:00
|
|
|
enum EProjectileAttrib {
|
|
|
|
kPA_None = 0,
|
|
|
|
kPA_PartialCharge = (1 << 0),
|
|
|
|
kPA_PlasmaProjectile = (1 << 1),
|
|
|
|
kPA_Charged = (1 << 2),
|
|
|
|
kPA_Ice = (1 << 3),
|
|
|
|
kPA_Wave = (1 << 4),
|
|
|
|
kPA_Plasma = (1 << 5),
|
|
|
|
kPA_Phazon = (1 << 6),
|
|
|
|
kPA_ComboShot = (1 << 7),
|
|
|
|
kPA_Bombs = (1 << 8),
|
|
|
|
kPA_PowerBombs = (1 << 9),
|
|
|
|
kPA_BigProjectile = (1 << 10),
|
|
|
|
kPA_ArmCannon = (1 << 11),
|
|
|
|
kPA_BigStrike = (1 << 12),
|
|
|
|
kPA_DamageFalloff = (1 << 13),
|
|
|
|
kPA_StaticInterference = (1 << 14),
|
|
|
|
kPA_PlayerUnFreeze = (1 << 15),
|
|
|
|
kPA_ParticleOPTS = (1 << 16),
|
|
|
|
kPA_KeepInCinematic = (1 << 17),
|
|
|
|
};
|
|
|
|
|
2022-10-27 05:57:38 +00:00
|
|
|
CWeapon(TUniqueId uid, TAreaId areaId, bool active, TUniqueId owner, EWeaponType type,
|
2022-11-09 23:45:24 +00:00
|
|
|
const rstl::string& name, const CTransform4f& xf, const CMaterialFilter& filter,
|
2024-09-30 06:02:23 +00:00
|
|
|
const CMaterialList& mList, const CDamageInfo& dInfo, int attribs,
|
2022-10-27 05:57:38 +00:00
|
|
|
const CModelData& mData);
|
2022-10-04 00:00:46 +00:00
|
|
|
|
|
|
|
// CEntity
|
2023-02-06 17:01:01 +00:00
|
|
|
~CWeapon() override;
|
|
|
|
void Think(float dt, CStateManager& mgr) override;
|
2022-10-04 00:00:46 +00:00
|
|
|
|
|
|
|
// CActor
|
2023-02-06 17:01:01 +00:00
|
|
|
void Render(const CStateManager&) const override;
|
2022-10-04 00:00:46 +00:00
|
|
|
EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&,
|
2024-09-30 06:02:23 +00:00
|
|
|
const CWeaponMode&, int) const override;
|
2023-02-06 17:01:01 +00:00
|
|
|
void FluidFXThink(EFluidState, CScriptWater&, CStateManager&) override;
|
2022-10-04 00:00:46 +00:00
|
|
|
|
2022-10-27 05:57:38 +00:00
|
|
|
void SetDamageFalloffSpeed(float d);
|
2022-10-29 04:22:07 +00:00
|
|
|
|
2024-09-30 06:02:23 +00:00
|
|
|
int GetAttribField() const { return xe8_projectileAttribs; }
|
|
|
|
bool HasAttrib(EProjectileAttrib attrib) const {
|
|
|
|
return (xe8_projectileAttribs & attrib) == attrib; // maybe wrong
|
|
|
|
}
|
2022-10-29 04:22:07 +00:00
|
|
|
TUniqueId GetOwnerId() const { return xec_ownerId; }
|
2024-09-30 06:02:23 +00:00
|
|
|
EWeaponType GetType() const { return xf0_weaponType; }
|
2022-11-24 16:29:09 +00:00
|
|
|
CMaterialFilter GetFilter() const { return xf8_filter; }
|
2022-11-09 23:45:24 +00:00
|
|
|
CDamageInfo& OrigDamageInfo() { return x110_origDamageInfo; }
|
2024-09-30 06:02:23 +00:00
|
|
|
float GetInterferenceDuration() const { return x154_interferenceDuration; }
|
|
|
|
|
|
|
|
void SetOwnerId(TUniqueId id) { xec_ownerId = id; }
|
|
|
|
void SetDamageInfo(const CDamageInfo& dInfo) { x12c_curDamageInfo = dInfo; }
|
|
|
|
void SetFilter(const CMaterialFilter& filter) { xf8_filter = filter; }
|
2022-10-29 04:22:07 +00:00
|
|
|
|
2022-11-09 23:45:24 +00:00
|
|
|
protected:
|
2024-09-30 06:02:23 +00:00
|
|
|
int xe8_projectileAttribs;
|
2022-10-04 00:00:46 +00:00
|
|
|
TUniqueId xec_ownerId;
|
|
|
|
EWeaponType xf0_weaponType;
|
|
|
|
CMaterialFilter xf8_filter;
|
|
|
|
CDamageInfo x110_origDamageInfo;
|
|
|
|
CDamageInfo x12c_curDamageInfo;
|
|
|
|
float x148_curTime;
|
|
|
|
float x14c_damageFalloffSpeed;
|
|
|
|
float x150_damageDuration;
|
|
|
|
float x154_interferenceDuration;
|
|
|
|
};
|
|
|
|
CHECK_SIZEOF(CWeapon, 0x158)
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CWEAPON
|