Minor fixes from decomp

This commit is contained in:
Phillip Stephens 2022-11-02 22:31:16 -07:00
parent 84724906a2
commit d180c253d1
4 changed files with 18 additions and 3 deletions

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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) {