mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-12-15 00:06:08 +00:00
CPatterned & related headers; almost match CPuffer
Former-commit-id: 7fd19f0c12
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
#ifndef _CKNOCKBACKCONTROLLER
|
||||
#define _CKNOCKBACKCONTROLLER
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "Kyoto/Animation/CPASAnimState.hpp"
|
||||
|
||||
class CDamageInfo;
|
||||
class CPatterned;
|
||||
|
||||
@@ -8,105 +12,72 @@ enum EKnockBackType {
|
||||
kKBT_Radius,
|
||||
kKBT_Direct,
|
||||
};
|
||||
/*
|
||||
enum class EKnockBackVariant { Small, Medium, Large };
|
||||
|
||||
enum class EKnockBackWeaponType {
|
||||
Invalid = -1,
|
||||
Power,
|
||||
PowerCharged,
|
||||
PowerComboed,
|
||||
PowerComboedDirect,
|
||||
Wave,
|
||||
WaveCharged,
|
||||
WaveComboed,
|
||||
WaveComboedDirect,
|
||||
Ice,
|
||||
IceCharged,
|
||||
IceComboed,
|
||||
IceComboedDirect,
|
||||
Plasma,
|
||||
PlasmaCharged,
|
||||
PlasmaComboed,
|
||||
Missile,
|
||||
Bomb,
|
||||
PowerBomb,
|
||||
Phazon
|
||||
enum EKnockBackVariant {
|
||||
kKBV_Small,
|
||||
kKBV_Medium,
|
||||
kKBV_Large,
|
||||
};
|
||||
|
||||
enum class EKnockBackCharacterState { Alive, Dead, FrozenAlive, FrozenDead };
|
||||
|
||||
enum class EKnockBackAnimationState { Invalid = -1, None, Flinch, KnockBack, Hurled, Fall };
|
||||
|
||||
enum class EKnockBackAnimationFollowUp {
|
||||
Invalid = -1,
|
||||
None,
|
||||
Freeze,
|
||||
Shock,
|
||||
Burn,
|
||||
PhazeOut,
|
||||
Death,
|
||||
ExplodeDeath,
|
||||
IceDeath,
|
||||
BurnDeath,
|
||||
LaggedBurnDeath
|
||||
enum EKnockBackWeaponType {
|
||||
kKBWT_Invalid = -1,
|
||||
kKBWT_Power,
|
||||
kKBWT_PowerCharged,
|
||||
kKBWT_PowerComboed,
|
||||
kKBWT_PowerComboedDirect,
|
||||
kKBWT_Wave,
|
||||
kKBWT_WaveCharged,
|
||||
kKBWT_WaveComboed,
|
||||
kKBWT_WaveComboedDirect,
|
||||
kKBWT_Ice,
|
||||
kKBWT_IceCharged,
|
||||
kKBWT_IceComboed,
|
||||
kKBWT_IceComboedDirect,
|
||||
kKBWT_Plasma,
|
||||
kKBWT_PlasmaCharged,
|
||||
kKBWT_PlasmaComboed,
|
||||
kKBWT_Missile,
|
||||
kKBWT_Bomb,
|
||||
kKBWT_PowerBomb,
|
||||
kKBWT_Phazon,
|
||||
};
|
||||
enum EKnockBackCharacterState {
|
||||
kKBCS_Alive,
|
||||
kKBCS_Dead,
|
||||
kKBCS_FrozenAlive,
|
||||
kKBCS_FrozenDead,
|
||||
};
|
||||
enum EKnockBackAnimationState {
|
||||
kKBAS_Invalid = -1,
|
||||
kKBAS_None,
|
||||
kKBAS_Flinch,
|
||||
kKBAS_KnockBack,
|
||||
kKBAS_Hurled,
|
||||
kKBAS_Fall,
|
||||
};
|
||||
enum EKnockBackAnimationFollowUp {
|
||||
kKBAFU_Invalid = -1,
|
||||
kKBAFU_None,
|
||||
kKBAFU_Freeze,
|
||||
kKBAFU_Shock,
|
||||
kKBAFU_Burn,
|
||||
kKBAFU_PhazeOut,
|
||||
kKBAFU_Death,
|
||||
kKBAFU_ExplodeDeath,
|
||||
kKBAFU_IceDeath,
|
||||
kKBAFU_BurnDeath,
|
||||
kKBAFU_LaggedBurnDeath,
|
||||
};
|
||||
|
||||
class CKnockBackController {
|
||||
friend class CPatterned;
|
||||
|
||||
public:
|
||||
struct KnockBackParms {
|
||||
EKnockBackAnimationState x0_animState = EKnockBackAnimationState::None;
|
||||
EKnockBackAnimationFollowUp x4_animFollowup = EKnockBackAnimationFollowUp::None;
|
||||
float x8_followupDuration = 0.f;
|
||||
float xc_intoFreezeDur = 0.f;
|
||||
EKnockBackAnimationState x0_animState;
|
||||
EKnockBackAnimationFollowUp x4_animFollowup;
|
||||
float x8_followupDuration;
|
||||
float xc_intoFreezeDur;
|
||||
};
|
||||
|
||||
private:
|
||||
friend class CPatterned;
|
||||
EKnockBackVariant x0_variant;
|
||||
KnockBackParms x4_activeParms{};
|
||||
EWeaponType x14_deferWeaponType = EWeaponType::None;
|
||||
EKnockBackAnimationState x18_minAnimState = EKnockBackAnimationState::None;
|
||||
EKnockBackAnimationState x1c_maxAnimState = EKnockBackAnimationState::Fall;
|
||||
u32 x20_impulseDurationIdx = 0;
|
||||
rstl::reserved_vector< std::pair< float, float >, 5 > x24_;
|
||||
zeus::CVector3f x50_impulseDir;
|
||||
float x5c_impulseMag = 0.f;
|
||||
float x60_impulseRemTime = 0.f;
|
||||
float x64_flinchRemTime = 0.f;
|
||||
float x68_deferRemTime = 0.f;
|
||||
u32 x6c_ = 0;
|
||||
u32 x70_ = 0;
|
||||
u32 x74_ = 0;
|
||||
pas::ESeverity x7c_severity = pas::ESeverity::One;
|
||||
std::bitset< 5 > x80_availableStates{0b11111};
|
||||
bool x81_24_autoResetImpulse : 1 = true;
|
||||
bool x81_25_enableFreeze : 1 = true;
|
||||
bool x81_26_enableShock : 1 = false;
|
||||
bool x81_27_enableBurn : 1 = true;
|
||||
bool x81_28_enableBurnDeath : 1 = true;
|
||||
bool x81_29_enableExplodeDeath : 1 = true;
|
||||
bool x81_30_enableLaggedBurnDeath : 1 = true;
|
||||
bool x81_31_ : 1 = true;
|
||||
bool x82_24_ : 1 = true;
|
||||
bool x82_25_inDeferredKnockBack : 1 = false;
|
||||
bool x82_26_locomotionDuringElectrocution : 1 = false;
|
||||
void ApplyImpulse(float dt, CPatterned& parent);
|
||||
bool TickDeferredTimer(float dt);
|
||||
EKnockBackCharacterState GetKnockBackCharacterState(const CPatterned& parent) const;
|
||||
void ValidateState(const CPatterned& parent);
|
||||
float CalculateExtraHurlVelocity(CStateManager& mgr, float magnitude, float kbResistance) const;
|
||||
void DoKnockBackAnimation(const zeus::CVector3f& backVec, CStateManager& mgr, CPatterned& parent,
|
||||
float magnitude);
|
||||
void ResetKnockBackImpulse(const CPatterned& parent, const zeus::CVector3f& backVec,
|
||||
float magnitude);
|
||||
void DoDeferredKnockBack(CStateManager& mgr, CPatterned& parent);
|
||||
EKnockBackWeaponType GetKnockBackWeaponType(const CDamageInfo& info, EWeaponType wType,
|
||||
EKnockBackType type);
|
||||
void SelectDamageState(const CPatterned& parent, const CDamageInfo& info, EWeaponType wType,
|
||||
EKnockBackType type);
|
||||
|
||||
public:
|
||||
explicit CKnockBackController(EKnockBackVariant variant);
|
||||
void SetKnockBackVariant(EKnockBackVariant v) { x0_variant = v; }
|
||||
void DeferKnockBack(EWeaponType tp) {
|
||||
@@ -115,14 +86,30 @@ public:
|
||||
}
|
||||
void sub80233d40(int i, float f1, float f2);
|
||||
void SetAutoResetImpulse(bool b);
|
||||
void SetImpulseDurationIdx(u32 i) { x20_impulseDurationIdx = i; }
|
||||
void SetImpulseDurationIdx(int i);
|
||||
void SetAnimationStateRange(EKnockBackAnimationState a, EKnockBackAnimationState b) {
|
||||
x18_minAnimState = a;
|
||||
x1c_maxAnimState = b;
|
||||
}
|
||||
void Update(float dt, CStateManager& mgr, CPatterned& parent);
|
||||
void KnockBack(const zeus::CVector3f& backVec, CStateManager& mgr, CPatterned& parent,
|
||||
void KnockBack(const CVector3f& backVec, CStateManager& mgr, CPatterned& parent,
|
||||
const CDamageInfo& info, EKnockBackType type, float magnitude);
|
||||
|
||||
void ApplyImpulse(float dt, CPatterned& parent);
|
||||
bool TickDeferredTimer(float dt);
|
||||
EKnockBackCharacterState GetKnockBackCharacterState(const CPatterned& parent) const;
|
||||
void ValidateState(const CPatterned& parent);
|
||||
float CalculateExtraHurlVelocity(CStateManager& mgr, float magnitude, float kbResistance) const;
|
||||
void DoKnockBackAnimation(const CVector3f& backVec, CStateManager& mgr, CPatterned& parent,
|
||||
float magnitude);
|
||||
void ResetKnockBackImpulse(const CPatterned& parent, const CVector3f& backVec,
|
||||
float magnitude);
|
||||
void DoDeferredKnockBack(CStateManager& mgr, CPatterned& parent);
|
||||
EKnockBackWeaponType GetKnockBackWeaponType(const CDamageInfo& info, EWeaponType wType,
|
||||
EKnockBackType type);
|
||||
void SelectDamageState(const CPatterned& parent, const CDamageInfo& info, EWeaponType wType,
|
||||
EKnockBackType type);
|
||||
|
||||
void SetSeverity(pas::ESeverity v) { x7c_severity = v; }
|
||||
void SetEnableFreeze(bool b) { x81_25_enableFreeze = b; }
|
||||
bool GetEnableFreeze() const { return x81_25_enableFreeze; }
|
||||
@@ -137,12 +124,44 @@ public:
|
||||
const KnockBackParms& GetActiveParms() const { return x4_activeParms; }
|
||||
EKnockBackVariant GetVariant() const { return x0_variant; }
|
||||
float GetFlinchRemTime() const { return x64_flinchRemTime; }
|
||||
void SetAvailableState(EKnockBackAnimationState s, bool b) {
|
||||
x80_availableStates.set(size_t(s), b);
|
||||
}
|
||||
bool TestAvailableState(EKnockBackAnimationState s) const {
|
||||
return x80_availableStates.test(size_t(s));
|
||||
}
|
||||
// void SetAvailableState(EKnockBackAnimationState s, bool b) {
|
||||
// x80_availableStates.set(size_t(s), b);
|
||||
// }
|
||||
// bool TestAvailableState(EKnockBackAnimationState s) const {
|
||||
// return x80_availableStates.test(size_t(s));
|
||||
// }
|
||||
|
||||
private:
|
||||
EKnockBackVariant x0_variant;
|
||||
KnockBackParms x4_activeParms;
|
||||
EWeaponType x14_deferWeaponType;
|
||||
EKnockBackAnimationState x18_minAnimState;
|
||||
EKnockBackAnimationState x1c_maxAnimState;
|
||||
uint x20_impulseDurationIdx;
|
||||
rstl::reserved_vector< rstl::pair< float, float >, 5 > x24_;
|
||||
CVector3f x50_impulseDir;
|
||||
float x5c_impulseMag;
|
||||
float x60_impulseRemTime;
|
||||
float x64_flinchRemTime;
|
||||
float x68_deferRemTime;
|
||||
uint x6c_;
|
||||
uint x70_;
|
||||
uint x74_;
|
||||
uint x78_;
|
||||
pas::ESeverity x7c_severity;
|
||||
uchar x80_availableStates;
|
||||
bool x81_24_autoResetImpulse : 1;
|
||||
bool x81_25_enableFreeze : 1;
|
||||
bool x81_26_enableShock : 1;
|
||||
bool x81_27_enableBurn : 1;
|
||||
bool x81_28_enableBurnDeath : 1;
|
||||
bool x81_29_enableExplodeDeath : 1;
|
||||
bool x81_30_enableLaggedBurnDeath : 1;
|
||||
bool x81_31_ : 1;
|
||||
bool x82_24_ : 1;
|
||||
bool x82_25_inDeferredKnockBack : 1;
|
||||
bool x82_26_locomotionDuringElectrocution : 1;
|
||||
};
|
||||
*/
|
||||
CHECK_SIZEOF(CKnockBackController, 0x84)
|
||||
|
||||
#endif // _CKNOCKBACKCONTROLLER
|
||||
|
||||
Reference in New Issue
Block a user