metaforce/DataSpec/DNAMP1/ScriptObjects/GunTurret.hpp

122 lines
4.3 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"
#include "IScriptObject.hpp"
#include "Parameters.hpp"
2018-12-08 05:30:43 +00:00
namespace DataSpec::DNAMP1 {
struct GunTurret : IScriptObject {
AT_DECL_DNA_YAML
AT_DECL_DNAV
String<-1> name;
Value<atUint32> unknown1;
Value<atVec3f> location;
Value<atVec3f> orientation;
Value<atVec3f> scale;
2019-02-18 05:47:46 +00:00
Value<atVec3f> collisionExtent;
Value<atVec3f> collisionOffset;
2018-12-08 05:30:43 +00:00
AnimationParameters animationParameters;
ActorParameters actorParameters;
HealthInfo healthInfo;
DamageVulnerability damageVulnerabilty;
2019-02-18 05:47:46 +00:00
Value<float> intoDeactivateDelay;
Value<float> reloadTime;
Value<float> reloadTimeVariance;
Value<float> panStartTime;
Value<float> panHoldTime;
Value<float> totalPanSearchTime;
Value<float> leftMaxAngle;
Value<float> rightMaxAngle;
Value<float> downMaxAngle;
Value<float> turnSpeed;
Value<float> detectionRange;
Value<float> detectionZRange;
Value<float> freezeDuration;
Value<float> freezeVariance;
Value<bool> freezeTimeout;
UniqueID32 projectileRes;
DamageInfo projectileDamage;
UniqueID32 idleLightRes;
UniqueID32 deactivateLightRes;
UniqueID32 targettingLightRes;
UniqueID32 frozenEffectRes;
UniqueID32 chargingEffectRes;
UniqueID32 panningEffectRes;
UniqueID32 visorEffectRes;
Value<atUint32> trackingSoundId;
Value<atUint32> lockOnSoundId;
Value<atUint32> unfreezeSoundId;
Value<atUint32> stopClankSoundId;
Value<atUint32> chargingSoundId;
Value<atUint32> visorSoundId;
UniqueID32 extensionModelResId;
Value<float> extensionDropDownDist;
Value<atUint32> numInitialShots;
Value<atUint32> initialShotTableIndex;
Value<atUint32> numSubsequentShots;
Value<float> frenzyDuration;
Value<bool> scriptedStartOnly;
2018-12-08 05:30:43 +00:00
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const {
actorParameters.addCMDLRigPairs(pakRouter, charAssoc, animationParameters);
}
2018-12-08 05:30:43 +00:00
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
2019-02-18 05:47:46 +00:00
if (projectileRes) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(projectileRes);
ent->name = name + "_projectileRes";
}
2019-02-18 05:47:46 +00:00
if (idleLightRes) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(idleLightRes);
ent->name = name + "_idleLightRes";
2016-10-02 22:41:36 +00:00
}
2019-02-18 05:47:46 +00:00
if (deactivateLightRes) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(deactivateLightRes);
ent->name = name + "_deactivateLightRes";
2016-10-02 22:41:36 +00:00
}
2019-02-18 05:47:46 +00:00
if (targettingLightRes) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(targettingLightRes);
ent->name = name + "_targettingLightRes";
2018-12-08 05:30:43 +00:00
}
2019-02-18 05:47:46 +00:00
if (frozenEffectRes) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(frozenEffectRes);
ent->name = name + "_frozenEffectRes";
2018-12-08 05:30:43 +00:00
}
2019-02-18 05:47:46 +00:00
if (chargingEffectRes) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(chargingEffectRes);
ent->name = name + "_chargingEffectRes";
2018-12-08 05:30:43 +00:00
}
2019-02-18 05:47:46 +00:00
if (panningEffectRes) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(panningEffectRes);
ent->name = name + "_panningEffectRes";
2018-12-08 05:30:43 +00:00
}
2019-02-18 05:47:46 +00:00
if (visorEffectRes) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(visorEffectRes);
ent->name = name + "_visorEffectRes";
2018-12-08 05:30:43 +00:00
}
2019-02-18 05:47:46 +00:00
if (extensionModelResId) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(extensionModelResId);
ent->name = name + "_extensionModelResId";
2018-12-08 05:30:43 +00:00
}
animationParameters.nameANCS(pakRouter, name + "_animp");
actorParameters.nameIDs(pakRouter, name + "_actp");
}
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const {
2019-02-18 05:47:46 +00:00
g_curSpec->flattenDependencies(projectileRes, pathsOut);
g_curSpec->flattenDependencies(idleLightRes, pathsOut);
g_curSpec->flattenDependencies(deactivateLightRes, pathsOut);
g_curSpec->flattenDependencies(targettingLightRes, pathsOut);
g_curSpec->flattenDependencies(frozenEffectRes, pathsOut);
g_curSpec->flattenDependencies(chargingEffectRes, pathsOut);
g_curSpec->flattenDependencies(panningEffectRes, pathsOut);
g_curSpec->flattenDependencies(visorEffectRes, pathsOut);
g_curSpec->flattenDependencies(extensionModelResId, pathsOut);
2018-12-08 05:30:43 +00:00
animationParameters.depANCS(pathsOut);
actorParameters.depIDs(pathsOut, lazyOut);
}
2015-09-10 20:30:35 +00:00
2018-12-08 05:30:43 +00:00
void gatherScans(std::vector<Scan>& scansOut) const { actorParameters.scanIDs(scansOut); }
};
} // namespace DataSpec::DNAMP1