mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-24 06:23:35 +00:00
3262bc3a86
* Remove news in behavior members Tested that GrowingFlowers still have their SkillEvent fired with the correct parameters, gftikitorch works, sharks eating stinky fish still work * explicitly default move assignment and copy operators/constructors --------- Co-authored-by: jadebenn <jadebenn@users.noreply.github.com>
25 lines
1008 B
C++
25 lines
1008 B
C++
#include "SkillEventBehavior.h"
|
|
#include "BehaviorBranchContext.h"
|
|
#include "BehaviorContext.h"
|
|
#include "EntityManager.h"
|
|
#include "CppScripts.h"
|
|
#include "Entity.h"
|
|
|
|
void SkillEventBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStream, BehaviorBranchContext branch) {
|
|
auto* target = Game::entityManager->GetEntity(branch.target);
|
|
auto* caster = Game::entityManager->GetEntity(context->originator);
|
|
|
|
if (caster != nullptr && target != nullptr && !this->m_effectHandle.empty()) {
|
|
target->GetScript()->OnSkillEventFired(target, caster, this->m_effectHandle);
|
|
}
|
|
}
|
|
|
|
void SkillEventBehavior::Calculate(BehaviorContext* context, RakNet::BitStream& bitStream, BehaviorBranchContext branch) {
|
|
auto* target = Game::entityManager->GetEntity(branch.target);
|
|
auto* caster = Game::entityManager->GetEntity(context->originator);
|
|
|
|
if (caster != nullptr && target != nullptr && !this->m_effectHandle.empty()) {
|
|
target->GetScript()->OnSkillEventFired(target, caster, this->m_effectHandle);
|
|
}
|
|
}
|