2022-01-20 11:20:39 +00:00
|
|
|
#include "AgSurvivalBuffStation.h"
|
|
|
|
#include "SkillComponent.h"
|
|
|
|
#include "dLogger.h"
|
2022-02-07 05:32:36 +00:00
|
|
|
#include "DestroyableComponent.h"
|
2022-01-20 11:20:39 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
2022-01-20 11:20:39 +00:00
|
|
|
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-20 11:48:43 +00:00
|
|
|
|
2022-01-21 00:00:45 +00:00
|
|
|
self->AddCallbackTimer(10.0f, [self]() {
|
2022-01-20 11:48:43 +00:00
|
|
|
self->Smash();
|
2022-01-21 00:00:45 +00:00
|
|
|
});
|
|
|
|
}
|