From 7eb3bce499934c58bbb7ab0454be10eb23bfb6c4 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Tue, 13 Aug 2019 14:41:15 -0700 Subject: [PATCH] Update submodules, more CMetroidBeta imps --- Runtime/MP1/World/CMetroidBeta.cpp | 25 ++++++++++++++++++++++++- hecl | 2 +- kabufuda | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Runtime/MP1/World/CMetroidBeta.cpp b/Runtime/MP1/World/CMetroidBeta.cpp index dcbf1c0ab..3dffdc048 100644 --- a/Runtime/MP1/World/CMetroidBeta.cpp +++ b/Runtime/MP1/World/CMetroidBeta.cpp @@ -5,10 +5,12 @@ #include "Particle/CElementGen.hpp" #include "Particle/CParticleSwoosh.hpp" #include "Weapon/CGameProjectile.hpp" +#include "World/CGameArea.hpp" #include "World/CPatternedInfo.hpp" #include "World/CPlayer.hpp" #include "World/ScriptLoader.hpp" #include "World/CTeamAiMgr.hpp" +#include "World/CWorld.hpp" #include "CStateManager.hpp" #include "GameGlobalObjects.hpp" @@ -134,9 +136,28 @@ void CMetroidBeta::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CSta break; } case EScriptObjectMessage::Touched: { + if (TCastToConstPtr colAct = mgr.GetObjectById(uid)) { + if (HealthInfo(mgr)->GetHP() > 0.f && colAct->GetLastTouchedObject() == mgr.GetPlayer().GetUniqueId() && + x420_curDamageRemTime <= 0.f) { + CDamageInfo dInfo = GetContactDamage(); + dInfo.SetDamage(0.5f * dInfo.GetDamage()); + if (x840_29_ && x840_30_) + dInfo = GetContactDamage(); + + mgr.ApplyDamage(GetUniqueId(), mgr.GetPlayer().GetUniqueId(), GetUniqueId(), dInfo, + CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, {}), {}); + + x420_curDamageRemTime = x424_damageWaitTime; + x840_30_ = false; + } + } break; } case EScriptObjectMessage::InitializedInArea: { + if (x678_teamMgr == kInvalidUniqueId) + x678_teamMgr = CTeamAiMgr::GetTeamAiMgr(*this, mgr); + + x67c_pathFind.SetArea(mgr.GetWorld()->GetAreaAlways(GetAreaId())->GetPostConstructed()->x10bc_pathArea); break; } case EScriptObjectMessage::SuspendedMove: { @@ -181,7 +202,9 @@ void CMetroidBeta::SelectTarget(CStateManager& mgr, EStateMsg msg, float arg) { void CMetroidBeta::TargetPatrol(CStateManager& mgr, EStateMsg msg, float arg) { CPatterned::TargetPatrol(mgr, msg, arg); } -void CMetroidBeta::Generate(CStateManager& mgr, EStateMsg msg, float arg) { CAi::Generate(mgr, msg, arg); } +void CMetroidBeta::Generate(CStateManager& mgr, EStateMsg msg, float arg) { + CAi::Generate(mgr, msg, arg); +} void CMetroidBeta::Attack(CStateManager& mgr, EStateMsg msg, float arg) { CAi::Attack(mgr, msg, arg); } void CMetroidBeta::TurnAround(CStateManager& mgr, EStateMsg msg, float arg) { CAi::TurnAround(mgr, msg, arg); } void CMetroidBeta::TelegraphAttack(CStateManager& mgr, EStateMsg msg, float arg) { diff --git a/hecl b/hecl index 298803aac..a3b44da04 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit 298803aac4d4797c439c97f036ad6ff566de8bd6 +Subproject commit a3b44da040e60a453f82005523810f38dabc3f1e diff --git a/kabufuda b/kabufuda index dc436ffb3..f57d8cf76 160000 --- a/kabufuda +++ b/kabufuda @@ -1 +1 @@ -Subproject commit dc436ffb320b1028b49ef2f6934317f8e409ae78 +Subproject commit f57d8cf76187e0444e232b557e709fca161c64a9