2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 13:47:43 +00:00

Initial PAL/JP/Trilogy imps, various cleanup

This commit is contained in:
2020-04-15 22:26:14 -07:00
parent 3487ea92c7
commit 582d8a6999
20 changed files with 285 additions and 91 deletions

View File

@@ -835,7 +835,7 @@ void CWallCrawlerSwarm::Think(float dt, CStateManager& mgr) {
const zeus::CAABox aabb = BoxForPosition(r26, r27, r20, x374_boidRadius + 0.5f);
CAreaCollisionCache ccache(aabb);
CGameCollision::BuildAreaCollisionCache(mgr, ccache);
while (boid) {
while (boid != nullptr) {
r21 += 1;
if (boid->GetActive()) {
if (x558_flavor == EFlavor::Scarab) {
@@ -1235,5 +1235,15 @@ zeus::CVector3f CWallCrawlerSwarm::GetAimPosition(const CStateManager&, float dt
return x108_boids[x42c_lockOnIdx].x30_velocity * dt + x124_lastOrbitPosition;
}
void CWallCrawlerSwarm::ApplyRadiusDamage(const zeus::CVector3f& pos, const CDamageInfo& info, CStateManager& stateMgr) {
for (CBoid& boid : x108_boids) {
if (boid.GetActive() && (boid.GetTranslation() - pos).magSquared() < info.GetRadius() * info.GetRadius()) {
boid.x78_health -= info.GetRadiusDamage();
if (boid.x78_health <= 0.f) {
KillBoid(boid, stateMgr, 1.f, 0.1f);
}
}
}
}
} // namespace urde