2023-03-08 13:31:45 +00:00
|
|
|
#include "StunImmunity.h"
|
|
|
|
#include "DestroyableComponent.h"
|
|
|
|
#include "ControllablePhysicsComponent.h"
|
2023-05-02 22:39:21 +00:00
|
|
|
#include "eStateChangeType.h"
|
2023-03-08 13:31:45 +00:00
|
|
|
|
|
|
|
void StunImmunity::OnStartup(Entity* self) {
|
2023-06-09 08:27:05 +00:00
|
|
|
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
2023-03-08 13:31:45 +00:00
|
|
|
if (destroyableComponent) {
|
|
|
|
destroyableComponent->SetStatusImmunity(
|
|
|
|
eStateChangeType::PUSH, false, false, true, true, false, false, false, false, true
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-06-09 08:27:05 +00:00
|
|
|
auto* controllablePhysicsComponent = self->GetComponent<ControllablePhysicsComponent>();
|
2023-03-08 13:31:45 +00:00
|
|
|
if (controllablePhysicsComponent) {
|
|
|
|
controllablePhysicsComponent->SetStunImmunity(
|
|
|
|
eStateChangeType::PUSH, self->GetObjectID(), true
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|