mirror of https://github.com/AxioDL/metaforce.git
Minor flamethrower and babygoth fixes
This commit is contained in:
parent
003146f614
commit
fd0bfc3acf
|
@ -365,14 +365,13 @@ bool ViewManager::proc() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewManager::stop() {
|
void ViewManager::stop() {
|
||||||
m_videoVoice.reset();
|
m_mainWindow->getCommandQueue()->stopRenderer();
|
||||||
m_projManager.shutdown();
|
m_projManager.shutdown();
|
||||||
CDvdFile::Shutdown();
|
CDvdFile::Shutdown();
|
||||||
DestroyIcons();
|
DestroyIcons();
|
||||||
DestroyBadging();
|
DestroyBadging();
|
||||||
m_viewResources.destroyResData();
|
m_viewResources.destroyResData();
|
||||||
m_fontCache.destroyAtlases();
|
m_fontCache.destroyAtlases();
|
||||||
m_mainWindow->getCommandQueue()->stopRenderer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace urde
|
||||||
|
|
|
@ -120,7 +120,6 @@ class ViewManager final : public specter::IViewManager {
|
||||||
};
|
};
|
||||||
std::unique_ptr<TestGameView> m_testGameView;
|
std::unique_ptr<TestGameView> m_testGameView;
|
||||||
std::unique_ptr<boo::IAudioVoiceEngine> m_voiceEngine;
|
std::unique_ptr<boo::IAudioVoiceEngine> m_voiceEngine;
|
||||||
std::unique_ptr<boo::IAudioVoice> m_videoVoice;
|
|
||||||
std::optional<amuse::BooBackendVoiceAllocator> m_amuseAllocWrapper;
|
std::optional<amuse::BooBackendVoiceAllocator> m_amuseAllocWrapper;
|
||||||
|
|
||||||
hecl::SystemString m_recentProjectsPath;
|
hecl::SystemString m_recentProjectsPath;
|
||||||
|
|
|
@ -5,20 +5,20 @@
|
||||||
namespace urde {
|
namespace urde {
|
||||||
|
|
||||||
class CRandom16 {
|
class CRandom16 {
|
||||||
u32 m_seed;
|
s32 m_seed;
|
||||||
static CRandom16* g_randomNumber;
|
static CRandom16* g_randomNumber;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CRandom16(u32 p = 99) : m_seed(p) {}
|
CRandom16(s32 p = 99) : m_seed(p) {}
|
||||||
|
|
||||||
u32 Next() {
|
s32 Next() {
|
||||||
m_seed = (m_seed * 0x41c64e6d) + 0x00003039;
|
m_seed = (m_seed * 0x41c64e6d) + 0x00003039;
|
||||||
return m_seed >> 16;
|
return (m_seed >> 16) & 0xffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 GetSeed() const { return m_seed; }
|
s32 GetSeed() const { return m_seed; }
|
||||||
|
|
||||||
void SetSeed(u32 p) { m_seed = p; }
|
void SetSeed(s32 p) { m_seed = p; }
|
||||||
|
|
||||||
float Float() { return Next() * 0.000015259022f; }
|
float Float() { return Next() * 0.000015259022f; }
|
||||||
|
|
||||||
|
|
|
@ -146,6 +146,8 @@ void CBabygoth::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateM
|
||||||
case EScriptObjectMessage::InitializedInArea: {
|
case EScriptObjectMessage::InitializedInArea: {
|
||||||
x6ec_pathSearch.SetArea(mgr.GetWorld()->GetAreaAlways(GetAreaIdAlways())->GetPostConstructed()->x10bc_pathArea);
|
x6ec_pathSearch.SetArea(mgr.GetWorld()->GetAreaAlways(GetAreaIdAlways())->GetPostConstructed()->x10bc_pathArea);
|
||||||
x7d0_approachPathSearch.SetArea(mgr.GetWorld()->GetAreaAlways(GetAreaIdAlways())->GetPostConstructed()->x10bc_pathArea);
|
x7d0_approachPathSearch.SetArea(mgr.GetWorld()->GetAreaAlways(GetAreaIdAlways())->GetPostConstructed()->x10bc_pathArea);
|
||||||
|
if (x6e8_teamMgr == kInvalidUniqueId)
|
||||||
|
x6e8_teamMgr = CTeamAiMgr::GetTeamAiMgr(*this, mgr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EScriptObjectMessage::Touched: {
|
case EScriptObjectMessage::Touched: {
|
||||||
|
@ -1075,7 +1077,7 @@ bool CBabygoth::Leash(CStateManager& mgr, float) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBabygoth::IsDestinationObstructed(CStateManager& mgr) {
|
bool CBabygoth::IsDestinationObstructed(CStateManager& mgr) {
|
||||||
for (auto obj : mgr.GetListeningAiObjectList()) {
|
for (CEntity* obj : mgr.GetListeningAiObjectList()) {
|
||||||
if (TCastToPtr<CAi> ai = obj) {
|
if (TCastToPtr<CAi> ai = obj) {
|
||||||
if (ai->GetAreaIdAlways() == GetAreaIdAlways()) {
|
if (ai->GetAreaIdAlways() == GetAreaIdAlways()) {
|
||||||
if ((x8b8_backupDestPos - ai->GetTranslation()).magSquared() <= 10.f)
|
if ((x8b8_backupDestPos - ai->GetTranslation()).magSquared() <= 10.f)
|
||||||
|
@ -1128,9 +1130,9 @@ float CBabygoth::CalculateShellCrackHP(EShellState state) {
|
||||||
if (state == EShellState::Default)
|
if (state == EShellState::Default)
|
||||||
return x570_babyData.GetShellHitPoints();
|
return x570_babyData.GetShellHitPoints();
|
||||||
else if (state == EShellState::CrackOne)
|
else if (state == EShellState::CrackOne)
|
||||||
return 0.66666669f * x570_babyData.GetShellHitPoints();
|
return (2.f / 3.f) * x570_babyData.GetShellHitPoints();
|
||||||
else if (state == EShellState::CrackTwo)
|
else if (state == EShellState::CrackTwo)
|
||||||
return 0.33333334f * x570_babyData.GetShellHitPoints();
|
return (1.f / 3.f) * x570_babyData.GetShellHitPoints();
|
||||||
|
|
||||||
return 0.f;
|
return 0.f;
|
||||||
}
|
}
|
||||||
|
@ -1139,7 +1141,7 @@ bool CBabygoth::ShouldTurn(CStateManager& mgr, float arg) {
|
||||||
const float speedScale = GetModelData()->GetAnimationData()->GetSpeedScale();
|
const float speedScale = GetModelData()->GetAnimationData()->GetSpeedScale();
|
||||||
zeus::CVector3f aimPos = mgr.GetPlayer().GetAimPosition(mgr, (speedScale > 0.f ? 1.f / speedScale : 0.f));
|
zeus::CVector3f aimPos = mgr.GetPlayer().GetAimPosition(mgr, (speedScale > 0.f ? 1.f / speedScale : 0.f));
|
||||||
return zeus::CVector2f::getAngleDiff(GetTransform().basis[1].toVec2f(), (aimPos - GetTranslation()).toVec2f()) >
|
return zeus::CVector2f::getAngleDiff(GetTransform().basis[1].toVec2f(), (aimPos - GetTranslation()).toVec2f()) >
|
||||||
(arg == 0.f ? 0.78539819f : arg);
|
(arg == 0.f ? zeus::degToRad(45.f) : arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBabygoth::ShouldAttack(CStateManager& mgr, float arg) {
|
bool CBabygoth::ShouldAttack(CStateManager& mgr, float arg) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ void CFlameWarp::ModifyParticles(std::vector<CParticle>& particles) {
|
||||||
if (result.IsValid()) {
|
if (result.IsValid()) {
|
||||||
float dist = result.GetPlane().pointToPlaneDist(particle.x4_pos);
|
float dist = result.GetPlane().pointToPlaneDist(particle.x4_pos);
|
||||||
if (dist <= 0.f) {
|
if (dist <= 0.f) {
|
||||||
particle.x4_pos = -result.GetPlane().normal() * dist;
|
particle.x4_pos -= result.GetPlane().normal() * dist;
|
||||||
if (result.GetPlane().normal().dot(particle.x1c_vel) < 0.f) {
|
if (result.GetPlane().normal().dot(particle.x1c_vel) < 0.f) {
|
||||||
zeus::CVector3f prevStepPos = particle.x4_pos - particle.x1c_vel;
|
zeus::CVector3f prevStepPos = particle.x4_pos - particle.x1c_vel;
|
||||||
particle.x4_pos +=
|
particle.x4_pos +=
|
||||||
|
|
Loading…
Reference in New Issue