Implement CPatterned::KnockBack

This commit is contained in:
Jack Andersen 2018-11-05 20:16:12 -10:00
parent 3ef7386978
commit 0b3a9e1865
42 changed files with 709 additions and 385 deletions

View File

@ -31,7 +31,7 @@
#define SFXpik_x_elevamb_lp_00 1147
#define SFXsfx047C 1148
#define SFXsfx047D 1149
#define SFXsfx047E 1150
#define SFXeff_x_smallfire_lp_00 1150
#define SFXeff_x_fire_lp_00 1151
#define SFXsfx0480 1152
#define SFXsfx0481 1153

View File

@ -54,6 +54,8 @@
#include "World/CScriptDamageableTrigger.hpp"
#include "World/CScriptDebris.hpp"
#include "hecl/CVarManager.hpp"
#include "World/CPatterned.hpp"
#include "World/CDestroyableRock.hpp"
#include <cmath>
namespace urde
@ -1361,7 +1363,8 @@ void CStateManager::ApplyKnockBack(CActor& actor, const CDamageInfo& info, const
{
if (TCastToPtr<CPhysicsActor> physActor = actor)
{
zeus::CVector3f kbVec = pos * (dampedPower - hInfo->GetKnockbackResistance()) * physActor->GetMass() * 1.5f;
zeus::CVector3f kbVec = pos *
(dampedPower - hInfo->GetKnockbackResistance()) * physActor->GetMass() * 1.5f;
if (physActor->GetMaterialList().HasMaterial(EMaterialTypes::Immovable) ||
!physActor->GetMaterialList().HasMaterial(EMaterialTypes::Grass))
return;
@ -1372,7 +1375,8 @@ void CStateManager::ApplyKnockBack(CActor& actor, const CDamageInfo& info, const
}
if (ai)
ai->KnockBack(pos, *this, info, dampen == 0.f ? EKnockBackType::Zero : EKnockBackType::One, false, dampedPower);
ai->KnockBack(pos, *this, info, dampen == 0.f ? EKnockBackType::Direct : EKnockBackType::Radius,
false, dampedPower);
}
void CStateManager::KnockBackPlayer(CPlayer& player, const zeus::CVector3f& pos, float power, float resistance)
@ -1698,11 +1702,9 @@ bool CStateManager::ApplyLocalDamage(const zeus::CVector3f& vec1, const zeus::CV
float mulDam = dam;
TCastToPtr<CPlayer> player = damagee;
TCastToPtr<CAi> ai = damagee;
#if 0
if (TCastToPtr<CDestroyableRock>(damagee))
ai = damagee;
#endif
CAi* ai = TCastToPtr<CPatterned>(damagee).GetPtr();
if (!ai)
ai = TCastToPtr<CDestroyableRock>(damagee).GetPtr();
if (player)
{
@ -1746,7 +1748,7 @@ bool CStateManager::ApplyLocalDamage(const zeus::CVector3f& vec1, const zeus::CV
if (significant)
ai->TakeDamage(vec2, mulDam);
if (newHp <= 0.f)
ai->Death(vec2, *this, EScriptObjectState::DeathRattle);
ai->Death(*this, vec2, EScriptObjectState::DeathRattle);
}
return significant;

View File

@ -93,6 +93,24 @@ CCameraShakeData CCameraShakeData::BuildPhazonCameraShakeData(float duration, fl
SCameraShakePoint(1, 0.f, 0.f, 0.5f * duration, 0.5f))};
}
CCameraShakeData CCameraShakeData::BuildPatternedExplodeShakeData(float duration, float magnitude)
{
return {duration, 100.f, 0, zeus::CVector3f::skZero,
CCameraShakerComponent(1,
SCameraShakePoint(0, 0.25f * duration, 0.f, 0.75f * duration, magnitude),
SCameraShakePoint(1, 0.f, 0.f, 0.5f * duration, 2.0f)),
CCameraShakerComponent(),
CCameraShakerComponent()};
}
CCameraShakeData CCameraShakeData::BuildPatternedExplodeShakeData(const zeus::CVector3f& pos, float duration,
float magnitude, float distance)
{
CCameraShakeData shakeData = CCameraShakeData::BuildPatternedExplodeShakeData(duration, magnitude);
shakeData.SetSfxPositionAndDistance(pos, distance);
return shakeData;
}
void SCameraShakePoint::Update(float curTime)
{
float offTimePoint = xc_attackTime + x10_sustainTime;

View File

@ -66,6 +66,9 @@ public:
static CCameraShakeData BuildMissileCameraShake(float duration, float magnitude, float sfxDistance,
const zeus::CVector3f& sfxPos);
static CCameraShakeData BuildPhazonCameraShakeData(float duration, float magnitude);
static CCameraShakeData BuildPatternedExplodeShakeData(float duration, float magnitude);
static CCameraShakeData BuildPatternedExplodeShakeData(const zeus::CVector3f& pos, float duration,
float magnitude, float distance);
void Update(float dt, CStateManager& mgr);
zeus::CVector3f GetPoint() const;
float GetMaxAMComponent() const;

View File

@ -333,4 +333,21 @@ bool CBodyController::HasIceBreakoutState() const
return best.first > 0.f;
}
void CBodyController::StopElectrocution()
{
x324_electrocutionDur = 0.f;
x32c_timeElectrocuting = 0.f;
x4_cmdMgr.DeliverCmd(CBodyStateCmd(EBodyStateCmd::StopReaction));
}
void CBodyController::FrozenBreakout()
{
if (x300_26_frozen)
{
float timeToBreakout = x304_intoFreezeDur + x308_frozenDur;
if (x310_timeFrozen < timeToBreakout)
x310_timeFrozen = timeToBreakout;
}
}
}

View File

@ -101,6 +101,8 @@ public:
void DouseElectrocuting();
void UpdateFrozenInfo(float, CStateManager&);
bool HasIceBreakoutState() const;
void StopElectrocution();
void FrozenBreakout();
pas::EAnimationState GetCurrentAdditiveStateId() const
{ return x2a4_bodyStateInfo.GetCurrentAdditiveStateId(); }
EBodyType GetBodyType() const { return x2f4_bodyType; }

View File

@ -7,7 +7,7 @@ CAtomicAlpha::CAtomicAlpha(TUniqueId uid, std::string_view name, const CEntityIn
CAssetId wpsc, const CDamageInfo& dInfo, float f1, float f2, float f3, CAssetId cmdl,
bool b1, bool b2)
: CPatterned(ECharacter::AtomicAlpha, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
EMovementType::Flyer, EColliderType::One, EBodyType::Flyer, actParms, EKnockBackVariant::One)
EMovementType::Flyer, EColliderType::One, EBodyType::Flyer, actParms, EKnockBackVariant::Medium)
{
}

View File

@ -35,7 +35,7 @@ CBabygothData::CBabygothData(CInputStream& in)
CBabygoth::CBabygoth(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
CModelData&& mData, const CPatternedInfo& pInfo, const CActorParameters& actParms, const CBabygothData& babyData)
: CPatterned(ECharacter::Babygoth, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo, EMovementType::Ground,
EColliderType::One, EBodyType::BiPedal, actParms, EKnockBackVariant::One)
EColliderType::One, EBodyType::BiPedal, actParms, EKnockBackVariant::Medium)
{
}

View File

@ -8,5 +8,5 @@ CBloodFlower::CBloodFlower(TUniqueId uid, std::string_view name, const CEntityIn
const CDamageInfo& dInfo2, const CDamageInfo& dInfo3, CAssetId partId2, CAssetId partId3,
CAssetId partId4, float f1, CAssetId partId5, u32 soundId)
: CPatterned(ECharacter::BloodFlower, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
EMovementType::Ground, EColliderType::One, EBodyType::Restricted, actParms, EKnockBackVariant::One) {}
EMovementType::Ground, EColliderType::One, EBodyType::Restricted, actParms, EKnockBackVariant::Medium) {}
}

View File

