mirror of https://github.com/AxioDL/metaforce.git
Initial CEnergyBall, update submodules, various fixes
This commit is contained in:
parent
3ca09f60db
commit
256994c199
|
@ -4,6 +4,7 @@ make_dnalist(CMDL
|
|||
FSM2
|
||||
MAPA
|
||||
MAPU
|
||||
MayaSpline
|
||||
EGMC
|
||||
SAVWCommon
|
||||
ParticleCommon
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#pragma once
|
||||
|
||||
#include "DataSpec/DNACommon/DNACommon.hpp"
|
||||
|
||||
namespace DataSpec {
|
||||
struct MayaSpline : public BigDNA {
|
||||
AT_DECL_DNA_YAML
|
||||
Value<atUint8> preInf;
|
||||
Value<atUint8> postInf;
|
||||
Value<atUint32> knotCount;
|
||||
struct Knot : BigDNA {
|
||||
AT_DECL_DNA_YAML
|
||||
Value<float> time;
|
||||
Value<float> amplitude;
|
||||
Value<atUint8> unk1;
|
||||
Value<atUint8> unk2;
|
||||
};
|
||||
|
||||
Vector<Knot, AT_DNA_COUNT(knotCount)> knots;
|
||||
Value<atUint8> clampMode;
|
||||
Value<float> minAmp;
|
||||
Value<float> maxAmp;
|
||||
};
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
#include "CAUD.hpp"
|
||||
|
||||
namespace DataSpec::DNAMP3 {
|
||||
|
||||
template <class Op>
|
||||
void CAUD::CSMPInfo::UnknownStruct2::UnknownQuad::Enumerate(typename Op::StreamT& s) {
|
||||
Do<Op>(athena::io::PropId{"unknown1"}, unknown1, s);
|
||||
Do<Op>(athena::io::PropId{"unknown2"}, unknown2, s);
|
||||
Do<Op>(athena::io::PropId{"unknown3"}, unknown3, s);
|
||||
Do<Op>(athena::io::PropId{"unknown4"}, unknown4, s);
|
||||
if (unknown4 == 5)
|
||||
Do<Op>(athena::io::PropId{"unknown5"}, unknown5, s);
|
||||
}
|
||||
|
||||
AT_SPECIALIZE_DNA_YAML(CAUD::CSMPInfo::UnknownStruct2::UnknownQuad)
|
||||
|
||||
const char* CAUD::CSMPInfo::UnknownStruct2::UnknownQuad::DNAType() {
|
||||
return "DataSpec::DNAMP3::CAUD::CSMPInfo::UnknownStruct2::UnknownQuad";
|
||||
}
|
||||
|
||||
} // namespace DataSpec::DNAMP3
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include "DataSpec/DNACommon/DNACommon.hpp"
|
||||
#include "DataSpec/DNACommon/MayaSpline.hpp"
|
||||
#include "DataSpec/DNACommon/PAK.hpp"
|
||||
|
||||
namespace DataSpec::DNAMP3 {
|
||||
|
||||
struct CAUD : BigDNA {
|
||||
|
@ -10,8 +10,8 @@ struct CAUD : BigDNA {
|
|||
DNAFourCC magic;
|
||||
Value<atUint32> version;
|
||||
String<-1> name;
|
||||
Value<atUint32> nameCount;
|
||||
Vector<String<-1>, AT_DNA_COUNT(nameCount)> names;
|
||||
Value<atUint32> volumeGroupCount;
|
||||
Vector<String<-1>, AT_DNA_COUNT(volumeGroupCount)> volumeGroups;
|
||||
Value<float> unknown1;
|
||||
Value<atUint32> unknown2;
|
||||
Value<float> unknown3;
|
||||
|
@ -24,75 +24,39 @@ struct CAUD : BigDNA {
|
|||
UniqueID64 csmpId;
|
||||
Value<float> unknown1;
|
||||
Value<atUint32> unknown2;
|
||||
Value<atUint32> unknown3;
|
||||
Value<float> unknown3;
|
||||
Value<float> unknown4;
|
||||
Value<float> unknown5;
|
||||
Value<float> unknown6;
|
||||
Value<atUint32> unknown7;
|
||||
Value<atUint32> unknown8;
|
||||
Value<atUint32> unknown9;
|
||||
Value<atInt32> unknown8;
|
||||
Value<atInt32> unknown9;
|
||||
Value<atUint32> unknown10;
|
||||
Value<float> unknown11;
|
||||
Value<float> unknown12;
|
||||
Value<float> unknown13;
|
||||
Value<atUint8> unknown14[8];
|
||||
struct UnknownStruct1 : BigDNA {
|
||||
Value<bool> unknown14;
|
||||
Value<bool> unknown15;
|
||||
Value<bool> unknown16;
|
||||
Value<bool> unknown17;
|
||||
Value<bool> unknown18;
|
||||
Value<bool> unknown19;
|
||||
MayaSpline spline1;
|
||||
MayaSpline spline2;
|
||||
MayaSpline spline3;
|
||||
MayaSpline spline4;
|
||||
Value<atUint32> unkStructCount;
|
||||
struct UnknownStruct : BigDNA {
|
||||
AT_DECL_DNA_YAML
|
||||
Value<float> unknown1;
|
||||
Value<float> unknown2;
|
||||
Value<atUint8> unknown3;
|
||||
Value<atUint8> unknown4;
|
||||
};
|
||||
Value<atUint32> unknown15;
|
||||
Vector<UnknownStruct1, AT_DNA_COUNT(unknown15)> unknown16;
|
||||
struct UnknownStruct2 : BigDNA {
|
||||
AT_DECL_DNA_YAML
|
||||
Value<atUint8> unknown1;
|
||||
Vector<atUint8, AT_DNA_COUNT(unknown1)> unknown2;
|
||||
Value<float> unknown3;
|
||||
Value<float> unknown4;
|
||||
Value<atUint16> unknown5;
|
||||
struct UnknownPair : BigDNA {
|
||||
AT_DECL_DNA_YAML
|
||||
Value<float> unknown1;
|
||||
Value<atInt32> unknown2;
|
||||
};
|
||||
Value<atUint16> unknown6;
|
||||
Vector<UnknownPair, AT_DNA_COUNT(unknown6)> unknown7;
|
||||
struct UnknownQuad : BigDNA {
|
||||
AT_DECL_EXPLICIT_DNA_YAML
|
||||
Value<float> unknown1;
|
||||
Value<float> unknown2;
|
||||
Value<atUint8> unknown3;
|
||||
Value<atUint8> unknown4;
|
||||
Value<float> unknown5[5];
|
||||
};
|
||||
|
||||
Value<atUint16> unknown8;
|
||||
Vector<UnknownQuad, AT_DNA_COUNT(unknown8)> unknown9;
|
||||
};
|
||||
UnknownStruct2 unknown17[4];
|
||||
Value<atUint16> unknown18;
|
||||
Value<float> unknown19;
|
||||
Value<atUint8> unknown20;
|
||||
Value<atUint8> unknown21;
|
||||
Value<atUint8> unknown22;
|
||||
Value<atUint8> unknown23;
|
||||
Value<atUint8> unknown24;
|
||||
Value<atUint8> unknown25;
|
||||
Value<atUint8> unknown26;
|
||||
Value<atUint8> unknown27;
|
||||
Value<atUint8> unknown28;
|
||||
struct UnknownStruct3 : BigDNA {
|
||||
AT_DECL_DNA_YAML
|
||||
Value<atUint32> unknown1;
|
||||
Value<float> unknown2;
|
||||
Value<atUint8> unknown3;
|
||||
Value<atUint8> unknown4;
|
||||
};
|
||||
Vector<UnknownStruct3, AT_DNA_COUNT(unknown27)> unknown29;
|
||||
Value<float> unknown30;
|
||||
Value<float> unknown31;
|
||||
Vector<UnknownStruct, AT_DNA_COUNT(unkStructCount)> unkStructs;
|
||||
Value<atUint32> unknown20;
|
||||
Value<float> unknown21;
|
||||
Value<bool> unknown22;
|
||||
Value<bool> unknown23;
|
||||
MayaSpline spline5;
|
||||
};
|
||||
|
||||
Value<atUint32> infoCount;
|
||||
|
|
|
@ -19,7 +19,6 @@ set(DNAMP3_SOURCES
|
|||
CMDL.hpp CMDL.cpp
|
||||
CMDLMaterials.cpp
|
||||
CSKR.cpp
|
||||
CAUD.cpp
|
||||
STRG.hpp STRG.cpp
|
||||
MAPA.hpp
|
||||
MREA.cpp)
|
||||
|
|
|
@ -226,8 +226,8 @@ void PAKBridge::addMAPATransforms(PAKRouter<PAKBridge>& pakRouter,
|
|||
|
||||
ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const nod::Node& pakNode, const PAK& pak, const PAK::Entry& entry) {
|
||||
switch (entry.type.toUint32()) {
|
||||
// case SBIG('CAUD'):
|
||||
// return {CAUD::Extract, {_SYS_STR(".yaml")}};
|
||||
case SBIG('CAUD'):
|
||||
return {CAUD::Extract, {_SYS_STR(".yaml")}};
|
||||
case SBIG('STRG'):
|
||||
return {STRG::Extract, {_SYS_STR(".yaml")}};
|
||||
case SBIG('TXTR'):
|
||||
|
@ -236,16 +236,16 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const nod::Node& pakNode, con
|
|||
return {SAVWCommon::ExtractSAVW<SAVW>, {_SYS_STR(".yaml")}};
|
||||
case SBIG('HINT'):
|
||||
return {HINT::Extract, {_SYS_STR(".yaml")}};
|
||||
case SBIG('CMDL'):
|
||||
return {CMDL::Extract, {_SYS_STR(".blend")}, 1};
|
||||
case SBIG('CHAR'):
|
||||
return {CHAR::Extract, {_SYS_STR(".yaml"), _SYS_STR(".blend")}, 2};
|
||||
case SBIG('MLVL'):
|
||||
return {MLVL::Extract, {_SYS_STR(".yaml"), _SYS_STR(".blend")}, 3};
|
||||
case SBIG('MREA'):
|
||||
return {MREA::Extract, {_SYS_STR(".blend")}, 4};
|
||||
case SBIG('MAPA'):
|
||||
return {MAPA::Extract, {_SYS_STR(".blend")}, 4};
|
||||
// case SBIG('CMDL'):
|
||||
// return {CMDL::Extract, {_SYS_STR(".blend")}, 1};
|
||||
// case SBIG('CHAR'):
|
||||
// return {CHAR::Extract, {_SYS_STR(".yaml"), _SYS_STR(".blend")}, 2};
|
||||
// case SBIG('MLVL'):
|
||||
// return {MLVL::Extract, {_SYS_STR(".yaml"), _SYS_STR(".blend")}, 3};
|
||||
// case SBIG('MREA'):
|
||||
// return {MREA::Extract, {_SYS_STR(".blend")}, 4};
|
||||
// case SBIG('MAPA'):
|
||||
// return {MAPA::Extract, {_SYS_STR(".blend")}, 4};
|
||||
case SBIG('FSM2'):
|
||||
return {DNAFSM2::ExtractFSM2<UniqueID64>, {_SYS_STR(".yaml")}};
|
||||
case SBIG('FONT'):
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "DNACommon/TXTR.hpp"
|
||||
#include "AssetNameMap.hpp"
|
||||
#include "hecl/ClientProcess.hpp"
|
||||
#include "nod/DiscBase.hpp"
|
||||
#include "nod/nod.hpp"
|
||||
#include "hecl/Blender/Connection.hpp"
|
||||
#include "hecl/Blender/SDNARead.hpp"
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "Badging.hpp"
|
||||
#include "athena/MemoryReader.hpp"
|
||||
|
||||
#include <specter/Icon.hpp>
|
||||
#include <zlib.h>
|
||||
|
||||
extern "C" uint8_t URDE_BADGE[];
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
#include "CSimplePool.hpp"
|
||||
#include "CStateManager.hpp"
|
||||
#include "GameGlobalObjects.hpp"
|
||||
#include "MP1/World/CEnergyBall.hpp"
|
||||
#include "World/CPatternedInfo.hpp"
|
||||
#include "World/CPlayer.hpp"
|
||||
|
||||
namespace urde::MP1 {
|
||||
CEnergyBall::CEnergyBall(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
|
||||
|
@ -7,5 +12,90 @@ CEnergyBall::CEnergyBall(TUniqueId uid, std::string_view name, const CEntityInfo
|
|||
const CAssetId& a2, const CAssetId& a3, s16 sfxId2, float f3, float f4, const CAssetId& a4,
|
||||
const CDamageInfo& dInfo2, float f5)
|
||||
: CPatterned(ECharacter::EnergyBall, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
|
||||
EMovementType::Flyer, EColliderType::One, EBodyType::NewFlyer, actParms, EKnockBackVariant::Medium) {}
|
||||
EMovementType::Flyer, EColliderType::One, EBodyType::NewFlyer, actParms, EKnockBackVariant::Medium)
|
||||
, x570_(w1)
|
||||
, x574_(f1)
|
||||
, x578_(dInfo1)
|
||||
, x594_initialTurnSpeed(pInfo.GetTurnSpeed())
|
||||
, x598_(f2)
|
||||
, x59c_(a1)
|
||||
, x5a0_(sfxId1)
|
||||
, x5a4_(a2)
|
||||
, x5a8_(g_SimplePool->GetObj({FOURCC('ELSC'), a3}))
|
||||
, x5b4_(sfxId2)
|
||||
, x5b8_(f3)
|
||||
, x5bc_(f4)
|
||||
, x5c0_(g_SimplePool->GetObj({FOURCC('PART'), a4}))
|
||||
, x5cc_(dInfo2)
|
||||
, x5e8_(f5) {
|
||||
x460_knockBackController.SetEnableExplodeDeath(false);
|
||||
x460_knockBackController.SetAutoResetImpulse(false);
|
||||
x460_knockBackController.SetEnableBurnDeath(false);
|
||||
x460_knockBackController.SetX82_24(false);
|
||||
x460_knockBackController.SetEnableBurn(false);
|
||||
x460_knockBackController.SetEnableLaggedBurnDeath(false);
|
||||
x460_knockBackController.SetEnableShock(false);
|
||||
x460_knockBackController.SetEnableFreeze(false);
|
||||
x460_knockBackController.SetX81_31(false);
|
||||
}
|
||||
|
||||
void CEnergyBall::Think(float dt, CStateManager& mgr) {
|
||||
float newTurnSpeed = x594_initialTurnSpeed * zeus::clamp(0.f, (x56c_ - 2.5f) * 0.125f, 1.f);
|
||||
x3b8_turnSpeed = newTurnSpeed;
|
||||
x450_bodyController->SetTurnSpeed(newTurnSpeed);
|
||||
CPatterned::Think(dt, mgr);
|
||||
GetModelData()->GetAnimationData()->GetParticleDB().SetModulationColorAllActiveEffects(
|
||||
zeus::CColor::lerp(zeus::skWhite, zeus::skRed, zeus::clamp(0.f, x428_damageCooldownTimer / 0.33f, 1.f)));
|
||||
|
||||
bool r27 = false;
|
||||
if (GetActive() && IsAlive()) {
|
||||
x56c_ -= dt;
|
||||
if (x56c_ > x574_)
|
||||
r27 = true;
|
||||
if (!InMaxRange(mgr, dt))
|
||||
r27 = true;
|
||||
}
|
||||
|
||||
if (!r27)
|
||||
sub8029f4a8(mgr);
|
||||
}
|
||||
|
||||
void CEnergyBall::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) {
|
||||
if (msg == EScriptObjectMessage::Registered) {
|
||||
SetMaterialFilter(CMaterialFilter::MakeInclude({EMaterialTypes::Player}));
|
||||
RemoveMaterial(EMaterialTypes::Solid, mgr);
|
||||
}
|
||||
CPatterned::AcceptScriptMsg(msg, uid, mgr);
|
||||
}
|
||||
|
||||
void CEnergyBall::Death(CStateManager& mgr, const zeus::CVector3f& direction, EScriptObjectState /* state */) {
|
||||
CHealthInfo* hInfo = HealthInfo(mgr);
|
||||
if (hInfo && hInfo->GetHP() > 0.f) {
|
||||
CPatterned::Death(mgr, direction, EScriptObjectState::Any);
|
||||
} else {
|
||||
CPatterned::Death(mgr, direction, EScriptObjectState::DeathRattle);
|
||||
}
|
||||
}
|
||||
|
||||
void CEnergyBall::Generate(CStateManager& mgr, EStateMsg msg, float /*arg*/) {
|
||||
if (msg == EStateMsg::Activate || msg == EStateMsg::Update) {
|
||||
if (msg == EStateMsg::Activate)
|
||||
x32c_animState = EAnimState::Ready;
|
||||
|
||||
TryGenerateDeactivate(mgr, 0);
|
||||
|
||||
if (!x450_bodyController->GetActive())
|
||||
x450_bodyController->Activate(mgr);
|
||||
} else if (msg == EStateMsg::Deactivate) {
|
||||
x32c_animState = EAnimState::NotReady;
|
||||
}
|
||||
}
|
||||
|
||||
void CEnergyBall::Attack(CStateManager& mgr, EStateMsg msg, float arg) {
|
||||
if (msg == EStateMsg::Update) {
|
||||
zeus::CVector3f seekPos = x568_steeringBehaviors.Seek(*this, mgr.GetPlayer().GetEyePosition());
|
||||
x450_bodyController->FaceDirection3D(seekPos, GetTransform().basis[1], arg);
|
||||
}
|
||||
}
|
||||
void CEnergyBall::sub8029f4a8(CStateManager& mgr) {}
|
||||
}
|
|
@ -1,9 +1,30 @@
|
|||
#pragma once
|
||||
|
||||
#include "Character/CSteeringBehaviors.hpp"
|
||||
#include "World/CDamageInfo.hpp"
|
||||
#include "World/CPatterned.hpp"
|
||||
|
||||
namespace urde::MP1 {
|
||||
class CEnergyBall : public CPatterned {
|
||||
CSteeringBehaviors x568_steeringBehaviors;
|
||||
float x56c_ = 0.f;
|
||||
s32 x570_;
|
||||
float x574_;
|
||||
CDamageInfo x578_;
|
||||
float x594_initialTurnSpeed;
|
||||
float x598_;
|
||||
CAssetId x59c_;
|
||||
s16 x5a0_;
|
||||
CAssetId x5a4_;
|
||||
TToken<CElectricDescription> x5a8_; // originally an rstl::optional_object
|
||||
s16 x5b4_;
|
||||
float x5b8_;
|
||||
float x5bc_;
|
||||
TToken<CGenDescription> x5c0_;
|
||||
CDamageInfo x5cc_;
|
||||
float x5e8_;
|
||||
|
||||
void sub8029f4a8(CStateManager& mgr);
|
||||
public:
|
||||
DEFINE_PATTERNED(EnergyBall)
|
||||
CEnergyBall(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
|
||||
|
@ -11,5 +32,12 @@ public:
|
|||
const CDamageInfo& dInfo1, float f2, const CAssetId& a1, s16 sfxId1, const CAssetId& a2,
|
||||
const CAssetId& a3, s16 sfxId2, float f3, float f4, const CAssetId& a4, const CDamageInfo& dInfo2,
|
||||
float f5);
|
||||
|
||||
|
||||
void Think(float dt, CStateManager& mgr) override;
|
||||
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override;
|
||||
void Death(CStateManager& mgr, const zeus::CVector3f& direction, EScriptObjectState state) override;
|
||||
void Generate(CStateManager& mgr, EStateMsg msg, float arg) override;
|
||||
void Attack(CStateManager& mgr, EStateMsg msg, float arg) override;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -936,6 +936,10 @@ void CPatterned::TryKnockBack(CStateManager& mgr, int arg) {
|
|||
x450_bodyController->GetCommandMgr().DeliverCmd(CBCKnockBackCmd(GetTranslation(), pas::ESeverity(arg)));
|
||||
}
|
||||
|
||||
void CPatterned::TryGenerateDeactivate(urde::CStateManager& mgr, int arg) {
|
||||
x450_bodyController->GetCommandMgr().DeliverCmd(CBCGenerateCmd(pas::EGenerateType(arg), zeus::skZero3f));
|
||||
}
|
||||
|
||||
void CPatterned::BuildBodyController(EBodyType bodyType) {
|
||||
if (x450_bodyController)
|
||||
return;
|
||||
|
|
|
@ -337,6 +337,7 @@ public:
|
|||
void TryCover(CStateManager& mgr, int arg);
|
||||
void TryWallHang(CStateManager& mgr, int arg);
|
||||
void TryKnockBack(CStateManager& mgr, int arg);
|
||||
void TryGenerateDeactivate(CStateManager& mgr, int arg);
|
||||
|
||||
virtual bool KnockbackWhenFrozen() const { return true; }
|
||||
virtual void MassiveDeath(CStateManager& mgr);
|
||||
|
|
|
@ -57,6 +57,7 @@ public:
|
|||
CPatternedInfo(CInputStream& in, u32 pcount);
|
||||
static std::pair<bool, u32> HasCorrectParameterCount(CInputStream& in);
|
||||
|
||||
float GetTurnSpeed() const { return x8_turnSpeed; }
|
||||
float GetDetectionHeightRange() const { return x10_detectionHeightRange; }
|
||||
const CHealthInfo& GetHealthInfo() const { return x54_healthInfo; }
|
||||
const CDamageVulnerability& GetDamageVulnerability() const { return x5c_damageVulnerability; }
|
||||
|
|
2
amuse
2
amuse
|
@ -1 +1 @@
|
|||
Subproject commit 107ddeb5a9dfe3e336c26c285ce0be0b8f0ebd2c
|
||||
Subproject commit 5da58eb1da26c83307b324be3fc9c3d496b46d86
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
|||
Subproject commit af5d10cfe91655d2dc48c53df52e564e2b0d6be7
|
||||
Subproject commit 0eb776c5406b0c203e81d45edf611da76c6ed7fd
|
2
hecl-gui
2
hecl-gui
|
@ -1 +1 @@
|
|||
Subproject commit 1ebf7ec1261d13e7921a3f3bafa30688d2d0f5f3
|
||||
Subproject commit c2101317ad3f727f6f284e3285ce425431763203
|
2
kabufuda
2
kabufuda
|
@ -1 +1 @@
|
|||
Subproject commit f57d8cf76187e0444e232b557e709fca161c64a9
|
||||
Subproject commit 222fb5c179b2ab1aa302053825321762451e2be5
|
2
nod
2
nod
|
@ -1 +1 @@
|
|||
Subproject commit df1e450728c725ab66508caca64b76cff13c354c
|
||||
Subproject commit 55301dd505ae38a7ad5ba0dc145eb6a826887fb5
|
2
specter
2
specter
|
@ -1 +1 @@
|
|||
Subproject commit ba31ba180f3cbc1ba9513befa95a4dbbdbaf38a4
|
||||
Subproject commit 73ace31365553b7264bf1de9968b74aec5636d6e
|
Loading…
Reference in New Issue