2019-12-22 20:04:07 +00:00
|
|
|
#include "Runtime/Weapon/CWaveBuster.hpp"
|
|
|
|
|
|
|
|
#include "Runtime/CSimplePool.hpp"
|
|
|
|
#include "Runtime/GameGlobalObjects.hpp"
|
2017-09-10 00:36:21 +00:00
|
|
|
|
2020-05-10 01:17:20 +00:00
|
|
|
#include "TCastTo.hpp" // Generated file, do not modify include path
|
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2017-09-10 00:36:21 +00:00
|
|
|
|
|
|
|
CWaveBuster::CWaveBuster(const TToken<CWeaponDescription>& desc, EWeaponType type, const zeus::CTransform& xf,
|
2018-12-08 05:30:43 +00:00
|
|
|
EMaterialTypes matType, const CDamageInfo& dInfo, TUniqueId uid, TAreaId aid, TUniqueId owner,
|
|
|
|
TUniqueId homingTarget, EProjectileAttrib attrib)
|
2017-09-10 00:36:21 +00:00
|
|
|
: CGameProjectile(true, desc, "WaveBuster", type, xf, matType, dInfo, uid, aid, owner, homingTarget, attrib, false,
|
2019-02-24 07:15:54 +00:00
|
|
|
zeus::skOne3f, {}, -1, false)
|
2018-12-08 05:30:43 +00:00
|
|
|
, x2e8_originalXf(xf)
|
|
|
|
, x348_targetPoint(x2e8_originalXf.basis[1].normalized() * 25.f + x2e8_originalXf.origin)
|
|
|
|
, x354_busterSwoosh1(g_SimplePool->GetObj("BusterSwoosh1"))
|
|
|
|
, x360_busterSwoosh2(g_SimplePool->GetObj("BusterSwoosh2"))
|
|
|
|
, x36c_busterSparks(g_SimplePool->GetObj("BusterSparks"))
|
|
|
|
, x378_busterLight(g_SimplePool->GetObj("BusterLight")) {
|
|
|
|
x354_busterSwoosh1.GetObj();
|
|
|
|
x360_busterSwoosh2.GetObj();
|
|
|
|
x36c_busterSparks.GetObj();
|
|
|
|
x378_busterLight.GetObj();
|
|
|
|
x384_busterSwoosh1Gen = std::make_unique<CParticleSwoosh>(x354_busterSwoosh1, 0);
|
|
|
|
x388_busterSwoosh2Gen = std::make_unique<CParticleSwoosh>(x360_busterSwoosh2, 0);
|
|
|
|
x38c_busterSparksGen = std::make_unique<CElementGen>(x36c_busterSparks);
|
|
|
|
x390_busterLightGen = std::make_unique<CElementGen>(x378_busterLight);
|
2017-09-10 00:36:21 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void CWaveBuster::UpdateFx(const zeus::CTransform& xf, float dt, CStateManager& mgr) {}
|
2017-09-10 00:36:21 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void CWaveBuster::ResetBeam(bool deactivate) {}
|
2017-09-10 00:36:21 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void CWaveBuster::SetNewTarget(TUniqueId id) {}
|
2017-09-10 00:36:21 +00:00
|
|
|
|
2020-05-10 01:17:20 +00:00
|
|
|
void CWaveBuster::Accept(IVisitor& visitor) { visitor.Visit(this); }
|
|
|
|
|
2020-05-10 01:24:07 +00:00
|
|
|
void CWaveBuster::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId senderId, CStateManager& mgr) {
|
|
|
|
if (msg == EScriptObjectMessage::Deleted) {
|
|
|
|
DeleteProjectileLight(mgr);
|
|
|
|
} else if (msg == EScriptObjectMessage::Registered) {
|
|
|
|
if (x390_busterLightGen != nullptr && x390_busterLightGen->SystemHasLight()) {
|
|
|
|
const CLight light = x390_busterLightGen->GetLight();
|
|
|
|
CreateProjectileLight("WaveBuster_Light", light, mgr);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Thermal hot
|
|
|
|
xe6_27_thermalVisorFlags = 2;
|
|
|
|
|
|
|
|
x318_ = x2e8_originalXf.origin;
|
|
|
|
x324_ = x34_transform.origin;
|
|
|
|
x330_ = x34_transform.origin;
|
|
|
|
}
|
|
|
|
|
|
|
|
CGameProjectile::AcceptScriptMsg(msg, senderId, mgr);
|
|
|
|
}
|
|
|
|
|
2020-05-10 01:12:09 +00:00
|
|
|
void CWaveBuster::AddToRenderer([[maybe_unused]] const zeus::CFrustum& frustum, CStateManager& mgr) {
|
|
|
|
const auto bounds = GetSortingBounds(mgr);
|
|
|
|
EnsureRendered(mgr, x2e8_originalXf.origin, bounds);
|
|
|
|
}
|
|
|
|
|
2020-03-09 18:47:34 +00:00
|
|
|
std::optional<zeus::CAABox> CWaveBuster::GetTouchBounds() const {
|
|
|
|
if (x3d0_28_) {
|
|
|
|
return std::nullopt;
|
|
|
|
}
|
|
|
|
|
|
|
|
return GetProjectileBounds();
|
|
|
|
}
|
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|