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

@@ -4,6 +4,7 @@
#include "MissionComponent.h"
#include "SkillComponent.h"
#include "eMissionTaskType.h"
#include "RenderComponent.h"
//TODO: this has to be updated so that you only get killed if you're in a certain radius.
//And so that all entities in a certain radius are killed, not just the attacker.
@@ -69,23 +70,6 @@ void ExplodingAsset::OnHit(Entity* self, Entity* attacker) {
}
void ExplodingAsset::OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) {
/*
if msg.objId:BelongsToFaction{factionID = 1}.bIsInFaction then
if (msg.status == "ENTER") then
self:PlayAnimation{ animationID = "bounce" }
self:PlayFXEffect{ name = "bouncin", effectType = "anim" }
self:SetVar("playersNearChest", (self:GetVar("playersNearChest") + 1 ))
elseif (msg.status == "LEAVE") then
self:SetVar("playersNearChest", (self:GetVar("playersNearChest") - 1 ))
if self:GetVar("playersNearChest") < 1 then
self:PlayAnimation{ animationID = "idle" }
self:StopFXEffect{ name = "bouncin" }
self:SetVar("playersNearChest", 0)
end
end
end
*/
auto* destuctableComponent = entering->GetComponent<DestroyableComponent>();
if (destuctableComponent == nullptr) return;
@@ -95,14 +79,14 @@ void ExplodingAsset::OnProximityUpdate(Entity* self, Entity* entering, std::stri
if (!std::count(factions.begin(), factions.end(), 1)) return;
if (status == "ENTER") {
GameMessages::SendPlayAnimation(self, u"bounce");
RenderComponent::PlayAnimation(self, u"bounce");
GameMessages::SendPlayFXEffect(self, -1, u"anim", "bouncin", LWOOBJID_EMPTY, 1, 1, true);
self->SetVar(u"playersNearChest", self->GetVar<int32_t>(u"playersNearChest") + 1);
} else if (status == "LEAVE") {
self->SetVar(u"playersNearChest", self->GetVar<int32_t>(u"playersNearChest") - 1);
if (self->GetVar<int32_t>(u"playersNearChest") < 1) {
GameMessages::SendPlayAnimation(self, u"idle");
RenderComponent::PlayAnimation(self, u"idle");
GameMessages::SendStopFXEffect(self, true, "bouncin");
self->SetVar<int32_t>(u"playersNearChest", 0);
}

View File

@@ -1,6 +1,8 @@
#include "NjIceRailActivator.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "Entity.h"
#include "RenderComponent.h"
void NjIceRailActivator::OnPlayerRailArrived(Entity* self, Entity* sender, const std::u16string& pathName,
int32_t waypoint) {
@@ -9,7 +11,7 @@ void NjIceRailActivator::OnPlayerRailArrived(Entity* self, Entity* sender, const
const auto& blockGroup = self->GetVar<std::u16string>(BlockGroupVariable);
for (auto* block : EntityManager::Instance()->GetEntitiesInGroup(GeneralUtils::UTF16ToWTF8(blockGroup))) {
GameMessages::SendPlayAnimation(block, u"explode");
RenderComponent::PlayAnimation(block, u"explode");
const auto blockID = block->GetObjectID();