diff --git a/DataSpec/DNAMP1/SCLY.cpp b/DataSpec/DNAMP1/SCLY.cpp index 5083eed1b..09c3dcb2f 100644 --- a/DataSpec/DNAMP1/SCLY.cpp +++ b/DataSpec/DNAMP1/SCLY.cpp @@ -92,7 +92,7 @@ void SCLY::ScriptLayer::read(Athena::io::IStreamReader& rs) objects.push_back(obj); size_t actualLen = rs.position() - start; if (actualLen != len) - Log.report(LogVisor::Warning, _S("Error while reading object of type 0x%.2X, did not read the expected amount of data, read 0x%x, expected 0x%x"), (atUint32)type, actualLen, len); + Log.report(LogVisor::FatalError, _S("Error while reading object of type 0x%.2X, did not read the expected amount of data, read 0x%x, expected 0x%x"), (atUint32)type, actualLen, len); rs.seek(start + len, Athena::Begin); } else diff --git a/DataSpec/DNAMP1/ScriptObjects/Oculus.hpp b/DataSpec/DNAMP1/ScriptObjects/Oculus.hpp index bbb2de2e1..50a8846cb 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Oculus.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Oculus.hpp @@ -11,7 +11,7 @@ namespace DNAMP1 { struct Oculus : IScriptObject { - DECL_YAML + Delete expl; String<-1> name; Value location; Value orientation; @@ -27,6 +27,170 @@ struct Oculus : IScriptObject DamageVulnerability damageVulnerabilty; Value unknown7; DamageInfo damageInfo; + + /* Trilogy addition */ + Value unknown8; + + void read(Athena::io::IStreamReader& __dna_reader) + { + IScriptObject::read(__dna_reader); + /* name */ + name = __dna_reader.readString(-1); + /* location */ + location = __dna_reader.readVec3fBig(); + /* orientation */ + orientation = __dna_reader.readVec3fBig(); + /* scale */ + scale = __dna_reader.readVec3fBig(); + /* patternedInfo */ + patternedInfo.read(__dna_reader); + /* actorParameters */ + actorParameters.read(__dna_reader); + /* unknown1 */ + unknown1 = __dna_reader.readFloatBig(); + /* unknown2 */ + unknown2 = __dna_reader.readFloatBig(); + /* unknown3 */ + unknown3 = __dna_reader.readFloatBig(); + /* unknown4 */ + unknown4 = __dna_reader.readFloatBig(); + /* unknown5 */ + unknown5 = __dna_reader.readFloatBig(); + /* unknown6 */ + unknown6 = __dna_reader.readFloatBig(); + /* damageVulnerabilty */ + damageVulnerabilty.read(__dna_reader); + /* unknown7 */ + unknown7 = __dna_reader.readFloatBig(); + /* damageInfo */ + damageInfo.read(__dna_reader); + + if (propertyCount == 16) + unknown8 = __dna_reader.readFloatBig(); + else + unknown8 = 0.0; + } + + void write(Athena::io::IStreamWriter& __dna_writer) const + { + IScriptObject::write(__dna_writer); + /* name */ + __dna_writer.writeString(name, -1); + /* location */ + __dna_writer.writeVec3fBig(location); + /* orientation */ + __dna_writer.writeVec3fBig(orientation); + /* scale */ + __dna_writer.writeVec3fBig(scale); + /* patternedInfo */ + patternedInfo.write(__dna_writer); + /* actorParameters */ + actorParameters.write(__dna_writer); + /* unknown1 */ + __dna_writer.writeFloatBig(unknown1); + /* unknown2 */ + __dna_writer.writeFloatBig(unknown2); + /* unknown3 */ + __dna_writer.writeFloatBig(unknown3); + /* unknown4 */ + __dna_writer.writeFloatBig(unknown4); + /* unknown5 */ + __dna_writer.writeFloatBig(unknown5); + /* unknown6 */ + __dna_writer.writeFloatBig(unknown6); + /* damageVulnerabilty */ + damageVulnerabilty.write(__dna_writer); + /* unknown7 */ + __dna_writer.writeFloatBig(unknown7); + /* damageInfo */ + damageInfo.write(__dna_writer); + + if (propertyCount == 16) + __dna_writer.writeFloatBig(unknown8); + } + + void fromYAML(Athena::io::YAMLDocReader& __dna_docin) + { + IScriptObject::fromYAML(__dna_docin); + /* name */ + name = __dna_docin.readString("name"); + /* location */ + location = __dna_docin.readVec3f("location"); + /* orientation */ + orientation = __dna_docin.readVec3f("orientation"); + /* scale */ + scale = __dna_docin.readVec3f("scale"); + /* patternedInfo */ + __dna_docin.enumerate("patternedInfo", patternedInfo); + /* actorParameters */ + __dna_docin.enumerate("actorParameters", actorParameters); + /* unknown1 */ + unknown1 = __dna_docin.readFloat("unknown1"); + /* unknown2 */ + unknown2 = __dna_docin.readFloat("unknown2"); + /* unknown3 */ + unknown3 = __dna_docin.readFloat("unknown3"); + /* unknown4 */ + unknown4 = __dna_docin.readFloat("unknown4"); + /* unknown5 */ + unknown5 = __dna_docin.readFloat("unknown5"); + /* unknown6 */ + unknown6 = __dna_docin.readFloat("unknown6"); + /* damageVulnerabilty */ + __dna_docin.enumerate("damageVulnerabilty", damageVulnerabilty); + /* unknown7 */ + unknown7 = __dna_docin.readFloat("unknown7"); + /* damageInfo */ + __dna_docin.enumerate("damageInfo", damageInfo); + + if (propertyCount == 16) + unknown8 = __dna_docin.readFloat("unknown8"); + else + unknown8 = 0.0; + } + + void toYAML(Athena::io::YAMLDocWriter& __dna_docout) const + { + IScriptObject::toYAML(__dna_docout); + /* name */ + __dna_docout.writeString("name", name); + /* location */ + __dna_docout.writeVec3f("location", location); + /* orientation */ + __dna_docout.writeVec3f("orientation", orientation); + /* scale */ + __dna_docout.writeVec3f("scale", scale); + /* patternedInfo */ + __dna_docout.enumerate("patternedInfo", patternedInfo); + /* actorParameters */ + __dna_docout.enumerate("actorParameters", actorParameters); + /* unknown1 */ + __dna_docout.writeFloat("unknown1", unknown1); + /* unknown2 */ + __dna_docout.writeFloat("unknown2", unknown2); + /* unknown3 */ + __dna_docout.writeFloat("unknown3", unknown3); + /* unknown4 */ + __dna_docout.writeFloat("unknown4", unknown4); + /* unknown5 */ + __dna_docout.writeFloat("unknown5", unknown5); + /* unknown6 */ + __dna_docout.writeFloat("unknown6", unknown6); + /* damageVulnerabilty */ + __dna_docout.enumerate("damageVulnerabilty", damageVulnerabilty); + /* unknown7 */ + __dna_docout.writeFloat("unknown7", unknown7); + /* damageInfo */ + __dna_docout.enumerate("damageInfo", damageInfo); + + if (propertyCount == 16) + __dna_docout.writeFloat("unknown8", unknown8); + } + + static const char* DNAType() + { + return "Retro::DNAMP1::Oculus"; + } }; } } diff --git a/DataSpec/DNAMP1/ScriptObjects/Ridley.hpp b/DataSpec/DNAMP1/ScriptObjects/Ridley.hpp index 24cd2c16f..2d158202c 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Ridley.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Ridley.hpp @@ -11,7 +11,7 @@ namespace DNAMP1 { struct Ridley : IScriptObject { - DECL_YAML + Delete expl; String<-1> name; Value location; Value orientation; @@ -61,6 +61,7 @@ struct Ridley : IScriptObject Value soundID1; UniqueID32 wpsc2; + UniqueID32 wpsc3; DamageInfo damageInfo2; struct RidleyStruct2 : BigYAML @@ -77,7 +78,7 @@ struct Ridley : IScriptObject Value unknown9; } ridleyStruct2_1; - UniqueID32 wpsc3; + UniqueID32 wpsc4; DamageInfo damageInfo3; RidleyStruct2 ridleyStruct2_2; Value soundID2; @@ -95,6 +96,454 @@ struct Ridley : IScriptObject Value unknown10; Value soundID3; DamageInfo damageInfo8; + + /* Trilogy addition */ + DamageInfo damageInfo9; + + void read(Athena::io::IStreamReader& __dna_reader) + { + IScriptObject::read(__dna_reader); + /* name */ + name = __dna_reader.readString(-1); + /* location */ + location = __dna_reader.readVec3fBig(); + /* orientation */ + orientation = __dna_reader.readVec3fBig(); + /* scale */ + scale = __dna_reader.readVec3fBig(); + /* patternedInfo */ + patternedInfo.read(__dna_reader); + /* actorParameters */ + actorParameters.read(__dna_reader); + /* model1 */ + model1.read(__dna_reader); + /* model2 */ + model2.read(__dna_reader); + if (propertyCount == 48) + { + /* model3 */ + model3.read(__dna_reader); + /* model4 */ + model4.read(__dna_reader); + /* model5 */ + model5.read(__dna_reader); + /* model6 */ + model6.read(__dna_reader); + /* model7 */ + model7.read(__dna_reader); + /* model8 */ + model8.read(__dna_reader); + /* model9 */ + model9.read(__dna_reader); + /* model10 */ + model10.read(__dna_reader); + /* model11 */ + model11.read(__dna_reader); + /* model12 */ + model12.read(__dna_reader); + } + /* particle */ + particle.read(__dna_reader); + /* unknown1 */ + unknown1 = __dna_reader.readFloatBig(); + /* unknown2 */ + unknown2 = __dna_reader.readFloatBig(); + /* unknown3 */ + unknown3 = __dna_reader.readFloatBig(); + /* unknown4 */ + unknown4 = __dna_reader.readFloatBig(); + /* wpsc1 */ + wpsc1.read(__dna_reader); + /* damageInfo1 */ + damageInfo1.read(__dna_reader); + /* ridleyStruct1 */ + ridleyStruct1.read(__dna_reader); + /* soundID1 */ + soundID1 = __dna_reader.readUint32Big(); + /* wpsc2 */ + wpsc2.read(__dna_reader); + /* wpsc3 */ + if (propertyCount == 40) + wpsc3.read(__dna_reader); + /* damageInfo2 */ + damageInfo2.read(__dna_reader); + /* ridleyStruct2_1 */ + ridleyStruct2_1.read(__dna_reader); + /* wpsc4 */ + wpsc4.read(__dna_reader); + /* damageInfo3 */ + damageInfo3.read(__dna_reader); + /* ridleyStruct2_2 */ + ridleyStruct2_2.read(__dna_reader); + /* soundID2 */ + soundID2 = __dna_reader.readUint32Big(); + /* damageInfo4 */ + damageInfo4.read(__dna_reader); + /* ridleyStruct2_3 */ + ridleyStruct2_3.read(__dna_reader); + /* unknown5 */ + unknown5 = __dna_reader.readFloatBig(); + /* unknown6 */ + unknown6 = __dna_reader.readFloatBig(); + /* damageInfo5 */ + damageInfo5.read(__dna_reader); + /* unknown7 */ + unknown7 = __dna_reader.readFloatBig(); + /* damageInfo6 */ + damageInfo6.read(__dna_reader); + /* unknown8 */ + unknown8 = __dna_reader.readFloatBig(); + /* damageInfo7 */ + damageInfo7.read(__dna_reader); + /* unknown9 */ + unknown9 = __dna_reader.readFloatBig(); + /* elsc */ + elsc.read(__dna_reader); + /* unknown10 */ + unknown10 = __dna_reader.readFloatBig(); + /* soundID3 */ + soundID3 = __dna_reader.readUint32Big(); + /* damageInfo8 */ + damageInfo8.read(__dna_reader); + + if (propertyCount == 40) + damageInfo9.read(__dna_reader); + } + + void write(Athena::io::IStreamWriter& __dna_writer) const + { + IScriptObject::write(__dna_writer); + /* name */ + __dna_writer.writeString(name, -1); + /* location */ + __dna_writer.writeVec3fBig(location); + /* orientation */ + __dna_writer.writeVec3fBig(orientation); + /* scale */ + __dna_writer.writeVec3fBig(scale); + /* patternedInfo */ + patternedInfo.write(__dna_writer); + /* actorParameters */ + actorParameters.write(__dna_writer); + /* model1 */ + model1.write(__dna_writer); + /* model2 */ + model2.write(__dna_writer); + if (propertyCount == 48) + { + /* model3 */ + model3.write(__dna_writer); + /* model4 */ + model4.write(__dna_writer); + /* model5 */ + model5.write(__dna_writer); + /* model6 */ + model6.write(__dna_writer); + /* model7 */ + model7.write(__dna_writer); + /* model8 */ + model8.write(__dna_writer); + /* model9 */ + model9.write(__dna_writer); + /* model10 */ + model10.write(__dna_writer); + /* model11 */ + model11.write(__dna_writer); + /* model12 */ + model12.write(__dna_writer); + } + /* particle */ + particle.write(__dna_writer); + /* unknown1 */ + __dna_writer.writeFloatBig(unknown1); + /* unknown2 */ + __dna_writer.writeFloatBig(unknown2); + /* unknown3 */ + __dna_writer.writeFloatBig(unknown3); + /* unknown4 */ + __dna_writer.writeFloatBig(unknown4); + /* wpsc1 */ + wpsc1.write(__dna_writer); + /* damageInfo1 */ + damageInfo1.write(__dna_writer); + /* ridleyStruct1 */ + ridleyStruct1.write(__dna_writer); + /* soundID1 */ + __dna_writer.writeUint32Big(soundID1); + /* wpsc2 */ + wpsc2.write(__dna_writer); + /* wpsc3 */ + if (propertyCount == 40) + wpsc3.write(__dna_writer); + /* damageInfo2 */ + damageInfo2.write(__dna_writer); + /* ridleyStruct2_1 */ + ridleyStruct2_1.write(__dna_writer); + /* wpsc4 */ + wpsc4.write(__dna_writer); + /* damageInfo3 */ + damageInfo3.write(__dna_writer); + /* ridleyStruct2_2 */ + ridleyStruct2_2.write(__dna_writer); + /* soundID2 */ + __dna_writer.writeUint32Big(soundID2); + /* damageInfo4 */ + damageInfo4.write(__dna_writer); + /* ridleyStruct2_3 */ + ridleyStruct2_3.write(__dna_writer); + /* unknown5 */ + __dna_writer.writeFloatBig(unknown5); + /* unknown6 */ + __dna_writer.writeFloatBig(unknown6); + /* damageInfo5 */ + damageInfo5.write(__dna_writer); + /* unknown7 */ + __dna_writer.writeFloatBig(unknown7); + /* damageInfo6 */ + damageInfo6.write(__dna_writer); + /* unknown8 */ + __dna_writer.writeFloatBig(unknown8); + /* damageInfo7 */ + damageInfo7.write(__dna_writer); + /* unknown9 */ + __dna_writer.writeFloatBig(unknown9); + /* elsc */ + elsc.write(__dna_writer); + /* unknown10 */ + __dna_writer.writeFloatBig(unknown10); + /* soundID3 */ + __dna_writer.writeUint32Big(soundID3); + /* damageInfo8 */ + damageInfo8.write(__dna_writer); + + if (propertyCount == 40) + damageInfo9.write(__dna_writer); + } + + void fromYAML(Athena::io::YAMLDocReader& __dna_docin) + { + IScriptObject::fromYAML(__dna_docin); + /* name */ + name = __dna_docin.readString("name"); + /* location */ + location = __dna_docin.readVec3f("location"); + /* orientation */ + orientation = __dna_docin.readVec3f("orientation"); + /* scale */ + scale = __dna_docin.readVec3f("scale"); + /* patternedInfo */ + __dna_docin.enumerate("patternedInfo", patternedInfo); + /* actorParameters */ + __dna_docin.enumerate("actorParameters", actorParameters); + /* model1 */ + __dna_docin.enumerate("model1", model1); + /* model2 */ + __dna_docin.enumerate("model2", model2); + if (propertyCount == 48) + { + /* model3 */ + __dna_docin.enumerate("model3", model3); + /* model4 */ + __dna_docin.enumerate("model4", model4); + /* model5 */ + __dna_docin.enumerate("model5", model5); + /* model6 */ + __dna_docin.enumerate("model6", model6); + /* model7 */ + __dna_docin.enumerate("model7", model7); + /* model8 */ + __dna_docin.enumerate("model8", model8); + /* model9 */ + __dna_docin.enumerate("model9", model9); + /* model10 */ + __dna_docin.enumerate("model10", model10); + /* model11 */ + __dna_docin.enumerate("model11", model11); + /* model12 */ + __dna_docin.enumerate("model12", model12); + } + /* particle */ + __dna_docin.enumerate("particle", particle); + /* unknown1 */ + unknown1 = __dna_docin.readFloat("unknown1"); + /* unknown2 */ + unknown2 = __dna_docin.readFloat("unknown2"); + /* unknown3 */ + unknown3 = __dna_docin.readFloat("unknown3"); + /* unknown4 */ + unknown4 = __dna_docin.readFloat("unknown4"); + /* wpsc1 */ + __dna_docin.enumerate("wpsc1", wpsc1); + /* damageInfo1 */ + __dna_docin.enumerate("damageInfo1", damageInfo1); + /* ridleyStruct1 */ + __dna_docin.enumerate("ridleyStruct1", ridleyStruct1); + /* soundID1 */ + soundID1 = __dna_docin.readUint32("soundID1"); + /* wpsc2 */ + __dna_docin.enumerate("wpsc2", wpsc2); + /* wpsc3 */ + if (propertyCount == 40) + __dna_docin.enumerate("wpsc3", wpsc3); + /* damageInfo2 */ + __dna_docin.enumerate("damageInfo2", damageInfo2); + /* ridleyStruct2_1 */ + __dna_docin.enumerate("ridleyStruct2_1", ridleyStruct2_1); + /* wpsc4 */ + __dna_docin.enumerate("wpsc4", wpsc4); + /* damageInfo3 */ + __dna_docin.enumerate("damageInfo3", damageInfo3); + /* ridleyStruct2_2 */ + __dna_docin.enumerate("ridleyStruct2_2", ridleyStruct2_2); + /* soundID2 */ + soundID2 = __dna_docin.readUint32("soundID2"); + /* damageInfo4 */ + __dna_docin.enumerate("damageInfo4", damageInfo4); + /* ridleyStruct2_3 */ + __dna_docin.enumerate("ridleyStruct2_3", ridleyStruct2_3); + /* unknown5 */ + unknown5 = __dna_docin.readFloat("unknown5"); + /* unknown6 */ + unknown6 = __dna_docin.readFloat("unknown6"); + /* damageInfo5 */ + __dna_docin.enumerate("damageInfo5", damageInfo5); + /* unknown7 */ + unknown7 = __dna_docin.readFloat("unknown7"); + /* damageInfo6 */ + __dna_docin.enumerate("damageInfo6", damageInfo6); + /* unknown8 */ + unknown8 = __dna_docin.readFloat("unknown8"); + /* damageInfo7 */ + __dna_docin.enumerate("damageInfo7", damageInfo7); + /* unknown9 */ + unknown9 = __dna_docin.readFloat("unknown9"); + /* elsc */ + __dna_docin.enumerate("elsc", elsc); + /* unknown10 */ + unknown10 = __dna_docin.readFloat("unknown10"); + /* soundID3 */ + soundID3 = __dna_docin.readUint32("soundID3"); + /* damageInfo8 */ + __dna_docin.enumerate("damageInfo8", damageInfo8); + + if (propertyCount == 40) + __dna_docin.enumerate("damageInfo9", damageInfo9); + } + + void toYAML(Athena::io::YAMLDocWriter& __dna_docout) const + { + IScriptObject::toYAML(__dna_docout); + /* name */ + __dna_docout.writeString("name", name); + /* location */ + __dna_docout.writeVec3f("location", location); + /* orientation */ + __dna_docout.writeVec3f("orientation", orientation); + /* scale */ + __dna_docout.writeVec3f("scale", scale); + /* patternedInfo */ + __dna_docout.enumerate("patternedInfo", patternedInfo); + /* actorParameters */ + __dna_docout.enumerate("actorParameters", actorParameters); + /* model1 */ + __dna_docout.enumerate("model1", model1); + /* model2 */ + __dna_docout.enumerate("model2", model2); + if (propertyCount == 48) + { + /* model3 */ + __dna_docout.enumerate("model3", model3); + /* model4 */ + __dna_docout.enumerate("model4", model4); + /* model5 */ + __dna_docout.enumerate("model5", model5); + /* model6 */ + __dna_docout.enumerate("model6", model6); + /* model7 */ + __dna_docout.enumerate("model7", model7); + /* model8 */ + __dna_docout.enumerate("model8", model8); + /* model9 */ + __dna_docout.enumerate("model9", model9); + /* model10 */ + __dna_docout.enumerate("model10", model10); + /* model11 */ + __dna_docout.enumerate("model11", model11); + /* model12 */ + __dna_docout.enumerate("model12", model12); + } + /* particle */ + __dna_docout.enumerate("particle", particle); + /* unknown1 */ + __dna_docout.writeFloat("unknown1", unknown1); + /* unknown2 */ + __dna_docout.writeFloat("unknown2", unknown2); + /* unknown3 */ + __dna_docout.writeFloat("unknown3", unknown3); + /* unknown4 */ + __dna_docout.writeFloat("unknown4", unknown4); + /* wpsc1 */ + __dna_docout.enumerate("wpsc1", wpsc1); + /* damageInfo1 */ + __dna_docout.enumerate("damageInfo1", damageInfo1); + /* ridleyStruct1 */ + __dna_docout.enumerate("ridleyStruct1", ridleyStruct1); + /* soundID1 */ + __dna_docout.writeUint32("soundID1", soundID1); + /* wpsc2 */ + __dna_docout.enumerate("wpsc2", wpsc2); + /* wpsc3 */ + if (propertyCount == 40) + __dna_docout.enumerate("wpsc3", wpsc3); + /* damageInfo2 */ + __dna_docout.enumerate("damageInfo2", damageInfo2); + /* ridleyStruct2_1 */ + __dna_docout.enumerate("ridleyStruct2_1", ridleyStruct2_1); + /* wpsc4 */ + __dna_docout.enumerate("wpsc4", wpsc4); + /* damageInfo3 */ + __dna_docout.enumerate("damageInfo3", damageInfo3); + /* ridleyStruct2_2 */ + __dna_docout.enumerate("ridleyStruct2_2", ridleyStruct2_2); + /* soundID2 */ + __dna_docout.writeUint32("soundID2", soundID2); + /* damageInfo4 */ + __dna_docout.enumerate("damageInfo4", damageInfo4); + /* ridleyStruct2_3 */ + __dna_docout.enumerate("ridleyStruct2_3", ridleyStruct2_3); + /* unknown5 */ + __dna_docout.writeFloat("unknown5", unknown5); + /* unknown6 */ + __dna_docout.writeFloat("unknown6", unknown6); + /* damageInfo5 */ + __dna_docout.enumerate("damageInfo5", damageInfo5); + /* unknown7 */ + __dna_docout.writeFloat("unknown7", unknown7); + /* damageInfo6 */ + __dna_docout.enumerate("damageInfo6", damageInfo6); + /* unknown8 */ + __dna_docout.writeFloat("unknown8", unknown8); + /* damageInfo7 */ + __dna_docout.enumerate("damageInfo7", damageInfo7); + /* unknown9 */ + __dna_docout.writeFloat("unknown9", unknown9); + /* elsc */ + __dna_docout.enumerate("elsc", elsc); + /* unknown10 */ + __dna_docout.writeFloat("unknown10", unknown10); + /* soundID3 */ + __dna_docout.writeUint32("soundID3", soundID3); + /* damageInfo8 */ + __dna_docout.enumerate("damageInfo8", damageInfo8); + + if (propertyCount == 40) + __dna_docout.enumerate("damageInfo9", damageInfo9); + } + + static const char* DNAType() + { + return "Retro::DNAMP1::Ridley"; + } }; } }