Remove inlines

Clean up macros

more tomorrow

Cleanup and optimize CDActivities table

Remove unused include

Further work on CDActivityRewards

Update MasterServer.cpp

Further animations work

Activities still needs work for a better PK.

fix type

All of these replacements worked

Create internal interface for animations

Allows for user to just call GetAnimationTIme or PlayAnimation rather than passing in arbitrary true false statements
This commit is contained in:
David Markowitz
2023-03-20 06:10:52 -07:00
parent 7671cc6865
commit b432a3f5da
84 changed files with 631 additions and 607 deletions

View File

@@ -14,6 +14,7 @@
#include "GameMessages.h"
#include "SkillComponent.h"
#include "eReplicaComponentType.h"
#include "RenderComponent.h"
#include <vector>
@@ -695,11 +696,11 @@ float BossSpiderQueenEnemyServer::PlayAnimAndReturnTime(Entity* self, const std:
//TODO: Get the actual animation time
// Get the anim time
float animTimer = defaultAnimPause; //self:GetAnimationTime{animationID = animID}.time
float animTimer = RenderComponent::GetAnimationTime(self, animID);
// If we have an animation play it
if (animTimer > 0) {
GameMessages::SendPlayAnimation(self, animID);
animTimer = RenderComponent::PlayAnimation(self, animID);
}
// If the anim time is less than the the default time use default

View File

@@ -7,6 +7,7 @@
#include "BaseCombatAIComponent.h"
#include "EntityInfo.h"
#include "eAninmationFlags.h"
#include "RenderComponent.h"
void AmDarklingDragon::OnStartup(Entity* self) {
self->SetVar<int32_t>(u"weakspot", 0);
@@ -70,9 +71,9 @@ void AmDarklingDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t
self->SetVar<int32_t>(u"weakpoint", 2);
GameMessages::SendChangeIdleFlags(self->GetObjectID(), eAnimationFlags::IDLE_NONE, eAnimationFlags::IDLE_COMBAT, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::SendPlayAnimation(self, u"stunstart", 1.7f);
float animationTime = RenderComponent::PlayAnimation(self, u"stunstart", 1.7f);
self->AddTimer("timeToStunLoop", 1);
self->AddTimer("timeToStunLoop", animationTime);
auto position = self->GetPosition();
auto forward = self->GetRotation().GetForwardVector();
@@ -121,9 +122,9 @@ void AmDarklingDragon::OnTimerDone(Entity* self, std::string timerName) {
} else if (timerName == "ExposeWeakSpotTimer") {
self->SetVar<int32_t>(u"weakspot", 1);
} else if (timerName == "timeToStunLoop") {
GameMessages::SendPlayAnimation(self, u"stunloop", 1.8f);
RenderComponent::PlayAnimation(self, u"stunloop", 1.8f);
} else if (timerName == "ReviveTimer") {
GameMessages::SendPlayAnimation(self, u"stunend", 2.0f);
RenderComponent::PlayAnimation(self, u"stunend", 2.0f);
self->AddTimer("backToAttack", 1);
} else if (timerName == "backToAttack") {
auto* baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
@@ -153,5 +154,5 @@ void AmDarklingDragon::OnFireEventServerSide(Entity* self, Entity* sender, std::
self->SetVar<LWOOBJID>(u"Golem", sender->GetObjectID());
GameMessages::SendPlayAnimation(self, u"quickbuildhold", 1.9f);
RenderComponent::PlayAnimation(self, u"quickbuildhold", 1.9f);
}

View File

@@ -5,6 +5,7 @@
#include "DestroyableComponent.h"
#include "eAninmationFlags.h"
#include "EntityInfo.h"
#include "RenderComponent.h"
void FvMaelstromDragon::OnStartup(Entity* self) {
self->SetVar<int32_t>(u"weakspot", 0);
@@ -86,9 +87,9 @@ void FvMaelstromDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_
self->SetVar<int32_t>(u"weakpoint", 2);
GameMessages::SendChangeIdleFlags(self->GetObjectID(), eAnimationFlags::IDLE_NONE, eAnimationFlags::IDLE_COMBAT, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::SendPlayAnimation(self, u"stunstart", 1.7f);
RenderComponent::PlayAnimation(self, u"stunstart", 1.7f);
self->AddTimer("timeToStunLoop", 1);
self->AddTimer("timeToStunLoop", 1.0f);
auto position = self->GetPosition();
auto forward = self->GetRotation().GetForwardVector();
@@ -137,10 +138,10 @@ void FvMaelstromDragon::OnTimerDone(Entity* self, std::string timerName) {
} else if (timerName == "ExposeWeakSpotTimer") {
self->SetVar<int32_t>(u"weakspot", 1);
} else if (timerName == "timeToStunLoop") {
GameMessages::SendPlayAnimation(self, u"stunloop", 1.8f);
RenderComponent::PlayAnimation(self, u"stunloop", 1.8f);
} else if (timerName == "ReviveTimer") {
GameMessages::SendPlayAnimation(self, u"stunend", 2.0f);
self->AddTimer("backToAttack", 1);
RenderComponent::PlayAnimation(self, u"stunend", 2.0f);
self->AddTimer("backToAttack", 1.0f);
} else if (timerName == "backToAttack") {
auto* baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
auto* skillComponent = self->GetComponent<SkillComponent>();
@@ -174,5 +175,5 @@ FvMaelstromDragon::OnFireEventServerSide(Entity* self, Entity* sender, std::stri
self->SetVar<LWOOBJID>(u"Golem", sender->GetObjectID());
GameMessages::SendPlayAnimation(self, u"quickbuildhold", 1.9f);
RenderComponent::PlayAnimation(self, u"quickbuildhold", 1.9f);
}

View File

@@ -6,6 +6,7 @@
#include "EntityInfo.h"
#include "SkillComponent.h"
#include "eAninmationFlags.h"
#include "RenderComponent.h"
void BaseEnemyApe::OnStartup(Entity* self) {
self->SetVar<uint32_t>(u"timesStunned", 2);
@@ -37,7 +38,7 @@ void BaseEnemyApe::OnHit(Entity* self, Entity* attacker) {
if (skillComponent) {
skillComponent->Reset();
}
GameMessages::SendPlayAnimation(self, u"disable", 1.7f);
RenderComponent::PlayAnimation(self, u"disable", 1.7f);
GameMessages::SendChangeIdleFlags(self->GetObjectID(), eAnimationFlags::IDLE_NONE, eAnimationFlags::IDLE_COMBAT, UNASSIGNED_SYSTEM_ADDRESS);
const auto reviveTime = self->GetVar<float_t>(u"reviveTime") != 0.0f
? self->GetVar<float_t>(u"reviveTime") : 12.0f;

View File

@@ -1,6 +1,8 @@
#include "GfApeSmashingQB.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "Entity.h"
#include "RenderComponent.h"
void GfApeSmashingQB::OnStartup(Entity* self) {
self->SetNetworkVar<LWOOBJID>(u"lootTagOwner", self->GetVar<LWOOBJID>(u"lootTagOwner"));
@@ -16,7 +18,7 @@ void GfApeSmashingQB::OnRebuildComplete(Entity* self, Entity* target) {
auto* ape = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"ape"));
if (ape != nullptr) {
ape->OnFireEventServerSide(target, "rebuildDone");
GameMessages::SendPlayAnimation(self, u"smash", 1.7f);
RenderComponent::PlayAnimation(self, u"smash", 1.7f);
self->AddTimer("anchorBreakTime", 1.0f);
}
}