mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-12-21 04:00:13 +00:00
rigid as heck
This commit is contained in:
36
dScripts/ai/RACING/OBJECTS/FvRacePillarDServer.cpp
Normal file
36
dScripts/ai/RACING/OBJECTS/FvRacePillarDServer.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include "FvRacePillarDServer.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "RacingControlComponent.h"
|
||||
|
||||
void FvRacePillarDServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
if (!target) return;
|
||||
|
||||
const auto racingControllers = Game::entityManager->GetEntitiesByComponent(eReplicaComponentType::RACING_CONTROL);
|
||||
if (racingControllers.empty()) return;
|
||||
const auto* racingController = racingControllers.at(0);
|
||||
|
||||
auto* racingControlComponent = racingController->GetComponent<RacingControlComponent>();
|
||||
if (!racingControlComponent) return;
|
||||
const auto* player = racingControlComponent->GetPlayerData(target->GetObjectID());
|
||||
if(!player) return;
|
||||
if (player->lap == 3){
|
||||
LOG("pillar d, Script");
|
||||
|
||||
const auto pillars = Game::entityManager->GetEntitiesInGroup("pillars");
|
||||
for (const auto &pillar : pillars){
|
||||
if (!pillar || pillar->GetLOT() != this->m_PillarD) continue;
|
||||
auto* renderComponent = pillar->GetComponent<RenderComponent>();
|
||||
if (!renderComponent) continue;
|
||||
renderComponent->PlayAnimation(pillar, "crumble");
|
||||
}
|
||||
|
||||
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, "roar");
|
||||
}
|
||||
Game::entityManager->DestroyEntity(self);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user