@ -7,7 +7,7 @@ CBurrower::CBurrower(TUniqueId uid, std::string_view name, const CEntityInfo& in
CModelData&& mData, const CPatternedInfo& pInfo, const CActorParameters& actParms,
CAssetId, CAssetId, CAssetId, const CDamageInfo&, CAssetId, u32, CAssetId)
: CPatterned(ECharacter::Burrower, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
EMovementType::Ground, EColliderType::One, EBodyType::BiPedal, actParms, EKnockBackVariant::Zero)
EMovementType::Ground, EColliderType::One, EBodyType::BiPedal, actParms, EKnockBackVariant::Small)
{
}

View File

@ -22,7 +22,7 @@ CChozoGhost::CChozoGhost(TUniqueId uid, std::string_view name, const CEntityInfo
const CBehaveChance& chance3, u16 sId1, float f5, u16 sId2, u16 sId3, u32 w1, float f6, u32 w2,
float f7, CAssetId partId, s16 sId4, float f8, float f9, u32 w3, u32 w4)
: CPatterned(ECharacter::ChozoGhost, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
EMovementType::Flyer, EColliderType::Zero, EBodyType::BiPedal, actParms, EKnockBackVariant::One)
EMovementType::Flyer, EColliderType::Zero, EBodyType::BiPedal, actParms, EKnockBackVariant::Medium)
{
}

View File

@ -19,7 +19,7 @@ CElitePirate::CElitePirate(TUniqueId uid, std::string_view name, const CEntityIn
CModelData&& mData, const CPatternedInfo& pInfo, const CActorParameters& actParms,
const CElitePirateData& eliteData)
: CPatterned(ECharacter::ElitePirate, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
EMovementType::Ground, EColliderType::One, EBodyType::BiPedal, actParms, EKnockBackVariant::Two)
EMovementType::Ground, EColliderType::One, EBodyType::BiPedal, actParms, EKnockBackVariant::Large)
{
}

View File

@ -7,7 +7,7 @@ CEyeball::CEyeball(TUniqueId uid, std::string_view name, CPatterned::EFlavorType
CAssetId, const CDamageInfo&, CAssetId, CAssetId, CAssetId, CAssetId, u32, u32, u32, u32, u32,
const CActorParameters& actParms, bool)
: CPatterned(ECharacter::EyeBall, uid, name, flavor, info, xf, std::move(mData), pInfo, EMovementType::Flyer,
EColliderType::Zero, EBodyType::Restricted, actParms, EKnockBackVariant::One)
EColliderType::Zero, EBodyType::Restricted, actParms, EKnockBackVariant::Medium)
{
}

View File

@ -6,7 +6,7 @@ namespace urde::MP1
CFireFlea::CFireFlea(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
CModelData&& mData, const CActorParameters& actParms, const CPatternedInfo& pInfo, float)
: CPatterned(ECharacter::FireFlea, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
EMovementType::Flyer, EColliderType::One, EBodyType::NewFlyer, actParms, EKnockBackVariant::Zero)
EMovementType::Flyer, EColliderType::One, EBodyType::NewFlyer, actParms, EKnockBackVariant::Small)
{
}

View File

@ -7,7 +7,7 @@ CFlickerBat::CFlickerBat(TUniqueId uid, std::string_view name, CPatterned::EFlav
const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo,
EColliderType colType, bool b1, const CActorParameters& actParms, bool b2)
: CPatterned(ECharacter::FlickerBat, uid, name, flavor, info, xf, std::move(mData), pInfo, EMovementType::Flyer, colType,
EBodyType::Pitchable, actParms, EKnockBackVariant::Zero)
EBodyType::Pitchable, actParms, EKnockBackVariant::Small)
{
}

View File

@ -7,7 +7,7 @@ CFlyingPirate::CFlyingPirate(TUniqueId uid, std::string_view name, const CEntity
CModelData&& mData, const CActorParameters& actParms, const CPatternedInfo& pInfo,
CInputStream& in, u32 propCount)
: CPatterned(ECharacter::FlyingPirate, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
EMovementType::Flyer, EColliderType::One, EBodyType::NewFlyer, actParms, EKnockBackVariant::One)
EMovementType::Flyer, EColliderType::One, EBodyType::NewFlyer, actParms, EKnockBackVariant::Medium)
{
}

View File

@ -21,7 +21,7 @@ CMagdolite::CMagdolite(TUniqueId uid, std::string_view name, const CEntityInfo&
const CDamageVulnerability& dVuln2, CAssetId modelId, CAssetId skinId, float f3, float f4,
float f5, float f6, const urde::MP1::CMagdolite::CMagdoliteData& magData, float f7, float f8, float f9)
: CPatterned(ECharacter::Magdolite, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
EMovementType::Flyer, EColliderType::One, EBodyType::BiPedal, actParms, EKnockBackVariant::Two)
EMovementType::Flyer, EColliderType::One, EBodyType::BiPedal, actParms, EKnockBackVariant::Large)
{
}

View File

@ -7,7 +7,7 @@ CMetaree::CMetaree(TUniqueId uid, std::string_view name, EFlavorType flavor, con
float f1, const zeus::CVector3f& v1, float f2, EBodyType bodyType, float f3, float f4,
const CActorParameters& aParms)
: CPatterned(ECharacter::Metaree, uid, name, flavor, info, xf, std::move(mData), pInfo, EMovementType::Flyer,
EColliderType::Zero, bodyType, aParms, EKnockBackVariant::Zero)
EColliderType::Zero, bodyType, aParms, EKnockBackVariant::Small)
, x568_(f3)
, x56c_(f4)
, x570_(f1)

View File

@ -24,7 +24,7 @@ CMetroid::CMetroid(TUniqueId uid, std::string_view name, EFlavorType flavor, con
const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo,
const CActorParameters& aParms, const CMetroidData& metroidData)
: CPatterned(ECharacter::Metroid, uid, name, flavor, info, xf, std::move(mData), pInfo,
EMovementType::Flyer, EColliderType::One, EBodyType::Flyer, aParms, EKnockBackVariant::One)
EMovementType::Flyer, EColliderType::One, EBodyType::Flyer, aParms, EKnockBackVariant::Medium)
{
}

View File

@ -29,7 +29,7 @@ CMetroidBeta::CMetroidBeta(TUniqueId uid, std::string_view name, const CEntityIn
const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo,
const CActorParameters& aParms, const CMetroidBetaData& metroidData)
: CPatterned(ECharacter::MetroidBeta, uid, name, EFlavorType::One, info, xf, std::move(mData), pInfo,
EMovementType::Flyer, EColliderType::One, EBodyType::Flyer, aParms, EKnockBackVariant::Two)
EMovementType::Flyer, EColliderType::One, EBodyType::Flyer, aParms, EKnockBackVariant::Large)
{
}

View File

@ -142,7 +142,7 @@ CMetroidPrimeExo::CMetroidPrimeExo(TUniqueId uid, std::string_view name, const C
CAssetId particle3, CAssetId particle4,
const rstl::reserved_vector<SPrimeStruct6, 4>& struct6s)
: CPatterned(ECharacter::MetroidPrimeExo, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
EMovementType::Flyer, EColliderType::One, EBodyType::Flyer, aParms, EKnockBackVariant::Two)
EMovementType::Flyer, EColliderType::One, EBodyType::Flyer, aParms, EKnockBackVariant::Large)
{
}

View File

@ -10,7 +10,7 @@ CNewIntroBoss::CNewIntroBoss(TUniqueId uid, std::string_view name, const CEntity
const CActorParameters& actParms, float, u32, const CDamageInfo& dInfo,
u32, u32, u32, u32)
: CPatterned(ECharacter::NewIntroBoss, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
EMovementType::Flyer, EColliderType::One, EBodyType::Restricted, actParms, EKnockBackVariant::One)
EMovementType::Flyer, EColliderType::One, EBodyType::Restricted, actParms, EKnockBackVariant::Medium)
{
}

View File

