Add Animation Table logic

This commit is contained in:
David Markowitz
2023-03-26 03:09:04 -07:00
parent 1e4e1b914c
commit 426bc963fe
40 changed files with 419 additions and 291 deletions

View File

@@ -73,7 +73,7 @@ void AmDarklingDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t
GameMessages::SendChangeIdleFlags(self->GetObjectID(), eAnimationFlags::IDLE_NONE, eAnimationFlags::IDLE_COMBAT, UNASSIGNED_SYSTEM_ADDRESS);
float animationTime = RenderComponent::PlayAnimation(self, u"stunstart", 1.7f);
self->AddTimer("timeToStunLoop", animationTime);
self->AddTimer("timeToStunLoop", 1.0f);
auto position = self->GetPosition();
auto forward = self->GetRotation().GetForwardVector();

View File

@@ -7,7 +7,10 @@
#include "RenderComponent.h"
void MaestromExtracticatorServer::OnStartup(Entity* self) {
self->AddTimer("PlayFail", RenderComponent::PlayAnimation(self, failAnim));
float animTime = RenderComponent::PlayAnimation(self, failAnim);
if (animTime == 0.0f) animTime = defaultTime;
self->AddTimer("PlayFail", animTime);
self->AddTimer("RemoveSample", destroyAfterNoSampleTime);
}

View File

@@ -13,5 +13,6 @@ public:
private:
const std::string failAnim = "idle_maelstrom";
const std::string collectAnim = "collect_maelstrom";
const float defaultTime = 4.0f;
const float destroyAfterNoSampleTime = 8.0f;
};

View File

@@ -28,9 +28,8 @@ void NtParadoxTeleServer::OnProximityUpdate(Entity* self, Entity* entering, std:
true, true, true, true, true, true, true
);
RenderComponent::PlayAnimation(player, u"teledeath", 4.0f);
const auto animTime = 2;
auto animTime = RenderComponent::PlayAnimation(player, u"teledeath", 4.0f);
if (animTime == 0.0f) animTime = 2.0f;
self->AddCallbackTimer(animTime, [this, self, playerID]() {
auto* player = EntityManager::Instance()->GetEntity(playerID);