From d1a714cf1a76db5258ae5a6898d54f16a5567285 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 3 Feb 2020 10:35:49 -0500 Subject: [PATCH] CBloodFlower: Implement GetCollisionResponseType CBloodFlower seems to be missing the implementation from v0-00. This change adds in its equivalent behavior. --- Runtime/MP1/World/CBloodFlower.cpp | 11 +++++++++++ Runtime/MP1/World/CBloodFlower.hpp | 3 +++ 2 files changed, 14 insertions(+) diff --git a/Runtime/MP1/World/CBloodFlower.cpp b/Runtime/MP1/World/CBloodFlower.cpp index fe2d867ac..46e7930cd 100644 --- a/Runtime/MP1/World/CBloodFlower.cpp +++ b/Runtime/MP1/World/CBloodFlower.cpp @@ -146,6 +146,17 @@ void CBloodFlower::Render(const CStateManager& mgr) const { x574_podEffect->Render(GetActorLights()); } +EWeaponCollisionResponseTypes CBloodFlower::GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&, + const CWeaponMode& weaponMode, EProjectileAttrib) const { + const auto* const damageVulnerability = GetDamageVulnerability(); + + if (damageVulnerability->WeaponHurts(weaponMode, false)) { + return EWeaponCollisionResponseTypes::Unknown28; + } + + return EWeaponCollisionResponseTypes::Unknown78; +} + bool CBloodFlower::ShouldAttack(CStateManager& mgr, float arg) { if (TooClose(mgr, 0.f)) return false; diff --git a/Runtime/MP1/World/CBloodFlower.hpp b/Runtime/MP1/World/CBloodFlower.hpp index 699e58af5..3e42a9afc 100644 --- a/Runtime/MP1/World/CBloodFlower.hpp +++ b/Runtime/MP1/World/CBloodFlower.hpp @@ -56,6 +56,9 @@ public: void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type, float dt) override; void Render(const CStateManager& mgr) const override; void Touch(CActor&, CStateManager&) override {} + EWeaponCollisionResponseTypes GetCollisionResponseType(const zeus::CVector3f& v1, const zeus::CVector3f& v2, + const CWeaponMode& weaponMode, + EProjectileAttrib attribute) const override; CProjectileInfo* GetProjectileInfo() override { return &x590_projectileInfo; } bool ShouldAttack(CStateManager&, float) override;