More Exo work

This commit is contained in:
Phillip Stephens 2021-06-26 13:31:52 -07:00
parent 5e0c8fe9fd
commit 63c4083bef
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
3 changed files with 39 additions and 7 deletions

View File

@ -7,6 +7,23 @@ namespace metaforce {
class CElementGen; class CElementGen;
namespace MP1 { namespace MP1 {
class CIceAttackProjectile : public CActor { class CIceAttackProjectile : public CActor {
class CTrailObject {
std::unique_ptr<CElementGen> x0_gen1;
std::unique_ptr<CElementGen> x8_explosion;
TUniqueId x10_collisionObj;
float x14_ = 0.f;
CActorLights x18_ = CActorLights(1, zeus::CVector3f(0.f, 0.f, 1.f), 4, 4, false, false, false, 0.1f);
zeus::CVector3f x2f8_;
zeus::CVector3f x304_;
zeus::CVector3f x310_;
int x31c_ = 0;
u8 x320_ = 0;
public:
CTrailObject(CElementGen* gen, TUniqueId uid, const zeus::CVector3f& vec1, const zeus::CVector3f& vec2,
const zeus::CVector3f& vec3)
: x0_gen1(gen), x10_collisionObj(uid), x2f8_(vec1), x304_(vec2), x310_(vec3) {}
};
TToken<CGenDescription> xe8_; TToken<CGenDescription> xe8_;
TToken<CGenDescription> xf0_; TToken<CGenDescription> xf0_;
TToken<CGenDescription> xf8_; TToken<CGenDescription> xf8_;

View File

@ -6,9 +6,10 @@
#include "Runtime/CStateManager.hpp" #include "Runtime/CStateManager.hpp"
#include "Runtime/Collision/CCollisionActor.hpp" #include "Runtime/Collision/CCollisionActor.hpp"
#include "Runtime/Collision/CCollisionActorManager.hpp" #include "Runtime/Collision/CCollisionActorManager.hpp"
#include "Runtime/Graphics/CBooRenderer.hpp"
#include "Runtime/GameGlobalObjects.hpp" #include "Runtime/GameGlobalObjects.hpp"
#include "Runtime/Graphics/CBooRenderer.hpp"
#include "Runtime/MP1/World/CEnergyBall.hpp" #include "Runtime/MP1/World/CEnergyBall.hpp"
#include "Runtime/MP1/World/CIceAttackProjectile.hpp"
#include "Runtime/MP1/World/CMetroidPrimeRelay.hpp" #include "Runtime/MP1/World/CMetroidPrimeRelay.hpp"
#include "Runtime/Particle/CElementGen.hpp" #include "Runtime/Particle/CElementGen.hpp"
#include "Runtime/Particle/CParticleElectric.hpp" #include "Runtime/Particle/CParticleElectric.hpp"
@ -443,7 +444,7 @@ void CMetroidPrimeExo::AddToRenderer(const zeus::CFrustum& frustum, CStateManage
} }
void CMetroidPrimeExo::Render(CStateManager& mgr) { void CMetroidPrimeExo::Render(CStateManager& mgr) {
g_Renderer->SetGXRegister1Color(x8d8_); g_Renderer->SetGXRegister1Color(x8d8_beamColor);
CPatterned::Render(mgr); CPatterned::Render(mgr);
} }
@ -485,7 +486,21 @@ void CMetroidPrimeExo::DoUserAnimEvent(CStateManager& mgr, const CInt32POINode&
} }
return; return;
} }
if (type == EUserEventType::Projectile) {} if (type == EUserEventType::Projectile) {
if (x92c_ == 6) {
auto xf = zeus::lookAt(GetLctrTransform(node.GetLocatorName()).origin + zeus::CVector3f{0.f, 0.f, 1.5f},
mgr.GetPlayer().GetTranslation());
float randAngle = zeus::degToRad(mgr.GetActiveRandom()->Range(-20.f, 20.f));
xf.rotateLocalZ(randAngle);
TUniqueId uid = mgr.AllocateUniqueId();
auto gen1 = g_SimplePool->GetObj(SObjectTag{SBIG('PART'), x930_.x4_particle1});
auto gen2 = g_SimplePool->GetObj(SObjectTag{SBIG('PART'), x930_.x8_particle2});
auto gen3 = g_SimplePool->GetObj(SObjectTag{SBIG('PART'), x930_.xc_particle3});
mgr.AddObject(new CIceAttackProjectile(gen1, gen2, gen3, uid, GetAreaIdAlways(), GetUniqueId(), true, xf,
x930_.x10_dInfo, {-1.f, 1.f}, x930_.x2c_, zeus::degToRad(x930_.x30_),
x930_.x34_texture, x930_.x38_, x930_.x3a_, {}));
}
}
CPatterned::DoUserAnimEvent(mgr, node, type, dt); CPatterned::DoUserAnimEvent(mgr, node, type, dt);
} }
@ -1626,12 +1641,12 @@ void CMetroidPrimeExo::UpdateColorChange(float f1, CStateManager& mgr) {
} }
if (x8e4_ >= 1.f) { if (x8e4_ >= 1.f) {
x8d8_ = x8e0_; x8d8_beamColor = x8e0_;
x8f4_24_ = false; x8f4_24_ = false;
GetModelData()->GetAnimationData()->SetParticleEffectState("ColorChange"sv, false, mgr); GetModelData()->GetAnimationData()->SetParticleEffectState("ColorChange"sv, false, mgr);
} else { } else {
x8e4_ = std::max(1.f, x8e4_ + f1 / 0.3f); x8e4_ = std::max(1.f, x8e4_ + f1 / 0.3f);
x8d8_ = zeus::CColor::lerp(x8dc_, x8e0_, x8e4_); x8d8_beamColor = zeus::CColor::lerp(x8dc_, x8e0_, x8e4_);
} }
} }
@ -1639,7 +1654,7 @@ void CMetroidPrimeExo::sub80278130(const zeus::CColor& col) {
x8e4_ = 0.f; x8e4_ = 0.f;
x8f4_24_ = true; x8f4_24_ = true;
x8e0_ = col; x8e0_ = col;
x8dc_ = x8d8_; x8dc_ = x8d8_beamColor;
} }
void CMetroidPrimeExo::UpdateHeadAnimation(float f1) { void CMetroidPrimeExo::UpdateHeadAnimation(float f1) {

View File

@ -114,7 +114,7 @@ class CMetroidPrimeExo : public CPatterned {
TUniqueId x8cc_headColActor = kInvalidUniqueId; TUniqueId x8cc_headColActor = kInvalidUniqueId;
u32 x8d0_ = 3; u32 x8d0_ = 3;
u32 x8d4_ = 3; u32 x8d4_ = 3;
zeus::CColor x8d8_ = zeus::skBlack; zeus::CColor x8d8_beamColor = zeus::skBlack;
zeus::CColor x8dc_ = zeus::skBlack; zeus::CColor x8dc_ = zeus::skBlack;
zeus::CColor x8e0_ = zeus::skBlack; zeus::CColor x8e0_ = zeus::skBlack;
float x8e4_ = 0.f; float x8e4_ = 0.f;