@ -24,7 +24,7 @@ CParasite::CParasite(TUniqueId uid, std::string_view name, EFlavorType flavor, c
bool b1, u32 w1, const CDamageVulnerability& dVuln,const CDamageInfo& parInfo, u16 sfxId1,
u16 sfxId2, u16 sfxId3, u32 w2, u32 w3, float f19, const CActorParameters &aParams)
: CWallWalker(ECharacter::Parasite, uid, name, flavor, info, xf, std::move(mData), pInfo, EMovementType::Flyer,
EColliderType::Zero, bodyType, aParams, f7, f4, EKnockBackVariant::Zero, f2, w1, f17, b1)
EColliderType::Zero, bodyType, aParams, f7, f4, EKnockBackVariant::Small, f2, w1, f17, b1)
, x64c_(dVuln)
, x6b4_(parInfo)
, x6d0_(f1)
@ -53,7 +53,7 @@ CParasite::CParasite(TUniqueId uid, std::string_view name, EFlavorType flavor, c
switch(x5d0_)
{
case 2:
x460_knockBackController.SetX81_25(false);
x460_knockBackController.SetEnableFreeze(false);
case 1:
x460_knockBackController.SetAutoResetImpulse(false);
break;

View File

@ -9,7 +9,7 @@ CPuddleToadGamma::CPuddleToadGamma(TUniqueId uid, std::string_view name, EFlavor
const zeus::CVector3f& v1,
float f4, float f5, float f6, const CDamageInfo& dInfo1, const CDamageInfo& dInfo2)
: CPatterned(ECharacter::PuddleToad, uid, name, flavor, info, xf, std::move(mData), pInfo, EMovementType::Flyer,
EColliderType::Zero, EBodyType::Restricted, aParms, EKnockBackVariant::Two)
EColliderType::Zero, EBodyType::Restricted, aParms, EKnockBackVariant::Large)
{
}

View File

@ -8,7 +8,7 @@ CPuffer::CPuffer(TUniqueId uid, std::string_view name, const CEntityInfo& info,
float hoverSpeed, CAssetId cloudEffect, const CDamageInfo& cloudDamage, CAssetId cloudSteam, float f2,
bool b1, bool b2, bool b3, const CDamageInfo& explosionDamage, s16 sfxId)
: CPatterned(ECharacter::Puffer, uid, name, EFlavorType::Zero, info, xf, std::move(modelData), patternedInfo,
EMovementType::Flyer, EColliderType::One, EBodyType::RestrictedFlyer, actorParameters, EKnockBackVariant::Zero)
EMovementType::Flyer, EColliderType::One, EBodyType::RestrictedFlyer, actorParameters, EKnockBackVariant::Small)
{
}

View File

@ -22,7 +22,7 @@ CRidley::CRidley(TUniqueId uid, std::string_view name, const CEntityInfo& info,
const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo,
const CActorParameters& actParms, CInputStream& in, u32 propCount)
: CPatterned(ECharacter::Ridley, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
EMovementType::Flyer, EColliderType::Zero, EBodyType::Flyer, actParms, EKnockBackVariant::Two),
EMovementType::Flyer, EColliderType::Zero, EBodyType::Flyer, actParms, EKnockBackVariant::Large),
x568_(in, propCount)
{
}

View File

@ -11,7 +11,7 @@ CSeedling::CSeedling(TUniqueId uid, std::string_view name, const CEntityInfo& in
CAssetId, CAssetId, const CDamageInfo&, const CDamageInfo&, float f1, float f2, float f3, float f4)
: CWallWalker(ECharacter::Seedling, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
EMovementType::Ground, EColliderType::Zero, EBodyType::WallWalker, actParms, f1, f2,
EKnockBackVariant::Zero, f3, 4, f4, false)
EKnockBackVariant::Small, f3, 4, f4, false)
{
}

View File

@ -22,7 +22,7 @@ CSpacePirate::CSpacePirate(TUniqueId uid, std::string_view name, const CEntityIn
CModelData&& mData, const CActorParameters& aParams, const CPatternedInfo& pInfo,
CInputStream& in, u32 propCount)
: CPatterned(ECharacter::SpacePirate, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo, EMovementType::Ground,
EColliderType::One, EBodyType::BiPedal, aParams, EKnockBackVariant::One)
EColliderType::One, EBodyType::BiPedal, aParams, EKnockBackVariant::Medium)
, x568_(in, propCount)
{
}

View File

@ -8,7 +8,7 @@ CThardusRockProjectile::CThardusRockProjectile(
const zeus::CTransform& xf, CModelData&& modelData, const CActorParameters& aParms,
const CPatternedInfo& patternedInfo, const std::vector<CModelData>& mDataVec, u32)
: CPatterned(ECharacter::ThardusRockProjectile, uid, name, EFlavorType::Zero, info, xf, std::move(modelData),
patternedInfo, EMovementType::Flyer, EColliderType::One, EBodyType::Flyer, aParms, EKnockBackVariant::One)
patternedInfo, EMovementType::Flyer, EColliderType::One, EBodyType::Flyer, aParms, EKnockBackVariant::Medium)
{
}

View File

@ -5,6 +5,6 @@ namespace urde::MP1
CTryclops::CTryclops(urde::TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
urde::CModelData&& mData, const urde::CPatternedInfo& pInfo, const urde::CActorParameters& actParms, float, float, float, float)
: CPatterned(ECharacter::Tryclops, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
EMovementType::Ground, EColliderType::One, EBodyType::BiPedal, actParms, EKnockBackVariant::Zero)
EMovementType::Ground, EColliderType::One, EBodyType::BiPedal, actParms, EKnockBackVariant::Small)
{}
}

View File

@ -9,7 +9,7 @@ CWarWasp::CWarWasp(TUniqueId uid, std::string_view name, const CEntityInfo& info
CPatterned::EColliderType collider, const CDamageInfo& dInfo1, const CActorParameters& actorParms,
CAssetId weapon, const CDamageInfo& dInfo2, CAssetId particle, u32 w3)
: CPatterned(ECharacter::WarWasp, uid, name, flavor, info, xf, std::move(mData), pInfo, EMovementType::Flyer, collider,
EBodyType::Flyer, actorParms, EKnockBackVariant::Zero)
EBodyType::Flyer, actorParms, EKnockBackVariant::Small)
{
}

View File

