DarkflameServer/dScripts/ai/AG/AgShipPlayerShockServer.cpp
Aaron Kimbrell 6aa90ad5b2
Breakout rest of the enums from dCommonVars and clean it up (#1061)
* Breakout rest of the enums from dcommonvars
so we don't have to deal with merge conflicts
ePlayerFlags is not a scoped enum, yet, due to it's complexity

* address feedback

* make player flag types consistent

* fix typo
2023-05-02 17:39:21 -05:00

22 lines
798 B
C++

#include "AgShipPlayerShockServer.h"
#include "GameMessages.h"
#include "eTerminateType.h"
void AgShipPlayerShockServer::OnUse(Entity* self, Entity* user) {
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
if (active) {
return;
}
active = true;
GameMessages::SendPlayAnimation(user, shockAnim);
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;
}