DarkflameServer/dScripts/EquipmentScripts/StunImmunity.cpp

21 lines
656 B
C++
Raw Normal View History

#include "StunImmunity.h"
#include "DestroyableComponent.h"
#include "ControllablePhysicsComponent.h"
#include "eStateChangeType.h"
void StunImmunity::OnStartup(Entity* self) {
2023-06-07 07:23:50 +00:00
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
if (destroyableComponent) {
destroyableComponent->SetStatusImmunity(
eStateChangeType::PUSH, false, false, true, true, false, false, false, false, true
);
}
2023-06-07 07:23:50 +00:00
auto controllablePhysicsComponent = self->GetComponent<ControllablePhysicsComponent>();
if (controllablePhysicsComponent) {
controllablePhysicsComponent->SetStunImmunity(
eStateChangeType::PUSH, self->GetObjectID(), true
);
}
}