2022-11-28 00:40:14 +00:00
|
|
|
#include "RemoveBuffBehavior.h"
|
|
|
|
|
|
|
|
#include "BehaviorBranchContext.h"
|
|
|
|
#include "BehaviorContext.h"
|
|
|
|
#include "EntityManager.h"
|
|
|
|
#include "BuffComponent.h"
|
|
|
|
|
2024-02-27 07:25:44 +00:00
|
|
|
void RemoveBuffBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStream, BehaviorBranchContext branch) {
|
2023-07-15 20:56:33 +00:00
|
|
|
auto* entity = Game::entityManager->GetEntity(context->caster);
|
2022-11-28 00:40:14 +00:00
|
|
|
if (!entity) return;
|
|
|
|
|
|
|
|
auto* buffComponent = entity->GetComponent<BuffComponent>();
|
|
|
|
if (!buffComponent) return;
|
|
|
|
|
|
|
|
buffComponent->RemoveBuff(m_BuffId, false, m_RemoveImmunity);
|
|
|
|
}
|
|
|
|
|
|
|
|
void RemoveBuffBehavior::Load() {
|
|
|
|
this->m_RemoveImmunity = GetBoolean("remove_immunity");
|
|
|
|
this->m_BuffId = GetInt("buff_id");
|
|
|
|
}
|