2021-12-05 17:54:36 +00:00
|
|
|
#include "AgShipPlayerShockServer.h"
|
|
|
|
#include "GameMessages.h"
|
2023-03-20 13:10:52 +00:00
|
|
|
#include "RenderComponent.h"
|
|
|
|
#include "Entity.h"
|
2023-05-02 22:39:21 +00:00
|
|
|
#include "eTerminateType.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
void AgShipPlayerShockServer::OnUse(Entity* self, Entity* user) {
|
|
|
|
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
|
|
|
if (active) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
active = true;
|
2023-03-20 13:10:52 +00:00
|
|
|
RenderComponent::PlayAnimation(user, shockAnim);
|
2021-12-05 17:54:36 +00:00
|
|
|
GameMessages::SendKnockback(user->GetObjectID(), self->GetObjectID(), self->GetObjectID(), 0, NiPoint3(-20, 10, -20));
|
|
|
|
|
|
|
|
GameMessages::SendPlayFXEffect(self, 1430, u"create", "console_sparks", LWOOBJID_EMPTY, 1.0, 1.0, true);
|
|
|
|
self->AddTimer("FXTime", fxTime);
|
|
|
|
}
|
|
|
|
|
|
|
|
void AgShipPlayerShockServer::OnTimerDone(Entity* self, std::string timerName) {
|
|
|
|
GameMessages::SendStopFXEffect(self, true, "console_sparks");
|
|
|
|
active = false;
|
|
|
|
}
|