From 58cca6ffa8a103262a0ce496d9b6b9c432235b7c Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Thu, 5 Mar 2020 01:56:04 -0800 Subject: [PATCH] More chozoghost imps --- Runtime/MP1/World/CChozoGhost.cpp | 34 ++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/Runtime/MP1/World/CChozoGhost.cpp b/Runtime/MP1/World/CChozoGhost.cpp index ea1e82205..3f67e8345 100644 --- a/Runtime/MP1/World/CChozoGhost.cpp +++ b/Runtime/MP1/World/CChozoGhost.cpp @@ -360,7 +360,39 @@ void CChozoGhost::Taunt(CStateManager& mgr, EStateMsg msg, float arg) { } } -void CChozoGhost::Hurled(CStateManager& mgr, EStateMsg msg, float arg) { CAi::Hurled(mgr, msg, arg); } +void CChozoGhost::Hurled(CStateManager& mgr, EStateMsg msg, float arg) { + if (msg == EStateMsg::Activate) { + x328_25_verticalMovement = false; + x664_27_ = false; + x665_24_ = true; + } else if (msg == EStateMsg::Update) { + x3e8_alphaDelta = 2.f; + if (x664_27_) + return; + + if (x138_velocity.z() < 0.f) { + CRayCastResult res = mgr.RayStaticIntersection(GetTranslation() + zeus::skUp, zeus::skDown, 2.f, + CMaterialFilter::MakeInclude({EMaterialTypes::Floor})); + if (res.IsValid()) { + x664_27_ = true; + x150_momentum.zeroOut(); + zeus::CVector3f velNoZ = x138_velocity; + velNoZ.z() = 0.f; + SetVelocityWR(velNoZ); + x678_ = res.GetPoint().z(); + x330_stateMachineState.SetCodeTrigger(); + } + } + if (!x664_27_ && x638_hurlRecoverTime < x330_stateMachineState.GetTime()) { + GetBodyController()->GetCommandMgr().DeliverCmd(CBodyStateCmd(EBodyStateCmd::ExitState)); + GetBodyController()->SetLocomotionType(pas::ELocomotionType::Lurk); + x330_stateMachineState.SetCodeTrigger(); + } + } else if (msg == EStateMsg::Deactivate) { + x328_25_verticalMovement = true; + x150_momentum.zeroOut(); + } +} void CChozoGhost::WallDetach(CStateManager& mgr, EStateMsg msg, float arg) { CAi::WallDetach(mgr, msg, arg); }