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) {
|
|
|
|
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
|
|
|
if (destroyableComponent) {
|
|
|
|
destroyableComponent->SetStatusImmunity(
|
|
|
|
eStateChangeType::PUSH, false, false, true, true, false, false, false, false, true
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
auto* controllablePhysicsComponent = self->GetComponent<ControllablePhysicsComponent>();
|
|
|
|
if (controllablePhysicsComponent) {
|
|
|
|
controllablePhysicsComponent->SetStunImmunity(
|
|
|
|
eStateChangeType::PUSH, self->GetObjectID(), true
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|