2021-12-05 17:54:36 +00:00
|
|
|
#include "PersonalFortress.h"
|
|
|
|
#include "GameMessages.h"
|
|
|
|
#include "SkillComponent.h"
|
|
|
|
#include "DestroyableComponent.h"
|
2023-01-07 05:59:19 +00:00
|
|
|
#include "ControllablePhysicsComponent.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
#include "EntityManager.h"
|
2023-05-02 22:39:21 +00:00
|
|
|
#include "eStateChangeType.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
void PersonalFortress::OnStartup(Entity* self) {
|
|
|
|
auto* owner = self->GetOwner();
|
|
|
|
self->AddTimer("FireSkill", 1.5);
|
|
|
|
|
|
|
|
auto* destroyableComponent = owner->GetComponent<DestroyableComponent>();
|
2023-01-07 05:59:19 +00:00
|
|
|
if (destroyableComponent) destroyableComponent->SetStatusImmunity(
|
|
|
|
eStateChangeType::PUSH,
|
|
|
|
true, true, true, true, true, false, true, false, false
|
|
|
|
);
|
|
|
|
|
|
|
|
auto* controllablePhysicsComponent = owner->GetComponent<ControllablePhysicsComponent>();
|
|
|
|
if (controllablePhysicsComponent) controllablePhysicsComponent->SetStunImmunity(
|
|
|
|
eStateChangeType::PUSH, LWOOBJID_EMPTY,
|
|
|
|
true, true, true, true, true, true
|
|
|
|
);
|
|
|
|
|
|
|
|
GameMessages::SendSetStunned(owner->GetObjectID(), eStateChangeType::PUSH, owner->GetSystemAddress(), LWOOBJID_EMPTY,
|
|
|
|
true, true, true, true, true, true, true, true, true
|
|
|
|
);
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2023-07-15 20:56:33 +00:00
|
|
|
Game::entityManager->SerializeEntity(owner);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
void PersonalFortress::OnDie(Entity* self, Entity* killer) {
|
|
|
|
auto* owner = self->GetOwner();
|
2023-01-07 05:59:19 +00:00
|
|
|
auto* destroyableComponent = owner->GetComponent<DestroyableComponent>();
|
|
|
|
if (destroyableComponent) destroyableComponent->SetStatusImmunity(
|
|
|
|
eStateChangeType::POP,
|
|
|
|
true, true, true, true, true, false, true, false, false
|
|
|
|
);
|
|
|
|
|
|
|
|
auto* controllablePhysicsComponent = owner->GetComponent<ControllablePhysicsComponent>();
|
|
|
|
if (controllablePhysicsComponent) controllablePhysicsComponent->SetStunImmunity(
|
|
|
|
eStateChangeType::POP, LWOOBJID_EMPTY,
|
|
|
|
true, true, true, true, true, true
|
|
|
|
);
|
|
|
|
|
|
|
|
GameMessages::SendSetStunned(owner->GetObjectID(), eStateChangeType::POP, owner->GetSystemAddress(), LWOOBJID_EMPTY,
|
2022-07-28 13:39:57 +00:00
|
|
|
true, true, true, true, true, true, true, true, true
|
|
|
|
);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-07-15 20:56:33 +00:00
|
|
|
Game::entityManager->SerializeEntity(owner);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
void PersonalFortress::OnTimerDone(Entity* self, std::string timerName) {
|
|
|
|
if (timerName == "FireSkill") {
|
|
|
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
2023-01-07 05:59:19 +00:00
|
|
|
if (skillComponent) skillComponent->CalculateBehavior(650, 13364, LWOOBJID_EMPTY, true, false);
|
2022-07-28 13:39:57 +00:00
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|