@ -10,6 +10,7 @@
#include "Graphics/CBooRenderer.hpp"
#include "Graphics/CSkinnedModel.hpp"
#include "World/CScriptPlayerActor.hpp"
#include "CPatterned.hpp"
namespace urde
{
@ -123,6 +124,22 @@ void CActorModelParticles::CItem::Update(float, CStateManager&)
}
void CActorModelParticles::CItem::EnsureLoaded(EDependency d)
{
if (!(x134_bits & (1 << int(d))))
{
x128_parent.IncrementDependency(d);
x134_bits |= (1 << int(d));
}
}
void CActorModelParticles::IncrementDependency(EDependency d)
{
x50_dgrps[int(d)].Increment();
if (!(xe6_bits2 & (1 << int(d))))
xe4_bits |= (1 << int(d));
}
static const char* ParticleDGRPs[] =
{
"Effect_OnFire_DGRP",
@ -133,15 +150,15 @@ static const char* ParticleDGRPs[] =
"Effect_Electric_DGRP",
};
std::pair<std::vector<CToken>, bool>
CActorModelParticles::Dependency
CActorModelParticles::GetParticleDGRPTokens(const char* name)
{
std::pair<std::vector<CToken>, bool> ret = {};
Dependency ret = {};
TToken<CDependencyGroup> dgrp = g_SimplePool->GetObj(name);
const auto& vector = dgrp->GetObjectTagVector();
ret.first.reserve(vector.size());
ret.x0_tokens.reserve(vector.size());
for (const SObjectTag& tag : vector)
ret.first.push_back(g_SimplePool->GetObj(tag));
ret.x0_tokens.push_back(g_SimplePool->GetObj(tag));
return ret;
}
@ -292,9 +309,16 @@ void CActorModelParticles::StartIce(CActor& actor)
{
}
void CActorModelParticles::StartElectric(CActor& act)
{
auto iter = FindOrCreateSystem(act);
if (iter->xc0_particleElectric && !iter->xc0_particleElectric->GetParticleEmission())
iter->xc0_particleElectric->SetParticleEmission(true);
}
void CActorModelParticles::StopElectric(CActor& act)
{
if (!act.GetPointGeneratorParticles())
if (act.GetPointGeneratorParticles())
{
auto iter = FindSystem(act.GetUniqueId());
if (iter != x0_items.cend() && iter->xc0_particleElectric)
@ -302,6 +326,61 @@ void CActorModelParticles::StopElectric(CActor& act)
}
}
void CActorModelParticles::StopThermalHotParticles(CActor& act)
{
if (act.GetPointGeneratorParticles())
{
auto iter = FindSystem(act.GetUniqueId());
if (iter != x0_items.cend())
{
for (auto& part : iter->x8_thermalHotParticles)
if (part.first)
part.first->SetParticleEmission(false);
}
}
}
static bool IsMediumOrLarge(CActor& act)
{
if (TCastToConstPtr<CPatterned> pat = act)
return pat->GetKnockBackController().GetVariant() != EKnockBackVariant::Small;
return false;
}
void CActorModelParticles::PlayFireSFX(CActor& act)
{
auto iter = FindOrCreateSystem(act);
u16 sfx = SFXeff_x_smallfire_lp_00 + u16(IsMediumOrLarge(act));
CSfxManager::AddEmitter(sfx, act.GetTranslation(), zeus::CVector3f::skZero, true, false, 0x7f, kInvalidAreaId);
iter->xdc_ashy.Lock();
}
void CActorModelParticles::EnsureElectricLoaded(CActor& act)
{
auto iter = FindOrCreateSystem(act);
iter->EnsureLoaded(EDependency::Electric);
}
void CActorModelParticles::EnsureFirePopLoaded(CActor& act)
{
auto iter = FindOrCreateSystem(act);
iter->EnsureLoaded(EDependency::FirePop);
}
void CActorModelParticles::EnsureIceBreakLoaded(CActor& act)
{
auto iter = FindOrCreateSystem(act);
iter->EnsureLoaded(EDependency::IceBreak);
}
void CActorModelParticles::LightDudeOnFire(CActor& act)
{
auto iter = FindOrCreateSystem(act);
iter->EnsureLoaded(EDependency::OnFire);
if (iter->x6c_ <= 0.f)
iter->x70_ = true;
}
void CActorModelParticles::AddRainSplashGenerator(CActor& act, CStateManager& mgr, u32 maxSplashes,
u32 genRate, float minZ)
{

View File

@ -21,6 +21,16 @@ class CScriptPlayerActor;
class CActorModelParticles
{
public:
enum class EDependency
{
OnFire,
Ash,
IceBreak,
FirePop,
IcePop,
Electric
};
class CItem
{
friend class CActorModelParticles;
@ -63,9 +73,11 @@ public:
CItem(const CEntity& ent, CActorModelParticles& parent);
void GeneratePoints(const std::vector<std::pair<zeus::CVector3f, zeus::CVector3f>>& vn);
void Update(float, CStateManager&);
void EnsureLoaded(EDependency i);
};
private:
friend class CItem;
std::list<CItem> x0_items;
TToken<CGenDescription> x18_onFire;
TToken<CGenDescription> x20_ash;
@ -74,9 +86,47 @@ private:
TToken<CGenDescription> x38_icePop;
TToken<CElectricDescription> x40_electric;
TToken<CTexture> x48_ashy;
rstl::reserved_vector<std::pair<std::vector<CToken>, bool>, 6> x50_dgrps;
struct Dependency
{
std::vector<CToken> x0_tokens;
int x10_refCount = 0;
bool x14_loaded = false;
void Increment()
{
++x10_refCount;
if (x10_refCount == 1)
Load();
}
void Decrement()
{
--x10_refCount;
if (x10_refCount <= 0)
Unload();
}
void Load()
{
bool loading = false;
for (CToken& tok : x0_tokens)
{
tok.Lock();
if (!tok.IsLoaded())
loading = true;
}
if (!loading)
x14_loaded = true;
}
void Unload()
{
for (CToken& tok : x0_tokens)
tok.Unlock();
x14_loaded = false;
}
};
rstl::reserved_vector<Dependency, 6> x50_dgrps;
u8 xe4_bits = 0;
u8 xe6_bits2 = 0;
std::pair<std::vector<CToken>, bool> GetParticleDGRPTokens(const char* name);
Dependency GetParticleDGRPTokens(const char* name);
void LoadParticleDGRPs();
std::unique_ptr<CElementGen> MakeOnFireGen() const;
@ -86,6 +136,7 @@ private:
std::unique_ptr<CElementGen> MakeIcePopGen() const;
std::unique_ptr<CParticleElectric> MakeElectricGen() const;
void IncrementDependency(EDependency d);
public:
CActorModelParticles();
static void PointGenerator(void* item, const std::vector<std::pair<zeus::CVector3f, zeus::CVector3f>>& vn);
@ -99,25 +150,14 @@ public:
u32 genRate, float minZ);
void RemoveRainSplashGenerator(CActor& act);
void Render(const CActor& actor) const;
void StartElectric(CActor& act)
{
auto iter = FindOrCreateSystem(act);
if (iter->xc0_particleElectric && !iter->xc0_particleElectric->GetParticleEmission())
iter->xc0_particleElectric->SetParticleEmission(true);
}
void StartElectric(CActor& act);
void StopElectric(CActor& act);
void LightDudeOnFire(CActor& act)
{
auto iter = FindOrCreateSystem(act);
/* iter->sub801e5a04(false); */
if (iter->x6c_ > 0.f)
iter->x70_ = true;
}
void StopThermalHotParticles(CActor& act);
void PlayFireSFX(CActor& act);
void EnsureElectricLoaded(CActor& act);
void EnsureFirePopLoaded(CActor& act);
void EnsureIceBreakLoaded(CActor& act);
void LightDudeOnFire(CActor& act);
};
}

View File

@ -45,7 +45,7 @@ public:
virtual void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&);
virtual CHealthInfo* HealthInfo(CStateManager&) { return &x258_healthInfo; }
virtual void Death(const zeus::CVector3f&, CStateManager&, EScriptObjectState)=0;
virtual void Death(CStateManager& mgr, const zeus::CVector3f&, EScriptObjectState)=0;
virtual void KnockBack(const zeus::CVector3f&, CStateManager&, const CDamageInfo& info,
EKnockBackType type, bool inDeferred, float magnitude)=0;
virtual const CDamageVulnerability* GetDamageVulnerability() const { return &x260_damageVulnerability; }

View File

