mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-10 02:08:20 +00:00
21 lines
738 B
C++
21 lines
738 B
C++
#include "AgSurvivalBuffStation.h"
|
|
#include "SkillComponent.h"
|
|
#include "dLogger.h"
|
|
#include "DestroyableComponent.h"
|
|
|
|
void AgSurvivalBuffStation::OnRebuildComplete(Entity* self, Entity* target) {
|
|
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
|
|
// We set the faction to 6 so that the buff station sees players as friendly targets
|
|
if (destroyableComponent != nullptr) destroyableComponent->SetFaction(6);
|
|
|
|
auto skillComponent = self->GetComponent<SkillComponent>();
|
|
|
|
if (skillComponent == nullptr) return;
|
|
|
|
skillComponent->CalculateBehavior(skillIdForBuffStation, behaviorIdForBuffStation, self->GetObjectID());
|
|
|
|
self->AddCallbackTimer(10.0f, [self]() {
|
|
self->Smash();
|
|
});
|
|
}
|