diff --git a/Runtime/MP1/World/CChozoGhost.cpp b/Runtime/MP1/World/CChozoGhost.cpp index b611ee221..2dd2a5d52 100644 --- a/Runtime/MP1/World/CChozoGhost.cpp +++ b/Runtime/MP1/World/CChozoGhost.cpp @@ -275,6 +275,9 @@ void CChozoGhost::DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, LaunchProjectile(xf, mgr, 5, EProjectileAttrib::DamageFalloff | EProjectileAttrib::StaticInterference, true, {x640_projectileVisor}, x650_sound_ProjectileVisor, false, zeus::skOne3f); if (proj) { + if (GetProjectileInfo()->GetProjectileSpeed() > 0.f) { + proj->SetDamageFalloffSpeed(80.f / GetProjectileInfo()->GetProjectileSpeed()); + } proj->AddAttrib(EProjectileAttrib::BigStrike); proj->SetDamageDuration(x62c_); proj->AddAttrib(EProjectileAttrib::StaticInterference); diff --git a/Runtime/Weapon/CWeapon.cpp b/Runtime/Weapon/CWeapon.cpp index 32f5538e7..33466d3fb 100644 --- a/Runtime/Weapon/CWeapon.cpp +++ b/Runtime/Weapon/CWeapon.cpp @@ -97,4 +97,11 @@ void CWeapon::FluidFXThink(EFluidState state, CScriptWater& water, CStateManager } } +void CWeapon::SetDamageFalloffSpeed(float d) { + if (d <= 0.f) { + return; + } + + x14c_damageFalloffSpeed = 1.f / d; +} } // namespace metaforce diff --git a/Runtime/Weapon/CWeapon.hpp b/Runtime/Weapon/CWeapon.hpp index 14c4ba727..f7236ec4c 100644 --- a/Runtime/Weapon/CWeapon.hpp +++ b/Runtime/Weapon/CWeapon.hpp @@ -50,5 +50,7 @@ public: EWeaponCollisionResponseTypes GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&, const CWeaponMode&, EProjectileAttrib) const override; void FluidFXThink(EFluidState state, CScriptWater& water, CStateManager& mgr) override; + + void SetDamageFalloffSpeed(float d); }; } // namespace metaforce diff --git a/Runtime/World/CStateMachine.hpp b/Runtime/World/CStateMachine.hpp index 3b9cccd4e..8d63b1720 100644 --- a/Runtime/World/CStateMachine.hpp +++ b/Runtime/World/CStateMachine.hpp @@ -25,11 +25,14 @@ public: CAiTrigger* GetAnd() const { return x10_andTrig; } CAiState* GetState() const { return x14_state; } bool CallFunc(CStateManager& mgr, CAi& ai) const { + bool ret = true; if (x0_func) { - bool ret = (ai.*x0_func)(mgr, xc_arg); - return x18_lNot == !ret; + ret = (ai.*x0_func)(mgr, xc_arg); + if (x18_lNot) { + ret = !ret; + } } - return true; + return ret; } void Setup(CAiTriggerFunc func, bool lnot, float arg, CAiTrigger* andTrig) {