@ -27,6 +27,23 @@ CExplosion::CExplosion(const TLockedToken<CGenDescription>& particle, TUniqueId
xe8_particleGen->SetModulationColor(color);
}
CExplosion::CExplosion(const TLockedToken<CElectricDescription>& electric, TUniqueId uid, bool active,
const CEntityInfo& info, std::string_view name, const zeus::CTransform& xf,
u32 flags, const zeus::CVector3f& scale, const zeus::CColor& color)
: CEffect(uid, info, active, name, xf)
{
xe8_particleGen = std::make_unique<CParticleElectric>(electric);
xf0_electricDesc = electric.GetObj();
xf4_24_renderThermalHot = flags & 0x4;
xf4_25_ = true;
xf4_26_renderXray = flags & 0x8;
xe6_27_thermalVisorFlags = flags & 0x1 ? 1 : 2;
xe8_particleGen->SetGlobalTranslation(xf.origin);
xe8_particleGen->SetOrientation(xf.getRotation());
xe8_particleGen->SetGlobalScale(scale);
xe8_particleGen->SetModulationColor(color);
}
void CExplosion::Accept(IVisitor& visitor)
{
visitor.Visit(this);

View File

@ -9,9 +9,13 @@ namespace urde
class CExplosion : public CEffect
{
std::unique_ptr<CElementGen> xe8_particleGen;
std::unique_ptr<CParticleGen> xe8_particleGen;
TUniqueId xec_explosionLight = kInvalidUniqueId;
const CGenDescription* xf0_particleDesc;
union
{
const CGenDescription* xf0_particleDesc;
const CElectricDescription* xf0_electricDesc;
};
bool xf4_24_renderThermalHot:1;
bool xf4_25_:1;
bool xf4_26_renderXray:1;
@ -21,6 +25,9 @@ public:
CExplosion(const TLockedToken<CGenDescription>& particle, TUniqueId uid, bool active,
const CEntityInfo& info, std::string_view name, const zeus::CTransform& xf,
u32, const zeus::CVector3f& scale, const zeus::CColor& color);
CExplosion(const TLockedToken<CElectricDescription>& electric, TUniqueId uid, bool active,
const CEntityInfo& info, std::string_view name, const zeus::CTransform& xf,
u32, const zeus::CVector3f& scale, const zeus::CColor& color);
void Accept(IVisitor&);
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&);

View File

@ -10,350 +10,350 @@ static const CKnockBackController::KnockBackParms KnockBackParmsTable[3][19][4]
{
{
{
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Seven, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Seven, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Flinch, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Two, 1.000000f, 0.000000f},
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 1.000000f, 0.000000f},
},
{
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Two, 2.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Two, 2.000000f, 0.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 2.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 2.000000f, 0.000000f},
},
{
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Two, 4.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Six, 4.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Two, 0.000000f, 0.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 4.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 0.000000f, 0.000000f},
},
{
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Two, 4.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Two, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 5.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 5.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 5.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 5.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 8.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 8.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 4.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 4.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Flinch, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Six, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::ExplodeDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
},
{
{
{EKnockBackAnimationState::Flinch, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Zero, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
},
{
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Seven, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Seven, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Seven, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Flinch, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Two, 2.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Two, 1.000000f, 0.000000f},
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 2.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 1.000000f, 0.000000f},
},
{
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Two, 2.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Two, 2.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Two, 2.000000f, 0.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Shock, 2.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 2.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 2.000000f, 0.000000f},
},
{
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Two, 4.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Two, 4.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Two, 0.000000f, 0.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 0.000000f, 0.000000f},
},
{
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Two, 4.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Two, 4.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Two, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Zero, 0.000000f, 0.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
},
{
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 5.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 5.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 5.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 5.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 8.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 8.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 8.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 8.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 4.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 4.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 4.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 4.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Three, 6.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Eight, 6.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Three, 6.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Burn, 6.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::FireDeath, 6.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Burn, 6.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Eight, 6.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Eight, 6.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Three, 6.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::FireDeath, 6.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::FireDeath, 6.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Burn, 6.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Three, 6.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Eight, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Three, 6.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Burn, 6.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::FireDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Burn, 6.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Seven, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Nine, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Nine, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Disintegrate, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Disintegrate, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Flinch, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Four, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::PhazeOut, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
},
{
{
{EKnockBackAnimationState::Flinch, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Zero, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
},
{
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Flinch, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Two, 2.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Two, 1.000000f, 0.000000f},
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 2.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 1.000000f, 0.000000f},
},
{
{EKnockBackAnimationState::Flinch, EKnockBackAnimationCondition::Two, 2.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Two, 2.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Two, 2.000000f, 0.000000f},
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::Shock, 2.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 2.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 2.000000f, 0.000000f},
},
{
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Two, 4.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Two, 4.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Two, 4.000000f, 0.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Shock, 4.000000f, 0.000000f},
},
{
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Two, 4.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Two, 4.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Two, 4.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 4.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Shock, 4.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Zero, 0.000000f, 0.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Zero, 0.000000f, 0.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
},
{
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Zero, 0.000000f, 0.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Zero, 0.000000f, 0.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
},
{
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 4.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Zero, 0.000000f, 0.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 4.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 4.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 4.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Zero, 0.000000f, 0.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::One, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Freeze, 2.500000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Flinch, EKnockBackAnimationCondition::Three, 6.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Three, 6.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Three, 6.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::Burn, 6.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Burn, 6.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Burn, 6.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Three, 6.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Three, 6.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Three, 6.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Burn, 6.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::Burn, 6.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Burn, 6.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Three, 6.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Eight, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Three, 6.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::Burn, 6.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::FireDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::Burn, 6.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Flinch, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationCondition::Seven, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::KnockBack, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Flinch, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationCondition::Zero, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::None, EKnockBackAnimationFollowUp::None, 0.000000f, 0.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Nine, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Nine, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Disintegrate, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::Disintegrate, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
{
{EKnockBackAnimationState::Flinch, EKnockBackAnimationCondition::Zero, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Four, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationCondition::Seven, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Flinch, EKnockBackAnimationFollowUp::None, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::PhazeOut, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Hurled, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
{EKnockBackAnimationState::Fall, EKnockBackAnimationFollowUp::IceDeath, 0.000000f, -1.000000f},
},
},
};
@ -362,11 +362,11 @@ CKnockBackController::CKnockBackController(EKnockBackVariant variant)
: x0_variant(variant)
{
x81_24_autoResetImpulse = true;
x81_25_ = true;
x81_27_ = true;
x81_28_ = true;
x81_29_ = true;
x81_30_ = true;
x81_25_enableFreeze = true;
x81_27_enableBurn = true;
x81_28_enableFireDeath = true;
x81_29_enableExplodeDeath = true;
x81_30_enableDisintegrate = true;
x81_31_ = true;
x82_24_ = true;
for (int i = 0; i < 4; ++i)
@ -454,38 +454,38 @@ void CKnockBackController::ValidateState(CPatterned& parent)
x4_activeParms.x0_animState = (useState != EKnockBackAnimationState::Invalid) ?
useState : EKnockBackAnimationState::None;
bool r4 = false;
switch (x4_activeParms.x4_animCondition)
bool disableFollowup = false;
switch (x4_activeParms.x4_animFollowup)
{
case EKnockBackAnimationCondition::One:
r4 = !x81_25_;
case EKnockBackAnimationFollowUp::Freeze:
disableFollowup = !x81_25_enableFreeze;
break;
case EKnockBackAnimationCondition::Two:
r4 = !x81_26_;
case EKnockBackAnimationFollowUp::Shock:
disableFollowup = !x81_26_enableShock;
break;
case EKnockBackAnimationCondition::Three:
r4 = !x81_27_;
case EKnockBackAnimationFollowUp::Burn:
disableFollowup = !x81_27_enableBurn;
break;
case EKnockBackAnimationCondition::Six:
r4 = !x81_29_;
case EKnockBackAnimationFollowUp::ExplodeDeath:
disableFollowup = !x81_29_enableExplodeDeath;
break;
case EKnockBackAnimationCondition::Seven:
r4 = !x81_29_;
case EKnockBackAnimationFollowUp::IceDeath:
disableFollowup = !x81_29_enableExplodeDeath;
break;
case EKnockBackAnimationCondition::Eight:
r4 = !x81_28_;
case EKnockBackAnimationFollowUp::FireDeath:
disableFollowup = !x81_28_enableFireDeath;
break;
case EKnockBackAnimationCondition::Nine:
r4 = !x81_30_;
case EKnockBackAnimationFollowUp::Disintegrate:
disableFollowup = !x81_30_enableDisintegrate;
break;
default:
break;
}
if (r4)
if (disableFollowup)
{
x4_activeParms.x4_animCondition = EKnockBackAnimationCondition::Zero;
x4_activeParms.x8_ = 0.f;
x4_activeParms.x4_animFollowup = EKnockBackAnimationFollowUp::None;
x4_activeParms.x8_followupMagnitude = 0.f;
}
}
@ -547,7 +547,7 @@ void CKnockBackController::DoKnockBackAnimation(const zeus::CVector3f& backVec,
void CKnockBackController::ResetKnockBackImpulse(CPatterned& parent, const zeus::CVector3f& backVec, float magnitude)
{
if (x81_24_autoResetImpulse && x4_activeParms.x0_animState == EKnockBackAnimationState::KnockBack &&
x4_activeParms.x4_animCondition != EKnockBackAnimationCondition::One)
x4_activeParms.x4_animFollowup != EKnockBackAnimationFollowUp::Freeze)
{
x50_impulseDir = backVec.canBeNormalized() ? backVec.normalized() : -parent.GetTransform().basis[1];
if (x60_impulseRemTime <= 0.f)
@ -562,7 +562,7 @@ void CKnockBackController::DoDeferredKnockBack(CStateManager& mgr, CPatterned& p
{
if (x14_deferWeaponType == EWeaponType::Wave)
{
x4_activeParms = KnockBackParmsTable[int(x0_variant)][int(EKnockBackWeaponType::WaveExtra)]
x4_activeParms = KnockBackParmsTable[int(x0_variant)][int(EKnockBackWeaponType::WaveComboedDirect)]
[int(GetKnockBackCharacterState(parent))];
ValidateState(parent);
if (CHealthInfo* hInfo = parent.HealthInfo(mgr))
@ -573,7 +573,7 @@ void CKnockBackController::DoDeferredKnockBack(CStateManager& mgr, CPatterned& p
x82_25_inDeferredKnockBack = true;
parent.KnockBack(backVec, mgr,
CDamageInfo({x14_deferWeaponType, false, true, false}, 0.f, 0.f, 10.f),
EKnockBackType::One, x82_25_inDeferredKnockBack, 10.f);
EKnockBackType::Radius, x82_25_inDeferredKnockBack, 10.f);
x82_25_inDeferredKnockBack = false;
}
}
@ -622,9 +622,9 @@ EKnockBackWeaponType CKnockBackController::GetKnockBackWeaponType(const CDamageI
switch (wType)
{
case EWeaponType::Power:
return EKnockBackWeaponType(type != EKnockBackType::Zero ? stacking : stacking + 1);
return EKnockBackWeaponType(type != EKnockBackType::Direct ? stacking : stacking + 1);
case EWeaponType::Ice:
return EKnockBackWeaponType(type != EKnockBackType::Zero ? stacking + 8 : stacking + 9);
return EKnockBackWeaponType(type != EKnockBackType::Direct ? stacking + 8 : stacking + 9);
case EWeaponType::Wave:
return EKnockBackWeaponType(stacking + 4);
case EWeaponType::Plasma:

View File

@ -11,15 +11,15 @@ class CDamageInfo;
enum class EKnockBackType
{
Zero,
One
Direct,
Radius
};
enum class EKnockBackVariant
{
Zero,
One,
Two
Small,
Medium,
Large
};
enum class EKnockBackWeaponType
@ -28,15 +28,15 @@ enum class EKnockBackWeaponType
Power,
PowerCharged,
PowerComboed,
PowerExtra,
PowerComboedDirect,
Wave,
WaveCharged,
WaveComboed,
WaveExtra,
WaveComboedDirect,
Ice,
IceCharged,
IceComboed,
IceExtra,
IceComboedDirect,
Plasma,
PlasmaCharged,
PlasmaComboed,
@ -64,19 +64,19 @@ enum class EKnockBackAnimationState
Fall
};
enum class EKnockBackAnimationCondition
enum class EKnockBackAnimationFollowUp
{
Invalid = -1,
Zero,
One,
Two,
Three,
Four,
Five,
Six,
Seven,
Eight,
Nine
None,
Freeze,
Shock,
Burn,
PhazeOut,
Death,
ExplodeDeath,
IceDeath,
FireDeath,
Disintegrate
};
class CKnockBackController
@ -85,8 +85,8 @@ public:
struct KnockBackParms
{
EKnockBackAnimationState x0_animState;
EKnockBackAnimationCondition x4_animCondition;
float x8_;
EKnockBackAnimationFollowUp x4_animFollowup;
float x8_followupMagnitude;
float xc_;
};
private:
@ -113,12 +113,12 @@ private:
struct
{
bool x81_24_autoResetImpulse : 1; // t
bool x81_25_ : 1; // t
bool x81_26_ : 1;
bool x81_27_ : 1; // t
bool x81_28_ : 1; // t
bool x81_29_ : 1; // t
bool x81_30_ : 1; // t
bool x81_25_enableFreeze : 1; // t
bool x81_26_enableShock : 1;
bool x81_27_enableBurn : 1; // t
bool x81_28_enableFireDeath : 1; // t
bool x81_29_enableExplodeDeath : 1; // t
bool x81_30_enableDisintegrate : 1; // t
bool x81_31_ : 1; // t
bool x82_24_ : 1; // t
bool x82_25_inDeferredKnockBack : 1;
@ -148,7 +148,9 @@ public:
void Update(float dt, CStateManager& mgr, CPatterned& parent);
void KnockBack(const zeus::CVector3f& backVec, CStateManager& mgr, CPatterned& parent,
const CDamageInfo& info, EKnockBackType type, float magnitude);
void SetX81_25(bool b) { x81_25_ = b; }
void SetEnableFreeze(bool b) { x81_25_enableFreeze = b; }
const KnockBackParms& GetActiveParms() const { return x4_activeParms; }
EKnockBackVariant GetVariant() const { return x0_variant; }
};
}

View File

@ -13,6 +13,7 @@
#include "TCastTo.hpp"
#include "MP1/World/CSpacePirate.hpp"
#include "World/CStateMachine.hpp"
#include "CExplosion.hpp"
namespace urde
{
@ -68,17 +69,17 @@ x460_knockBackController(kbVariant)
x4fc_ = pInfo.x108_;
x508_colliderType = colliderType;
x50c_thermalMag = actorParms.GetThermalMag();
x514_ = pInfo.x110_particle1Scale;
x540_ = pInfo.x124_particle2Scale;
x514_deathExplosionOffset = pInfo.x110_particle1Scale;
x540_iceDeathExplosionOffset = pInfo.x124_particle2Scale;
if (pInfo.x11c_particle1.IsValid())
x520_ = { g_SimplePool->GetObj({FOURCC('PART'), pInfo.x11c_particle1})};
x520_deathExplosionParticle = { g_SimplePool->GetObj({FOURCC('PART'), pInfo.x11c_particle1})};
if (pInfo.x120_electric.IsValid())
x530_ = { g_SimplePool->GetObj({FOURCC('ELSC'), pInfo.x120_electric})};
x530_deathExplosionElectric = { g_SimplePool->GetObj({FOURCC('ELSC'), pInfo.x120_electric})};
if (pInfo.x130_particle2.IsValid())
x54c_ = { g_SimplePool->GetObj({FOURCC('PART'), pInfo.x130_particle2})};
x54c_iceDeathExplosionParticle = { g_SimplePool->GetObj({FOURCC('PART'), pInfo.x130_particle2})};
if (x404_contactDamage.GetRadius() > 0.f)
x404_contactDamage.SetRadius(0.f);
@ -158,19 +159,19 @@ void CPatterned::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CState
const CDamageInfo& info = proj->GetDamageInfo();
if (info.GetWeaponMode().GetType() == EWeaponType::Wave)
{
if (x460_knockBackController.x81_26_ && info.GetWeaponMode().IsComboed() && HealthInfo(mgr))
if (x460_knockBackController.x81_26_enableShock && info.GetWeaponMode().IsComboed() && HealthInfo(mgr))
{
x401_31_ = true;
KnockBack(GetTransform().frontVector(), mgr, info, EKnockBackType::One, false,
KnockBack(GetTransform().frontVector(), mgr, info, EKnockBackType::Radius, false,
info.GetKnockBackPower());
x460_knockBackController.DeferKnockBack(EWeaponType::Wave);
}
}
else if (info.GetWeaponMode().GetType() == EWeaponType::Plasma)
{
if (x460_knockBackController.x81_27_ && info.GetWeaponMode().IsCharged() && HealthInfo(mgr))
if (x460_knockBackController.x81_27_enableBurn && info.GetWeaponMode().IsCharged() && HealthInfo(mgr))
{
KnockBack(GetTransform().frontVector(), mgr, info, EKnockBackType::One,
KnockBack(GetTransform().frontVector(), mgr, info, EKnockBackType::Radius,
false, info.GetKnockBackPower());
x460_knockBackController.DeferKnockBack(EWeaponType::Plasma);
}
@ -223,13 +224,13 @@ void CPatterned::Think(float dt, CStateManager& mgr)
{
if (x3e0_ > 0.f && x400_29_)
{
SendScriptMsgs(EScriptObjectState::UNKS4, mgr, EScriptObjectMessage::None);
sub8007ab34(mgr);
SendScriptMsgs(EScriptObjectState::AboutToDie, mgr, EScriptObjectMessage::None);
DoIceDeath(mgr);
}
else
{
SendScriptMsgs(EScriptObjectState::UNKS4, mgr, EScriptObjectMessage::None);
sub8007ace8(mgr);
SendScriptMsgs(EScriptObjectState::AboutToDie, mgr, EScriptObjectMessage::None);
DoDeath(mgr);
}
}
else if (!x400_29_)
@ -243,7 +244,7 @@ void CPatterned::Think(float dt, CStateManager& mgr)
bool isDead = false; //sub8007A454(unk, "Dead"sv);
if (!isDead && x330_stateMachineState.x8_time > 15.f)
sub8007ace8(mgr);
DoDeath(mgr);
}
}
}
@ -263,7 +264,7 @@ void CPatterned::Think(float dt, CStateManager& mgr)
else
x4f0_ = 0.f;
if (x460_knockBackController.x81_26_ && x401_31_ && x402_24_)
if (x460_knockBackController.x81_26_enableShock && x401_31_ && x402_24_)
Shock(0.5f + mgr.GetActiveRandom()->Range(0.f, 0.5f), 0.2f);
x402_24_ = x401_24_;
@ -282,7 +283,7 @@ void CPatterned::Think(float dt, CStateManager& mgr)
{
if (x3f0_!= 0.f)
{
//x450_bodyController->sub80139f0c(x3f0_);
x450_bodyController->StopElectrocution();
mgr.GetActorModelParticles()->StopElectric(*this);
}
}
@ -310,7 +311,7 @@ void CPatterned::Think(float dt, CStateManager& mgr)
if (x401_30_)
{
x401_30_ = false;
Death(GetTransform().frontVector(), mgr, EScriptObjectState::DeathRattle);
Death(mgr, GetTransform().frontVector(), EScriptObjectState::DeathRattle);
}
float thinkDt = (x400_25_alive ? dt : dt * sub80078a88());
@ -407,6 +408,18 @@ zeus::CVector3f CPatterned::GetAimPosition(const urde::CStateManager& mgr, float
return offset + GetBoundingBox().center();
}
void CPatterned::DeathDelete(CStateManager& mgr)
{
SendScriptMsgs(EScriptObjectState::Dead, mgr, EScriptObjectMessage::None);
if (x450_bodyController->IsElectrocuting())
{
x3f0_ = 0.f;
x450_bodyController->StopElectrocution();
mgr.GetActorModelParticles()->StopElectric(*this);
}
mgr.FreeScriptObject(GetUniqueId());
}
void CPatterned::KnockBack(const zeus::CVector3f& backVec, CStateManager& mgr, const CDamageInfo& info,
EKnockBackType type, bool inDeferred, float magnitude)
{
@ -414,7 +427,60 @@ void CPatterned::KnockBack(const zeus::CVector3f& backVec, CStateManager& mgr, c
if (!x401_27_ && !x401_28_ && hInfo)
{
x460_knockBackController.KnockBack(backVec, mgr, *this, info, type, magnitude);
/* TODO: Finish */
if (x450_bodyController->IsFrozen() && x460_knockBackController.GetActiveParms().xc_ >= 0.f)
x450_bodyController->FrozenBreakout();
switch (x460_knockBackController.GetActiveParms().x4_animFollowup)
{
case EKnockBackAnimationFollowUp::Freeze:
Freeze(mgr, zeus::CVector3f::skZero, zeus::CUnitVector3f(x34_transform.transposeRotate(backVec)),
x460_knockBackController.GetActiveParms().x8_followupMagnitude);
break;
case EKnockBackAnimationFollowUp::PhazeOut:
PhazeOut(mgr);
break;
case EKnockBackAnimationFollowUp::Shock:
Shock(x460_knockBackController.GetActiveParms().x8_followupMagnitude, -1.f);
break;
case EKnockBackAnimationFollowUp::Burn:
Burn(x460_knockBackController.GetActiveParms().x8_followupMagnitude, 0.25f);
break;
case EKnockBackAnimationFollowUp::Disintegrate:
x401_29_ = true;
case EKnockBackAnimationFollowUp::FireDeath:
Burn(x460_knockBackController.GetActiveParms().x8_followupMagnitude, -1.f);
Death(mgr, zeus::CVector3f::skZero, EScriptObjectState::DeathRattle);
x400_28_ = x400_29_ = false;
x400_27_ = x401_28_ = true;
x3f4_ = 1.5f;
x402_29_ = false;
x450_bodyController->DouseFlames();
mgr.GetActorModelParticles()->StopThermalHotParticles(*this);
mgr.GetActorModelParticles()->PlayFireSFX(*this);
if (!x401_29_)
{
mgr.GetActorModelParticles()->EnsureFirePopLoaded(*this);
mgr.GetActorModelParticles()->EnsureIceBreakLoaded(*this);
}
break;
case EKnockBackAnimationFollowUp::Death:
Death(mgr, zeus::CVector3f::skZero, EScriptObjectState::DeathRattle);
break;
case EKnockBackAnimationFollowUp::ExplodeDeath:
Death(mgr, zeus::CVector3f::skZero, EScriptObjectState::DeathRattle);
if (GetDeathExplosionParticle() || x530_deathExplosionElectric)
DoDeath(mgr);
else if (x450_bodyController->IsFrozen())
x450_bodyController->FrozenBreakout();
break;
case EKnockBackAnimationFollowUp::IceDeath:
Death(mgr, zeus::CVector3f::skZero, EScriptObjectState::DeathRattle);
if (x54c_iceDeathExplosionParticle)
DoIceDeath(mgr);
else if (x450_bodyController->IsFrozen())
x450_bodyController->FrozenBreakout();
default:
break;
}
}
}
@ -427,7 +493,71 @@ void CPatterned::BuildBodyController(EBodyType bodyType)
auto anim = x450_bodyController->GetPASDatabase().FindBestAnimation(CPASAnimParmData(24,
CPASAnimParm::FromEnum(0)), -1);
/* TODO: Double check this */
x460_knockBackController.x81_26_ = anim.first != 0.f;
x460_knockBackController.x81_26_enableShock = anim.first != 0.f;
}
void CPatterned::GenerateDeathExplosion(CStateManager& mgr)
{
if (auto particle = GetDeathExplosionParticle())
{
zeus::CTransform xf(GetTransform());
xf.origin = GetTransform() * (x64_modelData->GetScale() * x514_deathExplosionOffset);
CExplosion* explo = new CExplosion(*particle, mgr.AllocateUniqueId(), true,
CEntityInfo(GetAreaIdAlways(), CEntity::NullConnectionList), "", xf, 1,
zeus::CVector3f::skOne, zeus::CColor::skWhite);
mgr.AddObject(explo);
}
else if (x530_deathExplosionElectric)
{
zeus::CTransform xf(GetTransform());
xf.origin = GetTransform() * (x64_modelData->GetScale() * x514_deathExplosionOffset);
CExplosion* explo = new CExplosion(*x530_deathExplosionElectric, mgr.AllocateUniqueId(), true,
CEntityInfo(GetAreaIdAlways(), CEntity::NullConnectionList), "", xf, 1,
zeus::CVector3f::skOne, zeus::CColor::skWhite);
mgr.AddObject(explo);
}
}
void CPatterned::DoDeath(CStateManager& mgr)
{
CSfxManager::AddEmitter(x454_deathSfx, GetTranslation(), zeus::CVector3f::skZero,
true, false, 0x7f, kInvalidAreaId);
if (!x401_28_)
{
SendScriptMsgs(EScriptObjectState::DeathExplosion, mgr, EScriptObjectMessage::None);
GenerateDeathExplosion(mgr);
}
DeathDelete(mgr);
x400_28_ = x400_29_ = false;
}
void CPatterned::GenerateIceDeathExplosion(CStateManager& mgr)
{
if (x54c_iceDeathExplosionParticle)
{
zeus::CTransform xf(GetTransform());
xf.origin = GetTransform() * (x64_modelData->GetScale() * x540_iceDeathExplosionOffset);
CExplosion* explo = new CExplosion(*x54c_iceDeathExplosionParticle, mgr.AllocateUniqueId(), true,
CEntityInfo(GetAreaIdAlways(), CEntity::NullConnectionList), "", xf, 1,
zeus::CVector3f::skOne, zeus::CColor::skWhite);
mgr.AddObject(explo);
}
}
void CPatterned::DoIceDeath(CStateManager& mgr)
{
if (x458_iceShatterSfx == 0xffff)
x458_iceShatterSfx = x454_deathSfx;
CSfxManager::AddEmitter(x458_iceShatterSfx, GetTranslation(), zeus::CVector3f::skZero,
true, false, 0x7f, kInvalidAreaId);
SendScriptMsgs(EScriptObjectState::IceDeathExplosion, mgr, EScriptObjectMessage::None);
GenerateIceDeathExplosion(mgr);
float toPlayerDist = (mgr.GetPlayer().GetTranslation() - GetTranslation()).magnitude();
if (toPlayerDist < 40.f)
mgr.GetCameraManager()->AddCameraShaker(CCameraShakeData::BuildPatternedExplodeShakeData(
GetTranslation(), 0.25f, 0.3f, 40.f), true);
DeathDelete(mgr);
x400_28_ = x400_29_ = false;
}
zeus::CVector3f CPatterned::GetGunEyePos() const
@ -458,7 +588,7 @@ float CPatterned::sub80078a88()
void CPatterned::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum)
{
#if 1
if (mgr.GetPlayerState()->GetActiveVisor(mgr ) == CPlayerState::EPlayerVisor::Thermal)
if (mgr.GetPlayerState()->GetActiveVisor(mgr) == CPlayerState::EPlayerVisor::Thermal)
{
SetCalculateLighting(false);
x90_actorLights->BuildConstantAmbientLighting(zeus::CColor::skWhite);

View File

@ -191,8 +191,8 @@ protected:
zeus::CQuaternion x440_rotDelta;
CSteeringBehaviors x45c_;
std::unique_ptr<CBodyController> x450_bodyController;
u32 x454_deathSfx;
u32 x458_iceShatterSfx;
u16 x454_deathSfx;
u16 x458_iceShatterSfx;
CKnockBackController x460_knockBackController;
zeus::CVector3f x4e4_;
@ -205,13 +205,15 @@ protected:
EColliderType x508_colliderType;
float x50c_thermalMag;
std::shared_ptr<CVertexMorphEffect> x510_vertexMorph;
zeus::CVector3f x514_;
std::experimental::optional<TLockedToken<CGenDescription>> x520_;
std::experimental::optional<TLockedToken<CElectricDescription>> x530_;
zeus::CVector3f x540_;
std::experimental::optional<TLockedToken<CGenDescription>> x54c_;
zeus::CVector3f x514_deathExplosionOffset;
std::experimental::optional<TLockedToken<CGenDescription>> x520_deathExplosionParticle;
std::experimental::optional<TLockedToken<CElectricDescription>> x530_deathExplosionElectric;
zeus::CVector3f x540_iceDeathExplosionOffset;
std::experimental::optional<TLockedToken<CGenDescription>> x54c_iceDeathExplosionParticle;
zeus::CVector3f x55c_;
void UpdateFrozenState(bool thawed);
void GenerateIceDeathExplosion(CStateManager& mgr);
void GenerateDeathExplosion(CStateManager& mgr);
public:
CPatterned(ECharacter character, TUniqueId uid, std::string_view name, EFlavorType flavor, const CEntityInfo& info,
const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pinfo,
@ -234,7 +236,8 @@ public:
zeus::CVector3f GetAimPosition(const CStateManager& mgr, float) const;
void Death(const zeus::CVector3f&, CStateManager&, EScriptObjectState) {}
void DeathDelete(CStateManager& mgr);
void Death(CStateManager& mgr, const zeus::CVector3f&, EScriptObjectState) {}
void KnockBack(const zeus::CVector3f&, CStateManager&, const CDamageInfo& info,
EKnockBackType type, bool inDeferred, float magnitude);
void TakeDamage(const zeus::CVector3f&, float) { x428_ = 0.33f;}
@ -244,10 +247,12 @@ public:
bool Default() { return true; }
virtual bool KnockbackWhenFrozen() const { return true;}
virtual void sub8007ace8(CStateManager&) {}
virtual void sub8007ab34(CStateManager&) {}
virtual void DoDeath(CStateManager&);
virtual void DoIceDeath(CStateManager&);
virtual void Burn(float, float) {}
virtual void Shock(float, float) {}
virtual void Freeze(CStateManager& mgr, const zeus::CVector3f& pos,
const zeus::CUnitVector3f& dir, float magnitude) {}
virtual void ThinkAboutMove(float);
virtual void GetSearchPath() {}
virtual CDamageInfo GetContactDamage() const { return x404_contactDamage; }
@ -256,7 +261,8 @@ public:
virtual float GetGravityConstant() const { return 24.525002f; }
virtual CProjectileInfo* GetProjectileInfo() { return nullptr; }
virtual void PhazeOut(CStateManager&) {}
virtual TLockedToken<CGenDescription>& GetX520() { return x520_.value(); }
virtual const std::experimental::optional<TLockedToken<CGenDescription>>&
GetDeathExplosionParticle() const { return x520_deathExplosionParticle; }
float GetDamageDuration() const { return x504_damageDur; }
zeus::CVector3f GetGunEyePos() const;
bool IsAlive() const { return x400_25_alive; }
@ -264,6 +270,7 @@ public:
void BuildBodyController(EBodyType);
const CBodyController* GetBodyController() const { return x450_bodyController.get(); }
CBodyController* BodyController() { return x450_bodyController.get(); }
const CKnockBackController& GetKnockBackController() const { return x460_knockBackController; }
void SetupPlayerCollision(bool);

View File

@ -163,12 +163,12 @@ std::string_view ScriptObjectStateToStr(EScriptObjectState state)
case EScriptObjectState::CameraTarget: return "CameraTarget"sv;
case EScriptObjectState::UNKS2: return "UNKS2"sv;
case EScriptObjectState::Play: return "Play"sv;
case EScriptObjectState::UNKS3: return "UNKS3"sv;
case EScriptObjectState::DeathExplosion: return "DeathExplosion"sv;
case EScriptObjectState::DeathRattle: return "DeathRattle"sv;
case EScriptObjectState::UNKS4: return "UNKS4"sv;
case EScriptObjectState::AboutToDie: return "AboutToDie"sv;
case EScriptObjectState::Damage: return "Damage"sv;
case EScriptObjectState::InvulnDamage: return "InvulnDamage"sv;
case EScriptObjectState::UNKS5: return "UNKS5"sv;
case EScriptObjectState::IceDeathExplosion: return "IceDeathExplosion"sv;
case EScriptObjectState::Modify: return "Modify"sv;
case EScriptObjectState::ScanStart: return "ScanStart"sv;
case EScriptObjectState::ScanProcessing: return "ScanProcessing"sv;

View File

@ -159,12 +159,12 @@ enum class EScriptObjectState
CameraTarget = 16,
UNKS2 = 17,
Play = 18,
UNKS3 = 19,
DeathExplosion = 19,
DeathRattle = 20,
UNKS4 = 21,
AboutToDie = 21,
Damage = 22,
InvulnDamage = 23,
UNKS5 = 24,
IceDeathExplosion = 24,
Modify = 25,
ScanStart = 26,
ScanProcessing = 27,