DarkflameServer/dScripts/AgSurvivalBuffStation.cpp

21 lines
738 B
C++
Raw Normal View History

#include "AgSurvivalBuffStation.h"
#include "SkillComponent.h"
#include "dLogger.h"
2022-02-07 05:32:36 +00:00
#include "DestroyableComponent.h"
void AgSurvivalBuffStation::OnRebuildComplete(Entity* self, Entity* target) {
2022-02-07 05:32:36 +00:00
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
2022-02-07 05:34:26 +00:00
// We set the faction to 6 so that the buff station sees players as friendly targets
2022-02-07 05:32:36 +00:00
if (destroyableComponent != nullptr) destroyableComponent->SetFaction(6);
auto skillComponent = self->GetComponent<SkillComponent>();
if (skillComponent == nullptr) return;
2022-02-07 05:34:26 +00:00
skillComponent->CalculateBehavior(skillIdForBuffStation, behaviorIdForBuffStation, self->GetObjectID());
2022-01-21 00:00:45 +00:00
self->AddCallbackTimer(10.0f, [self]() {
self->Smash();
2022-01-21 00:00:45 +00:00
});
}