mirror of
https://github.com/Squareville/wonderland-server.git
synced 2026-01-12 01:10:25 -06:00
12 lines
396 B
C++
12 lines
396 B
C++
#include "SkillCastAndOptionalDeath.h"
|
|
|
|
#include "Entity.h"
|
|
#include "SkillComponent.h"
|
|
|
|
void SkillCastAndOptionalDeath::OnStartup(Entity* self) {
|
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
|
if (!skillComponent) return;
|
|
skillComponent->CastSkill(m_SkillToCast, self->GetObjectID());
|
|
if (m_DieAfterXSeconds) self->AddCallbackTimer(m_TimeToDie, [self]() { self->Smash(); });
|
|
}
|