CSnakeWeedSwarm: Implement ApplyRadiusDamage

This commit is contained in:
Luke Street 2020-02-24 00:43:20 -05:00
parent f50f5cedef
commit 34a80aab81
2 changed files with 14 additions and 5 deletions

View File

@ -151,7 +151,9 @@ void CSnakeWeedSwarm::AddToRenderer(const zeus::CFrustum& frustum, const CStateM
g_Renderer->AddParticleGen(*x1f4_particleGen2); g_Renderer->AddParticleGen(*x1f4_particleGen2);
} }
if (x90_actorLights) { if (x90_actorLights) {
// x90_actorLights->ActivateLights(); FIXME pass what here? for (auto modelData : x1b0_modelData) {
x90_actorLights->ActivateLights(*modelData->PickAnimatedModel(x1c4_).GetModelInst());
}
} else { } else {
CGraphics::DisableAllLights(); CGraphics::DisableAllLights();
g_Renderer->SetAmbientColor(zeus::skWhite); g_Renderer->SetAmbientColor(zeus::skWhite);
@ -181,8 +183,8 @@ void CSnakeWeedSwarm::Touch(CActor& actor, CStateManager& mgr) {
} }
} }
void CSnakeWeedSwarm::sub_8023ca48(float param_1, CStateManager& mgr, const zeus::CVector3f& pos) { void CSnakeWeedSwarm::sub_8023ca48(float radius, CStateManager& mgr, const zeus::CVector3f& pos) {
float dVar8 = param_1 * param_1; float dVar8 = radius * radius;
for (auto boid : x134_boids) { for (auto boid : x134_boids) {
const zeus::CVector3f& boidPosition = boid.GetPosition(); const zeus::CVector3f& boidPosition = boid.GetPosition();
if ((boidPosition - pos).magSquared() < dVar8 && if ((boidPosition - pos).magSquared() < dVar8 &&
@ -444,4 +446,11 @@ void CSnakeWeedSwarm::RenderBoid(u32 p1, const CBoid* boid, u32* p3) const {
*p3 = var3; *p3 = var3;
} }
void CSnakeWeedSwarm::ApplyRadiusDamage(const zeus::CVector3f& pos, const CDamageInfo& info, CStateManager& mgr) {
EWeaponType type = info.GetWeaponMode().GetType();
if (type == EWeaponType::Bomb || type == EWeaponType::PowerBomb) {
sub_8023ca48(info.GetRadius(), mgr, pos);
}
}
} // namespace urde } // namespace urde

View File

@ -91,7 +91,7 @@ public:
CAssetId, float); CAssetId, float);
void Accept(IVisitor&) override; void Accept(IVisitor&) override;
void ApplyRadiusDamage(const zeus::CVector3f& pos, const CDamageInfo& info, CStateManager& stateMgr) {} void ApplyRadiusDamage(const zeus::CVector3f& pos, const CDamageInfo& info, CStateManager& stateMgr);
std::optional<zeus::CAABox> GetTouchBounds() const override { std::optional<zeus::CAABox> GetTouchBounds() const override {
if (x140_24_) { if (x140_24_) {
return {}; return {};
@ -106,7 +106,7 @@ public:
private: private:
void AllocateSkinnedModels(CStateManager& mgr, CModelData::EWhichModel which); void AllocateSkinnedModels(CStateManager& mgr, CModelData::EWhichModel which);
void sub_8023ca48(float param_1, CStateManager& mgr, const zeus::CVector3f& pos); void sub_8023ca48(float radius, CStateManager& mgr, const zeus::CVector3f& pos);
void sub_8023c238(const CStateManager& mgr); void sub_8023c238(const CStateManager& mgr);
zeus::CAABox sub_8023d3f4(); zeus::CAABox sub_8023d3f4();
int sub_8023c0fc(); int sub_8023c0fc();