mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-09-06 07:18:42 +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:
34
dScripts/ai/RACING/OBJECTS/FvRacePillarABCServer.cpp
Normal file
34
dScripts/ai/RACING/OBJECTS/FvRacePillarABCServer.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "FvRacePillarABCServer.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "RacingControlComponent.h"
|
||||
|
||||
void FvRacePillarABCServer::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 || player->lap != 1) return;
|
||||
|
||||
PlayAnimation("crumble", "pillars", m_PillarA);
|
||||
PlayAnimation("roar", "dragon", m_Dragon);
|
||||
|
||||
self->AddTimer("PillarBFall", 2.5f);
|
||||
self->AddTimer("PillarCFall", 3.7f);
|
||||
self->AddTimer("DeleteObject", 3.8f);
|
||||
}
|
||||
|
||||
void FvRacePillarABCServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "PillarBFall") {
|
||||
PlayAnimation("crumble", "pillars", m_PillarB);
|
||||
} else if (timerName == "PillarCFall") {
|
||||
PlayAnimation("crumble", "pillars", m_PillarC);
|
||||
} else if (timerName == "DeleteObject") {
|
||||
Game::entityManager->DestroyEntity(self);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user