metaforce/DataSpec/DNAMP1/ScriptObjects/Parameters.hpp

472 lines
13 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2015-09-10 20:30:35 +00:00
#include "../../DNACommon/DNACommon.hpp"
2015-11-10 02:07:15 +00:00
#include "../DNAMP1.hpp"
2016-10-02 22:41:36 +00:00
#include "../SAVW.hpp"
#include "specter/genie.hpp"
2015-09-10 20:30:35 +00:00
2018-12-08 05:30:43 +00:00
namespace DataSpec::DNAMP1 {
enum class EPickupType : atUint32 {
PowerBeam = 0,
IceBeam = 1,
WaveBeam = 2,
PlasmaBeam = 3,
Missile = 4,
ScanVisor = 5,
MorphBallBomb = 6,
PowerBomb = 7,
Flamethrower = 8,
ThermalVisor = 9,
ChargeBeam = 10,
SuperMissile = 11,
GrappleBeam = 12,
XRayVisor = 13,
IceSpreader = 14,
SpaceJump = 15,
MorphBall = 16,
CombatVisor = 17,
BoostBall = 18,
SpiderBall = 19,
PowerSuit = 20,
GravitySuit = 21,
VariaSuit = 22,
PhazonSuit = 23,
EnergyTank = 24,
UnknownItem1 = 25,
HealthRefill = 26,
UnknownItem2 = 27,
WaveBuster = 28,
Truth = 29,
Strength = 30,
Elder = 31,
Wild = 32,
LifeGiver = 33,
Warrior = 34,
Chozo = 35,
Nature = 36,
Sun = 37,
World = 38,
Spirit = 39,
Newborn = 40
} SPECTER_ENUM("Pickup Type", "", EPickupType);
2015-09-10 20:30:35 +00:00
2018-12-08 05:30:43 +00:00
enum class ESpecialFunctionType : atUint32 {
What,
PlayerFollowLocator,
SpinnerController,
ObjectFollowLocator,
2019-03-24 08:06:59 +00:00
ChaffTarget,
2018-12-08 05:30:43 +00:00
InventoryActivator,
MapStation,
SaveStation,
IntroBossRingController,
ViewFrustumTest,
ShotSpinnerController,
EscapeSequence,
BossEnergyBar,
EndGame,
HUDFadeIn,
CinematicSkip,
ScriptLayerController,
RainSimulator,
AreaDamage,
ObjectFollowObject,
HintSystem,
DropBomb,
2019-03-24 08:06:59 +00:00
ScaleActor,
2018-12-08 05:30:43 +00:00
MissileStation,
Billboard,
PlayerInAreaRelay,
HUDTarget,
FogFader,
EnterLogbook,
PowerBombStation,
Ending,
FusionRelay,
WeaponSwitch // PAL Only
2019-03-24 08:06:59 +00:00
} SPECTER_ENUM("Special Function", "", ESpecialFunctionType);
2015-09-10 20:30:35 +00:00
2018-12-08 05:30:43 +00:00
struct AnimationParameters : BigDNA {
AT_DECL_DNA_YAML
UniqueID32 animationCharacterSet;
Value<atUint32> character;
Value<atUint32> defaultAnimation;
UniqueID32 getCINF(PAKRouter<PAKBridge>& pakRouter) const;
void nameANCS(PAKRouter<PAKBridge>& pakRouter, const std::string& name) const {
2019-07-20 04:27:21 +00:00
if (!animationCharacterSet.isValid())
2018-12-08 05:30:43 +00:00
return;
PAK::Entry* ancsEnt = (PAK::Entry*)pakRouter.lookupEntry(animationCharacterSet);
if (ancsEnt->name.empty())
ancsEnt->name = name;
}
void depANCS(std::vector<hecl::ProjectPath>& pathsOut) const {
g_curSpec->flattenDependencies(animationCharacterSet, pathsOut, character);
}
void depANCSAll(std::vector<hecl::ProjectPath>& pathsOut) const {
g_curSpec->flattenDependencies(animationCharacterSet, pathsOut);
}
2015-09-10 20:30:35 +00:00
};
2018-12-08 05:30:43 +00:00
struct BehaveChance : BigDNA {
AT_DECL_DNA_YAML
Value<atUint32> propertyCount;
Value<float> unknown1;
Value<float> unknown2;
Value<float> unknown3;
Value<float> unknown4;
Value<float> unknown5;
Value<float> unknown6;
Value<float> unknown7;
2015-09-10 20:30:35 +00:00
};
2018-12-08 05:30:43 +00:00
struct DamageInfo : BigDNA {
AT_DECL_DNA_YAML
Value<atUint32> propertyCount;
Value<atUint32> weaponType;
Value<float> damage;
Value<float> radius;
Value<float> knockbackPower;
2015-09-10 20:30:35 +00:00
};
2018-12-08 05:30:43 +00:00
struct DamageVulnerability : BigDNA {
AT_DECL_DNA_YAML
Value<atUint32> propertyCount;
Value<atUint32> power;
Value<atUint32> ice;
Value<atUint32> wave;
Value<atUint32> plasma;
Value<atUint32> bomb;
Value<atUint32> powerBomb;
Value<atUint32> missile;
Value<atUint32> boostBall;
Value<atUint32> phazon;
Value<atUint32> enemyWeapon1;
Value<atUint32> enemyWeapon2Poison;
Value<atUint32> enemyWeapon3Lava;
Value<atUint32> enemyWeapon4;
Value<atUint32> unkownWeapon1;
Value<atUint32> unkownWeapon2;
Value<atUint32> deflected;
struct ChargedBeams : BigDNA {
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
2015-09-10 20:30:35 +00:00
Value<atUint32> propertyCount;
Value<atUint32> power;
Value<atUint32> ice;
Value<atUint32> wave;
Value<atUint32> plasma;
2018-02-12 05:30:21 +00:00
Value<atUint32> deflected;
2018-12-08 05:30:43 +00:00
} chargedBeams;
2015-09-10 20:30:35 +00:00
2018-12-08 05:30:43 +00:00
struct BeamCombos : BigDNA {
2018-02-22 07:24:51 +00:00
AT_DECL_DNA_YAML
2015-09-10 20:30:35 +00:00
Value<atUint32> propertyCount;
2018-12-08 05:30:43 +00:00
Value<atUint32> superMissiles;
Value<atUint32> iceSpreader;
Value<atUint32> wavebuster;
Value<atUint32> flameThrower;
Value<atUint32> deflected;
} beamCombos;
};
2016-10-02 22:41:36 +00:00
2018-12-08 05:30:43 +00:00
struct FlareDefinition : BigDNA {
AT_DECL_DNA_YAML
Value<atUint32> propertyCount;
UniqueID32 texture;
Value<float> unknown1;
Value<float> unknown2;
Value<atVec4f> unknown4; // CColor
void nameIDs(PAKRouter<PAKBridge>& pakRouter, const std::string& name) const {
2019-07-20 04:27:21 +00:00
if (texture.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture);
ent->name = name + "_texture";
2016-10-02 22:41:36 +00:00
}
2018-12-08 05:30:43 +00:00
}
void depIDs(std::vector<hecl::ProjectPath>& pathsOut) const { g_curSpec->flattenDependencies(texture, pathsOut); }
2015-09-10 20:30:35 +00:00
};
2018-12-08 05:30:43 +00:00
struct GrappleParameters : BigDNA {
AT_DECL_DNA_YAML
Value<atUint32> propertyCount;
Value<float> unknown1;
Value<float> unknown2;
Value<float> unknown3;
Value<float> unknown4;
Value<float> unknown5;
Value<float> unknown6;
Value<float> unknown7;
Value<float> unknown8;
Value<float> unknown9;
Value<float> unknown10;
Value<float> unknown11;
Value<bool> disableTurning;
2015-09-10 20:30:35 +00:00
};
2018-12-08 05:30:43 +00:00
struct HealthInfo : BigDNA {
AT_DECL_DNA_YAML
Value<atUint32> propertyCount;
Value<float> health SPECTER_PROPERTY("Health", "Base health for object");
2018-12-15 06:29:41 +00:00
Value<float> knockbackResistance SPECTER_PROPERTY("Knockback Resistance", "");
} SPECTER_PROPERTY("Health Info", "");
2015-09-10 20:30:35 +00:00
2018-12-08 05:30:43 +00:00
struct LightParameters : BigDNA {
AT_DECL_DNA_YAML
Value<atUint32> propertyCount;
2019-03-13 03:46:20 +00:00
Value<bool> castShadow;
Value<float> shadowScale;
2018-12-08 05:30:43 +00:00
Value<atUint32> shadowTesselation;
2019-03-13 03:46:20 +00:00
Value<float> shadowAlpha;
Value<float> maxShadowHeight;
Value<atVec4f> ambientColor; // CColor
2018-12-08 05:30:43 +00:00
Value<bool> makeLights;
Value<atUint32> worldLightingOptions;
2019-03-13 03:46:20 +00:00
Value<atUint32> lightRecalculation;
Value<atVec3f> lightingPositionOffset;
Value<atUint32> numDynamicLights;
Value<atUint32> numAreaLights;
2018-12-08 05:30:43 +00:00
Value<bool> ambientChannelOverflow;
Value<atUint32> layerIndex;
2015-09-10 20:30:35 +00:00
};
2018-12-08 05:30:43 +00:00
struct PatternedInfo : BigDNA {
AT_DECL_DNA_YAML
Value<atUint32> propertyCount;
Value<float> mass;
Value<float> speed;
Value<float> turnSpeed;
Value<float> detectionRange;
Value<float> detectionHeightRange;
Value<float> dectectionAngle;
Value<float> minAttackRange;
Value<float> maxAttackRange;
Value<float> averageAttackTime;
Value<float> attackTimeVariation;
Value<float> leashRadius;
Value<float> playerLeashRadius;
Value<float> playerLeashTime;
DamageInfo contactDamage;
Value<float> damageWaitTime;
HealthInfo healthInfo;
DamageVulnerability damageVulnerability;
Value<float> halfExtent;
Value<float> height;
Value<atVec3f> bodyOrigin;
Value<float> stepUpHeight;
Value<float> xDamage;
Value<float> frozenXDamage;
Value<float> xDamageDelay;
Value<atUint32> deathSfx;
AnimationParameters animationParameters;
Value<bool> active;
UniqueID32 stateMachine;
Value<float> intoFreezeDur;
Value<float> outOfFreezeDur;
Value<float> unknown10;
2018-12-13 07:39:16 +00:00
Value<atUint32> pathfindingIndex;
2018-12-08 05:30:43 +00:00
Value<atVec3f> particle1Scale;
UniqueID32 particle1;
UniqueID32 electric;
Value<atVec3f> particle2Scale;
UniqueID32 particle2;
Value<atUint32> iceShatterSfx;
void nameIDs(PAKRouter<PAKBridge>& pakRouter, const std::string& name) const {
animationParameters.nameANCS(pakRouter, name + "_animp");
2019-07-20 04:27:21 +00:00
if (stateMachine.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(stateMachine);
ent->name = name + "_fsm";
}
2019-07-20 04:27:21 +00:00
if (particle1.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1);
ent->name = name + "_part1";
}
2019-07-20 04:27:21 +00:00
if (electric.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(electric);
ent->name = name + "_elsc";
}
2019-07-20 04:27:21 +00:00
if (particle2.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2);
ent->name = name + "_part2";
2016-10-02 22:41:36 +00:00
}
2018-12-08 05:30:43 +00:00
}
void depIDs(std::vector<hecl::ProjectPath>& pathsOut) const {
animationParameters.depANCS(pathsOut);
g_curSpec->flattenDependencies(stateMachine, pathsOut);
g_curSpec->flattenDependencies(particle1, pathsOut);
g_curSpec->flattenDependencies(electric, pathsOut);
g_curSpec->flattenDependencies(particle2, pathsOut);
}
2015-09-10 20:30:35 +00:00
};
2018-12-08 05:30:43 +00:00
struct PlayerHintParameters : BigDNA {
AT_DECL_DNA_YAML
Value<atUint32> propertyCount;
Value<bool> unknown1;
Value<bool> unknown2;
Value<bool> extendTargetDistance;
Value<bool> unknown4;
Value<bool> unknown5;
Value<bool> unknown6;
Value<bool> unknown7;
Value<bool> unknown8;
Value<bool> unknown9;
Value<bool> unknown10;
Value<bool> unknown11;
Value<bool> unknown12;
Value<bool> unknown13;
Value<bool> unknown14;
Value<bool> unknown15;
2015-09-10 20:30:35 +00:00
};
2018-12-08 05:30:43 +00:00
struct ScannableParameters : BigDNA {
AT_DECL_DNA_YAML
Value<atUint32> propertyCount;
UniqueID32 scanId;
2016-10-02 22:41:36 +00:00
2018-12-08 05:30:43 +00:00
void nameIDs(PAKRouter<PAKBridge>& pakRouter, const std::string& name) const {
2019-07-20 04:27:21 +00:00
if (scanId.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* scanEnt = (PAK::Entry*)pakRouter.lookupEntry(scanId);
scanEnt->name = name + "_scan";
2016-10-02 22:41:36 +00:00
}
2018-12-08 05:30:43 +00:00
}
2016-10-02 22:41:36 +00:00
2018-12-08 05:30:43 +00:00
void depIDs(std::vector<hecl::ProjectPath>& pathsOut) const { g_curSpec->flattenDependencies(scanId, pathsOut); }
void scanIDs(std::vector<Scan>& scansOut) const { scansOut.emplace_back(scanId); }
2015-09-10 20:30:35 +00:00
};
2018-12-08 05:30:43 +00:00
struct VisorParameters : BigDNA {
AT_DECL_DNA_YAML
Value<atUint32> propertyCount;
Value<bool> unknown1;
Value<bool> scanPassthrough;
Value<atUint32> visorMask;
2015-09-10 20:30:35 +00:00
};
2019-02-10 04:41:35 +00:00
struct PropertyFlags : BigDNA {
2018-12-08 05:30:43 +00:00
AT_DECL_DNA_YAML
Value<atUint32> propertyCount;
Vector<bool, AT_DNA_COUNT(propertyCount)> bools;
2016-04-18 01:58:13 +00:00
};
2018-12-08 05:30:43 +00:00
struct ActorParameters : BigDNA {
AT_DECL_DNA_YAML
Value<atUint32> propertyCount;
LightParameters lightParameters;
ScannableParameters scannableParameters;
UniqueID32 cmdlXray;
UniqueID32 cskrXray;
UniqueID32 cmdlThermal;
UniqueID32 cskrThermal;
Value<bool> globalTimeProvider;
Value<float> fadeInTime;
Value<float> fadeOutTime;
VisorParameters visorParameters;
Value<bool> thermalHeat;
Value<bool> renderUnsorted;
Value<bool> noSortThermal;
Value<float> thermalMag;
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc,
const AnimationParameters& animParms) const {
auto cinf = animParms.getCINF(pakRouter);
2019-07-20 04:27:21 +00:00
if (cmdlXray.isValid() && cskrXray.isValid()) {
2018-12-08 05:30:43 +00:00
charAssoc.m_cmdlRigs[cmdlXray] = std::make_pair(cskrXray, cinf);
charAssoc.m_cskrCinfToCharacter[cskrXray] = std::make_pair(animParms.animationCharacterSet, "ATTACH.XRAY.CSKR");
charAssoc.addAttachmentRig(animParms.animationCharacterSet, {}, cmdlXray, "XRAY");
}
2019-07-20 04:27:21 +00:00
if (cmdlThermal.isValid() && cskrThermal.isValid()) {
2018-12-08 05:30:43 +00:00
charAssoc.m_cmdlRigs[cmdlThermal] = std::make_pair(cskrThermal, cinf);
charAssoc.m_cskrCinfToCharacter[cskrThermal] =
std::make_pair(animParms.animationCharacterSet, "ATTACH.THERMAL.CSKR");
charAssoc.addAttachmentRig(animParms.animationCharacterSet, {}, cmdlThermal, "THERMAL");
}
2018-12-08 05:30:43 +00:00
}
2016-10-02 22:41:36 +00:00
2018-12-08 05:30:43 +00:00
void nameIDs(PAKRouter<PAKBridge>& pakRouter, const std::string& name) const {
scannableParameters.nameIDs(pakRouter, name);
2019-07-20 04:27:21 +00:00
if (cmdlXray.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* xmEnt = (PAK::Entry*)pakRouter.lookupEntry(cmdlXray);
xmEnt->name = name + "_xraymodel";
2016-10-02 22:41:36 +00:00
}
2019-07-20 04:27:21 +00:00
if (cskrXray.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* xsEnt = (PAK::Entry*)pakRouter.lookupEntry(cskrXray);
xsEnt->name = name + "_xrayskin";
}
2019-07-20 04:27:21 +00:00
if (cmdlThermal.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* xmEnt = (PAK::Entry*)pakRouter.lookupEntry(cmdlThermal);
xmEnt->name = name + "_thermalmodel";
2016-10-02 22:41:36 +00:00
}
2019-07-20 04:27:21 +00:00
if (cskrThermal.isValid()) {
2018-12-08 05:30:43 +00:00
PAK::Entry* xsEnt = (PAK::Entry*)pakRouter.lookupEntry(cskrThermal);
xsEnt->name = name + "_thermalskin";
}
}
void depIDs(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const {
scannableParameters.depIDs(lazyOut);
g_curSpec->flattenDependencies(cmdlXray, pathsOut);
g_curSpec->flattenDependencies(cskrXray, pathsOut);
g_curSpec->flattenDependencies(cmdlThermal, pathsOut);
g_curSpec->flattenDependencies(cskrThermal, pathsOut);
}
void scanIDs(std::vector<Scan>& scansOut) const { scannableParameters.scanIDs(scansOut); }
2015-09-10 20:30:35 +00:00
};
2017-08-20 05:23:22 +00:00
2018-12-08 05:30:43 +00:00
struct BeamInfo : BigDNA {
AT_DECL_DNA_YAML
Value<atUint32> propertyCount;
2019-01-03 03:47:28 +00:00
Value<atUint32> beamAttributes;
UniqueID32 contactFxId;
UniqueID32 pulseFxId;
UniqueID32 textureId;
UniqueID32 glowTextureId;
Value<float> length;
Value<float> radius;
Value<float> expansionSpeed;
Value<float> lifeTime;
Value<float> pulseSpeed;
Value<float> shutdownTime;
Value<float> contactFxScale;
Value<float> pulseFxScale;
Value<float> travelSpeed;
DNAColor innerColor;
DNAColor outerColor;
2018-12-08 05:30:43 +00:00
void nameIDs(PAKRouter<PAKBridge>& pakRouter, const std::string& name) const {
2019-07-20 04:27:21 +00:00
if (contactFxId.isValid()) {
2019-01-03 03:47:28 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(contactFxId);
2018-12-08 05:30:43 +00:00
ent->name = name + "_part1";
2017-08-20 05:23:22 +00:00
}
2019-07-20 04:27:21 +00:00
if (pulseFxId.isValid()) {
2019-01-03 03:47:28 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(pulseFxId);
2018-12-08 05:30:43 +00:00
ent->name = name + "_part2";
2017-08-20 05:23:22 +00:00
}
2019-07-20 04:27:21 +00:00
if (textureId.isValid()) {
2019-01-03 03:47:28 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(textureId);
2018-12-08 05:30:43 +00:00
ent->name = name + "_tex1";
}
2019-07-20 04:27:21 +00:00
if (glowTextureId.isValid()) {
2019-01-03 03:47:28 +00:00
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(glowTextureId);
2018-12-08 05:30:43 +00:00
ent->name = name + "_tex2";
}
}
void depIDs(std::vector<hecl::ProjectPath>& pathsOut) const {
2019-01-03 03:47:28 +00:00
g_curSpec->flattenDependencies(contactFxId, pathsOut);
g_curSpec->flattenDependencies(pulseFxId, pathsOut);
g_curSpec->flattenDependencies(textureId, pathsOut);
g_curSpec->flattenDependencies(glowTextureId, pathsOut);
2018-12-08 05:30:43 +00:00
}
2017-08-20 05:23:22 +00:00
};
2018-12-08 05:30:43 +00:00
} // namespace DataSpec::DNAMP1