From 5b166b7be5fa167a3567dfcd3c587a581a2e841a Mon Sep 17 00:00:00 2001 From: Luke Street Date: Tue, 15 Sep 2020 02:40:42 -0400 Subject: [PATCH] CDrone: Implement Dead --- Runtime/MP1/World/CDrone.cpp | 26 ++++++++++++++++++++++++++ Runtime/MP1/World/CDrone.hpp | 1 + 2 files changed, 27 insertions(+) diff --git a/Runtime/MP1/World/CDrone.cpp b/Runtime/MP1/World/CDrone.cpp index fcb99f679..ddbcee867 100644 --- a/Runtime/MP1/World/CDrone.cpp +++ b/Runtime/MP1/World/CDrone.cpp @@ -1158,4 +1158,30 @@ void CDrone::sub_801656d4(const zeus::CTransform& xf, CStateManager& mgr) { mgr.sub_80044098(*x56c_.GetObj(), result, id, x5ac_.GetWeaponMode(), 1, xe6_27_thermalVisorFlags); } +void CDrone::Dead(CStateManager& mgr, EStateMsg msg, float arg) { + if (msg == EStateMsg::Activate) { + x460_knockBackController.SetAutoResetImpulse(false); + if (x834_31_attackOver) { + SetMomentumWR({0.f, 0.f, -GetWeight()}); + } else { + Stop(); + SetVelocityWR(zeus::skZero3f); + SetMomentumWR(zeus::skZero3f); + } + x401_26_disableMove = true; + x5c8_ = 0.f; + SetVisorFlareEnabled(mgr, false); + x7c8_ = 0; + } else if (msg == EStateMsg::Update && x7c0_ == 0) { + if (x834_31_attackOver) { + GetBodyController()->GetCommandMgr().DeliverCmd(CBCHurledCmd()); + x7c8_ = 1; + } else { + GetBodyController()->GetCommandMgr().DeliverCmd(CBCKnockDownCmd(zeus::skZero3f, pas::ESeverity::Zero)); + x7c8_ = 1; + Stop(); + } + } +} + } // namespace urde::MP1 diff --git a/Runtime/MP1/World/CDrone.hpp b/Runtime/MP1/World/CDrone.hpp index 7187c3003..df981c527 100644 --- a/Runtime/MP1/World/CDrone.hpp +++ b/Runtime/MP1/World/CDrone.hpp @@ -166,6 +166,7 @@ public: bool ShouldMove(CStateManager&, float arg) override; bool CodeTrigger(CStateManager&, float arg) override; void Burn(float duration, float damage) override; + void Dead(CStateManager& mgr, EStateMsg msg, float arg) override; CPathFindSearch* GetSearchPath() override; virtual void BuildNearList(EMaterialTypes includeMat, EMaterialTypes excludeMat, rstl::reserved_vector& listOut, float radius, CStateManager& mgr);