mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-09-06 15:28:39 +00:00
feat: Dragonmaw (#1562)
* rigid as heck * abstract physics creation to separate function * loading Update FvRacePillarDServer.cpp consolidate abcd pillar logic modularization Update SimplePhysicsComponent.cpp Update EntityManager.cpp Update MovingPlatformComponent.cpp still need another pass * geiser works * columns working finally * consolidate logic * constiness * Update PhantomPhysicsComponent.cpp * Update PhysicsComponent.cpp * revert testing code * add versions info --------- Co-authored-by: Aaron Kimbre <aronwk.aaron@gmail.com>
This commit is contained in:
30
dScripts/ai/RACING/OBJECTS/FvRaceDragon.cpp
Normal file
30
dScripts/ai/RACING/OBJECTS/FvRaceDragon.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include "FvRaceDragon.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "RacingControlComponent.h"
|
||||
|
||||
void FvRaceDragon::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
if (!target) return;
|
||||
|
||||
const auto racingControllers = Game::entityManager->GetEntitiesByComponent(eReplicaComponentType::RACING_CONTROL);
|
||||
if (racingControllers.empty()) return;
|
||||
|
||||
auto* racingControlComponent = racingControllers[0]->GetComponent<RacingControlComponent>();
|
||||
if (!racingControlComponent) return;
|
||||
|
||||
const auto* player = racingControlComponent->GetPlayerData(target->GetObjectID());
|
||||
if (!player) return;
|
||||
|
||||
if (player->lap != m_Lap) return;
|
||||
|
||||
const auto dragons = Game::entityManager->GetEntitiesInGroup("dragon");
|
||||
for (const auto& dragon : dragons) {
|
||||
if (!dragon || dragon->GetLOT() != this->m_Dragon) continue;
|
||||
|
||||
auto* renderComponent = dragon->GetComponent<RenderComponent>();
|
||||
if (!renderComponent) continue;
|
||||
|
||||
renderComponent->PlayAnimation(dragon, m_LapAnimName);
|
||||
|
||||
}
|
||||
Game::entityManager->DestroyEntity(self);
|
||||
}
|
Reference in New Issue
Block a user