mirror of https://github.com/AxioDL/metaforce.git
Minor fixes for CMetroidPrimeExo
This commit is contained in:
parent
01ee9a83b4
commit
a6df91b795
|
@ -503,7 +503,7 @@ void CMetroidPrimeExo::Run(CStateManager& mgr, EStateMsg msg, float arg) {
|
|||
if (msg == EStateMsg::Activate) {
|
||||
x92c_ = 10;
|
||||
x1084_ = 1.9666666f;
|
||||
TUniqueId wpId = sub802769e0(mgr, true);
|
||||
TUniqueId wpId = GetNextAttackWaypoint(mgr, true);
|
||||
if (TCastToConstPtr<CScriptWaypoint> wp = mgr.GetObjectById(wpId)) {
|
||||
GetBodyController()->SetLocomotionType(sub80275e14(1));
|
||||
SetDestPos(wp->GetTranslation());
|
||||
|
@ -686,7 +686,7 @@ void CMetroidPrimeExo::ProjectileAttack(CStateManager& mgr, EStateMsg msg, float
|
|||
x32c_animState = EAnimState::NotReady;
|
||||
x92c_ = 0;
|
||||
sub802738d4(mgr);
|
||||
x1088_ = 1.2166667;
|
||||
x1088_ = 1.2166667f;
|
||||
xc50_->SetParticleEmission(false);
|
||||
FirePlasmaProjectile(mgr, false);
|
||||
x1254_ = 2;
|
||||
|
@ -731,7 +731,7 @@ void CMetroidPrimeExo::Retreat(CStateManager& mgr, EStateMsg msg, float arg) {
|
|||
x32c_animState = EAnimState::Ready;
|
||||
SendStateToRelay(EScriptObjectState::Zero, mgr);
|
||||
if (TCastToConstPtr<CScriptWaypoint> wp =
|
||||
mgr.GetObjectById(sub80276b3c(mgr, EScriptObjectState::CloseIn, EScriptObjectMessage::Follow))) {
|
||||
mgr.GetObjectById(GetWaypointForBehavior(mgr, EScriptObjectState::CloseIn, EScriptObjectMessage::Follow))) {
|
||||
SetTransform(wp->GetTransform());
|
||||
}
|
||||
x1078_ = 1;
|
||||
|
@ -741,7 +741,7 @@ void CMetroidPrimeExo::Retreat(CStateManager& mgr, EStateMsg msg, float arg) {
|
|||
} else if (msg == EStateMsg::Deactivate) {
|
||||
x32c_animState = EAnimState::NotReady;
|
||||
if (TCastToConstPtr<CScriptWaypoint> wp =
|
||||
mgr.GetObjectById(sub80276b3c(mgr, EScriptObjectState::Retreat, EScriptObjectMessage::Follow))) {
|
||||
mgr.GetObjectById(GetWaypointForBehavior(mgr, EScriptObjectState::Retreat, EScriptObjectMessage::Follow))) {
|
||||
SetTransform(wp->GetTransform());
|
||||
}
|
||||
++x91c_;
|
||||
|
@ -975,7 +975,7 @@ void CMetroidPrimeExo::SetBillboardEmission(CStateManager& mgr, bool emission) {
|
|||
void CMetroidPrimeExo::FreeBillboard(CStateManager& mgr) { mgr.FreeScriptObject(x1044_billboardId); }
|
||||
|
||||
zeus::CVector3f CMetroidPrimeExo::sub8027464c(CStateManager& mgr) {
|
||||
TUniqueId uid = sub80276b3c(mgr, EScriptObjectState::Attack, EScriptObjectMessage::Follow);
|
||||
TUniqueId uid = GetWaypointForBehavior(mgr, EScriptObjectState::Attack, EScriptObjectMessage::Follow);
|
||||
|
||||
float dVar4 = 0.f;
|
||||
zeus::CVector3f tmpVec;
|
||||
|
@ -1195,7 +1195,7 @@ void CMetroidPrimeExo::UpdateTimers(float dt) {
|
|||
}
|
||||
|
||||
void CMetroidPrimeExo::sub80275800(CStateManager& mgr) {
|
||||
TUniqueId tmpId = sub802769e0(mgr, true);
|
||||
TUniqueId tmpId = GetNextAttackWaypoint(mgr, true);
|
||||
|
||||
u32 flags = 0x13c1;
|
||||
if (tmpId != kInvalidUniqueId) {
|
||||
|
@ -1449,7 +1449,7 @@ void CMetroidPrimeExo::SendStateToRelay(EScriptObjectState state, CStateManager&
|
|||
}
|
||||
}
|
||||
|
||||
void CMetroidPrimeExo::sub80276754(CStateManager& mgr) {
|
||||
void CMetroidPrimeExo::GetRelayState(CStateManager& mgr) {
|
||||
x1160_.clear();
|
||||
if (TCastToConstPtr<CMetroidPrimeRelay> relay = mgr.GetObjectById(x568_relayId)) {
|
||||
x1160_ = relay->GetRoomParameters();
|
||||
|
@ -1467,8 +1467,8 @@ void CMetroidPrimeExo::sub80276754(CStateManager& mgr) {
|
|||
}
|
||||
}
|
||||
|
||||
TUniqueId CMetroidPrimeExo::sub802769e0(CStateManager& mgr, bool b1) {
|
||||
TUniqueId uid = sub80276b3c(mgr, EScriptObjectState::Attack, EScriptObjectMessage::Follow);
|
||||
TUniqueId CMetroidPrimeExo::GetNextAttackWaypoint(CStateManager& mgr, bool b1) {
|
||||
TUniqueId uid = GetWaypointForBehavior(mgr, EScriptObjectState::Attack, EScriptObjectMessage::Follow);
|
||||
float lastDot = 0.f;
|
||||
TUniqueId lastUid = kInvalidUniqueId;
|
||||
while (uid != kInvalidUniqueId) {
|
||||
|
@ -1488,7 +1488,7 @@ TUniqueId CMetroidPrimeExo::sub802769e0(CStateManager& mgr, bool b1) {
|
|||
return lastUid;
|
||||
}
|
||||
|
||||
TUniqueId CMetroidPrimeExo::sub80276b3c(CStateManager& mgr, EScriptObjectState state, EScriptObjectMessage msg) {
|
||||
TUniqueId CMetroidPrimeExo::GetWaypointForBehavior(CStateManager& mgr, EScriptObjectState state, EScriptObjectMessage msg) {
|
||||
if (TCastToConstPtr<CMetroidPrimeRelay> relay = mgr.GetObjectById(x568_relayId)) {
|
||||
rstl::reserved_vector<TUniqueId, 8> uids;
|
||||
for (const auto& conn : relay->GetConnectionList()) {
|
||||
|
@ -1538,7 +1538,7 @@ void CMetroidPrimeExo::UpdateRelay(CStateManager& mgr, TAreaId areaId) {
|
|||
}
|
||||
}
|
||||
|
||||
sub80276754(mgr);
|
||||
GetRelayState(mgr);
|
||||
DeactivatePatrolObjects(mgr);
|
||||
}
|
||||
|
||||
|
@ -1557,15 +1557,12 @@ bool CMetroidPrimeExo::IsRelayValid(CStateManager& mgr, TAreaId aid) {
|
|||
}
|
||||
|
||||
bool CMetroidPrimeExo::sub80277224(float f1, CStateManager& mgr) {
|
||||
TUniqueId uid = sub802769e0(mgr, f1 >= 0.f);
|
||||
TUniqueId uid = GetNextAttackWaypoint(mgr, f1 >= 0.f);
|
||||
|
||||
if (TCastToConstPtr<CScriptWaypoint> wp = mgr.GetObjectById(uid)) {
|
||||
const float dist = (wp->GetTranslation() - GetTranslation()).magSquared();
|
||||
const float scaleMag = f1 * (0.57735026f * GetModelData()->GetScale().magSquared());
|
||||
if (f1 < 0.f) {
|
||||
return dist > scaleMag;
|
||||
}
|
||||
return dist < scaleMag;
|
||||
const float scaleMag = f1 * (0.57735026 * GetModelData()->GetScale().magnitude());
|
||||
const float dist = GetTransform().frontVector().dot(wp->GetTranslation() - GetTranslation());
|
||||
return f1 < 0.f ? dist < scaleMag : dist > scaleMag;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -1785,7 +1782,7 @@ void CMetroidPrimeExo::sub80278508(CStateManager& mgr, int w1, bool b1) {
|
|||
x570_ = w1;
|
||||
sub80278130(x588_[x570_].x6c_color);
|
||||
if (TCastToPtr<CCollisionActor> colAct = mgr.ObjectById(x8cc_headColActor)) {
|
||||
if (b1 == false) {
|
||||
if (!b1) {
|
||||
colAct->SetDamageVulnerability(CDamageVulnerability::ImmuneVulnerabilty());
|
||||
mgr.GetPlayer().SetOrbitRequestForTarget(GetUniqueId(), CPlayer::EPlayerOrbitRequest::ActivateOrbitSource, mgr);
|
||||
colAct->RemoveMaterial(EMaterialTypes::Target, EMaterialTypes::Orbit, mgr);
|
||||
|
|
|
@ -235,9 +235,9 @@ class CMetroidPrimeExo : public CPatterned {
|
|||
void SetActorAreaId(CStateManager& mgr, TUniqueId uid, TAreaId aid);
|
||||
void UpdateAreaId(CStateManager& mgr);
|
||||
void SendStateToRelay(EScriptObjectState state, CStateManager& mgr);
|
||||
void sub80276754(CStateManager& mgr);
|
||||
TUniqueId sub802769e0(CStateManager& mgr, bool b1);
|
||||
TUniqueId sub80276b3c(CStateManager& mgr, EScriptObjectState state, EScriptObjectMessage msg);
|
||||
void GetRelayState(CStateManager& mgr);
|
||||
TUniqueId GetNextAttackWaypoint(CStateManager& mgr, bool b1);
|
||||
TUniqueId GetWaypointForBehavior(CStateManager& mgr, EScriptObjectState state, EScriptObjectMessage msg);
|
||||
void UpdateRelay(CStateManager& mgr, TAreaId areaId);
|
||||
bool IsRelayValid(CStateManager& mgr, TAreaId w2);
|
||||
bool sub80277224(float f1, CStateManager& mgr);
|
||||
|
|
|
@ -41,18 +41,18 @@ public:
|
|||
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr) override;
|
||||
[[nodiscard]] TUniqueId GetMetroidPrimeExoId() const { return x34_mpUid; }
|
||||
void SetMetroidPrimeExoId(TUniqueId uid) { x34_mpUid = uid; }
|
||||
float Get_xc84() const { return xc84_f1; }
|
||||
float Get_xc88() const { return xc88_f2; }
|
||||
float Get_xc8c() const { return xc8c_f3; }
|
||||
u32 Get_xc90() const { return xc90_w1; }
|
||||
bool Get_xc94() const { return xc94_b1; }
|
||||
u32 Get_xc98() const { return xc98_w2; }
|
||||
CHealthInfo GetHealthInfo1() const { return xc9c_hInfo1; }
|
||||
CHealthInfo GetHealthInfo2() const { return xca4_hInfo2; }
|
||||
u32 Get_xcac() const { return xcac_w3; }
|
||||
u32 Get_xcb0() const { return xcb0_w4; }
|
||||
u32 Get_xcb4() const { return xcb4_w5; }
|
||||
rstl::reserved_vector<SPrimeExoRoomParameters, 4> GetRoomParameters() const { return xcb8_roomParms; }
|
||||
[[nodiscard]] float Get_xc84() const { return xc84_f1; }
|
||||
[[nodiscard]] float Get_xc88() const { return xc88_f2; }
|
||||
[[nodiscard]] float Get_xc8c() const { return xc8c_f3; }
|
||||
[[nodiscard]] u32 Get_xc90() const { return xc90_w1; }
|
||||
[[nodiscard]] bool Get_xc94() const { return xc94_b1; }
|
||||
[[nodiscard]] u32 Get_xc98() const { return xc98_w2; }
|
||||
[[nodiscard]] CHealthInfo GetHealthInfo1() const { return xc9c_hInfo1; }
|
||||
[[nodiscard]] CHealthInfo GetHealthInfo2() const { return xca4_hInfo2; }
|
||||
[[nodiscard]] u32 Get_xcac() const { return xcac_w3; }
|
||||
[[nodiscard]] u32 Get_xcb0() const { return xcb0_w4; }
|
||||
[[nodiscard]] u32 Get_xcb4() const { return xcb4_w5; }
|
||||
[[nodiscard]] rstl::reserved_vector<SPrimeExoRoomParameters, 4> GetRoomParameters() const { return xcb8_roomParms; }
|
||||
};
|
||||
|
||||
} // namespace metaforce::MP1
|
||||
|
|
Loading…
Reference in New Issue